counterfact 1.1.5 → 1.1.6

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.
@@ -259,7 +259,7 @@ interface WideResponseBuilder {
259
259
  interface WideOperationArgument {
260
260
  body: unknown;
261
261
  context: unknown;
262
- header: { [key: string]: string };
262
+ headers: { [key: string]: string };
263
263
  path: { [key: string]: string };
264
264
  proxy: (url: string) => { proxyUrl: string };
265
265
  query: { [key: string]: string };
@@ -72,7 +72,7 @@ export class OperationTypeCoder extends TypeCoder {
72
72
  const parameters = this.requirement.get("parameters");
73
73
  const queryType = new ParametersTypeCoder(parameters, "query").write(script);
74
74
  const pathType = new ParametersTypeCoder(parameters, "path").write(script);
75
- const headerType = new ParametersTypeCoder(parameters, "header").write(script);
75
+ const headersType = new ParametersTypeCoder(parameters, "header").write(script);
76
76
  const bodyRequirement = this.requirement.get("consumes") ||
77
77
  this.requirement.specification?.rootRequirement?.get("consumes")
78
78
  ? parameters
@@ -85,6 +85,6 @@ export class OperationTypeCoder extends TypeCoder {
85
85
  const responseType = new ResponsesTypeCoder(this.requirement.get("responses"), this.requirement.get("produces")?.data ??
86
86
  this.requirement.specification?.rootRequirement?.get("produces")?.data).write(script);
87
87
  const proxyType = "(url: string) => COUNTERFACT_RESPONSE";
88
- return `($: OmitValueWhenNever<{ query: ${queryType}, path: ${pathType}, header: ${headerType}, body: ${bodyType}, context: ${contextTypeImportName}, response: ${responseType}, x: ${xType}, proxy: ${proxyType}, user: ${this.userType()} }>) => ${this.responseTypes(script)} | { status: 415, contentType: "text/plain", body: string } | COUNTERFACT_RESPONSE | { ALL_REMAINING_HEADERS_ARE_OPTIONAL: COUNTERFACT_RESPONSE }`;
88
+ return `($: OmitValueWhenNever<{ query: ${queryType}, path: ${pathType}, headers: ${headersType}, body: ${bodyType}, context: ${contextTypeImportName}, response: ${responseType}, x: ${xType}, proxy: ${proxyType}, user: ${this.userType()} }>) => ${this.responseTypes(script)} | { status: 415, contentType: "text/plain", body: string } | COUNTERFACT_RESPONSE | { ALL_REMAINING_HEADERS_ARE_OPTIONAL: COUNTERFACT_RESPONSE }`;
89
89
  }
90
90
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "counterfact",
3
- "version": "1.1.5",
3
+ "version": "1.1.6",
4
4
  "description": "a library for building a fake REST API for testing",
5
5
  "type": "module",
6
6
  "main": "./src/server/counterfact.js",
@@ -48,7 +48,7 @@
48
48
  "@stryker-mutator/core": "8.7.1",
49
49
  "@stryker-mutator/jest-runner": "8.7.1",
50
50
  "@stryker-mutator/typescript-checker": "8.7.1",
51
- "@swc/core": "1.10.3",
51
+ "@swc/core": "1.10.7",
52
52
  "@swc/jest": "0.2.37",
53
53
  "@testing-library/dom": "10.4.0",
54
54
  "@types/jest": "29.5.14",
@@ -57,9 +57,9 @@
57
57
  "@types/koa-bodyparser": "4.3.12",
58
58
  "@types/koa-proxy": "1.0.7",
59
59
  "@types/koa-static": "4.0.4",
60
- "@types/lodash": "4.17.13",
60
+ "@types/lodash": "4.17.14",
61
61
  "copyfiles": "2.4.1",
62
- "eslint": "9.17.0",
62
+ "eslint": "9.18.0",
63
63
  "eslint-config-hardcore": "47.0.1",
64
64
  "eslint-formatter-github-annotations": "0.1.0",
65
65
  "eslint-import-resolver-typescript": "3.7.0",
@@ -86,7 +86,7 @@
86
86
  "@types/json-schema": "7.0.15",
87
87
  "ast-types": "0.14.2",
88
88
  "chokidar": "4.0.3",
89
- "commander": "12.1.0",
89
+ "commander": "13.0.0",
90
90
  "debug": "4.4.0",
91
91
  "fetch": "1.1.0",
92
92
  "fs-extra": "11.2.0",
@@ -106,6 +106,6 @@
106
106
  "precinct": "12.1.2",
107
107
  "prettier": "3.4.2",
108
108
  "recast": "0.23.9",
109
- "typescript": "5.7.2"
109
+ "typescript": "5.7.3"
110
110
  }
111
111
  }