apigen-ts 1.3.0 → 1.3.1

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/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { a as apigen, g as getCliConfig } from './main-B8jUVaQq.js';
2
+ import { a as apigen, g as getCliConfig } from './main-BiX2OIVV.js';
3
3
  import 'fs/promises';
4
4
  import 'path';
5
5
  import 'url';
@@ -10,7 +10,7 @@ import ts from 'typescript';
10
10
  import path from 'node:path';
11
11
 
12
12
  var name = "apigen-ts";
13
- var version = "1.3.0";
13
+ var version = "1.3.1";
14
14
 
15
15
  const initCtx = (config) => {
16
16
  return {
package/dist/main.d.cts CHANGED
@@ -1,5 +1,4 @@
1
- import { Oas3Definition } from '@redocly/openapi-core';
2
- import { Oas3Operation } from '@redocly/openapi-core/lib/typings/openapi';
1
+ import { Oas3Definition, Oas3Operation } from '@redocly/openapi-core';
3
2
 
4
3
  type OpConfig = Oas3Operation & {
5
4
  method: string;
package/dist/main.d.mts CHANGED
@@ -1,5 +1,4 @@
1
- import { Oas3Definition } from '@redocly/openapi-core';
2
- import { Oas3Operation } from '@redocly/openapi-core/lib/typings/openapi';
1
+ import { Oas3Definition, Oas3Operation } from '@redocly/openapi-core';
3
2
 
4
3
  type OpConfig = Oas3Operation & {
5
4
  method: string;
package/dist/main.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import 'fs/promises';
2
2
  import 'path';
3
3
  import 'url';
4
- export { a as apigen } from './main-B8jUVaQq.js';
4
+ export { a as apigen } from './main-BiX2OIVV.js';
5
5
  import 'cleye';
6
6
  import '@redocly/openapi-core';
7
7
  import 'array-utils-ts';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "apigen-ts",
4
- "version": "1.3.0",
4
+ "version": "1.3.1",
5
5
  "license": "MIT",
6
6
  "author": "vladkens <v.pronsky@gmail.com>",
7
7
  "repository": "vladkens/apigen-ts",
@@ -14,34 +14,28 @@
14
14
  "generator",
15
15
  "codegen"
16
16
  ],
17
- "scripts": {
18
- "build": "rm -rf dist && pkgroll && cp ./src/_template.ts ./dist && ls -lah dist",
19
- "test": "tsx --test --test-reporter=dot test/*.test.ts",
20
- "test-cov": "tsx --experimental-test-coverage --test test/*.test.ts",
21
- "format": "prettier --write --log-level warn .",
22
- "ci": "tsc --noEmit && npm run test-cov && npm run build"
23
- },
24
17
  "dependencies": {
25
- "@redocly/openapi-core": "2.21.1",
18
+ "@redocly/openapi-core": "2.31.5",
26
19
  "@types/lodash-es": "4.17.12",
27
20
  "@types/swagger2openapi": "7.0.4",
28
21
  "array-utils-ts": "1.1.0",
29
- "cleye": "2.3.0",
30
- "lodash-es": "4.17.23",
22
+ "cleye": "2.6.0",
23
+ "lodash-es": "4.18.1",
31
24
  "swagger2openapi": "7.0.8"
32
25
  },
33
26
  "devDependencies": {
34
- "@types/node": "25.5.0",
27
+ "@types/node": "25.9.1",
35
28
  "fetch-mock": "12.6.0",
36
- "tsx": "4.21.0",
37
- "pkgroll": "2.27.0",
38
- "prettier": "3.8.1",
29
+ "npm-check-updates": "22.2.1",
30
+ "pkgroll": "2.27.1",
31
+ "prettier": "3.8.3",
39
32
  "prettier-plugin-organize-imports": "4.3.0",
40
- "typescript": "5.9.3"
33
+ "tsx": "4.22.4",
34
+ "typescript": "6.0.3"
41
35
  },
42
36
  "peerDependencies": {
43
- "prettier": "^3.0.0",
44
- "typescript": "^5.0.0"
37
+ "prettier": ">=3.0.0",
38
+ "typescript": ">=5.0.0"
45
39
  },
46
40
  "files": [
47
41
  "dist"
@@ -60,5 +54,11 @@
60
54
  },
61
55
  "bin": {
62
56
  "apigen-ts": "./dist/cli.js"
57
+ },
58
+ "scripts": {
59
+ "build": "rm -rf dist && pkgroll && cp ./src/_template.ts ./dist && ls -lah dist",
60
+ "test": "tsx --test --test-reporter=dot test/*.test.ts",
61
+ "test-cov": "tsx --experimental-test-coverage --test test/*.test.ts",
62
+ "format": "prettier --write --log-level warn ."
63
63
  }
64
- }
64
+ }
package/readme.md CHANGED
@@ -29,7 +29,7 @@ Unlike `openapi-typescript`, it generates a ready-to-call client — not just ty
29
29
  ## Install
30
30
 
31
31
  ```sh
32
- npm i apigen-ts --save-dev
32
+ npm i -D apigen-ts
33
33
  ```
34
34
 
35
35
  ## Usage
@@ -134,9 +134,9 @@ npx apigen-ts ./openapi.json ./api-client.ts --exclude-tags internal
134
134
 
135
135
  When both flags are set, `--exclude-tags` wins.
136
136
 
137
- ### AbortController / cancellation
137
+ ### Fetch options
138
138
 
139
- Pass `--fetch-options` to add an optional last argument to every generated method, accepting any [`RequestInit`](https://developer.mozilla.org/en-US/docs/Web/API/RequestInit) field (including `signal`):
139
+ Pass `--fetch-options` to add an optional last argument to every generated method, accepting any [`RequestInit`](https://developer.mozilla.org/en-US/docs/Web/API/RequestInit) field:
140
140
 
141
141
  ```sh
142
142
  npx apigen-ts ./openapi.json ./api-client.ts --fetch-options
@@ -148,6 +148,9 @@ await api.pet.getPetById(1, { signal: controller.signal })
148
148
 
149
149
  // cancel the request
150
150
  controller.abort()
151
+
152
+ // or disable automatic redirects for a single request
153
+ await api.pet.getPetById(1, { redirect: "manual" })
151
154
  ```
152
155
 
153
156
  ### Error handling