@maioradv/cms-basic-lib 1.2.1 → 1.2.3

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.
@@ -17,7 +17,8 @@ export default class Collections extends ApiModule implements RestApiModuleI, Gr
17
17
  updateMany(args: ArgsUpdateManyDto): Promise<Collection[]>;
18
18
  updateProducts(args: ArgsUpdateProductsDto): Promise<ProductCollection[]>;
19
19
  removeMany(id: number | number[]): Promise<RemoveGQL>;
20
- createImage(collectionId: number, args?: CreateCollectionImageDto, formData?: FormData): Promise<CollectionImage>;
20
+ createImage(collectionId: number, args: CreateCollectionImageDto): Promise<CollectionImage>;
21
+ RNCreateImage(collectionId: number, formData: any): Promise<CollectionImage>;
21
22
  findAllImages(collectionId: number): Promise<WithRelation<CollectionImage, 'Image', Image>[]>;
22
23
  updateImage(collectionId: number, imageId: number, data: UpdateCollectionImageDto): Promise<CollectionImage>;
23
24
  removeImage(collectionId: number, imageId: number): Promise<CollectionImage>;
@@ -36,8 +36,15 @@ class Collections extends model_1.ApiModule {
36
36
  id
37
37
  });
38
38
  }
39
- createImage(collectionId, args, formData) {
40
- return this._call('post', `/collections/${collectionId}/images`, args !== null && args !== void 0 ? args : formData, {
39
+ createImage(collectionId, args) {
40
+ return this._call('post', `/collections/${collectionId}/images`, args, {
41
+ headers: {
42
+ 'Content-Type': 'multipart/form-data'
43
+ }
44
+ });
45
+ }
46
+ RNCreateImage(collectionId, formData) {
47
+ return this._call('post', `/collections/${collectionId}/images`, formData, {
41
48
  headers: {
42
49
  'Content-Type': 'multipart/form-data'
43
50
  }
@@ -49,6 +49,8 @@ export type ClausesCollectionDto = WhereClausesDto<{
49
49
  export type QueryCollectionDto = QueryParamsDto<SortingCollectionDto, ClausesCollectionDto>;
50
50
  export type FindOneCollectionDto = WithRelations<Collection, {
51
51
  parent: Collection | null;
52
+ children: Collection[];
53
+ CollectionImage: WithRelation<CollectionImage, 'Image', Image>[];
52
54
  }>;
53
55
  export type FindAllCollectionDto = WithRelations<Collection, {
54
56
  CollectionImage: WithRelation<CollectionImage, 'Image', Image>[];
@@ -13,7 +13,8 @@ export default class Popups extends ApiModule implements RestApiModuleI, GraphAp
13
13
  remove(id: number): Promise<Popup>;
14
14
  list(args?: QueryPopupGQLDto): Promise<PaginatedGQL<Popup>>;
15
15
  removeMany(id: number | number[]): Promise<RemoveGQL>;
16
- createImage(popupId: number, args?: CreatePopupImageDto, formData?: FormData): Promise<PopupImage>;
16
+ createImage(popupId: number, args: CreatePopupImageDto): Promise<PopupImage>;
17
+ RNCreateImage(popupId: number, formData: any): Promise<PopupImage>;
17
18
  findAllImages(popupId: number): Promise<WithRelation<PopupImage, 'Image', Image>[]>;
18
19
  updateImage(popupId: number, imageId: number, data: UpdatePopupImageDto): Promise<PopupImage>;
19
20
  removeImage(popupId: number, imageId: number): Promise<PopupImage>;
@@ -27,8 +27,15 @@ class Popups extends model_1.ApiModule {
27
27
  id
28
28
  });
29
29
  }
30
- createImage(popupId, args, formData) {
31
- return this._call('post', `/popups/${popupId}/images`, args !== null && args !== void 0 ? args : formData, {
30
+ createImage(popupId, args) {
31
+ return this._call('post', `/popups/${popupId}/images`, args, {
32
+ headers: {
33
+ 'Content-Type': 'multipart/form-data'
34
+ }
35
+ });
36
+ }
37
+ RNCreateImage(popupId, formData) {
38
+ return this._call('post', `/popups/${popupId}/images`, formData, {
32
39
  headers: {
33
40
  'Content-Type': 'multipart/form-data'
34
41
  }
@@ -14,7 +14,8 @@ export default class Products extends ApiModule implements RestApiModuleI, Graph
14
14
  remove(id: number): Promise<Product>;
15
15
  list(args?: QueryProductGQLDto): Promise<PaginatedGQL<Product>>;
16
16
  removeMany(id: number | number[]): Promise<RemoveGQL>;
17
- createImage(productId: number, args?: CreateProductImageDto, formData?: FormData): Promise<ProductImage>;
17
+ createImage(productId: number, args: CreateProductImageDto): Promise<ProductImage>;
18
+ RNCreateImage(productId: number, formData: any): Promise<ProductImage>;
18
19
  findAllImages(productId: number): Promise<WithRelation<ProductImage, 'Image', Image>[]>;
19
20
  updateImage(productId: number, imageId: number, data: UpdateProductImageDto): Promise<ProductImage>;
20
21
  removeImage(productId: number, imageId: number): Promise<ProductImage>;
@@ -27,8 +27,15 @@ class Products extends model_1.ApiModule {
27
27
  id
28
28
  });
29
29
  }
30
- createImage(productId, args, formData) {
31
- return this._call('post', `/products/${productId}/images`, args !== null && args !== void 0 ? args : formData, {
30
+ createImage(productId, args) {
31
+ return this._call('post', `/products/${productId}/images`, args, {
32
+ headers: {
33
+ 'Content-Type': 'multipart/form-data'
34
+ }
35
+ });
36
+ }
37
+ RNCreateImage(productId, formData) {
38
+ return this._call('post', `/products/${productId}/images`, formData, {
32
39
  headers: {
33
40
  'Content-Type': 'multipart/form-data'
34
41
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maioradv/cms-basic-lib",
3
- "version": "1.2.1",
3
+ "version": "1.2.3",
4
4
  "description": "JS lib for Maior CMS Basic Api",
5
5
  "repository": "https://github.com/maioradv/cms-basic-lib.git",
6
6
  "author": "Maior ADV Srl",