jamespot-user-api 1.0.138 → 1.0.140

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 (89) hide show
  1. package/documentation/assets/search.js +1 -1
  2. package/documentation/classes/AdminLicenseApi.html +11 -11
  3. package/documentation/classes/AdminStoreApi.html +1 -1
  4. package/documentation/classes/AdminUtilsApi.html +1 -1
  5. package/documentation/classes/JApplicationApi.html +8 -8
  6. package/documentation/classes/JArticleApi.html +1 -1
  7. package/documentation/classes/JAssetReservation.html +1 -1
  8. package/documentation/classes/JAudienceApi.html +1 -1
  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/JFaqApi.html +1 -1
  14. package/documentation/classes/JFileApi.html +5 -5
  15. package/documentation/classes/JFilebankApi.html +1 -1
  16. package/documentation/classes/JGroupApi.html +9 -9
  17. package/documentation/classes/JLandApi.html +1 -1
  18. package/documentation/classes/JMessengerApi.html +1 -1
  19. package/documentation/classes/JObjectApi.html +1 -1
  20. package/documentation/classes/JSearchApi.html +6 -6
  21. package/documentation/classes/JShareApi.html +1 -1
  22. package/documentation/classes/JTaxonomyApi.html +2 -2
  23. package/documentation/classes/JUserApi.html +10 -4
  24. package/documentation/classes/JWedocApi.html +1 -1
  25. package/documentation/classes/JamespotUserApi.html +1 -1
  26. package/documentation/classes/Network.html +1 -1
  27. package/documentation/classes/TVDisplayApi.html +1 -1
  28. package/documentation/classes/WindowBrowser.html +1 -1
  29. package/documentation/enums/StudioApplicationStatus.html +1 -1
  30. package/documentation/index.html +1 -1
  31. package/documentation/interfaces/AccessRightObject.html +1 -1
  32. package/documentation/interfaces/AdminLicenseUser.html +1 -1
  33. package/documentation/interfaces/ApiDefaultWrapper.html +1 -1
  34. package/documentation/interfaces/ApiWrapper.html +1 -1
  35. package/documentation/interfaces/BaseAutocomplete.html +1 -1
  36. package/documentation/interfaces/BaseMessage.html +1 -1
  37. package/documentation/interfaces/Category.html +1 -1
  38. package/documentation/interfaces/FileBankProps.html +1 -1
  39. package/documentation/interfaces/FolderProps.html +1 -1
  40. package/documentation/interfaces/ListFilterSpec.html +1 -1
  41. package/documentation/interfaces/OF.html +1 -1
  42. package/documentation/interfaces/ObjectListProps.html +1 -1
  43. package/documentation/interfaces/PagingResults.html +1 -1
  44. package/documentation/interfaces/RootFolderProps.html +1 -1
  45. package/documentation/interfaces/SearchCategoryModel.html +1 -1
  46. package/documentation/interfaces/SearchCategoryValue.html +1 -1
  47. package/documentation/interfaces/SearchConfig.html +1 -1
  48. package/documentation/interfaces/SearchFacetModel.html +1 -1
  49. package/documentation/interfaces/SearchFacetValueModel.html +1 -1
  50. package/documentation/interfaces/SearchQuery.html +1 -1
  51. package/documentation/interfaces/SearchQueryFilterModel.html +1 -1
  52. package/documentation/interfaces/SearchQueryOption.html +1 -1
  53. package/documentation/interfaces/SearchQueryResult.html +1 -1
  54. package/documentation/interfaces/SearchQuerySortModel.html +1 -1
  55. package/documentation/interfaces/SearchResultCatProps.html +1 -1
  56. package/documentation/interfaces/SearchResultPropsApp.html +1 -1
  57. package/documentation/interfaces/SearchResultPropsObject.html +1 -1
  58. package/documentation/interfaces/SpotProps.html +1 -1
  59. package/documentation/interfaces/Taxonomy.html +1 -1
  60. package/documentation/interfaces/TaxonomyCreate.html +1 -1
  61. package/documentation/interfaces/WindowInterface.html +1 -1
  62. package/documentation/modules.html +11 -11
  63. package/lib/jamespot-user-api.js +1 -1
  64. package/lib/jamespot-user-api.js.map +1 -1
  65. package/lib/src/apis/article/article.d.ts +8 -0
  66. package/lib/src/apis/article/article.mock.d.ts +4 -0
  67. package/lib/src/apis/fileSync/fileSync.d.ts +9 -0
  68. package/lib/src/apis/fileSync/fileSync.mock.d.ts +6 -0
  69. package/lib/src/apis/fileSync/fileSync.test.d.ts +1 -0
  70. package/lib/src/apis/jamespotUserApi.d.ts +2 -0
  71. package/lib/src/apis/mediaLibrary/mediaLibrary.d.ts +2 -2
  72. package/lib/src/apis/user/user.d.ts +17 -1
  73. package/lib/src/apis/user/user.mock.d.ts +6 -2
  74. package/lib/src/types/fileSync.d.ts +22 -0
  75. package/lib/src/types/group.d.ts +2 -0
  76. package/lib/src/types/mediaLibrary.d.ts +7 -1
  77. package/lib/src/types/user.d.ts +40 -0
  78. package/lib/src/types/widgets.d.ts +28 -17
  79. package/lib/src/util/Test.d.ts +119 -5
  80. package/package.json +1 -1
  81. package/phpunitMock/articleGet-with-widgets.json +56 -33
  82. package/phpunitMock/articleSaveAsDraft-default.json +7 -0
  83. package/phpunitMock/autocompleteAudience-u.json +16 -14
  84. package/phpunitMock/autocompleteSpot-a.json +12 -12
  85. package/phpunitMock/fileSyncGetFileBanks-success.json +11 -0
  86. package/phpunitMock/fileSyncGetUserQuota-success.json +7 -0
  87. package/phpunitMock/fileSyncSaveFileBanks-success.json +1 -0
  88. package/phpunitMock/objectListFileSyncAdminSpots-success.json +24 -0
  89. package/phpunitMock/spotGetProperties-default.json +184 -100
