@mondaydotcomorg/atp-client 0.23.2 → 0.24.0

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
@@ -360,25 +360,29 @@ var InProcessSession = class extends BaseSession {
360
360
  }
361
361
  async explore(path, options) {
362
362
  await this.ensureInitialized();
363
+ const { headers: callerHeaders, ...body } = options ?? {};
363
364
  const ctx = await this.createContext({
364
365
  method: "POST",
365
366
  path: "/api/explore",
366
367
  body: {
367
368
  path,
368
- ...options
369
- }
369
+ ...body
370
+ },
371
+ headers: callerHeaders
370
372
  });
371
373
  return await this.server.handleExplore(ctx);
372
374
  }
373
375
  async execute(code, config) {
374
376
  await this.ensureInitialized();
377
+ const rc = config?.requestContext ?? {};
375
378
  const ctx = await this.createContext({
376
379
  method: "POST",
377
380
  path: "/api/execute",
378
381
  body: {
379
382
  code,
380
383
  config
381
- }
384
+ },
385
+ headers: rc.headers
382
386
  });
383
387
  return await this.server.handleExecute(ctx);
384
388
  }
@@ -418,11 +422,16 @@ var InProcessSession = class extends BaseSession {
418
422
  error: /* @__PURE__ */ __name(() => {
419
423
  }, "error")
420
424
  };
425
+ const sessionHeaders = await this.prepareHeaders(options.method, options.path, options.body);
426
+ const mergedHeaders = options.headers ? {
427
+ ...sessionHeaders,
428
+ ...options.headers
429
+ } : sessionHeaders;
421
430
  return {
422
431
  method: options.method,
423
432
  path: options.path,
424
433
  query: options.query || {},
425
- headers: await this.prepareHeaders(options.method, options.path, options.body),
434
+ headers: mergedHeaders,
426
435
  body: options.body,
427
436
  clientId: this.clientId,
428
437
  clientToken: this.clientToken,