@counterfact/client 0.2.1 → 0.2.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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @counterfact/client
2
2
 
3
+ ## 0.2.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 0d35a14: Handle prototype-named cookie/query inputs as ordinary own data properties, preserve unchanged context initializers containing an own `__proto__` key, and ignore inherited names when completing scenario groups.
8
+
3
9
  ## 0.2.1
4
10
 
5
11
  ### Patch Changes
@@ -190,6 +190,7 @@ export class RouteBuilder {
190
190
  }
191
191
  getHeaderValue(name) {
192
192
  const key = findHeaderKey(this._headerParams, name);
193
+ // eslint-disable-next-line security/detect-object-injection -- key comes from own header enumeration; arbitrary header names are supported.
193
194
  return key === undefined ? undefined : this._headerParams[key];
194
195
  }
195
196
  getHeaderCookies() {
@@ -208,7 +209,8 @@ export class RouteBuilder {
208
209
  return cookies;
209
210
  }
210
211
  getCookieValue(name) {
211
- if (name in this._cookieParams)
212
+ if (Object.hasOwn(this._cookieParams, name))
213
+ // eslint-disable-next-line security/detect-object-injection -- The own-property check above limits this read to explicitly supplied cookie parameters.
212
214
  return this._cookieParams[name];
213
215
  return this.getHeaderCookies().get(name);
214
216
  }
@@ -23,11 +23,11 @@ export function createOpenApiRouteCatalog(document) {
23
23
  return {
24
24
  getOperation(routePath, method) {
25
25
  const normalizedPath = routePath.toLowerCase();
26
- const matchingPath = Object.keys(document.paths).find((path) => path.toLowerCase() === normalizedPath);
26
+ const matchingPath = Object.entries(document.paths).find(([path]) => path.toLowerCase() === normalizedPath);
27
27
  if (matchingPath === undefined) {
28
28
  return undefined;
29
29
  }
30
- const pathItem = document.paths[matchingPath];
30
+ const pathItem = matchingPath[1];
31
31
  const operation = pathItem?.[method.toLowerCase()];
32
32
  if (!operation) {
33
33
  return undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@counterfact/client",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Build and send reusable OpenAPI-aware HTTP requests without starting Counterfact.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",