@telorun/http-client 0.2.2 → 0.2.3
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.
|
@@ -165,8 +165,12 @@ class HttpRequestResource {
|
|
|
165
165
|
? resolvedTimeout
|
|
166
166
|
: DEFAULT_TIMEOUT;
|
|
167
167
|
}
|
|
168
|
-
//
|
|
169
|
-
//
|
|
168
|
+
// Build the effective inputs by layering, lowest precedence to highest:
|
|
169
|
+
// 1. manifest-level fields (url, method, ...) — fallback defaults
|
|
170
|
+
// 2. m.inputs — manifest-baked inputs (legacy, still supported when present)
|
|
171
|
+
// 3. call-site `input` — the canonical sibling-form invocation args
|
|
172
|
+
// CEL expressions inside any of these resolve against `input` as the context.
|
|
173
|
+
const callerInput = (input ?? {});
|
|
170
174
|
const manifestInputs = {
|
|
171
175
|
url: m.url,
|
|
172
176
|
method: m.method,
|
|
@@ -174,8 +178,9 @@ class HttpRequestResource {
|
|
|
174
178
|
headers: m.headers,
|
|
175
179
|
body: m.body,
|
|
176
180
|
...m.inputs,
|
|
181
|
+
...callerInput,
|
|
177
182
|
};
|
|
178
|
-
const resolved = ctx.expandValue(manifestInputs,
|
|
183
|
+
const resolved = ctx.expandValue(manifestInputs, callerInput);
|
|
179
184
|
const rawUrl = resolved.url;
|
|
180
185
|
const method = ((resolved.method ?? "GET") || "GET").toUpperCase();
|
|
181
186
|
const requestHeaders = normalizeHeaders((resolved.headers ?? {}));
|
package/package.json
CHANGED
|
@@ -229,8 +229,12 @@ class HttpRequestResource implements ResourceInstance {
|
|
|
229
229
|
: DEFAULT_TIMEOUT;
|
|
230
230
|
}
|
|
231
231
|
|
|
232
|
-
//
|
|
233
|
-
//
|
|
232
|
+
// Build the effective inputs by layering, lowest precedence to highest:
|
|
233
|
+
// 1. manifest-level fields (url, method, ...) — fallback defaults
|
|
234
|
+
// 2. m.inputs — manifest-baked inputs (legacy, still supported when present)
|
|
235
|
+
// 3. call-site `input` — the canonical sibling-form invocation args
|
|
236
|
+
// CEL expressions inside any of these resolve against `input` as the context.
|
|
237
|
+
const callerInput = (input ?? {}) as Record<string, unknown>;
|
|
234
238
|
const manifestInputs: HttpRequestInputs = {
|
|
235
239
|
url: m.url,
|
|
236
240
|
method: m.method,
|
|
@@ -238,8 +242,9 @@ class HttpRequestResource implements ResourceInstance {
|
|
|
238
242
|
headers: m.headers,
|
|
239
243
|
body: m.body,
|
|
240
244
|
...m.inputs,
|
|
245
|
+
...callerInput,
|
|
241
246
|
};
|
|
242
|
-
const resolved = ctx.expandValue(manifestInputs,
|
|
247
|
+
const resolved = ctx.expandValue(manifestInputs, callerInput) as HttpRequestInputs;
|
|
243
248
|
const rawUrl = resolved.url as string;
|
|
244
249
|
const method = ((resolved.method ?? "GET") || "GET").toUpperCase();
|
|
245
250
|
const requestHeaders = normalizeHeaders((resolved.headers ?? {}) as Record<string, string>);
|