@@ -29,6 +29,10 @@ export type BaseArticle = {
29
29
  title: string;
30
30
  uri: string;
31
31
  };
32
+ export type DraftSerializedForm = {
33
+ name: string;
34
+ value: unknown;
35
+ }[];
32
36
  export declare class JArticleApi extends JBaseApi {
33
37
  list<T extends jArticleLittle = jArticleLittle>(config: ArticleListConfig): Promise<ApiWrapper<PagingResults<T>>>;
34
38
  get<T extends jArticleLittle = jArticleLittle>(config: ArticleGetConfig): Promise<ApiWrapper<T, BaseMessages>>;
@@ -40,4 +44,8 @@ export declare class JArticleApi extends JBaseApi {
40
44
  count(type: string): Promise<ApiWrapper<number>>;
41
45
  getAttachments(id: number, type: string, format?: string): Promise<ApiWrapper<jFileLittle[]>>;
42
46
  permalink(permalinkId: string): Promise<ApiWrapper<jArticleLittle>>;
47
+ saveAsDraft(form: Record<string, unknown>, contentType: string, idDraft?: string): Promise<ApiWrapper<{
48
+ idDraft: string;
49
+ msg: string;
50
+ }>>;
43
51
  }
@@ -7,3 +7,7 @@ export declare const articleWithWidget: ApiWrapper<jArticleWidgetLittle>;
7
7
  export declare const objectListJamespotArticleQueryList: ApiWrapper<PagingResults<jArticleLittle>>;
8
8
  export declare const articleDeleteMpArticle: ApiWrapper<boolean, BaseMessages>;
9
9
  export declare const articleGetAttachment: ApiWrapper<jFileLittle[]>;
10
+ export declare const articleSaveAsDraft: ApiWrapper<{
11
+ idDraft: string;
12
+ msg: string;
13
+ }, BaseMessages>;
@@ -0,0 +1,9 @@
1
+ import { ApiWrapper, PagingResults } from '../../types';
2
+ import { FileSyncAdminSpot, FileSyncAdminSpotsProps, FileSyncFileBank, FileSyncUserQuota } from '../../types/fileSync';
3
+ import { JBaseApi } from '../base';
4
+ export declare class JFileSyncApi extends JBaseApi {
5
+ getFileBanks(signal?: AbortSignal): Promise<ApiWrapper<FileSyncFileBank[]>>;
6
+ saveFileBanks(fileBanks: FileSyncFileBank[]): Promise<ApiWrapper<boolean>>;
7
+ getUserQuota(signal?: AbortSignal): Promise<ApiWrapper<FileSyncUserQuota>>;
8
+ getAdminSpots(props: FileSyncAdminSpotsProps, signal?: AbortSignal): Promise<ApiWrapper<PagingResults<FileSyncAdminSpot>>>;
9
+ }
@@ -0,0 +1,6 @@
1
+ import { ApiWrapper, PagingResults } from '../../types';
2
+ import { FileSyncAdminSpot, FileSyncFileBank, FileSyncUserQuota } from '../../types/fileSync';
3
+ export declare const fileSyncGetFileBanks: ApiWrapper<FileSyncFileBank[]>;
4
+ export declare const fileSyncSaveFileBanks: ApiWrapper<boolean>;
5
+ export declare const fileSyncGetUserQuota: ApiWrapper<FileSyncUserQuota>;
6
+ export declare const fileSyncGetAdminSpots: ApiWrapper<PagingResults<FileSyncAdminSpot>>;
@@ -0,0 +1 @@
1
+ export {};
@@ -23,6 +23,7 @@ import { TVDisplayApi } from './tvDisplay/tvDisplay';
23
23
  import { JShareApi } from './share/share';
24
24
  import { JFaqApi } from './faq/faq';
25
25
  import { JObjectApi } from './object/object';
26
+ import { JFileSyncApi } from './fileSync/fileSync';
26
27
  /**
27
28
  * In browser usage, 'window' should be the window object.
28
29
  * In server side usage, 'window' object given must implement the fetch method, used by the Apis.
@@ -50,6 +51,7 @@ export declare class JamespotUserApi {
50
51
  faq: JFaqApi;
51
52
  file: JFileApi;
52
53
  filebank: JFilebankApi;
54
+ fileSync: JFileSyncApi;
53
55
  group: JGroupApi;
54
56
  jland: JLandApi;
55
57
  mediaLibrary: JMediaLibraryApi;
@@ -1,5 +1,5 @@
1
1
  import { JBaseApi } from '../base';
2
- import { PagingResults, ApiWrapper, MediaLibraryList } from '../../types';
2
+ import { PagingResults, ApiWrapper, MediaLibraryList, GetUnclassifiedFilesParams } from '../../types';
3
3
  export declare class JMediaLibraryApi extends JBaseApi {
4
- GetUnclassifiedFiles(format?: string): Promise<ApiWrapper<PagingResults<MediaLibraryList>>>;
4
+ GetUnclassifiedFiles(params: GetUnclassifiedFilesParams): Promise<ApiWrapper<PagingResults<MediaLibraryList>>>;
5
5
  }
@@ -1,5 +1,5 @@
1
1
  import { JBaseApi } from '../base';
2
- import { ApiWrapper, Little, jObjectLittle, UserModel, UserMapModel, jUserAutocomplete, ApiPagingResults, ApiDefaultWrapper, jUserLittle, Readable } from '../../types';
2
+ import { ApiWrapper, Little, jObjectLittle, UserModel, UserMapModel, jUserAutocomplete, ApiPagingResults, ApiDefaultWrapper, jUserLittle, Readable, jUserValues, UserFieldsConfigurationType } from '../../types';
3
3
  export type User = Little & {
4
4
  id: string;
5
5
  shortUri: string;
@@ -53,6 +53,10 @@ export type BusinessContact = {
53
53
  field4?: string | undefined;
54
54
  field5?: string | undefined;
55
55
  };
56
+ export type UserValues = {
57
+ values: jUserValues;
58
+ mobileEditableFields: Array<keyof jUserValues>;
59
+ };
56
60
  export declare class JUserApi extends JBaseApi {
57
61
  /**
58
62
  * autocomplete return a list users
@@ -65,7 +69,19 @@ export declare class JUserApi extends JBaseApi {
65
69
  * @param format little by default. If another format is provided, the generic types should be defined
66
70
  */
67
71
  get<T extends jObjectLittle = jObjectLittle>(uri: string, format?: string, signal?: AbortSignal): Promise<ApiWrapper<T>>;
72
+ /**
73
+ * On upload file component, do to forget to set attrName to image
74
+ * @param idFile
75
+ */
76
+ updateImage(idFile: number, format?: string): Promise<ApiWrapper<jObjectLittle>>;
77
+ /**
78
+ * On upload file component, do to forget to set attrName to userBanner
79
+ * @param idFile
80
+ */
81
+ updateBanner(idFile: number, format?: string): Promise<ApiWrapper<jObjectLittle>>;
82
+ userUpdateProfile(values: jUserValues): Promise<ApiWrapper<jUserLittle>>;
68
83
  configuration(): Promise<ApiWrapper<UserDirectoryConfiguration>>;
84
+ fieldsConfiguration(): Promise<ApiWrapper<UserFieldsConfigurationType>>;
69
85
  userList<T extends jObjectLittle = jUserLittle>(payload: ObjectListProps, signal?: AbortSignal): Promise<ApiPagingResults<T>>;
70
86
  userQueryList<T extends jObjectLittle = jUserLittle>(payload: ObjectListProps): Promise<ApiPagingResults<T>>;
71
87
  userMap(payload: ObjectListProps): Promise<ApiPagingResults<UserMapModel>>;
@@ -1,8 +1,12 @@
1
- import { ApiDefaultWrapper, ApiPagingResults, ApiWrapper, UserMapModel, jUserAutocomplete, jUserList, jUserView } from '../../types';
2
- import { UserDirectoryConfiguration } from './user';
1
+ import { ApiDefaultWrapper, ApiPagingResults, ApiWrapper, UserMapModel, jUserAutocomplete, jUserList, jUserView, jUserLittle, UserFieldsConfigurationType, UserModel } from '../../types';
2
+ import { UserDirectoryConfiguration, UserValues } from './user';
3
3
  export declare const userAutocompleteA: ApiWrapper<jUserAutocomplete[]>;
4
4
  export declare const userGetUser1: ApiWrapper<jUserView>;
5
5
  export declare const userDirectoryConfigurationDefault: ApiWrapper<UserDirectoryConfiguration>;
6
+ export declare const userFieldsConfiguration: ApiWrapper<UserFieldsConfigurationType>;
7
+ export declare const userBusinessContactQueryList: ApiPagingResults<UserModel>;
8
+ export declare const userGetValues: ApiWrapper<UserValues>;
9
+ export declare const updateUserValues: ApiWrapper<jUserLittle>;
6
10
  export declare const userListRawList: ApiPagingResults<jUserList>;
7
11
  export declare const userQueryListRawList: ApiPagingResults<jUserList>;
8
12
  export declare const userMapDefault: ApiPagingResults<UserMapModel>;
@@ -0,0 +1,22 @@
1
+ import { Orders } from './utils';
2
+ export type FileSyncFileBank = {
3
+ uri: string;
4
+ name: string;
5
+ size: number;
6
+ isSynchronized: boolean;
7
+ };
8
+ export type FileSyncUserQuota = {
9
+ quotaUsed: number;
10
+ quotaTotal: number;
11
+ percentage: number;
12
+ };
13
+ export type FileSyncAdminSpot = {
14
+ name: string;
15
+ isSynchronized: string;
16
+ synchronizationsNb: string;
17
+ };
18
+ export type FileSyncAdminSpotsProps = {
19
+ page: number;
20
+ limit: number;
21
+ orders?: Orders;
22
+ };
@@ -50,6 +50,8 @@ export type GroupProperties = {
50
50
  widgets: Array<string>;
51
51
  rss_access: '1' | '0';
52
52
  rss_key: string;
53
+ fileSyncEnabled: '1' | '0';
54
+ fileBankQuota: number | '';
53
55
  fileSyncVersioningType: 'overwrite' | 'author-change';
54
56
  _options: GroupPropertiesOptions;
55
57
  _errors: [];
@@ -1,4 +1,4 @@
1
- import { AudienceAutocomplete, jArticleList, jArticleLittle, jFileLittle } from '../types';
1
+ import { AudienceAutocomplete, Format, jArticleList, jArticleLittle, jFileLittle } from '../types';
2
2
  export type MediaLibraryLittle = jArticleLittle & {
3
3
  attachment: jFileLittle;
4
4
  description: string;
@@ -8,3 +8,9 @@ export type MediaLibraryList = jArticleList & {
8
8
  attachment: jFileLittle;
9
9
  _audience: Array<AudienceAutocomplete>;
10
10
  };
11
+ export type GetUnclassifiedFilesParams = {
12
+ format: Format;
13
+ page?: number;
14
+ limit?: number;
15
+ nolimit?: boolean;
16
+ };
@@ -32,3 +32,43 @@ export type jUserList = jUserLittle & {
32
32
  [key: string]: WidgetsValue;
33
33
  };
34
34
  export type jUserView = jUserList & {};
35
+ export type jUserValues = Required<UserDefaultFieldsType> & {
36
+ level: string;
37
+ image: string | undefined;
38
+ businessManagementManager?: jUserLittle[];
39
+ businessNetworkingUserToCompanySrc?: jObjectLittle[];
40
+ };
41
+ export type UserDefaultFieldsType = {
42
+ mail: string | undefined;
43
+ title: string;
44
+ firstname: string;
45
+ lastname: string;
46
+ description?: string;
47
+ dateOfBirth?: string;
48
+ phoneNumber?: string;
49
+ language?: string;
50
+ timeZone?: string;
51
+ mobileNumber?: string;
52
+ company?: string;
53
+ country?: string;
54
+ department?: string;
55
+ function?: string;
56
+ webSite?: string;
57
+ image?: string | undefined;
58
+ userBanner?: string | undefined;
59
+ field1?: string;
60
+ field2?: string;
61
+ field3?: string;
62
+ field4?: string;
63
+ field5?: string;
64
+ };
65
+ export type UserFieldsConfigurationType = {
66
+ user_field_edit_profil: Record<keyof UserDefaultFieldsType, number>;
67
+ user_field_editable: Record<keyof UserDefaultFieldsType, number>;
68
+ user_field_my_page: Record<keyof UserDefaultFieldsType, number>;
69
+ user_page_mandatory_fields: {
70
+ firstname: '0' | '1';
71
+ lastname: '0' | '1';
72
+ pseudo: '0' | '1';
73
+ };
74
+ };
@@ -1,8 +1,9 @@
1
1
  import { AudienceAutocomplete } from './autocomplete';
2
2
  import { jFileLittle } from './file';
3
- import { jArticleLittle } from './utils';
3
+ import { jArticleList, jArticleLittle } from './utils';
4
4
  export type jArticleWidgetLittle = jArticleLittle & {
5
5
  articleWidgets: WidgetWrapperProps[];
6
+ articleWidgetDisplayMode: null | undefined | string;
6
7
  };
7
8
  export type WidgetLayer = {
8
9
  uniqid: string;
@@ -33,6 +34,7 @@ export type WidgetTypeKeys = {
33
34
  'widget-article-text': WidgetArticleTextType;
34
35
  'widget-article-image': WidgetArticleImageType;
35
36
  'widget-article-attachment': WidgetArticleAttachmentType;
37
+ 'widget-article-slider': WidgetArticleSliderType;
36
38
  };
37
39
  export type WidgetContentKeys = {
38
40
  'widget-article-button': WidgetArticleButtonContent;
@@ -41,6 +43,7 @@ export type WidgetContentKeys = {
41
43
  'widget-article-text': WidgetArticleTextContent;
42
44
  'widget-article-image': WidgetArticleImageContent;
43
45
  'widget-article-attachment': WidgetArticleAttachmentContent;
46
+ 'widget-article-slider': WidgetArticleSliderContent;
44
47
  };
45
48
  export type WidgetKeys = keyof WidgetTypeKeys;
46
49
  export type WidgetExtendedType = {
@@ -76,6 +79,11 @@ export type WidgetArticleAttachmentType = {
76
79
  uniqid: string;
77
80
  content: WidgetArticleAttachmentContent;
78
81
  };
82
+ export type WidgetArticleSliderType = {
83
+ name: 'widget-article-slider';
84
+ uniqid: string;
85
+ content: WidgetArticleSliderContent;
86
+ };
79
87
  export type CSSTextAlignType = 'left' | 'right' | 'center' | 'justify';
80
88
  export type CSSBackgroundPosition = 'top' | 'bottom' | 'center' | 'left' | 'right';
81
89
  export type CSSBackgroundSize = 'auto' | 'contain' | 'cover';
@@ -128,18 +136,29 @@ export type WidgetArticleButtonContent = {
128
136
  export type WidgetArticleImageContent = {
129
137
  file?: jFileLittle;
130
138
  useFilter?: boolean;
131
- displayAs?: 'image' | 'background';
132
- backgroundPosition?: CSSBackgroundPosition;
133
- backgroundSize?: CSSBackgroundSize;
134
- borderRadius?: string;
135
139
  };
136
140
  export type WidgetArticleAttachmentContent = {
137
141
  files?: jFileLittle[];
138
142
  fileDisplay?: 'list' | 'gallery';
139
143
  };
144
+ export type WidgetArticleSliderContent = {
145
+ slides?: {
146
+ title: string;
147
+ text: string;
148
+ titleHeading?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span';
149
+ textColor?: string;
150
+ opacityFilter?: number;
151
+ opacityColor?: string;
152
+ file?: jFileLittle;
153
+ }[];
154
+ maxWidth?: number;
155
+ loop?: boolean;
156
+ useDots?: boolean;
157
+ startAt?: number;
158
+ };
140
159
  export type CombinedWidgetContent = {
141
160
  widgets?: WidgetWrapperProps[];
142
- } & (WidgetArticleTextContent | WidgetArticleImageContent | WidgetArticleTitleContent | WidgetArticleButtonContent | WidgetArticleGalleryContent | WidgetArticleAttachmentContent);
161
+ } & (WidgetArticleTextContent | WidgetArticleImageContent | WidgetArticleTitleContent | WidgetArticleButtonContent | WidgetArticleGalleryContent | WidgetArticleAttachmentContent | WidgetArticleSliderContent);
143
162
  export type WidgetStateProps = {
144
163
  busy?: boolean | undefined;
145
164
  loading?: boolean | undefined;
@@ -163,16 +182,6 @@ export type WidgetVector = {
163
182
  x: number;
164
183
  y: number;
165
184
  };
166
- export type WidgetFileType = {
167
- id: number;
168
- filename: string;
169
- name?: string;
170
- mimetype: string;
171
- dimension: {
172
- width: number;
173
- height: number;
174
- };
175
- };
176
185
  export type WidgetDisplayMode = 'edit' | 'view' | 'preview';
177
186
  export type WidgetModalProps = {
178
187
  title?: string;
@@ -194,8 +203,10 @@ export type WidgetsState = {
194
203
  currentEditableIndex: number;
195
204
  currentEditableWidgetId: string | undefined;
196
205
  };
197
- export type ArticleWidgetType = jArticleLittle & {
206
+ export type ArticleDisplayMode = 'default' | 'vertical';
207
+ export type ArticleWidgetType = jArticleList & {
198
208
  articleWidgets: WidgetWrapperProps[];
199
209
  articleWidgetsCover: number | undefined;
210
+ articleWidgetDisplayMode: ArticleDisplayMode;
200
211
  _audience: AudienceAutocomplete[];
201
212
  };
@@ -1,21 +1,136 @@
1
1
  import { JamespotUserApi } from '../apis';
2
- import { ApiDefaultWrapper, PagingResults, jArticleLittle, jObjectAutocomplete, jObjectLittle, jObjectList, jUserList, Rights, jArticleView } from '../types';
2
+ import { ApiDefaultWrapper, PagingResults, jArticleLittle, jArticleView, jObjectLittle, jObjectAutocomplete, Rights } from '../types';
3
3
  import { jCommentList } from '../types/comment';
4
4
  import { FetchResponseType, WindowBrowser } from '../window';
5
5
  import { Network } from './network';
6
6
  export declare const windowBrowser: WindowBrowser;
7
7
  export declare const network: Network;
8
8
  export declare const jApi: JamespotUserApi;
9
+ export declare const fieldsObjFormatLittle: ({
10
+ n: "id";
11
+ t: string;
12
+ } | {
13
+ n: "uri";
14
+ t: string;
15
+ } | {
16
+ n: "dateCreation";
17
+ t: string;
18
+ } | {
19
+ n: "dateModified";
20
+ t: string;
21
+ } | {
22
+ n: "_url";
23
+ t: string;
24
+ } | {
25
+ n: "type";
26
+ t: string;
27
+ } | {
28
+ n: "mainType";
29
+ t: string;
30
+ } | {
31
+ n: "title";
32
+ t: string;
33
+ })[];
34
+ export declare const fieldsObjFormatList: ({
35
+ n: "id";
36
+ t: string;
37
+ } | {
38
+ n: "uri";
39
+ t: string;
40
+ } | {
41
+ n: "dateCreation";
42
+ t: string;
43
+ } | {
44
+ n: "dateModified";
45
+ t: string;
46
+ } | {
47
+ n: "_url";
48
+ t: string;
49
+ } | {
50
+ n: "type";
51
+ t: string;
52
+ } | {
53
+ n: "mainType";
54
+ t: string;
55
+ } | {
56
+ n: "title";
57
+ t: string;
58
+ })[];
59
+ export declare const fieldsObjFormatAutocomplete: ({
60
+ n: "id";
61
+ t: string;
62
+ } | {
63
+ n: "uri";
64
+ t: string;
65
+ } | {
66
+ n: "shortUri";
67
+ t: string;
68
+ } | {
69
+ n: "name";
70
+ t: string;
71
+ } | {
72
+ n: "mainType";
73
+ t: string;
74
+ } | {
75
+ n: "type";
76
+ t: string;
77
+ } | {
78
+ n: "label";
79
+ t: string;
80
+ } | {
81
+ n: "cssClass";
82
+ t: string;
83
+ } | {
84
+ n: "cssColor";
85
+ t: string;
86
+ } | {
87
+ n: "class";
88
+ t: string;
89
+ } | {
90
+ n: "title";
91
+ t: string;
92
+ })[];
93
+ export declare const arrayRights: ({
94
+ n: "create";
95
+ t: string;
96
+ } | {
97
+ n: "read";
98
+ t: string;
99
+ } | {
100
+ n: "publish";
101
+ t: string;
102
+ } | {
103
+ n: "administrate";
104
+ t: string;
105
+ } | {
106
+ n: "update";
107
+ t: string;
108
+ } | {
109
+ n: "delete";
110
+ t: string;
111
+ } | {
112
+ n: "comment";
113
+ t: string;
114
+ } | {
115
+ n: "member";
116
+ t: string;
117
+ })[];
9
118
  export declare const fetchMock: <T>(data: T) => jest.Mock<Promise<FetchResponseType<T>>, []>;
10
119
  export declare const validateJArticle: <T extends jArticleLittle>(received: T, expected: T) => void;
11
120
  export declare const validateApiWrapper: <T extends ApiDefaultWrapper<import("../types").BaseMessages>>(res: T, o: string, f: string, error?: null) => void;
12
121
  export declare const validatePagingResults: <T>(res: PagingResults<T>) => void;
122
+ export declare const validateObject: <T extends {
123
+ [x: string]: any;
124
+ }>(object: T, objectDefinition: Array<{
125
+ n: string;
126
+ t: string;
127
+ }>) => void;
128
+ export declare const validateObjectIsFormatList: <T extends jObjectLittle = jObjectLittle>(object: T) => void;
13
129
  export declare const validateObjectIsFormatLittle: <T extends jObjectLittle = jObjectLittle>(object: T) => void;
14
- export declare const validateObjectIsFormatList: <T extends jObjectList = jObjectList>(object: T) => void;
15
130
  export declare const validateArticleIsFormatView: <T extends jArticleView = jArticleView>(object: T) => void;
16
- export declare const validateUserIsFormatList: <T extends jUserList = jUserList>(object: T) => void;
17
- export declare const validateCommentIsFormatList: <T extends jCommentList = jCommentList>(object: T) => void;
18
131
  export declare const validateObjectIsFormatAutocomplete: <T extends jObjectAutocomplete = jObjectAutocomplete>(object: T) => void;
132
+ export declare const validateRights: (object: Rights) => void;
133
+ export declare const validateCommentIsFormatList: <T extends jCommentList = jCommentList>(object: T) => void;
19
134
  export declare const validateFileIsFormatLittle: <T extends {
20
135
  uri: string;
21
136
  id: number;
@@ -41,7 +156,6 @@ export declare const validateFileIsFormatLittle: <T extends {
41
156
  }>(object: T) => void;
42
157
  export declare const expectToHaveProperties: <T>(props: string[], payload: T[]) => void;
43
158
  export declare const expectToBeArray: <T>(arr: T[]) => void;
44
- export declare const validateRights: (object: Rights) => void;
45
159
  export declare const jDynamicProperties: string[];
46
160
  /**
47
161
  * Valorise toutes les propriétés Jamespot dynamiques avec leur typeof, sur toute la profondeur de l'objet.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jamespot-user-api",
3
- "version": "1.0.138",
3
+ "version": "1.0.140",
4
4
  "main": "lib/jamespot-user-api.js",
5
5
  "types": "lib/src/index.d.ts",
6
6
  "directories": {
@@ -4,31 +4,31 @@
4
4
  "error": 0,
5
5
  "messages": [],
6
6
  "result": {
7
- "id": 191,
7
+ "id": 248,
8
8
  "mainType": "article",
9
9
  "type": "articleWidget",
10
- "uri": "articleWidget/191",
11
- "dateCreation": "2023-09-21 11:40:50",
12
- "dateModified": "2023-09-21 11:40:50",
10
+ "uri": "articleWidget/248",
11
+ "dateCreation": "2024-02-16 10:59:20",
12
+ "dateModified": "2024-02-16 10:59:20",
13
13
  "title": "Article with widgets",
14
- "_url": "/article/191",
14
+ "_url": "/article/248",
15
15
  "articleWidgets": [
16
16
  {
17
17
  "title": "",
18
18
  "widget": {
19
19
  "name": "widget-article-attachment",
20
- "uniqid": "650c0fa2c1c89",
20
+ "uniqid": "65cf31f8a9ba4",
21
21
  "content": {
22
22
  "files": [
23
23
  {
24
- "id": 93,
24
+ "id": 39,
25
25
  "mainType": "file",
26
26
  "type": "fileTmp",
27
- "uri": "fileTmp/93",
28
- "dateCreation": "2023-09-21 11:40:50",
29
- "dateModified": "2023-09-21 11:40:50",
27
+ "uri": "fileTmp/39",
28
+ "dateCreation": "2024-02-16 10:59:20",
29
+ "dateModified": "2024-02-16 10:59:20",
30
30
  "title": "txtTest.docx",
31
- "mimetype": "application/octet-stream",
31
+ "mimetype": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
32
32
  "_url": "javascript:void(0);"
33
33
  }
34
34
  ],
@@ -40,7 +40,7 @@
40
40
  "title": "",
41
41
  "widget": {
42
42
  "name": "widget-article-text",
43
- "uniqid": "650c0fa2c1c8d",
43
+ "uniqid": "65cf31f8a9ba6",
44
44
  "content": {
45
45
  "text": "Hello world",
46
46
  "color": "white",
@@ -54,7 +54,7 @@
54
54
  "title": "",
55
55
  "widget": {
56
56
  "name": "widget-article-title",
57
- "uniqid": "650c0fa2c1c8e",
57
+ "uniqid": "65cf31f8a9ba7",
58
58
  "content": {
59
59
  "text": "This is my title",
60
60
  "textAlign": "center",
@@ -68,7 +68,7 @@
68
68
  "title": "",
69
69
  "widget": {
70
70
  "name": "widget-article-button",
71
- "uniqid": "650c0fa2c1c8f",
71
+ "uniqid": "65cf31f8a9ba8",
72
72
  "content": {
73
73
  "text": "This is a button",
74
74
  "color": "white",
@@ -92,7 +92,7 @@
92
92
  "title": "",
93
93
  "widget": {
94
94
  "name": "widget-article-text",
95
- "uniqid": "650c0fa2c1c8d",
95
+ "uniqid": "65cf31f8a9ba6",
96
96
  "content": {
97
97
  "text": "Hello world",
98
98
  "color": "white",
@@ -111,24 +111,20 @@
111
111
  "title": "",
112
112
  "widget": {
113
113
  "name": "widget-article-image",
114
- "uniqid": "650c0fa2c1c92",
114
+ "uniqid": "65cf31f8a9baa",
115
115
  "content": {
116
116
  "file": {
117
- "id": 93,
117
+ "id": 39,
118
118
  "mainType": "file",
119
119
  "type": "fileTmp",
120
- "uri": "fileTmp/93",
121
- "dateCreation": "2023-09-21 11:40:50",
122
- "dateModified": "2023-09-21 11:40:50",
120
+ "uri": "fileTmp/39",
121
+ "dateCreation": "2024-02-16 10:59:20",
122
+ "dateModified": "2024-02-16 10:59:20",
123
123
  "title": "txtTest.docx",
124
- "mimetype": "application/octet-stream",
124
+ "mimetype": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
125
125
  "_url": "javascript:void(0);"
126
126
  },
127
- "useFilter": true,
128
- "displayAs": "image",
129
- "backgroundPosition": "center",
130
- "backgroundSize": "cover",
131
- "borderRadius": "10"
127
+ "useFilter": true
132
128
  }
133
129
  }
134
130
  },
@@ -136,18 +132,18 @@
136
132
  "title": "",
137
133
  "widget": {
138
134
  "name": "widget-article-gallery",
139
- "uniqid": "650c0fa2c1c93",
135
+ "uniqid": "65cf31f8a9bab",
140
136
  "content": {
141
137
  "files": [
142
138
  {
143
- "id": 93,
139
+ "id": 39,
144
140
  "mainType": "file",
145
141
  "type": "fileTmp",
146
- "uri": "fileTmp/93",
147
- "dateCreation": "2023-09-21 11:40:50",
148
- "dateModified": "2023-09-21 11:40:50",
142
+ "uri": "fileTmp/39",
143
+ "dateCreation": "2024-02-16 10:59:20",
144
+ "dateModified": "2024-02-16 10:59:20",
149
145
  "title": "txtTest.docx",
150
- "mimetype": "application/octet-stream",
146
+ "mimetype": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
151
147
  "_url": "javascript:void(0);"
152
148
  }
153
149
  ],
@@ -155,7 +151,34 @@
155
151
  "column": "3"
156
152
  }
157
153
  }
154
+ },
155
+ {
156
+ "title": "",
157
+ "widget": {
158
+ "name": "widget-article-slider",
159
+ "uniqid": "65cf31f8a9bac",
160
+ "content": {
161
+ "slides": [
162
+ {
163
+ "title": "Slider",
164
+ "text": "Description",
165
+ "file": {
166
+ "id": 39,
167
+ "mainType": "file",
168
+ "type": "fileTmp",
169
+ "uri": "fileTmp/39",
170
+ "dateCreation": "2024-02-16 10:59:20",
171
+ "dateModified": "2024-02-16 10:59:20",
172
+ "title": "txtTest.docx",
173
+ "mimetype": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
174
+ "_url": "javascript:void(0);"
175
+ }
176
+ }
177
+ ]
178
+ }
179
+ }
158
180
  }
159
- ]
181
+ ],
182
+ "articleWidgetDisplayMode": null
160
183
  }
161
184
  }
@@ -0,0 +1,7 @@
1
+ {
2
+ "o": "article",
3
+ "f": "saveAsDraft",
4
+ "error": 0,
5
+ "messages": [],
6
+ "result": { "idDraft": "48", "msg": "Brouillon cr\u00e9\u00e9" }
7
+ }