jamespot-user-api 1.0.105 → 1.0.106

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/AdminLicenseApi.html +12 -12
  3. package/documentation/classes/AdminStoreApi.html +1 -1
  4. package/documentation/classes/AdminUtilsApi.html +2 -2
  5. package/documentation/classes/JApplicationApi.html +9 -9
  6. package/documentation/classes/JArticleApi.html +1 -1
  7. package/documentation/classes/JAssetReservation.html +1 -1
  8. package/documentation/classes/JAudienceApi.html +2 -2
  9. package/documentation/classes/JBaseApi.html +1 -1
  10. package/documentation/classes/JBookmarkApi.html +1 -1
  11. package/documentation/classes/JCommunityApi.html +1 -1
  12. package/documentation/classes/JDiapazoneApi.html +1 -1
  13. package/documentation/classes/JFileApi.html +6 -6
  14. package/documentation/classes/JFilebankApi.html +1 -1
  15. package/documentation/classes/JGroupApi.html +8 -8
  16. package/documentation/classes/JLandApi.html +1 -1
  17. package/documentation/classes/JMessengerApi.html +1 -1
  18. package/documentation/classes/JSearchApi.html +7 -7
  19. package/documentation/classes/JShareApi.html +1 -1
  20. package/documentation/classes/JTaxonomyApi.html +3 -3
  21. package/documentation/classes/JUserApi.html +4 -4
  22. package/documentation/classes/JWedocApi.html +1 -1
  23. package/documentation/classes/JamespotUserApi.html +1 -1
  24. package/documentation/classes/Network.html +1 -1
  25. package/documentation/classes/WindowBrowser.html +1 -1
  26. package/documentation/enums/StudioApplicationStatus.html +1 -1
  27. package/documentation/index.html +1 -1
  28. package/documentation/interfaces/AccessRightObject.html +1 -1
  29. package/documentation/interfaces/AdminLicenseUser.html +1 -1
  30. package/documentation/interfaces/ApiDefaultWrapper.html +1 -1
  31. package/documentation/interfaces/ApiWrapper.html +1 -1
  32. package/documentation/interfaces/BaseAutocomplete.html +1 -1
  33. package/documentation/interfaces/BaseMessage.html +1 -1
  34. package/documentation/interfaces/Category.html +1 -1
  35. package/documentation/interfaces/FileBankProps.html +1 -1
  36. package/documentation/interfaces/FolderProps.html +1 -1
  37. package/documentation/interfaces/ListFilterSpec.html +1 -1
  38. package/documentation/interfaces/OF.html +1 -1
  39. package/documentation/interfaces/ObjectListProps.html +1 -1
  40. package/documentation/interfaces/PagingResults.html +1 -1
  41. package/documentation/interfaces/RootFolderProps.html +1 -1
  42. package/documentation/interfaces/SearchCategoryModel.html +1 -1
  43. package/documentation/interfaces/SearchCategoryValue.html +1 -1
  44. package/documentation/interfaces/SearchConfig.html +1 -1
  45. package/documentation/interfaces/SearchFacetModel.html +1 -1
  46. package/documentation/interfaces/SearchFacetValueModel.html +1 -1
  47. package/documentation/interfaces/SearchQuery.html +1 -1
  48. package/documentation/interfaces/SearchQueryFilterModel.html +1 -1
  49. package/documentation/interfaces/SearchQueryOption.html +1 -1
  50. package/documentation/interfaces/SearchQueryResult.html +1 -1
  51. package/documentation/interfaces/SearchQuerySortModel.html +1 -1
  52. package/documentation/interfaces/SearchResultCatProps.html +1 -1
  53. package/documentation/interfaces/SearchResultPropsApp.html +1 -1
  54. package/documentation/interfaces/SearchResultPropsObject.html +1 -1
  55. package/documentation/interfaces/SpotProps.html +1 -1
  56. package/documentation/interfaces/Taxonomy.html +1 -1
  57. package/documentation/interfaces/TaxonomyCreate.html +1 -1
  58. package/documentation/interfaces/WindowInterface.html +1 -1
  59. package/documentation/modules.html +6 -6
  60. package/lib/jamespot-user-api.js +1 -1
  61. package/lib/jamespot-user-api.js.map +1 -1
  62. package/lib/src/apis/base.d.ts +3 -1
  63. package/lib/src/apis/{bookmark.d.ts → bookmark/bookmark.d.ts} +7 -7
  64. package/lib/src/apis/bookmark/bookmark.mock.d.ts +8 -0
  65. package/lib/src/apis/bookmark/bookmark.test.d.ts +1 -0
  66. package/lib/src/apis/index.d.ts +4 -3
  67. package/lib/src/apis/jamespotUserApi.d.ts +3 -3
  68. package/lib/src/apis/share/share.d.ts +14 -0
  69. package/lib/src/apis/share/share.mock.d.ts +7 -0
  70. package/lib/src/apis/share/share.test.d.ts +1 -0
  71. package/lib/src/apis/wedoc/wedoc.d.ts +17 -0
  72. package/lib/src/apis/wedoc/wedoc.mock.d.ts +14 -0
  73. package/lib/src/apis/wedoc/wedoc.test.d.ts +1 -0
  74. package/lib/src/types/bookmark.d.ts +2 -1
  75. package/lib/src/types/share.d.ts +7 -17
  76. package/lib/src/types/utils.d.ts +1 -8
  77. package/lib/src/types/wedoc.d.ts +6 -21
  78. package/lib/src/util/Test.d.ts +10 -5
  79. package/lib/src/util/ensure.d.ts +3 -0
  80. package/lib/src/util/network.d.ts +14 -5
  81. package/lib/src/util/network.mock.d.ts +2 -1
  82. package/lib/src/util/network.test.d.ts +1 -0
  83. package/lib/src/window/Window.d.ts +5 -4
  84. package/lib/src/window/WindowBrowser.d.ts +2 -2
  85. package/lib/src/window/WindowBrowser.test.d.ts +1 -0
  86. package/package.json +1 -1
  87. package/phpunitMock/bookmarksAdd-url.json +35 -0
  88. package/phpunitMock/bookmarksDelete-spot1Article.json +7 -0
  89. package/phpunitMock/bookmarksMove-spot1Article.json +7 -0
  90. package/phpunitMock/bookmarksRename-spot1Article.json +7 -0
  91. package/phpunitMock/customActionAdd-bookmarkSpot1Article.json +45 -0
  92. package/phpunitMock/objectList-bookmarksList.json +92 -0
  93. package/phpunitMock/onlyOfficeAskObjectAccess-ask-read.json +1 -0
  94. package/phpunitMock/onlyOfficeCreateFile-create-file.json +19 -0
  95. package/phpunitMock/onlyOfficeDeleteFile-delete-file.json +1 -0
  96. package/phpunitMock/onlyOfficeDuplicateFile-duplicate-file.json +19 -0
  97. package/phpunitMock/onlyOfficeGetFile-get-file.json +50 -0
  98. package/phpunitMock/onlyOfficeGetFiles-get-files.json +58 -0
  99. package/phpunitMock/onlyOfficeGetObject-default.json +26 -0
  100. package/phpunitMock/onlyOfficeGetObjectAccess-default.json +34 -0
  101. package/phpunitMock/onlyOfficeGetObjectAccessRequest-all-request.json +19 -0
  102. package/phpunitMock/onlyOfficeGetTemplates-get-templates.json +29 -0
  103. package/phpunitMock/onlyOfficeSetObjectAccess-default.json +1 -0
  104. package/phpunitMock/onlyOfficeSetObjectAccessRequest-accept.json +1 -0
  105. package/phpunitMock/onlyOfficeUpdateFile-update-file.json +1 -0
  106. package/documentation/interfaces/ApiError.html +0 -1
  107. package/lib/src/apis/share.d.ts +0 -17
  108. package/lib/src/apis/wedoc.d.ts +0 -26
