@travetto/openapi 2.2.0 → 2.2.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.
@@ -2,16 +2,24 @@ import * as path from 'path';
2
2
  import * as fs from 'fs/promises';
3
3
  import { readFileSync } from 'fs';
4
4
 
5
- import { BasePlugin } from '@travetto/cli/src/plugin-base';
5
+ import { BasePlugin, OptionConfig } from '@travetto/cli/src/plugin-base';
6
6
  import { AppCache, ExecUtil, PathUtil } from '@travetto/boot';
7
7
  import { color } from '@travetto/cli/src/color';
8
8
 
9
9
  const presets: Record<string, [string, object] | [string]> = JSON.parse(readFileSync(PathUtil.resolveUnix(__dirname, '..', 'resources', 'presets.json'), 'utf8'));
10
10
 
11
+ type Options = {
12
+ extendedHelp: OptionConfig<boolean>;
13
+ props: OptionConfig<string[]>;
14
+ input: OptionConfig<string>;
15
+ output: OptionConfig<string>;
16
+ dockerImage: OptionConfig<string>;
17
+ watch: OptionConfig<boolean>;
18
+ };
11
19
  /**
12
20
  * CLI for generating the cli client
13
21
  */
14
- export class OpenApiClientPlugin extends BasePlugin {
22
+ export class OpenApiClientPlugin extends BasePlugin<Options> {
15
23
  name = 'openapi:client';
16
24
 
17
25
  presetMap(prop?: object): string {
@@ -35,8 +43,7 @@ export class OpenApiClientPlugin extends BasePlugin {
35
43
  return list;
36
44
  }
37
45
 
38
- // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
39
- getOptions() {
46
+ getOptions(): Options {
40
47
  return {
41
48
  extendedHelp: this.boolOption({ name: 'extended-help', short: 'x', desc: 'Show Extended Help' }),
42
49
  props: this.listOption({ name: 'additional-properties', short: 'a', desc: 'Additional Properties' }),
@@ -1,15 +1,18 @@
1
- import { BasePlugin } from '@travetto/cli/src/plugin-base';
1
+ import { BasePlugin, OptionConfig } from '@travetto/cli/src/plugin-base';
2
2
  import { ExecUtil } from '@travetto/boot';
3
3
  import { EnvInit } from '@travetto/base/bin/init';
4
4
 
5
+ type Options = {
6
+ output: OptionConfig<string>;
7
+ };
8
+
5
9
  /**
6
10
  * CLI for outputting the open api spec to a local file
7
11
  */
8
- export class OpenApiSpecPlugin extends BasePlugin {
12
+ export class OpenApiSpecPlugin extends BasePlugin<Options> {
9
13
  name = 'openapi:spec';
10
14
 
11
- // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
12
- getOptions() {
15
+ getOptions(): Options {
13
16
  return { output: this.option({ desc: 'Output files', def: './openapi.yml' }) };
14
17
  }
15
18
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@travetto/openapi",
3
3
  "displayName": "OpenAPI Specification",
4
- "version": "2.2.0",
4
+ "version": "2.2.1",
5
5
  "description": "OpenAPI integration support for the travetto framework",
6
6
  "keywords": [
7
7
  "rest",
@@ -28,14 +28,14 @@
28
28
  "directory": "module/openapi"
29
29
  },
30
30
  "dependencies": {
31
- "@travetto/config": "^2.2.0",
32
- "@travetto/rest": "^2.2.0",
33
- "@travetto/schema": "^2.2.0",
34
- "@travetto/yaml": "^2.2.0",
31
+ "@travetto/config": "^2.2.1",
32
+ "@travetto/rest": "^2.2.1",
33
+ "@travetto/schema": "^2.2.1",
34
+ "@travetto/yaml": "^2.2.1",
35
35
  "openapi3-ts": "^2.0.2"
36
36
  },
37
37
  "optionalPeerDependencies": {
38
- "@travetto/cli": "^2.2.0"
38
+ "@travetto/cli": "^2.2.1"
39
39
  },
40
40
  "publishConfig": {
41
41
  "access": "public"