@hubs101/js-api-skd-client 1.0.10338 → 1.0.10340
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/lib/api/event/index.d.ts +8 -2
- package/lib/api/event/index.js +4 -4
- package/lib/index.js +4 -4
- package/lib/types/base.d.ts +16 -4
- package/package.json +1 -1
package/lib/api/event/index.d.ts
CHANGED
|
@@ -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
|
|
103
|
-
|
|
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>;
|
package/lib/api/event/index.js
CHANGED
|
@@ -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.
|
|
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.
|
|
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;
|
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,
|
package/lib/types/base.d.ts
CHANGED
|
@@ -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
|
|
286
|
-
|
|
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;
|
|
@@ -495,8 +501,14 @@ export type EventAPIType = {
|
|
|
495
501
|
deletePortfolio: (portfolioId: string) => Promise<Response>;
|
|
496
502
|
assignPortfolio: (eventId: string, portfolioId: string) => Promise<Response>;
|
|
497
503
|
unassignPortfolio: (eventId: string, portfolioId: string) => Promise<Response>;
|
|
498
|
-
createPortfolio: (data: PortfolioInput
|
|
499
|
-
|
|
504
|
+
createPortfolio: (data: PortfolioInput, files: {
|
|
505
|
+
name: string;
|
|
506
|
+
value: File;
|
|
507
|
+
}[]) => Promise<Portfolio>;
|
|
508
|
+
updatePortfolio: (portfolioId: string, data: PortfolioInput, files: {
|
|
509
|
+
name: string;
|
|
510
|
+
value: File;
|
|
511
|
+
}[]) => Promise<Portfolio>;
|
|
500
512
|
};
|
|
501
513
|
export type BaseAPIConfigType = {
|
|
502
514
|
baseUrl?: string;
|