@@ -4,7 +4,7 @@ export * from './article/article';
4
4
  export * from './assetReservation';
5
5
  export * from './audience/audience';
6
6
  export * from './base';
7
- export * from './bookmark';
7
+ export * from './bookmark/bookmark';
8
8
  export * from './community';
9
9
  export * from './diapazone';
10
10
  export * from './file';
@@ -13,8 +13,9 @@ export * from './group';
13
13
  export * from './jamespotUserApi';
14
14
  export * from './jland/jland';
15
15
  export * from './messenger';
16
+ export * from './share/share';
16
17
  export * from './search/search';
17
- export * from './share';
18
+ export * from './share/share';
18
19
  export * from './user/user';
19
20
  export * from './taxonomy';
20
- export * from './wedoc';
21
+ export * from './wedoc/wedoc';
@@ -13,13 +13,13 @@ import { JMediaLibraryApi } from './mediaLibrary/mediaLibrary';
13
13
  import { JLandApi } from './jland/jland';
14
14
  import { JMessengerApi } from './messenger';
15
15
  import { JSearchApi } from './search/search';
16
- import { JBookmarkApi } from './bookmark';
16
+ import { JBookmarkApi } from './bookmark/bookmark';
17
17
  import { JTaxonomyApi } from './taxonomy';
