@mondaydotcomorg/atp-server 0.19.16 → 0.20.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
@@ -6292,7 +6292,7 @@ function convertOperation(path, method, operation, spec, baseURL, options, auth)
6292
6292
  const inputSchema = buildInputSchema(operation, spec);
6293
6293
  const outputSchema = buildOutputSchema(operation, spec);
6294
6294
  extractAnnotations(operation, operationKey, options.annotations);
6295
- const handler = /* @__PURE__ */ __name(async (params) => {
6295
+ const handler = /* @__PURE__ */ __name(async (params, handlerContext) => {
6296
6296
  const input = params || {};
6297
6297
  let requestPath = path;
6298
6298
  const queryParams = {};
@@ -6300,7 +6300,18 @@ function convertOperation(path, method, operation, spec, baseURL, options, auth)
6300
6300
  const headers = {
6301
6301
  "Content-Type": "application/json"
6302
6302
  };
6303
- if (auth) {
6303
+ let context;
6304
+ if (options.contextProvider) {
6305
+ context = await options.contextProvider(handlerContext?.requestContext);
6306
+ }
6307
+ if (options.headerProvider) {
6308
+ const dynamicHeaders = await options.headerProvider(input, context);
6309
+ Object.assign(headers, dynamicHeaders);
6310
+ log.debug("Added headers from headerProvider", {
6311
+ keys: Object.keys(dynamicHeaders)
6312
+ });
6313
+ }
6314
+ if (auth && !headers["Authorization"]) {
6304
6315
  if (auth.scheme === "bearer" && auth.envVar) {
6305
6316
  let token = null;
6306
6317
  if (options.authProvider) {
@@ -10330,6 +10341,9 @@ var ExplorerService = class {
10330
10341
  context.allowedTypes.add(group.type);
10331
10342
  }
10332
10343
  context.allowedGroups.add(group.name);
10344
+ }
10345
+ for (const group of this.apiGroups) {
10346
+ if (!context.allowedGroups.has(group.name)) continue;
10333
10347
  if (group.functions) {
10334
10348
  for (const func of group.functions) {
10335
10349
  context.allowedTools.add(`${group.name}:${func.name}`);