@hubs101/js-api-skd-client 1.0.10337 → 1.0.10339

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.
@@ -99,5 +99,11 @@ export declare const _fetchPortfolios: (basePath: string, token: string, account
99
99
  export declare const _deletePortfolio: (basePath: string, token: string, portfolioId: string) => Promise<any>;
100
100
  export declare const _assignPortfolio: (basePath: string, token: string, eventId: string, portfolioId: string) => Promise<any>;
101
101
  export declare const _unassignPortfolio: (basePath: string, token: string, eventId: string, portfolioId: string) => Promise<any>;
102
- export declare const _createPortfolio: (basePath: string, token: string, data: PortfolioInput) => Promise<any>;
103
- export declare const _updatePortfolio: (basePath: string, token: string, portfolioId: string, data: PortfolioInput) => Promise<any>;
102
+ export declare const _createPortfolio: (basePath: string, token: string, data: PortfolioInput, files: {
103
+ name: string;
104
+ value: File;
105
+ }[]) => Promise<any>;
106
+ export declare const _updatePortfolio: (basePath: string, token: string, portfolioId: string, data: PortfolioInput, files: {
107
+ name: string;
108
+ value: File;
109
+ }[]) => Promise<any>;
@@ -575,15 +575,15 @@ const _unassignPortfolio = (basePath, token, eventId, portfolioId) => __awaiter(
575
575
  return response;
576
576
  });
577
577
  exports._unassignPortfolio = _unassignPortfolio;
578
- const _createPortfolio = (basePath, token, data) => __awaiter(void 0, void 0, void 0, function* () {
578
+ const _createPortfolio = (basePath, token, data, files) => __awaiter(void 0, void 0, void 0, function* () {
579
579
  const base = (0, base_1.getBasePath)(basePath);
580
- const response = yield (0, api_1.postRequestWE)(`${base.PORTFOLIOS}`, data, token);
580
+ const response = yield (0, api_1.postFilesAndDataRequest)(`${base.PORTFOLIOS}`, data, files, token);
581
581
  return response;
582
582
  });
583
583
  exports._createPortfolio = _createPortfolio;
584
- const _updatePortfolio = (basePath, token, portfolioId, data) => __awaiter(void 0, void 0, void 0, function* () {
584
+ const _updatePortfolio = (basePath, token, portfolioId, data, files) => __awaiter(void 0, void 0, void 0, function* () {
585
585
  const base = (0, base_1.getBasePath)(basePath);
586
- const response = yield (0, api_1.putRequest)(`${base.PORTFOLIOS}/${portfolioId}`, token, data);
586
+ const response = yield (0, api_1.postFilesAndDataRequest)(`${base.PORTFOLIOS}/${portfolioId}`, data, files, token, "put");
587
587
  return response;
588
588
  });
589
589
  exports._updatePortfolio = _updatePortfolio;
@@ -757,6 +757,16 @@ export type DiscountServerResponse = {
757
757
  expire_at: null | string;
758
758
  updated_at: string;
759
759
  };
760
+ export type PortfolioDesign = {
761
+ primaryColor: string;
762
+ secondaryColor: string;
763
+ backgroundColor: string;
764
+ logoPosImage: string;
765
+ logoNegImage: string;
766
+ backgroundDesktopImage: string;
767
+ backgroundTabletImage: string;
768
+ backgroundMobileImage: string;
769
+ };
760
770
  export type Portfolio = {
761
771
  id: string;
762
772
  name: string;
@@ -766,7 +776,7 @@ export type Portfolio = {
766
776
  description_en: string;
767
777
  tags_de: string[];
768
778
  tags_en: string[];
769
- design: Design;
779
+ design: PortfolioDesign;
770
780
  belong_to: string;
771
781
  published: number;
772
782
  created_at: string | null;
package/lib/index.js CHANGED
@@ -853,13 +853,13 @@ function EventAPIProvider(props) {
853
853
  (0, api_1.validateConfig)(config);
854
854
  return (0, event_1._unassignPortfolio)(config.baseUrl, config.token, eventId, portfolioId);
855
855
  }), [config, config.baseUrl, config.token]);
856
- const createPortfolio = react_1.default.useCallback((data) => __awaiter(this, void 0, void 0, function* () {
856
+ const createPortfolio = react_1.default.useCallback((data, files) => __awaiter(this, void 0, void 0, function* () {
857
857
  (0, api_1.validateConfig)(config);
858
- return (0, event_1._createPortfolio)(config.baseUrl, config.token, data);
858
+ return (0, event_1._createPortfolio)(config.baseUrl, config.token, data, files);
859
859
  }), [config, config.baseUrl, config.token]);
860
- const updatePortfolio = react_1.default.useCallback((portfolioId, data) => __awaiter(this, void 0, void 0, function* () {
860
+ const updatePortfolio = react_1.default.useCallback((portfolioId, data, files) => __awaiter(this, void 0, void 0, function* () {
861
861
  (0, api_1.validateConfig)(config);
862
- return (0, event_1._updatePortfolio)(config.baseUrl, config.token, portfolioId, data);
862
+ return (0, event_1._updatePortfolio)(config.baseUrl, config.token, portfolioId, data, files);
863
863
  }), [config, config.baseUrl, config.token]);
864
864
  return (react_1.default.createElement(EventAPIContext_1.default.Provider, { value: {
865
865
  config,
@@ -282,8 +282,14 @@ export type BaseAPIType = {
282
282
  deletePortfolio: (basePath: string, token: string, portfolioId: string) => Promise<Response>;
283
283
  assignPortfolio: (basePath: string, token: string, eventId: string, portfolioId: string) => Promise<Response>;
284
284
  unassignPortfolio: (basePath: string, token: string, eventId: string, portfolioId: string) => Promise<Response>;
285
- createPortfolio: (basePath: string, token: string, data: PortfolioInput) => Promise<Portfolio>;
286
- updatePortfolio: (basePath: string, token: string, portfolioId: string, data: PortfolioInput) => Promise<Portfolio>;
285
+ createPortfolio: (basePath: string, token: string, data: PortfolioInput, files: {
286
+ name: string;
287
+ value: File;
288
+ }[]) => Promise<Portfolio>;
289
+ updatePortfolio: (basePath: string, token: string, portfolioId: string, data: PortfolioInput, files: {
290
+ name: string;
291
+ value: File;
292
+ }[]) => Promise<Portfolio>;
287
293
  };
288
294
  export type EventAPIType = {
289
295
  config: BaseAPIConfigType;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hubs101/js-api-skd-client",
3
- "version": "1.0.10337",
3
+ "version": "1.0.10339",
4
4
  "author": "Liveware",
5
5
  "scripts": {
6
6
  "test": "jest --config jestconfig.json",