18
18
  import { JUserApi } from './user/user';
19
19
  import { JDiapazoneApi } from './diapazone';
20
- import { JWedocApi } from './wedoc';
20
+ import { JWedocApi } from './wedoc/wedoc';
21
21
  import { Network } from '../util/network';
22
- import { JShareApi } from './share';
22
+ import { JShareApi } from './share/share';
23
23
  /**
24
24
  * In browser usage, 'window' should be the window object.
25
25
  * In server side usage, 'window' object given must implement the fetch method, used by the Apis.
@@ -0,0 +1,14 @@
1
+ import { ApiWrapper } from '../../types';
2
+ import { JBaseApi } from '../base';
3
+ import { ShareAccessObject, ShareAccessProps, ShareAudienceItem, ShareGeneralAccessRules } from '../../types/share';
4
+ export declare class JShareApi extends JBaseApi {
5
+ setObjectAccessRequest(uri: string, idUser: number, requestAccessValue: 'accept' | 'deny', requestResponseMessage?: string): Promise<ApiWrapper<[]>>;
6
+ getObjectAccessRequest(uri: string, idUser?: number): Promise<ApiWrapper<ShareAudienceItem[]>>;
7
+ getObject(uri: string): Promise<ApiWrapper<ShareAccessObject>>;
8
+ askObjectAccess(uri: string, askAccess: 'read' | 'write', askMessage?: string): Promise<ApiWrapper<boolean>>;
9
+ setObjectAccess(uri: string, access: {
10
+ read: string[];
11
+ write: string[];
12
+ }, message: string, generalAccessRule: ShareGeneralAccessRules): Promise<ApiWrapper<boolean>>;
13
+ getObjectAccess(uri: string): Promise<ApiWrapper<ShareAccessProps>>;
14
+ }
@@ -0,0 +1,7 @@
1
+ import { ApiWrapper, ShareAccessObject, ShareAccessProps, ShareAudienceItem } from '../../types';
2
+ export declare const shareAskObjectAccess: ApiWrapper<boolean>;
3
+ export declare const shareGetObject: ApiWrapper<ShareAccessObject>;
4
+ export declare const shareGetObjectAccess: ApiWrapper<ShareAccessProps>;
5
+ export declare const shareGetObjectAccessRequest: ApiWrapper<ShareAudienceItem[]>;
6
+ export declare const shareSetObjectAccess: ApiWrapper<boolean>;
7
+ export declare const shareSetObjectAccessRequest: ApiWrapper<[]>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,17 @@
1
+ import { ApiWrapper, PagingResults, WedocFileType, WedocQueryType, WedocTemplate, jArticleLittle } from '../../types';
2
+ import { JBaseApi } from '../base';
3
+ export declare class JWedocApi extends JBaseApi {
4
+ getFiles(query: WedocQueryType): Promise<ApiWrapper<PagingResults<WedocFileType>>>;
5
+ getFile(idFile: number, hash?: string): Promise<ApiWrapper<WedocFileType>>;
6
+ getTemplates(): Promise<ApiWrapper<WedocTemplate[]>>;
7
+ duplicateFile(idFile: number, title: string, publishTo: string[]): Promise<ApiWrapper<{
8
+ idFile: number;
9
+ article: jArticleLittle;
10
+ }>>;
11
+ deleteFile(idFile: number): Promise<ApiWrapper<boolean>>;
12
+ createFile(title: string, type: string, publishTo: string[]): Promise<ApiWrapper<{
13
+ idFile: number;
14
+ article: jArticleLittle;
15
+ }>>;
16
+ updateFile(idFile: number, title: string): Promise<ApiWrapper<boolean>>;
17
+ }
@@ -0,0 +1,14 @@
1
+ import { ApiWrapper, PagingResults, WedocFileType, WedocTemplate, jArticleLittle } from '../../types';
2
+ export declare const wedocGetTemplates: ApiWrapper<WedocTemplate[]>;
3
+ export declare const wedocCreateFile: ApiWrapper<{
4
+ idFile: number;
5
+ article: jArticleLittle;
6
+ }>;
7
+ export declare const wedocDuplicateFile: ApiWrapper<{
8
+ idFile: number;
9
+ article: jArticleLittle;
10
+ }>;
11
+ export declare const wedocUpdateFile: ApiWrapper<boolean>;
12
+ export declare const wedocDeleteFile: ApiWrapper<boolean>;
13
+ export declare const wedocGetFile: ApiWrapper<WedocFileType>;
14
+ export declare const wedocGetFiles: ApiWrapper<PagingResults<WedocFileType>>;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,5 +1,6 @@
1
+ import { jUserLittle } from './user';
1
2
  import { jLinkList, jObjectBase, jObjectLittle } from './utils';
2
- export declare type BookmarkRawList<T extends jObjectBase = jObjectLittle> = jLinkList<T> & {
3
+ export declare type BookmarkRawList<T extends jObjectBase = jObjectLittle | jUserLittle> = jLinkList<T> & {
3
4
  bookmarkUrl?: string | null;
4
5
  bookmarkOrder?: number;
5
6
  bookmarkLabel?: string;
@@ -1,10 +1,6 @@
1
+ import { jUserLittle } from './user';
1
2
  import { Rights } from './utils';
2
- export declare type ShareAccessObjectAudience = {
3
- id: number;
4
- uri: string;
5
- title: string;
6
- type: string;
7
- };
3
+ export declare type ShareGeneralAccessRules = 'link' | 'invitation';
8
4
  export declare type ShareOptionObject = {
9
5
  id: number;
10
6
  title: string;
@@ -17,21 +13,15 @@ export declare type ShareAccessObject = {
17
13
  type: string;
18
14
  uri: string;
19
15
  title: string;
20
- generalAccessRule: 'link' | 'invitation';
21
- generalAccessHash: string;
16
+ generalAccessRule: ShareGeneralAccessRules;
17
+ generalAccessHash: string | null;
22
18
  idUser: number;
23
- _audience: ShareAccessObjectAudience[];
19
+ _audience: ShareAudienceItem[];
24
20
  _right: Rights;
25
- _user: ShareAccessObjectAudience;
26
21
  };
22
+ export declare type ShareAudienceItem = jUserLittle;
27
23
  export declare type ShareAccessProps = {
28
- audience: ShareAccessObjectAudience[];
24
+ audience: ShareAudienceItem[];
29
25
  read: string[];
30
26
  write: string[];
31
27
  };
32
- export declare type ShareAccessRequestProps = {
33
- id: number;
34
- uri: string;
35
- title: string;
36
- type: string;
37
- };
@@ -45,10 +45,6 @@ export interface PagingResults<T> {
45
45
  page: number;
46
46
  }
47
47
  export declare type ApiPagingResults<T, U = BaseMessages> = ApiWrapper<PagingResults<T>, U>;
48
- export interface ApiError<U = string> {
49
- error: number;
50
- messages: U[];
51
- }
52
48
  export declare type Rights = {
53
49
  create: boolean;
54
50
  read: boolean;
@@ -90,7 +86,7 @@ export declare type jLinkLittle = jObjectBase & {
90
86
  targetId: number;
91
87
  targetType: string | null;
92
88
  };
93
- export declare type jLinkList<T extends jObjectBase = jObjectLittle> = jLinkLittle & {
89
+ export declare type jLinkList<T extends jObjectBase = jObjectLittle | jUserLittle> = jLinkLittle & {
94
90
  value: string | null;
95
91
  _src?: T;
96
92
  _target?: T | undefined;
@@ -127,9 +123,6 @@ export declare type Filter = {
127
123
  method?: '<' | '>' | '<=' | '>=' | '!=' | '<>' | '+' | '-' | 'like' | 'between' | 'is' | 'is not' | 'in' | 'link' | 'match' | 'equal';
128
124
  };
129
125
  export declare type Filters = Array<Filter>;
130
- export declare type MaybeWithCsrf<T> = T & {
131
- tokenCSRF?: string | undefined;
132
- };
133
126
  export declare type MaybeWithToken<T> = T & {
134
127
  token?: string | undefined;
135
128
  };
@@ -1,4 +1,5 @@
1
- import { Filters, Orders, Rights } from './utils';
1
+ import { jUserLittle } from './user';
2
+ import { Filters, jObjectBase, jObjectLittle, Orders, Rights } from './utils';
2
3
  export declare type WedocFileInfo = {
3
4
  color: string;
4
5
  description: string;
@@ -6,14 +7,9 @@ export declare type WedocFileInfo = {
6
7
  icon: string;
7
8
  label: string;
8
9
  };
9
- export declare type WedocFileType = {
10
- dateCreation: string;
11
- dateModified: string;
12
- id: string;
13
- mimetype: string;
10
+ export declare type WedocFileType = jObjectBase & {
14
11
  title: string;
15
- type: string;
16
- uri: string;
12
+ mimetype: string;
17
13
  _extend: {
18
14
  generalAccessRule: string;
19
15
  dateModified: string;
@@ -22,20 +18,9 @@ export declare type WedocFileType = {
22
18
  };
23
19
  _audience: WedocFileAudienceType[];
24
20
  _right: Rights;
25
- _user: WedocFileUserType;
26
- };
27
- export declare type WedocFileAudienceType = {
28
- id: number;
29
- title: string;
30
- uri: string;
31
- type: string;
32
- };
33
- export declare type WedocFileUserType = {
34
- id: number;
35
- title: string;
36
- uri: string;
37
- type: string;
21
+ _user: jUserLittle;
38
22
  };
23
+ export declare type WedocFileAudienceType = jObjectLittle;
39
24
  export declare type WedocTemplate = {
40
25
  color: string;
41
26
  description: string;
@@ -1,9 +1,12 @@
1
1
  import { JamespotUserApi } from '../apis';
2
2
  import { ApiDefaultWrapper, PagingResults, jArticleLittle, jObjectAutocomplete, jObjectList, jUserList } from '../types';
3
+ import { FetchResponseType, WindowBrowser } from '../window';
3
4
  import { Network } from './network';
5
+ export declare const windowBrowser: WindowBrowser;
4
6
  export declare const network: Network;
5
7
  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;
8
+ export declare const fetchMock: <T>(data: T) => jest.Mock<Promise<FetchResponseType<T>>, []>;
9
+ export declare const validateJArticle: <T extends jArticleLittle>(received: T, expected: T) => void;
7
10
  export declare const validateApiWrapper: <T extends ApiDefaultWrapper<import("../types").BaseMessages>>(res: T, o: string, f: string, error?: null) => void;
8
11
  export declare const validatePagingResults: <T>(res: PagingResults<T>) => void;
9
12
  export declare const validateObjectIsFormatLittle: <T extends {
@@ -24,7 +27,9 @@ export declare const validateObjectIsFormatLittle: <T extends {
24
27
  dateModified?: string;
25
28
  title: string;
26
29
  _url: string;
27
- }>(object: T) => boolean;
28
- export declare const validateObjectIsFormatList: <T extends jObjectList = jObjectList>(object: T) => boolean;
29
- export declare const validateUserIsFormatList: <T extends jUserList = jUserList>(object: T) => boolean;
30
- export declare const validateObjectIsFormatAutocomplete: <T extends jObjectAutocomplete = jObjectAutocomplete>(object: T) => boolean;
30
+ }>(object: T) => void;
31
+ export declare const validateObjectIsFormatList: <T extends jObjectList = jObjectList>(object: T) => void;
32
+ export declare const validateUserIsFormatList: <T extends jUserList = jUserList>(object: T) => void;
33
+ export declare const validateObjectIsFormatAutocomplete: <T extends jObjectAutocomplete = jObjectAutocomplete>(object: T) => void;
34
+ export declare const expectToHaveProperties: <T>(props: string[], payload: T[]) => void;
35
+ export declare const expectToBeArray: <T>(arr: T[]) => void;
@@ -1,4 +1,5 @@
1
1
  import { BookmarkCustom, BookmarkLink, BookmarkRawList, jObjectBase } from '../types';
2
+ import { AbortApiError, StandardApiError } from './network';
2
3
  declare function ensureIsBookmarkLink(bookmark: BookmarkCustom | BookmarkLink): bookmark is BookmarkLink;
3
4
  declare function ensureIsBookmarkCustom(bookmark: BookmarkCustom | BookmarkLink): bookmark is BookmarkCustom;
4
5
  declare function ensureIsBookmarkRawList(bookmark: jObjectBase | BookmarkRawList): bookmark is BookmarkRawList;
@@ -11,5 +12,7 @@ export declare const jEnsure: {
11
12
  isBookmarkCustom: typeof ensureIsBookmarkCustom;
12
13
  isBookmarkRawList: typeof ensureIsBookmarkRawList;
13
14
  objectIsType: typeof ensureObjectIsType;
15
+ isStandardApiError: (err: any) => err is StandardApiError<import("../types").BaseMessages>;
16
+ isAbortApiError: (err: any) => err is AbortApiError;
14
17
  };
15
18
  export {};
@@ -1,9 +1,20 @@
1
- import { ApiWrapper, BaseMessages, FileResponse, MaybeWithCsrf, MaybeWithToken } from '../types';
2
- import { FetchReturnType, WindowInterface } from '../window/Window';
1
+ import { ApiWrapper, BaseMessages, FileResponse, MaybeWithToken } from '../types';
2
+ import { WindowInterface } from '../window/Window';
3
3
  export interface OF {
4
4
  o: string;
5
5
  f: string;
6
6
  }
7
+ export declare type ApiError = {
8
+ error: number;
9
+ };
10
+ export declare type StandardApiError<T = BaseMessages> = ApiError & {
11
+ errorMsg: string | undefined;
12
+ messages: T;
13
+ };
14
+ export declare type AbortApiError = ApiError & {
15
+ error: -1;
16
+ aborted: true;
17
+ };
7
18
  /**
8
19
  * deprecated
9
20
  */
