@hubs101/js-api-skd-client 1.0.10665 → 1.0.10667

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.
@@ -239,7 +239,19 @@ const _createFeed = (basePath, token, accountId, data, files) => __awaiter(void
239
239
  exports._createFeed = _createFeed;
240
240
  const _updateFeed = (basePath, token, accountId, feedId, data, files) => __awaiter(void 0, void 0, void 0, function* () {
241
241
  const base = (0, base_1.getBasePath)(basePath);
242
- const response = yield (0, api_1.postFilesAndDataRequest)(`${base.ACCOUNTS}/${accountId}/feeds/${feedId}`, data, files !== null && files !== void 0 ? files : [], token, "put");
242
+ const requestUrl = `${base.ACCOUNTS}/${accountId}/feeds/${feedId}`;
243
+ const normalizedFiles = files !== null && files !== void 0 ? files : [];
244
+ const hasBinaryFile = normalizedFiles.some((file) => (file === null || file === void 0 ? void 0 : file.value) && typeof file.value !== "string");
245
+ if ((data === null || data === void 0 ? void 0 : data.webinar_id) === null && !hasBinaryFile) {
246
+ return (0, api_1.putRequestDirect)(requestUrl, token, data);
247
+ }
248
+ if ((data === null || data === void 0 ? void 0 : data.webinar_id) === null && hasBinaryFile) {
249
+ yield (0, api_1.putRequestDirect)(requestUrl, token, data);
250
+ const payloadWithoutWebinarId = Object.assign({}, data);
251
+ delete payloadWithoutWebinarId.webinar_id;
252
+ return (0, api_1.postFilesAndDataRequest)(requestUrl, payloadWithoutWebinarId, normalizedFiles, token, "put");
253
+ }
254
+ const response = yield (0, api_1.postFilesAndDataRequest)(requestUrl, data, normalizedFiles, token, "put");
243
255
  return response;
244
256
  });
245
257
  exports._updateFeed = _updateFeed;
@@ -117,7 +117,7 @@ export type FeedType = {
117
117
  events: string;
118
118
  portfolios: string;
119
119
  language: string;
120
- webinar_id?: string;
120
+ webinar_id?: string | null;
121
121
  updated_by?: string;
122
122
  updated_at: string;
123
123
  };
@@ -151,7 +151,7 @@ export type FeedDetailsType = {
151
151
  name: string;
152
152
  }[];
153
153
  language: string;
154
- webinar_id?: string;
154
+ webinar_id?: string | null;
155
155
  updated_by?: string;
156
156
  updated_at: string;
157
157
  };
@@ -178,5 +178,5 @@ export type FeedInputType = {
178
178
  events: string;
179
179
  portfolios: string;
180
180
  language: string;
181
- webinar_id?: string;
181
+ webinar_id?: string | null;
182
182
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hubs101/js-api-skd-client",
3
- "version": "1.0.10665",
3
+ "version": "1.0.10667",
4
4
  "author": "Liveware",
5
5
  "scripts": {
6
6
  "test": "jest --config jestconfig.json",