@mhubcloud/tms_core 2.0.1-beta.0 → 2.0.1

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/dist/index.js CHANGED
@@ -198,10 +198,7 @@ async function handlePlatformRequest({
198
198
  // eslint-disable-next-line @typescript-eslint/naming-convention
199
199
  headers: { ...requestOptions.headers }
200
200
  };
201
- const rawPlatformResponse = await fetchWithTimeout(
202
- fullUrl,
203
- fetchRequestOptions
204
- );
201
+ const rawPlatformResponse = await fetch(fullUrl, fetchRequestOptions);
205
202
  if (process.env.PUBLISHER_TESTURL) {
206
203
  await handleTestRequest({
207
204
  fetchRequestOptions,
@@ -230,21 +227,13 @@ async function handleTestRequest(params) {
230
227
  // eslint-disable-next-line @typescript-eslint/naming-convention
231
228
  "x-mhub-orig-response-status-message": params.rawPlatformResponse.statusText
232
229
  };
233
- await fetchWithTimeout(
230
+ await fetch(
234
231
  `${process.env.PUBLISHER_TESTURL ?? ""} + ${params.query ?? ""}`,
235
232
  params.fetchRequestOptions
236
233
  );
237
234
  } catch {
238
235
  }
239
236
  }
240
- async function fetchWithTimeout(resource, options = {}) {
241
- const { timeoutMS = 3e3 } = options;
242
- const response = await fetch(resource, {
243
- ...options,
244
- signal: AbortSignal.timeout(timeoutMS)
245
- });
246
- return response;
247
- }
248
237
 
249
238
  // src/defaultPublisher.ts
250
239
  async function defaultPublisher(azureFunctionContext, eventHubMessages, source, platformPublisher, trigger) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mhubcloud/tms_core",
3
- "version": "2.0.1-beta.0",
3
+ "version": "2.0.1",
4
4
  "description": "Core function for mHub Cloud TMS publishers",
5
5
  "homepage": "https://mhubcloud.com/",
6
6
  "license": "Apache 2.0",
@@ -306,10 +306,7 @@ export async function handlePlatformRequest({
306
306
  headers: { ...requestOptions.headers },
307
307
  };
308
308
 
309
- const rawPlatformResponse = await fetchWithTimeout(
310
- fullUrl,
311
- fetchRequestOptions,
312
- );
309
+ const rawPlatformResponse = await fetch(fullUrl, fetchRequestOptions);
313
310
 
314
311
  if (process.env.PUBLISHER_TESTURL) {
315
312
  await handleTestRequest({
@@ -350,7 +347,7 @@ async function handleTestRequest(params: HandleTestRequestParams) {
350
347
  'x-mhub-orig-response-status-message':
351
348
  params.rawPlatformResponse.statusText,
352
349
  };
353
- await fetchWithTimeout(
350
+ await fetch(
354
351
  `${process.env.PUBLISHER_TESTURL ?? ''} + ${params.query ?? ''}`,
355
352
  params.fetchRequestOptions,
356
353
  );
@@ -358,14 +355,3 @@ async function handleTestRequest(params: HandleTestRequestParams) {
358
355
  /* empty */
359
356
  }
360
357
  }
361
-
362
- async function fetchWithTimeout(resource, options = {}) {
363
- const { timeoutMS = 3000 } = options;
364
-
365
- const response = await fetch(resource, {
366
- ...options,
367
- signal: AbortSignal.timeout(timeoutMS),
368
- });
369
-
370
- return response;
371
- }