@@ -12,14 +23,12 @@ export declare class Network {
12
23
  private readonly window;
13
24
  constructor(window: WindowInterface, action?: string);
14
25
  static _formatPostOptions(body: object): RequestInit;
15
- static _formatQueryOptions(options: Record<string, string | boolean | number>): string;
16
26
  getUrl(o: string, f: string): Promise<string>;
17
27
  getHostname(): Promise<string>;
18
- fetch({ o, f, ...body }: OF, signal?: AbortSignal | null): FetchReturnType;
28
+ fetch<T>({ o, f, ...body }: OF, signal?: AbortSignal | null): Promise<import("../window/Window").FetchResponseType<T>>;
19
29
  post<T, U = BaseMessages>(body: OF, signal?: AbortSignal): Promise<ApiWrapper<T, U>>;
20
30
  postFile(body: FormData): Promise<ApiWrapper<FileResponse, BaseMessages>>;
21
31
  postCSRF<T, U = BaseMessages>(body: OF): Promise<ApiWrapper<T, U>>;
22
- maybePostCSRF<T, U = BaseMessages>(body: MaybeWithCsrf<OF>): Promise<ApiWrapper<T, U>>;
23
32
  postToken<T, U = BaseMessages>(body: OF): Promise<ApiWrapper<T, U>>;
24
33
  maybePostToken<T, U = BaseMessages>(body: MaybeWithToken<OF>): Promise<ApiWrapper<T, U>>;
25
34
  token(): Promise<ApiWrapper<string>>;
@@ -1,3 +1,4 @@
1
- import { ApiWrapper } from '../types';
1
+ import { ApiDefaultWrapper, ApiWrapper } from '../types';
2
+ export declare const miscTokenError: ApiDefaultWrapper;
2
3
  export declare const miscToken: ApiWrapper<string>;
3
4
  export declare const miscTokenCSRF: ApiWrapper<string>;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,7 +1,8 @@
1
- export declare type FetchReturnType = Promise<{
2
- json: () => unknown;
3
- }>;
1
+ export declare type FetchResponseType<T> = {
2
+ json: () => Promise<T>;
3
+ };
4
+ export declare type FetchReturnType<T> = Promise<FetchResponseType<T>>;
4
5
  export interface WindowInterface {
5
6
  getBackendUrl: () => Promise<string>;
6
- fetch: (url: string, init?: RequestInit) => FetchReturnType;
7
+ fetch: <T>(url: string, init?: RequestInit) => FetchReturnType<T>;
7
8
  }
@@ -1,5 +1,5 @@
1
- import { WindowInterface } from './Window';
1
+ import { FetchReturnType, WindowInterface } from './Window';
2
2
  export declare class WindowBrowser implements WindowInterface {
3
3
  getBackendUrl(): Promise<string>;
4
- fetch(url: string, init?: RequestInit): Promise<Response>;
4
+ fetch<T>(url: string, init?: RequestInit): FetchReturnType<T>;
5
5
  }
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jamespot-user-api",
3
- "version": "1.0.105",
3
+ "version": "1.0.106",
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,35 @@
1
+ {
2
+ "o": "bookmarks",
3
+ "f": "add",
4
+ "error": 0,
5
+ "messages": [{ "code": 200, "msg": "Enregistrement r\u00e9ussi" }],
6
+ "result": {
7
+ "id": 46,
8
+ "mainType": "link",
9
+ "type": "bookmarkLink",
10
+ "uri": "bookmarkLink/46",
11
+ "dateCreation": "2023-06-09 16:26:25",
12
+ "dateModified": "2023-06-09 16:26:25",
13
+ "srcId": 1,
14
+ "srcType": "user",
15
+ "targetId": 0,
16
+ "targetType": null,
17
+ "value": null,
18
+ "_src": {
19
+ "id": 1,
20
+ "mainType": "user",
21
+ "type": "user",
22
+ "uri": "user/1",
23
+ "dateCreation": "2019-03-26 16:29:33",
24
+ "dateModified": "2019-07-19 09:39:23",
25
+ "title": "AdminJenkins",
26
+ "_url": "/user/1",
27
+ "level": 9
28
+ },
29
+ "bookmarkOrder": -13,
30
+ "bookmarkLabel": "www.example.com",
31
+ "bookmarkUrl": "https://www.example.com",
32
+ "bookmarkMeta": null,
33
+ "url": null
34
+ }
35
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "o": "bookmarks",
3
+ "f": "delete",
4
+ "error": 0,
5
+ "messages": [{ "code": 200, "msg": "Suppression r\u00e9ussie" }],
6
+ "result": null
7
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "o": "bookmarks",
3
+ "f": "move",
4
+ "error": 0,
5
+ "messages": [{ "code": 200, "msg": "Enregistrement r\u00e9ussi" }],
6
+ "result": null
7
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "o": "bookmarks",
3
+ "f": "rename",
4
+ "error": 0,
5
+ "messages": [{ "code": 200, "msg": "Enregistrement r\u00e9ussi" }],
6
+ "result": null
7
+ }
@@ -0,0 +1,45 @@
1
+ {
2
+ "o": "custom",
3
+ "f": "actionAdd",
4
+ "error": 0,
5
+ "messages": [],
6
+ "result": {
7
+ "id": 31,
8
+ "mainType": "link",
9
+ "type": "bookmarkLink",
10
+ "uri": "bookmarkLink/31",
11
+ "dateCreation": "2023-06-09 16:18:47",
12
+ "dateModified": "2023-06-09 16:18:47",
13
+ "srcId": 1,
14
+ "srcType": "user",
15
+ "targetId": 2,
16
+ "targetType": "mpArticle",
17
+ "value": null,
18
+ "_src": {
19
+ "id": 1,
20
+ "mainType": "user",
21
+ "type": "user",
22
+ "uri": "user/1",
23
+ "dateCreation": "2019-03-26 16:29:33",
24
+ "dateModified": "2019-07-19 09:39:23",
25
+ "title": "AdminJenkins",
26
+ "_url": "/user/1",
27
+ "level": 9
28
+ },
29
+ "_target": {
30
+ "id": 2,
31
+ "mainType": "article",
32
+ "type": "mpArticle",
33
+ "uri": "mpArticle/2",
34
+ "dateCreation": "2019-07-19 09:36:25",
35
+ "dateModified": "2019-07-19 09:36:25",
36
+ "title": "Article groupe public",
37
+ "_url": "/article/2"
38
+ },
39
+ "bookmarkOrder": -1,
40
+ "bookmarkLabel": "Article groupe public",
41
+ "bookmarkUrl": "",
42
+ "bookmarkMeta": null,
43
+ "url": "http://jenkins-preprod.jamespot.pro/index.php?action=article&idArticle=2"
44
+ }
45
+ }
@@ -0,0 +1,92 @@
1
+ {
2
+ "o": "object",
3
+ "f": "list",
4
+ "error": 0,
5
+ "messages": [],
6
+ "result": {
7
+ "limit": 10,
8
+ "page": 1,
9
+ "cnt": 2,
10
+ "data": [
11
+ {
12
+ "id": 34,
13
+ "mainType": "link",
14
+ "type": "bookmarkLink",
15
+ "uri": "bookmarkLink/34",
16
+ "dateCreation": "2023-06-09 16:26:22",
17
+ "dateModified": "2023-06-09 16:26:22",
18
+ "srcId": 1,
19
+ "srcType": "user",
20
+ "targetId": 4,
21
+ "targetType": "mpArticle",
22
+ "value": null,
23
+ "_src": {
24
+ "id": 1,
25
+ "mainType": "user",
26
+ "type": "user",
27
+ "uri": "user/1",
28
+ "dateCreation": "2019-03-26 16:29:33",
29
+ "dateModified": "2019-07-19 09:39:23",
30
+ "title": "AdminJenkins",
31
+ "_url": "/user/1",
32
+ "level": 9
33
+ },
34
+ "_target": {
35
+ "id": 4,
36
+ "mainType": "article",
37
+ "type": "mpArticle",
38
+ "uri": "mpArticle/4",
39
+ "dateCreation": "2019-07-19 09:36:48",
40
+ "dateModified": "2019-07-19 09:36:48",
41
+ "title": "Article groupe priv\u00e9",
42
+ "_url": "/article/4"
43
+ },
44
+ "bookmarkOrder": -3,
45
+ "bookmarkLabel": "Article groupe priv\u00e9",
46
+ "bookmarkUrl": "",
47
+ "bookmarkMeta": null,
48
+ "url": "http://jenkins-preprod.jamespot.pro/index.php?action=article&idArticle=4"
49
+ },
50
+ {
51
+ "id": 33,
52
+ "mainType": "link",
53
+ "type": "bookmarkLink",
54
+ "uri": "bookmarkLink/33",
55
+ "dateCreation": "2023-06-09 16:26:22",
56
+ "dateModified": "2023-06-09 16:26:22",
57
+ "srcId": 1,
58
+ "srcType": "user",
59
+ "targetId": 2,
60
+ "targetType": "mpArticle",
61
+ "value": null,
62
+ "_src": {
63
+ "id": 1,
64
+ "mainType": "user",
65
+ "type": "user",
66
+ "uri": "user/1",
67
+ "dateCreation": "2019-03-26 16:29:33",
68
+ "dateModified": "2019-07-19 09:39:23",
69
+ "title": "AdminJenkins",
70
+ "_url": "/user/1",
71
+ "level": 9
72
+ },
73
+ "_target": {
74
+ "id": 2,
75
+ "mainType": "article",
76
+ "type": "mpArticle",
77
+ "uri": "mpArticle/2",
78
+ "dateCreation": "2019-07-19 09:36:25",
79
+ "dateModified": "2019-07-19 09:36:25",
80
+ "title": "Article groupe public",
81
+ "_url": "/article/2"
82
+ },
83
+ "bookmarkOrder": -2,
84
+ "bookmarkLabel": "Article groupe public",
85
+ "bookmarkUrl": "",
86
+ "bookmarkMeta": null,
87
+ "url": "http://jenkins-preprod.jamespot.pro/index.php?action=article&idArticle=2"
88
+ }
89
+ ],
90
+ "facets": null
91
+ }
92
+ }
@@ -0,0 +1 @@
1
+ { "o": "onlyOffice", "f": "askObjectAccess", "error": 0, "messages": [], "result": true }
@@ -0,0 +1,19 @@
1
+ {
2
+ "o": "onlyOffice",
3
+ "f": "createFile",
4
+ "error": 0,
5
+ "messages": [],
6
+ "result": {
7
+ "idFile": 58,
8
+ "article": {
9
+ "id": 314,
10
+ "mainType": "article",
11
+ "type": "mpSocialFile",
12
+ "uri": "mpSocialFile/314",
13
+ "title": "xlsx_document",
14
+ "_url": "/article/314",
15
+ "dateCreation": "2023-04-14 14:52:36",
16
+ "dateModified": "2023-04-14 14:52:36"
17
+ }
18
+ }
19
+ }
@@ -0,0 +1 @@
1
+ { "o": "onlyOffice", "f": "deleteFile", "error": 0, "messages": [], "result": true }
@@ -0,0 +1,19 @@
1
+ {
2
+ "o": "onlyOffice",
3
+ "f": "duplicateFile",
4
+ "error": 0,
5
+ "messages": [],
6
+ "result": {
7
+ "idFile": 163,
8
+ "article": {
9
+ "id": 91,
10
+ "mainType": "article",
11
+ "type": "mpSocialFile",
12
+ "uri": "mpSocialFile/91",
13
+ "title": "DUPLICATED",
14
+ "_url": "/article/91",
15
+ "dateCreation": "2023-04-14 15:54:17",
16
+ "dateModified": "2023-04-14 15:54:17"
17
+ }
18
+ }
19
+ }