@ps-aux/api-client-gen 0.7.0-rc.2 → 0.7.0-rc.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.
package/README.md CHANGED
@@ -18,6 +18,9 @@ Create api-client-gen.config.json (via [cosmiconfig](https://github.com/cosmicon
18
18
  "srcSpec": "https://petstore3.swagger.io/api/v3/openapi.json",
19
19
  "dstDir": "./generated",
20
20
  "apiName": "PetstoreApi",
21
+ "openApiGenerator": {
22
+ "codegen": {}
23
+ },
21
24
  "zodSchemas": { "enabled": true }
22
25
  }
23
26
  }
@@ -33,7 +36,10 @@ import { generateApiClient } from '@ps-aux/api-client-gen'
33
36
  await generateApiClient({
34
37
  srcSpec: 'https://petstore3.swagger.io/api/v3/openapi.json',
35
38
  dstDir: './generated',
36
- apiName: 'PetstoreApi'
39
+ apiName: 'PetstoreApi',
40
+ openApiGenerator: {
41
+ codegen: {}
42
+ }
37
43
  })
38
44
  ```
39
45
 
package/dist/bin.cjs CHANGED
@@ -6,11 +6,11 @@ var cosmiconfig = require('cosmiconfig');
6
6
  require('path');
7
7
  require('fs');
8
8
  require('fs/promises');
9
- require('node:path');
10
- require('node:fs/promises');
11
- require('node:fs');
12
9
  require('swagger-typescript-api');
13
10
  require('node:url');
11
+ require('node:fs/promises');
12
+ require('node:path');
13
+ require('node:fs');
14
14
  require('ts-to-zod');
15
15
 
16
16
  const profile = process.argv[2];
@@ -20,4 +20,7 @@ if (!conf) throw new Error(`No config provided`);
20
20
  const profileConf = conf.config[profile];
21
21
  if (!profileConf)
22
22
  throw new Error(`Profile "${profile}" not present in the configuration`);
23
- generateApiClient.generateApiClient(profileConf).catch(console.error);
23
+ generateApiClient.generateApiClient(profileConf, conf.filepath).catch((error) => {
24
+ console.error(error instanceof Error ? error.message : String(error));
25
+ process.exitCode = 1;
26
+ });
package/dist/bin.mjs CHANGED
@@ -4,11 +4,11 @@ import { cosmiconfigSync } from 'cosmiconfig';
4
4
  import 'path';
5
5
  import 'fs';
6
6
  import 'fs/promises';
7
- import 'node:path';
8
- import 'node:fs/promises';
9
- import 'node:fs';
10
7
  import 'swagger-typescript-api';
11
8
  import 'node:url';
9
+ import 'node:fs/promises';
10
+ import 'node:path';
11
+ import 'node:fs';
12
12
  import 'ts-to-zod';
13
13
 
14
14
  const profile = process.argv[2];
@@ -18,4 +18,7 @@ if (!conf) throw new Error(`No config provided`);
18
18
  const profileConf = conf.config[profile];
19
19
  if (!profileConf)
20
20
  throw new Error(`Profile "${profile}" not present in the configuration`);
21
- generateApiClient(profileConf).catch(console.error);
21
+ generateApiClient(profileConf, conf.filepath).catch((error) => {
22
+ console.error(error instanceof Error ? error.message : String(error));
23
+ process.exitCode = 1;
24
+ });