@mondaydotcomorg/atp-server 0.24.1 → 0.24.2
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/graphql-loader.d.ts +6 -5
- package/dist/graphql-loader.d.ts.map +1 -1
- package/dist/graphql-loader.js +8 -8
- package/dist/graphql-loader.js.map +1 -1
- package/dist/index.cjs +12 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +12 -9
- package/dist/index.js.map +1 -1
- package/dist/openapi-loader.d.ts +4 -7
- package/dist/openapi-loader.d.ts.map +1 -1
- package/dist/openapi-loader.js +5 -5
- package/dist/openapi-loader.js.map +1 -1
- package/package.json +6 -6
- package/src/graphql-loader.ts +15 -14
- package/src/openapi-loader.ts +9 -13
package/dist/index.js
CHANGED
|
@@ -6333,12 +6333,12 @@ function convertOperation(path, method, operation, spec, baseURL, options, pathP
|
|
|
6333
6333
|
const headers = {
|
|
6334
6334
|
"Content-Type": "application/json"
|
|
6335
6335
|
};
|
|
6336
|
-
let context;
|
|
6337
|
-
if (options.contextProvider) {
|
|
6338
|
-
context = await options.contextProvider(handlerContext?.requestContext);
|
|
6339
|
-
}
|
|
6340
6336
|
if (options.headerProvider) {
|
|
6341
|
-
|
|
6337
|
+
let requestContext = handlerContext?.requestContext;
|
|
6338
|
+
if (options.contextProvider) {
|
|
6339
|
+
requestContext = await options.contextProvider(requestContext);
|
|
6340
|
+
}
|
|
6341
|
+
const dynamicHeaders = await options.headerProvider(input, requestContext);
|
|
6342
6342
|
Object.assign(headers, dynamicHeaders);
|
|
6343
6343
|
log.debug("Added headers from headerProvider", {
|
|
6344
6344
|
keys: Object.keys(dynamicHeaders)
|
|
@@ -21256,7 +21256,7 @@ function buildSchema(source, options) {
|
|
|
21256
21256
|
});
|
|
21257
21257
|
}
|
|
21258
21258
|
__name(buildSchema, "buildSchema");
|
|
21259
|
-
async function resolveHeaders(options, params,
|
|
21259
|
+
async function resolveHeaders(options, params, requestContext) {
|
|
21260
21260
|
const headers = {};
|
|
21261
21261
|
if (options.headers) {
|
|
21262
21262
|
Object.assign(headers, options.headers);
|
|
@@ -21269,8 +21269,11 @@ async function resolveHeaders(options, params, executionContext) {
|
|
|
21269
21269
|
Object.assign(headers, authHeaders);
|
|
21270
21270
|
}
|
|
21271
21271
|
if (options.headerProvider) {
|
|
21272
|
-
|
|
21273
|
-
|
|
21272
|
+
let ctx = requestContext;
|
|
21273
|
+
if (options.contextProvider) {
|
|
21274
|
+
ctx = await options.contextProvider(requestContext);
|
|
21275
|
+
}
|
|
21276
|
+
const dynamicHeaders = await options.headerProvider(params, ctx);
|
|
21274
21277
|
Object.assign(headers, dynamicHeaders);
|
|
21275
21278
|
}
|
|
21276
21279
|
return headers;
|
|
@@ -21480,7 +21483,7 @@ function convertFieldToFunction(type, fieldName, field, url, options) {
|
|
|
21480
21483
|
context.metadata.graphql_query = query;
|
|
21481
21484
|
context.metadata.graphql_variables = variables;
|
|
21482
21485
|
}
|
|
21483
|
-
const headers = await resolveHeaders(options, paramsObj, context);
|
|
21486
|
+
const headers = await resolveHeaders(options, paramsObj, context?.requestContext);
|
|
21484
21487
|
const fetchFn = options.fetcher || fetch;
|
|
21485
21488
|
const response = await fetchFn(url, {
|
|
21486
21489
|
method: "POST",
|