api-def 0.12.0-alpha.45 → 0.12.0-alpha.46

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/cjs/Api.d.ts CHANGED
@@ -49,5 +49,5 @@ export declare class Api implements ApiInfo {
49
49
  put: <R = unknown>(path: string, config: RequestConfig) => Promise<ApiResponse<R>>;
50
50
  delete: <R = unknown>(path: string, config: RequestConfig) => Promise<ApiResponse<R>>;
51
51
  patch: <R = unknown>(path: string, config: RequestConfig) => Promise<ApiResponse<R>>;
52
- resolveUrl(path: string): URL;
52
+ resolveUrl(path: string, baseUrl?: string): URL;
53
53
  }
package/cjs/Api.js CHANGED
@@ -200,8 +200,8 @@ var Api = /** @class */ (function () {
200
200
  Api.prototype.computeRequestConfig = function () {
201
201
  return ((typeof this.defaultRequestConfig === "function" ? this.defaultRequestConfig() : this.defaultRequestConfig) || {});
202
202
  };
203
- Api.prototype.resolveUrl = function (path) {
204
- return (0, ApiUtils_1.resolveUrl)(this.baseUrl, path);
203
+ Api.prototype.resolveUrl = function (path, baseUrl) {
204
+ return (0, ApiUtils_1.resolveUrl)(baseUrl !== null && baseUrl !== void 0 ? baseUrl : this.baseUrl, path);
205
205
  };
206
206
  return Api;
207
207
  }());
package/cjs/Endpoint.d.ts CHANGED
@@ -5,6 +5,7 @@ import type * as Mocking from "./MockingTypes";
5
5
  import type { Validation } from "./Validation";
6
6
  import type RequestBackend from "./backend/RequestBackend";
7
7
  export interface EndpointResolveUrlOptions<TParams extends Params | undefined, TQuery extends Query | undefined> {
8
+ baseUrl?: string;
8
9
  params?: (TParams extends string | symbol | number ? Record<TParams, string> : never) | undefined;
9
10
  query?: TQuery;
10
11
  }
package/cjs/Endpoint.js CHANGED
@@ -156,7 +156,7 @@ var Endpoint = /** @class */ (function () {
156
156
  };
157
157
  Endpoint.prototype.resolveUrl = function (options) {
158
158
  var query = options.query;
159
- var url = this.api.resolveUrl(this.resolvePath(options));
159
+ var url = this.api.resolveUrl(this.resolvePath(options), options.baseUrl);
160
160
  if (query) {
161
161
  url.search = new URLSearchParams(query).toString();
162
162
  }
@@ -11,9 +11,9 @@ declare class RetryOperation {
11
11
  _attempts: number;
12
12
  _operationTimeout: any;
13
13
  _operationTimeoutCb: any;
14
- _timeout: Timer | null;
14
+ _timeout: NodeJS.Timeout | null;
15
15
  _operationStart: number | null;
16
- _timer: Timer | null;
16
+ _timer: NodeJS.Timeout | null;
17
17
  _cachedTimeouts: any;
18
18
  reset(): void;
19
19
  stop(): void;
package/esm/Api.d.ts CHANGED
@@ -49,5 +49,5 @@ export declare class Api implements ApiInfo {
49
49
  put: <R = unknown>(path: string, config: RequestConfig) => Promise<ApiResponse<R>>;
50
50
  delete: <R = unknown>(path: string, config: RequestConfig) => Promise<ApiResponse<R>>;
51
51
  patch: <R = unknown>(path: string, config: RequestConfig) => Promise<ApiResponse<R>>;
52
- resolveUrl(path: string): URL;
52
+ resolveUrl(path: string, baseUrl?: string): URL;
53
53
  }
package/esm/Api.js CHANGED
@@ -126,7 +126,7 @@ export class Api {
126
126
  computeRequestConfig() {
127
127
  return ((typeof this.defaultRequestConfig === "function" ? this.defaultRequestConfig() : this.defaultRequestConfig) || {});
128
128
  }
129
- resolveUrl(path) {
130
- return resolveUrl(this.baseUrl, path);
129
+ resolveUrl(path, baseUrl) {
130
+ return resolveUrl(baseUrl !== null && baseUrl !== void 0 ? baseUrl : this.baseUrl, path);
131
131
  }
132
132
  }
package/esm/Endpoint.d.ts CHANGED
@@ -5,6 +5,7 @@ import type * as Mocking from "./MockingTypes";
5
5
  import type { Validation } from "./Validation";
6
6
  import type RequestBackend from "./backend/RequestBackend";
7
7
  export interface EndpointResolveUrlOptions<TParams extends Params | undefined, TQuery extends Query | undefined> {
8
+ baseUrl?: string;
8
9
  params?: (TParams extends string | symbol | number ? Record<TParams, string> : never) | undefined;
9
10
  query?: TQuery;
10
11
  }
package/esm/Endpoint.js CHANGED
@@ -69,7 +69,7 @@ export default class Endpoint {
69
69
  }
70
70
  resolveUrl(options) {
71
71
  const { query } = options;
72
- const url = this.api.resolveUrl(this.resolvePath(options));
72
+ const url = this.api.resolveUrl(this.resolvePath(options), options.baseUrl);
73
73
  if (query) {
74
74
  url.search = new URLSearchParams(query).toString();
75
75
  }
@@ -11,9 +11,9 @@ declare class RetryOperation {
11
11
  _attempts: number;
12
12
  _operationTimeout: any;
13
13
  _operationTimeoutCb: any;
14
- _timeout: Timer | null;
14
+ _timeout: NodeJS.Timeout | null;
15
15
  _operationStart: number | null;
16
- _timer: Timer | null;
16
+ _timer: NodeJS.Timeout | null;
17
17
  _cachedTimeouts: any;
18
18
  reset(): void;
19
19
  stop(): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "api-def",
3
- "version": "0.12.0-alpha.45",
3
+ "version": "0.12.0-alpha.46",
4
4
  "description": "Typed API definitions with middleware support",
5
5
  "main": "cjs/index.js",
6
6
  "types": "esm/index.d.ts",
@@ -41,27 +41,27 @@
41
41
  "repository": "https://github.com/Censkh/api-def",
42
42
  "devDependencies": {
43
43
  "@biomejs/biome": "1.9.4",
44
- "@redocly/openapi-core": "^1.27.2",
45
- "@swc/core": "^1.10.9",
46
- "@swc/jest": "^0.2.37",
47
- "@types/axios": "0.14.0",
48
- "@types/bun": "^1.2.2",
49
- "@types/jest": "^29.5.14",
50
- "@types/lodash": "^4.17.14",
51
- "@types/node": "22.10.10",
52
- "@types/qs": "6.9.18",
53
- "axios": "1.7.9",
54
- "chalk": "^4.1.2",
55
- "commander": "^13.1.0",
44
+ "@redocly/openapi-core": "^1.34.3",
45
+ "@swc/core": "^1.12.11",
46
+ "@swc/jest": "^0.2.39",
47
+ "@types/axios": "0.14.4",
48
+ "@types/bun": "^1.2.18",
49
+ "@types/jest": "^30.0.0",
50
+ "@types/lodash": "^4.17.20",
51
+ "@types/node": "24.0.12",
52
+ "@types/qs": "6.14.0",
53
+ "axios": "1.10.0",
54
+ "commander": "^14.0.0",
56
55
  "cross-env": "7.0.3",
57
- "esbuild": "^0.24.2",
56
+ "esbuild": "^0.25.6",
58
57
  "jest": "latest",
59
58
  "lodash": "^4.17.21",
59
+ "chalk": "4.1.2",
60
60
  "npm-run-all": "4.1.5",
61
- "openapi-typescript": "^7.6.1",
61
+ "openapi-typescript": "7.6.1",
62
62
  "qs": "6.14.0",
63
63
  "rimraf": "6.0.1",
64
- "typescript": "^5.7.3",
65
- "zod": "3.24.1"
64
+ "typescript": "^5.8.3",
65
+ "zod": "3.25.76"
66
66
  }
67
67
  }