jamespot-user-api 1.0.118 → 1.0.120
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/documentation/assets/search.js +1 -1
- package/documentation/classes/AdminLicenseApi.html +11 -11
- package/documentation/classes/AdminStoreApi.html +1 -1
- package/documentation/classes/AdminUtilsApi.html +1 -1
- package/documentation/classes/JApplicationApi.html +8 -8
- package/documentation/classes/JArticleApi.html +1 -1
- package/documentation/classes/JAssetReservation.html +1 -1
- package/documentation/classes/JAudienceApi.html +1 -1
- package/documentation/classes/JBaseApi.html +1 -1
- package/documentation/classes/JBookmarkApi.html +1 -1
- package/documentation/classes/JCommunityApi.html +1 -1
- package/documentation/classes/JDiapazoneApi.html +1 -1
- package/documentation/classes/JFaqApi.html +1 -1
- package/documentation/classes/JFileApi.html +6 -6
- package/documentation/classes/JFilebankApi.html +1 -1
- package/documentation/classes/JGroupApi.html +9 -9
- package/documentation/classes/JLandApi.html +1 -1
- package/documentation/classes/JMessengerApi.html +1 -1
- package/documentation/classes/JSearchApi.html +6 -6
- package/documentation/classes/JShareApi.html +1 -1
- package/documentation/classes/JTaxonomyApi.html +2 -2
- package/documentation/classes/JUserApi.html +4 -4
- package/documentation/classes/JWedocApi.html +1 -1
- package/documentation/classes/JamespotUserApi.html +1 -1
- package/documentation/classes/Network.html +1 -1
- package/documentation/classes/TVDisplayApi.html +1 -1
- package/documentation/classes/WindowBrowser.html +1 -1
- package/documentation/enums/StudioApplicationStatus.html +1 -1
- package/documentation/index.html +1 -1
- package/documentation/interfaces/AccessRightObject.html +1 -1
- package/documentation/interfaces/AdminLicenseUser.html +1 -1
- package/documentation/interfaces/ApiDefaultWrapper.html +1 -1
- package/documentation/interfaces/ApiWrapper.html +1 -1
- package/documentation/interfaces/BaseAutocomplete.html +1 -1
- package/documentation/interfaces/BaseMessage.html +1 -1
- package/documentation/interfaces/Category.html +1 -1
- package/documentation/interfaces/FileBankProps.html +1 -1
- package/documentation/interfaces/FolderProps.html +1 -1
- package/documentation/interfaces/ListFilterSpec.html +1 -1
- package/documentation/interfaces/OF.html +1 -1
- package/documentation/interfaces/ObjectListProps.html +1 -1
- package/documentation/interfaces/PagingResults.html +1 -1
- package/documentation/interfaces/RootFolderProps.html +1 -1
- package/documentation/interfaces/SearchCategoryModel.html +1 -1
- package/documentation/interfaces/SearchCategoryValue.html +1 -1
- package/documentation/interfaces/SearchConfig.html +1 -1
- package/documentation/interfaces/SearchFacetModel.html +1 -1
- package/documentation/interfaces/SearchFacetValueModel.html +1 -1
- package/documentation/interfaces/SearchQuery.html +1 -1
- package/documentation/interfaces/SearchQueryFilterModel.html +1 -1
- package/documentation/interfaces/SearchQueryOption.html +1 -1
- package/documentation/interfaces/SearchQueryResult.html +1 -1
- package/documentation/interfaces/SearchQuerySortModel.html +1 -1
- package/documentation/interfaces/SearchResultCatProps.html +1 -1
- package/documentation/interfaces/SearchResultPropsApp.html +1 -1
- package/documentation/interfaces/SearchResultPropsObject.html +1 -1
- package/documentation/interfaces/SpotProps.html +1 -1
- package/documentation/interfaces/Taxonomy.html +1 -1
- package/documentation/interfaces/TaxonomyCreate.html +1 -1
- package/documentation/interfaces/WindowInterface.html +1 -1
- package/documentation/modules.html +14 -9
- package/lib/jamespot-user-api.js +1 -1
- package/lib/jamespot-user-api.js.map +1 -1
- package/lib/src/apis/article/article.d.ts +3 -11
- package/lib/src/apis/article/article.mock.d.ts +3 -3
- package/lib/src/apis/faq/faq.d.ts +7 -4
- package/lib/src/apis/faq/faq.mock.d.ts +6 -1
- package/lib/src/apis/file/file.d.ts +68 -0
- package/lib/src/apis/file/file.mock.d.ts +8 -0
- package/lib/src/apis/file/file.test.d.ts +1 -0
- package/lib/src/apis/index.d.ts +1 -1
- package/lib/src/apis/jamespotUserApi.d.ts +1 -1
- package/lib/src/types/faq.d.ts +24 -3
- package/lib/src/types/file.d.ts +9 -20
- package/lib/src/types/mediaLibrary.d.ts +3 -7
- package/lib/src/types/utils.d.ts +1 -1
- package/lib/src/types/widgets.d.ts +9 -10
- package/lib/src/util/Test.d.ts +23 -0
- package/lib/src/util/file.d.ts +23 -7
- package/lib/src/util/file.mock.d.ts +312 -0
- package/lib/src/util/network.d.ts +16 -2
- package/package.json +1 -1
- package/phpunitMock/articleCreate-faq-category.json +3 -4
- package/phpunitMock/articleGet-faq-category.json +7 -9
- package/phpunitMock/articleGet-mpArticle-list.json +1 -2
- package/phpunitMock/articleGet-with-widgets.json +161 -0
- package/phpunitMock/articleGetAttachment-success.json +19 -18
- package/phpunitMock/articleUpdate-faq-category.json +3 -4
- package/phpunitMock/faqAccess-success.json +9 -0
- package/phpunitMock/faqCheckItem-success.json +89 -0
- package/phpunitMock/fileCreate-rawLittle.json +17 -0
- package/phpunitMock/fileDelete-default.json +1 -0
- package/phpunitMock/fileDeleteImage-default.json +1 -0
- package/phpunitMock/fileGet-default.json +17 -0
- package/phpunitMock/fileUpdate-rawLittle.json +18 -0
- package/phpunitMock/objectListFaqQueryList-faq-success.json +192 -0
- package/phpunitMock/tvDisplayGetChannel-dynamic.json +16 -16
- package/phpunitMock/tvDisplayGetChannel-slideshow.json +16 -14
- package/phpunitMock/tvDisplayGetConfigureChannel-dynamic.json +16 -16
- package/phpunitMock/tvDisplayGetConfigureChannel-slideshow.json +16 -14
- package/lib/src/apis/file.d.ts +0 -62
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { JBaseApi } from '../base';
|
|
2
|
-
import { ApiWrapper, BaseMessages, Filters, jArticleList, jArticleLittle,
|
|
2
|
+
import { ApiWrapper, BaseMessages, Filters, jArticleList, jArticleLittle, jFileLittle, MaybeWithToken, Orders, PagingResults } from '../../types';
|
|
3
3
|
export type ArticleListConfig = {
|
|
4
4
|
type: string;
|
|
5
5
|
format?: string;
|
|
@@ -29,22 +29,14 @@ export type BaseArticle = {
|
|
|
29
29
|
title: string;
|
|
30
30
|
uri: string;
|
|
31
31
|
};
|
|
32
|
-
export type FileArticle = jObjectBase & {
|
|
33
|
-
title: string;
|
|
34
|
-
type: 'fileArticle';
|
|
35
|
-
mainType: 'fileArticle';
|
|
36
|
-
_url: string;
|
|
37
|
-
};
|
|
38
32
|
export declare class JArticleApi extends JBaseApi {
|
|
39
33
|
list<T extends jArticleLittle = jArticleLittle>(config: ArticleListConfig): Promise<ApiWrapper<PagingResults<T>>>;
|
|
40
|
-
get<T extends jArticleLittle = jArticleLittle>(config: ArticleGetConfig): Promise<ApiWrapper<T
|
|
41
|
-
_nbAttachedFiles: number;
|
|
42
|
-
}, BaseMessages>>;
|
|
34
|
+
get<T extends jArticleLittle = jArticleLittle>(config: ArticleGetConfig): Promise<ApiWrapper<T, BaseMessages>>;
|
|
43
35
|
create<R extends jArticleLittle = jArticleLittle, P extends ArticleCreation = ArticleCreation>(article: MaybeWithToken<P>, format?: string): Promise<ApiWrapper<Array<R>, BaseMessages>>;
|
|
44
36
|
update<T extends {
|
|
45
37
|
uri: string;
|
|
46
38
|
}, U extends jArticleLittle = jArticleList>(article: T): Promise<ApiWrapper<U, BaseMessages>>;
|
|
47
39
|
delete(id: number): Promise<ApiWrapper<boolean, BaseMessages>>;
|
|
48
40
|
count(type: string): Promise<ApiWrapper<number>>;
|
|
49
|
-
getAttachments(id: number, type: string, format?: string): Promise<ApiWrapper<
|
|
41
|
+
getAttachments(id: number, type: string, format?: string): Promise<ApiWrapper<jFileLittle[]>>;
|
|
50
42
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ApiWrapper, BaseMessages, PagingResults, jArticleList, jArticleLittle, jArticleView } from '../../types';
|
|
2
|
-
import { FileArticle } from './article';
|
|
1
|
+
import { ApiWrapper, BaseMessages, PagingResults, jArticleList, jArticleLittle, jArticleView, jArticleWidgetLittle, jFileLittle } from '../../types';
|
|
3
2
|
export declare const articleGetMpArticleList: ApiWrapper<jArticleList, BaseMessages>;
|
|
4
3
|
export declare const articleCreateMpArticleLittle: ApiWrapper<Array<jArticleLittle>, BaseMessages>;
|
|
5
4
|
export declare const articleUpdateMpArticleView: ApiWrapper<jArticleView, BaseMessages>;
|
|
6
5
|
export declare const articleCountMpArticle: ApiWrapper<number>;
|
|
6
|
+
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
|
-
export declare const articleGetAttachment: ApiWrapper<
|
|
9
|
+
export declare const articleGetAttachment: ApiWrapper<jFileLittle[]>;
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { JBaseApi } from '../base';
|
|
2
|
-
import { ApiWrapper, CreateFaqCategory, EditFaqCategory, FaqCategoryView, FaqHookProperties, FaqTaxonomy, jArticleLittle } from '../../types';
|
|
2
|
+
import { ApiWrapper, CreateFaqCategory, EditFaqCategory, ExtendedFaqCategory, FaqAccess, FaqCategoryList, FaqCategoryView, FaqHookProperties, FaqItemList, FaqTaxonomy, jArticleLittle, Orders, PagingResults } from '../../types';
|
|
3
3
|
export declare class JFaqApi extends JBaseApi {
|
|
4
|
+
getCategoriesList<T extends ExtendedFaqCategory<FaqCategoryList> = ExtendedFaqCategory<FaqCategoryList>>(format?: string, orders?: Orders): Promise<ApiWrapper<PagingResults<T>>>;
|
|
4
5
|
createCategory<T extends jArticleLittle = FaqCategoryView>(params: Omit<CreateFaqCategory, 'type'>, format?: string): Promise<ApiWrapper<Array<T>>>;
|
|
5
6
|
updateCategory<T extends jArticleLittle = FaqCategoryView>(params: Omit<EditFaqCategory, 'type'>, format?: string): Promise<ApiWrapper<T>>;
|
|
6
|
-
getCategory<T extends jArticleLittle = FaqCategoryView>(id: number, format?: string): Promise<ApiWrapper<T
|
|
7
|
-
_nbAttachedFiles: number;
|
|
8
|
-
}>>;
|
|
7
|
+
getCategory<T extends jArticleLittle = FaqCategoryView>(id: number, format?: string): Promise<ApiWrapper<T>>;
|
|
9
8
|
deleteCategory(id: number): Promise<ApiWrapper<boolean>>;
|
|
9
|
+
checkItem<T extends FaqItemList>(query: string, page?: number, format?: string): Promise<ApiWrapper<PagingResults<T & {
|
|
10
|
+
_percent: number;
|
|
11
|
+
}>>>;
|
|
10
12
|
getTaxonomy(): Promise<ApiWrapper<FaqTaxonomy>>;
|
|
11
13
|
getHookProperties(properties?: Array<keyof FaqHookProperties>): Promise<ApiWrapper<FaqHookProperties>>;
|
|
14
|
+
getAccess(): Promise<ApiWrapper<FaqAccess>>;
|
|
12
15
|
}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
import { ApiWrapper, FaqCategoryView, FaqHookProperties, FaqTaxonomy } from '../../types';
|
|
1
|
+
import { ApiWrapper, ExtendedFaqCategory, FaqAccess, FaqCategoryList, FaqCategoryView, FaqHookProperties, FaqItemList, FaqTaxonomy, PagingResults } from '../../types';
|
|
2
2
|
export declare const faqCreateCategory: ApiWrapper<FaqCategoryView[]>;
|
|
3
3
|
export declare const faqGetCategory: ApiWrapper<FaqCategoryView>;
|
|
4
4
|
export declare const faqUpdateCategory: ApiWrapper<FaqCategoryView>;
|
|
5
5
|
export declare const faqDeleteCategory: ApiWrapper<boolean>;
|
|
6
6
|
export declare const faqGetTaxonomy: ApiWrapper<FaqTaxonomy>;
|
|
7
7
|
export declare const faqGetHookProperties: ApiWrapper<FaqHookProperties>;
|
|
8
|
+
export declare const faqGetAccess: ApiWrapper<FaqAccess>;
|
|
9
|
+
export declare const faqGetCategoriesList: ApiWrapper<PagingResults<ExtendedFaqCategory<FaqCategoryList>>>;
|
|
10
|
+
export declare const faqCheckItem: ApiWrapper<PagingResults<FaqItemList & {
|
|
11
|
+
_percent: number;
|
|
12
|
+
}>>;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { ApiWrapper, FileCropConfig, UploadConfig, jFileLittle, jFileLittleCrop } from '../../types';
|
|
2
|
+
import { JBaseApi } from '../base';
|
|
3
|
+
export declare class JFileApi extends JBaseApi {
|
|
4
|
+
/**
|
|
5
|
+
* Upload a file to the server. use the same token to link the file to an article
|
|
6
|
+
* @param config configuration object. One of "file" and "url" is mandatory
|
|
7
|
+
*/
|
|
8
|
+
upload(config: UploadConfig): Promise<{
|
|
9
|
+
response: ApiWrapper<{
|
|
10
|
+
uri: string;
|
|
11
|
+
id: number;
|
|
12
|
+
mainType: string;
|
|
13
|
+
type: string;
|
|
14
|
+
dateCreation: string;
|
|
15
|
+
title: string;
|
|
16
|
+
_url: string;
|
|
17
|
+
dateModified: string | null;
|
|
18
|
+
mimetype: string;
|
|
19
|
+
path?: string;
|
|
20
|
+
}, import("../../types").BaseMessages>;
|
|
21
|
+
token: string;
|
|
22
|
+
}>;
|
|
23
|
+
/**
|
|
24
|
+
* Upload a list of files to the server. use the same token to link the file to an article
|
|
25
|
+
* @param attrName file name (attachment, image, bannerImage, etc.)
|
|
26
|
+
* @param files files
|
|
27
|
+
* @param token token
|
|
28
|
+
*/
|
|
29
|
+
uploadMany(configArray: Array<UploadConfig>): Promise<{
|
|
30
|
+
response: ApiWrapper<{
|
|
31
|
+
uri: string;
|
|
32
|
+
id: number;
|
|
33
|
+
mainType: string;
|
|
34
|
+
type: string;
|
|
35
|
+
dateCreation: string;
|
|
36
|
+
title: string;
|
|
37
|
+
_url: string;
|
|
38
|
+
dateModified: string | null;
|
|
39
|
+
mimetype: string;
|
|
40
|
+
path?: string;
|
|
41
|
+
}, import("../../types").BaseMessages>;
|
|
42
|
+
token: string;
|
|
43
|
+
}[]>;
|
|
44
|
+
get<T extends jFileLittle>(idFile: number, format?: string): Promise<ApiWrapper<T>>;
|
|
45
|
+
/**
|
|
46
|
+
* Crop an image
|
|
47
|
+
* @param config crop configuration
|
|
48
|
+
* @returns
|
|
49
|
+
*/
|
|
50
|
+
update(idFile: number | string, type: string, config: FileCropConfig): Promise<ApiWrapper<jFileLittleCrop, import("../../types").BaseMessages>>;
|
|
51
|
+
/**
|
|
52
|
+
* delete file. This action is not automatic. You need to update the content associated with the deleted image with the same token
|
|
53
|
+
* @param idFile file id
|
|
54
|
+
* @param attrName attribute name
|
|
55
|
+
* @param token token
|
|
56
|
+
* @returns
|
|
57
|
+
*/
|
|
58
|
+
deleteFile(idFile: number | string, attrName: string, token: string, signal?: AbortSignal): Promise<ApiWrapper<boolean, import("../../types").BaseMessages>>;
|
|
59
|
+
/**
|
|
60
|
+
* delete the image associated with a content. This action is permanent. There is no two step process with a token
|
|
61
|
+
* @param id content id
|
|
62
|
+
* @param type content type
|
|
63
|
+
* @returns
|
|
64
|
+
*/
|
|
65
|
+
deleteImage(id: number | string, type: string): Promise<ApiWrapper<{
|
|
66
|
+
id: number;
|
|
67
|
+
}, import("../../types").BaseMessages>>;
|
|
68
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ApiWrapper, jFileLittle, jFileLittleCrop } from '../../types';
|
|
2
|
+
export declare const fileCreateRawLittle: ApiWrapper<jFileLittle>;
|
|
3
|
+
export declare const fileUpdateRawLittle: ApiWrapper<jFileLittleCrop>;
|
|
4
|
+
export declare const fileDeleteDefault: ApiWrapper<boolean>;
|
|
5
|
+
export declare const fileDeleteImageDefault: ApiWrapper<{
|
|
6
|
+
id: number;
|
|
7
|
+
}>;
|
|
8
|
+
export declare const fileGetDefault: ApiWrapper<jFileLittle>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/lib/src/apis/index.d.ts
CHANGED
|
@@ -7,8 +7,8 @@ export * from './base';
|
|
|
7
7
|
export * from './bookmark/bookmark';
|
|
8
8
|
export * from './community';
|
|
9
9
|
export * from './diapazone/diapazone';
|
|
10
|
+
export * from './file/file';
|
|
10
11
|
export * from './faq/faq';
|
|
11
|
-
export * from './file';
|
|
12
12
|
export * from './filebank';
|
|
13
13
|
export * from './group';
|
|
14
14
|
export * from './jamespotUserApi';
|
|
@@ -7,7 +7,7 @@ import { JAudienceApi } from './audience/audience';
|
|
|
7
7
|
import { JCommunityApi } from './community';
|
|
8
8
|
import { JDiapazoneApi } from './diapazone/diapazone';
|
|
9
9
|
import { JDriveApi } from './drive/drive';
|
|
10
|
-
import { JFileApi } from './file';
|
|
10
|
+
import { JFileApi } from './file/file';
|
|
11
11
|
import { JFilebankApi } from './filebank';
|
|
12
12
|
import { JGroupApi } from './group/group';
|
|
13
13
|
import { JMediaLibraryApi } from './mediaLibrary/mediaLibrary';
|
package/lib/src/types/faq.d.ts
CHANGED
|
@@ -1,15 +1,31 @@
|
|
|
1
|
-
import { jArticleView, MaybeWithToken } from './utils';
|
|
1
|
+
import { jArticleList, jArticleView, MaybeWithToken } from './utils';
|
|
2
2
|
import { ArticleCreation, AutoCompleteConcept } from '../apis';
|
|
3
3
|
import { ImageSize } from './file';
|
|
4
4
|
import { AudienceAutocomplete } from './autocomplete';
|
|
5
5
|
export type FaqCategoryView = jArticleView & {
|
|
6
6
|
faqColor?: string;
|
|
7
7
|
_audience: AudienceAutocomplete[];
|
|
8
|
-
image?: ImageSize
|
|
8
|
+
image?: ImageSize;
|
|
9
9
|
tags?: AutoCompleteConcept[];
|
|
10
10
|
type: 'faq';
|
|
11
11
|
isWeb: boolean;
|
|
12
12
|
};
|
|
13
|
+
export type FaqCategoryList = jArticleList & {
|
|
14
|
+
faqColor?: string;
|
|
15
|
+
image?: ImageSize;
|
|
16
|
+
};
|
|
17
|
+
export type ExtendedFaqCategory<T extends FaqCategoryList> = T & {
|
|
18
|
+
_extend: {
|
|
19
|
+
itemsCount: number;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export type FaqItemList = jArticleList & {
|
|
23
|
+
type: 'faqItem';
|
|
24
|
+
hierarchy: {
|
|
25
|
+
category?: string;
|
|
26
|
+
theme?: string;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
13
29
|
export type CreateFaqCategory = MaybeWithToken<Omit<ArticleCreation, 'idSpot'>> & {
|
|
14
30
|
image?: ImageSize | null;
|
|
15
31
|
tags?: string;
|
|
@@ -26,5 +42,10 @@ export type FaqTaxonomy = {
|
|
|
26
42
|
id: string;
|
|
27
43
|
};
|
|
28
44
|
export type FaqHookProperties = {
|
|
29
|
-
_web
|
|
45
|
+
_web?: '0' | '1' | '';
|
|
46
|
+
appImage?: string;
|
|
47
|
+
appImageText?: string;
|
|
48
|
+
};
|
|
49
|
+
export type FaqAccess = {
|
|
50
|
+
createCategory: boolean;
|
|
30
51
|
};
|
package/lib/src/types/file.d.ts
CHANGED
|
@@ -9,39 +9,28 @@ export type ImageSize = {
|
|
|
9
9
|
width: number;
|
|
10
10
|
height: number;
|
|
11
11
|
};
|
|
12
|
-
export type FileResponse = {
|
|
13
|
-
id: string;
|
|
14
|
-
name: string;
|
|
15
|
-
type: string;
|
|
16
|
-
token?: string;
|
|
17
|
-
crop?: FileCropConfig;
|
|
18
|
-
size: string;
|
|
19
|
-
mediaKey: string;
|
|
20
|
-
imagesize: ImageSize;
|
|
21
|
-
};
|
|
22
12
|
export type FileCropConfig = {
|
|
23
13
|
x: number;
|
|
24
14
|
y: number;
|
|
25
|
-
|
|
26
|
-
|
|
15
|
+
w: number;
|
|
16
|
+
h: number;
|
|
27
17
|
rotation: number;
|
|
28
18
|
killSize?: boolean;
|
|
29
19
|
};
|
|
30
|
-
export type FileCropReturnType = Omit<FileResponse, 'token'> & {
|
|
31
|
-
crop: FileCropConfig;
|
|
32
|
-
};
|
|
33
20
|
export type jFileLittle = Readable<Omit<jObjectLittle, 'dateModified'> & {
|
|
34
21
|
dateCreation: string;
|
|
35
22
|
dateModified: string | null;
|
|
23
|
+
mimetype: string;
|
|
24
|
+
path?: string;
|
|
36
25
|
}>;
|
|
26
|
+
export type jFileLittleCrop = jFileLittle & {
|
|
27
|
+
_extend: {
|
|
28
|
+
crop: FileCropConfig;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
37
31
|
export type jFileRendition = {
|
|
38
32
|
name: string;
|
|
39
33
|
filename: string;
|
|
40
34
|
dateModified: string;
|
|
41
35
|
mimetype: string;
|
|
42
36
|
};
|
|
43
|
-
export type JFileExtended = jFileLittle & {
|
|
44
|
-
meta?: string;
|
|
45
|
-
_renditions: string[];
|
|
46
|
-
_renditionsData: Record<string, jFileRendition>;
|
|
47
|
-
};
|
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
import { AudienceAutocomplete, jArticleList, jArticleLittle,
|
|
2
|
-
export type MediaLibraryAttachment = jObjectBase & {
|
|
3
|
-
title: string;
|
|
4
|
-
size: string;
|
|
5
|
-
};
|
|
1
|
+
import { AudienceAutocomplete, jArticleList, jArticleLittle, jFileLittle } from '../types';
|
|
6
2
|
export type MediaLibraryLittle = jArticleLittle & {
|
|
7
|
-
attachment:
|
|
3
|
+
attachment: jFileLittle;
|
|
8
4
|
description: string;
|
|
9
5
|
};
|
|
10
6
|
export type MediaLibraryList = jArticleList & {
|
|
11
7
|
description: string;
|
|
12
|
-
attachment:
|
|
8
|
+
attachment: jFileLittle;
|
|
13
9
|
_audience: Array<AudienceAutocomplete>;
|
|
14
10
|
};
|
package/lib/src/types/utils.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { AudienceAutocomplete } from './autocomplete';
|
|
2
|
+
import { jFileLittle } from './file';
|
|
2
3
|
import { jArticleLittle } from './utils';
|
|
4
|
+
export type jArticleWidgetLittle = jArticleLittle & {
|
|
5
|
+
articleWidgets: WidgetWrapperProps[];
|
|
6
|
+
};
|
|
3
7
|
export type WidgetLayer = {
|
|
4
8
|
uniqid: string;
|
|
5
9
|
title: string;
|
|
@@ -80,14 +84,10 @@ export type VariantType = 'contained' | 'outlined';
|
|
|
80
84
|
export type OpeningType = 'link' | 'anchor' | 'popup';
|
|
81
85
|
export type WidgetArticleGalleryContent = {
|
|
82
86
|
gap?: string;
|
|
83
|
-
|
|
84
|
-
files?:
|
|
85
|
-
galleryDisplay?: 'portrait' | 'landscape';
|
|
86
|
-
heightMode?: 'auto' | 'custom';
|
|
87
|
-
heightModeValue?: string;
|
|
87
|
+
column?: string;
|
|
88
|
+
files?: jFileLittle[];
|
|
88
89
|
};
|
|
89
90
|
export type WidgetArticleTitleContent = {
|
|
90
|
-
widgets?: WidgetWrapperProps[];
|
|
91
91
|
text?: string;
|
|
92
92
|
textAlign?: CSSTextAlignType;
|
|
93
93
|
heading?: string;
|
|
@@ -126,16 +126,15 @@ export type WidgetArticleButtonContent = {
|
|
|
126
126
|
openingTypePopup?: OpeningTypePopup;
|
|
127
127
|
};
|
|
128
128
|
export type WidgetArticleImageContent = {
|
|
129
|
-
file?:
|
|
129
|
+
file?: jFileLittle;
|
|
130
130
|
useFilter?: boolean;
|
|
131
131
|
displayAs?: 'image' | 'background';
|
|
132
132
|
backgroundPosition?: CSSBackgroundPosition;
|
|
133
133
|
backgroundSize?: CSSBackgroundSize;
|
|
134
134
|
borderRadius?: string;
|
|
135
|
-
widgets?: WidgetWrapperProps[];
|
|
136
135
|
};
|
|
137
136
|
export type WidgetArticleAttachmentContent = {
|
|
138
|
-
files?:
|
|
137
|
+
files?: jFileLittle[];
|
|
139
138
|
fileDisplay?: 'list' | 'gallery';
|
|
140
139
|
};
|
|
141
140
|
export type CombinedWidgetContent = {
|
|
@@ -174,7 +173,7 @@ export type WidgetFileType = {
|
|
|
174
173
|
height: number;
|
|
175
174
|
};
|
|
176
175
|
};
|
|
177
|
-
export type WidgetDisplayMode = 'edit' | 'view';
|
|
176
|
+
export type WidgetDisplayMode = 'edit' | 'view' | 'preview';
|
|
178
177
|
export type WidgetModalProps = {
|
|
179
178
|
title?: string;
|
|
180
179
|
view?: any;
|
package/lib/src/util/Test.d.ts
CHANGED
|
@@ -16,6 +16,29 @@ export declare const validateArticleIsFormatView: <T extends jArticleView = jArt
|
|
|
16
16
|
export declare const validateUserIsFormatList: <T extends jUserList = jUserList>(object: T) => void;
|
|
17
17
|
export declare const validateCommentIsFormatList: <T extends jCommentList = jCommentList>(object: T) => void;
|
|
18
18
|
export declare const validateObjectIsFormatAutocomplete: <T extends jObjectAutocomplete = jObjectAutocomplete>(object: T) => void;
|
|
19
|
+
export declare const validateFileIsFormatLittle: <T extends {
|
|
20
|
+
uri: string;
|
|
21
|
+
id: number;
|
|
22
|
+
mainType: string;
|
|
23
|
+
type: string;
|
|
24
|
+
dateCreation: string;
|
|
25
|
+
title: string;
|
|
26
|
+
_url: string;
|
|
27
|
+
dateModified: string | null;
|
|
28
|
+
mimetype: string;
|
|
29
|
+
path?: string;
|
|
30
|
+
} = {
|
|
31
|
+
uri: string;
|
|
32
|
+
id: number;
|
|
33
|
+
mainType: string;
|
|
34
|
+
type: string;
|
|
35
|
+
dateCreation: string;
|
|
36
|
+
title: string;
|
|
37
|
+
_url: string;
|
|
38
|
+
dateModified: string | null;
|
|
39
|
+
mimetype: string;
|
|
40
|
+
path?: string;
|
|
41
|
+
}>(object: T) => void;
|
|
19
42
|
export declare const expectToHaveProperties: <T>(props: string[], payload: T[]) => void;
|
|
20
43
|
export declare const expectToBeArray: <T>(arr: T[]) => void;
|
|
21
44
|
export declare const validateRights: (object: Rights) => void;
|
package/lib/src/util/file.d.ts
CHANGED
|
@@ -1,7 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export declare
|
|
6
|
-
export
|
|
7
|
-
export declare
|
|
1
|
+
import { jFileLittle } from '../types';
|
|
2
|
+
export declare const mimetypes: readonly ["application/vnd.openxmlformats-officedocument.wordprocessingml.document", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "application/vnd.openxmlformats-officedocument.presentationml.presentation", "application/pdf", "application/zip", "application/illustrator", "application/postscript", "application/vnd.ms-opentype", "application/x-font-ttf", "application/octet-stream", "audio/mp3", "audio/mpeg", "font/ttf", "font/otf", "image/jpeg", "image/jpg", "image/png", "image/gif", "image/vnd.adobe.photoshop", "image/svg+xml", "text/plain", "text/csv", "video/mp4", "video/webm"];
|
|
3
|
+
export type MimetypesType = (typeof mimetypes)[number];
|
|
4
|
+
export type fileExtensionTypes = 'docx' | 'xlsx' | 'csv' | 'pptx' | 'pdf' | 'zip' | 'ai' | 'mp3' | 'mpeg' | 'ttf' | 'otf' | 'jpg' | 'jpeg' | 'png' | 'gif' | 'psd' | 'svg' | 'txt' | 'mp4' | 'odt' | 'webm';
|
|
5
|
+
export declare const extensions: fileExtensionTypes[];
|
|
6
|
+
export type fileFamilyTypes = 'application' | 'gif' | 'image' | 'video' | 'audio' | 'font' | 'text';
|
|
7
|
+
export declare const mimetypeToExt: Record<string, fileExtensionTypes>;
|
|
8
|
+
export declare const getMimetypeFromExtension: (fileExt: fileExtensionTypes) => string | undefined;
|
|
9
|
+
export declare const getFileExtensionFromMimetype: (mimetype: string) => fileExtensionTypes;
|
|
10
|
+
export declare function getExtensionFromName(name: string): fileExtensionTypes;
|
|
11
|
+
/**
|
|
12
|
+
* This resolve bad/missing (mostly application/octet-stream) mimetype with the file name.
|
|
13
|
+
* If this doesn't match any extension. Return application/octet-stream to get neutral file display
|
|
14
|
+
*/
|
|
15
|
+
export declare const getMimetypeFromName: (name: string) => string;
|
|
16
|
+
/**
|
|
17
|
+
* Resolve file path. If undefined show file avatar
|
|
18
|
+
*/
|
|
19
|
+
export declare const resolveFilePath: (file: jFileLittle, size?: string) => string | undefined;
|
|
20
|
+
export declare const getFileFamilyFromName: (name: string) => fileFamilyTypes;
|
|
21
|
+
export declare function getFileFamily(mimetype: string | undefined): fileFamilyTypes;
|
|
22
|
+
export declare const resolveFileMimetype: (file: jFileLittle) => string;
|
|
23
|
+
export declare const resolveFileFamily: (file: jFileLittle) => fileFamilyTypes;
|