@team-supercharge/oasg 16.0.1-master-453dcbac.0 â 16.1.0
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 +38 -1
- package/bin/oasg +2 -0
- package/config.schema.yml +30 -0
- package/package.json +1 -1
- package/targets/typescript-axios/generate.sh +20 -0
- package/targets/typescript-axios/generator-config.json +20 -0
- package/targets/typescript-axios/publish.sh +8 -0
- package/targets/typescript-fetch/generate.sh +19 -0
- package/targets/typescript-fetch/generator-config.json +14 -0
- package/targets/typescript-fetch/publish.sh +8 -0
package/README.md
CHANGED
@@ -111,7 +111,7 @@ The table below gives an overview of the changes (breaking, non-breaking, bug fi
|
|
111
111
|
|------------------------------|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|
|
112
112
|
| **Internal** | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 |
|
113
113
|
| _Core_ |â |đ |đĨ |⨠|đ |⨠|â |⨠|đ |đ |â |đĨ |đĨ |⨠|đĨ |đ |
|
114
|
-
| _Linter_
|
114
|
+
| _Linter_ |đ |â |â |â |â |đĨ |â |â |â |â |đ |â |⨠|đĨ |đ |
|
115
115
|
| **Client Targets** | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 |
|
116
116
|
| `android` |â |â |đ |đĨ |â |â |đĨ |â |â |â |â |â |â |â |đ |
|
117
117
|
| `angular` |â |â |đ |đĨ |â |â |â |đ |â |â |â |đĨ |â |â |â |đ |
|
@@ -123,6 +123,8 @@ The table below gives an overview of the changes (breaking, non-breaking, bug fi
|
|
123
123
|
| `kmp` |â |â |đ |
|
124
124
|
| `python-legacy` |đĨ |â |đ |đĨ |â |â |â |â |â |â |â |â |đ |
|
125
125
|
| `react` |â |đ |â |đĨ |â |â |â |â |â |â |â |â |â |â |â |đ |
|
126
|
+
| `typescript-axios` |đ |
|
127
|
+
| `typescript-fetch` |đ |
|
126
128
|
| **Server Targets** | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 |
|
127
129
|
| `nestjs` |đĨ |đĨ |â |đĨ |⨠|â |â |đ |â |â |⨠|đ |
|
128
130
|
| `python-fastapi` |â |â |đ |
|
@@ -527,6 +529,8 @@ We welcome feedback and contributions to help address this issue.
|
|
527
529
|
| packageName | Name of the generated NPM package | Y | - |
|
528
530
|
| repository | URL of the NPM package registry | Y | - |
|
529
531
|
|
532
|
+
> âšī¸ This package offers React Hooks for convenience.
|
533
|
+
|
530
534
|
#### `stubby`
|
531
535
|
|
532
536
|
**When using Stubby, you must use the Supercharge's fork of the OpenApi Generator!**
|
@@ -996,6 +1000,39 @@ Validations from OpenAPI spec:
|
|
996
1000
|
|-|-|-|-|
|
997
1001
|
| fileName | Name of the generated file | N | `collection.json` |
|
998
1002
|
|
1003
|
+
#### `typescript-axios`
|
1004
|
+
|
1005
|
+
```json
|
1006
|
+
{
|
1007
|
+
"id": "client-typescript-axios",
|
1008
|
+
"type": "typescript-axios",
|
1009
|
+
"source": "source-merged",
|
1010
|
+
"packageName": "@project/oasg-example-typescript-axios",
|
1011
|
+
"repository": "https://gitlab.supercharge.io/api/v4/projects/1226/packages/npm/"
|
1012
|
+
}
|
1013
|
+
|
1014
|
+
|Parameter| Description| Required | Default |
|
1015
|
+
|-|-|-|-|
|
1016
|
+
| packageName | Name of the generated NPM package | Y | - |
|
1017
|
+
| repository | URL of the NPM package registry | Y | - |
|
1018
|
+
|
1019
|
+
|
1020
|
+
#### `typescript-fetch`
|
1021
|
+
|
1022
|
+
```json
|
1023
|
+
{
|
1024
|
+
"id": "client-typescript-fetch",
|
1025
|
+
"type": "typescript-fetch",
|
1026
|
+
"source": "source-merged",
|
1027
|
+
"packageName": "@project/oasg-example-typescript-fetch",
|
1028
|
+
"repository": "https://gitlab.supercharge.io/api/v4/projects/1226/packages/npm/"
|
1029
|
+
}
|
1030
|
+
|
1031
|
+
|Parameter| Description| Required | Default |
|
1032
|
+
|-|-|-|-|
|
1033
|
+
| packageName | Name of the generated NPM package | Y | - |
|
1034
|
+
| repository | URL of the NPM package registry | Y | - |
|
1035
|
+
|
999
1036
|
---
|
1000
1037
|
|
1001
1038
|
# Migration Guide
|
package/bin/oasg
CHANGED
@@ -44,6 +44,8 @@ const DEFAULT_GENERATOR_MAPPING = {
|
|
44
44
|
"kmp": { version: '7.8.0', generator: 'kotlin' },
|
45
45
|
"python-legacy": { version: '7.11.0', generator: 'python-pydantic-v1' },
|
46
46
|
"react": { version: '7.0.1', generator: 'typescript-fetch' },
|
47
|
+
"typescript-axios": { version: '7.11.0', generator: 'typescript-axios' },
|
48
|
+
"typescript-fetch": { version: '7.11.0', generator: 'typescript-fetch' },
|
47
49
|
// server targets
|
48
50
|
"nestjs": { version: '7.0.1', generator: 'typescript-angular' },
|
49
51
|
"spring": { version: '7.0.1', generator: 'spring' },
|
package/config.schema.yml
CHANGED
@@ -29,6 +29,8 @@ properties:
|
|
29
29
|
- $ref: '#/targets/Kmp'
|
30
30
|
- $ref: '#/targets/Dotnet'
|
31
31
|
- $ref: '#/targets/Postman'
|
32
|
+
- $ref: '#/targets/TypeScriptAxios'
|
33
|
+
- $ref: '#/targets/TypeScriptFetch'
|
32
34
|
required:
|
33
35
|
- targets
|
34
36
|
additionalProperties: false
|
@@ -430,6 +432,34 @@ targets:
|
|
430
432
|
fileName:
|
431
433
|
type: string
|
432
434
|
|
435
|
+
TypeScriptAxios:
|
436
|
+
allOf:
|
437
|
+
- $ref: '#/targets/Base'
|
438
|
+
- properties:
|
439
|
+
type:
|
440
|
+
pattern: "^typescript-axios$"
|
441
|
+
packageName:
|
442
|
+
type: string
|
443
|
+
repository:
|
444
|
+
type: string
|
445
|
+
required:
|
446
|
+
- packageName
|
447
|
+
- repository
|
448
|
+
|
449
|
+
TypeScriptFetch:
|
450
|
+
allOf:
|
451
|
+
- $ref: '#/targets/Base'
|
452
|
+
- properties:
|
453
|
+
type:
|
454
|
+
pattern: "^typescript-fetch$"
|
455
|
+
packageName:
|
456
|
+
type: string
|
457
|
+
repository:
|
458
|
+
type: string
|
459
|
+
required:
|
460
|
+
- packageName
|
461
|
+
- repository
|
462
|
+
|
433
463
|
definitions:
|
434
464
|
# default
|
435
465
|
SourceOverrides:
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@team-supercharge/oasg",
|
3
|
-
"version": "16.
|
3
|
+
"version": "16.1.0",
|
4
4
|
"description": "Node-based tool to lint OpenAPI documents and generate clients, servers and documentation from them",
|
5
5
|
"author": "Supercharge",
|
6
6
|
"license": "MIT",
|
@@ -0,0 +1,20 @@
|
|
1
|
+
#/bin/bash
|
2
|
+
|
3
|
+
source $(dirname "$0")/../common.sh
|
4
|
+
|
5
|
+
rm -rf out/$targetId
|
6
|
+
mkdir -p out/$targetId
|
7
|
+
|
8
|
+
java -jar $binary generate \
|
9
|
+
-g $generatorId \
|
10
|
+
-i $openApiFile \
|
11
|
+
-t $templateDir \
|
12
|
+
-o out/$targetId \
|
13
|
+
-c $(dirname "$0")/generator-config.json \
|
14
|
+
-p "npmVersion=$version,npmName=$packageName,npmRepository=$repository" $generatorCustomArgs
|
15
|
+
|
16
|
+
cd out/$targetId
|
17
|
+
|
18
|
+
npm install
|
19
|
+
npm run build
|
20
|
+
cd ../..
|
@@ -0,0 +1,20 @@
|
|
1
|
+
{
|
2
|
+
"modelPropertyNaming": "original",
|
3
|
+
"supportsES6": "true",
|
4
|
+
"providedInRoot": "true",
|
5
|
+
"ngVersion": "10.0.2",
|
6
|
+
"serviceSuffix": "Api",
|
7
|
+
"serviceFileSuffix": ".api",
|
8
|
+
"stringEnums": "true",
|
9
|
+
"enumPropertyNaming": "UPPERCASE",
|
10
|
+
"fileNaming": "kebab-case",
|
11
|
+
"useSingleRequestParameter": "false",
|
12
|
+
"sortModelPropertiesByRequiredFlag": "false",
|
13
|
+
"sortParamsByRequiredFlag": "true",
|
14
|
+
"inlineSchemaOptions": {
|
15
|
+
"ARRAY_ITEM_SUFFIX": "",
|
16
|
+
"MAP_ITEM_SUFFIX": "",
|
17
|
+
"SKIP_SCHEMA_REUSE": "true",
|
18
|
+
"RESOLVE_INLINE_ENUMS": "true"
|
19
|
+
}
|
20
|
+
}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
#/bin/bash
|
2
|
+
|
3
|
+
source $(dirname "$0")/../common.sh
|
4
|
+
|
5
|
+
rm -rf out/$targetId
|
6
|
+
mkdir -p out/$targetId
|
7
|
+
|
8
|
+
java -jar $binary generate \
|
9
|
+
-g $generatorId \
|
10
|
+
-i $openApiFile \
|
11
|
+
-t $templateDir \
|
12
|
+
-o out/$targetId \
|
13
|
+
-c $(dirname "$0")/generator-config.json \
|
14
|
+
-p "npmVersion=$version,npmName=$packageName,npmRepository=$repository" $generatorCustomArgs
|
15
|
+
|
16
|
+
cd out/$targetId
|
17
|
+
npm install
|
18
|
+
npm run build
|
19
|
+
cd ../..
|
@@ -0,0 +1,14 @@
|
|
1
|
+
{
|
2
|
+
"typescriptThreePlus": "true",
|
3
|
+
"supportsES6": "true",
|
4
|
+
"modelPropertyNaming": "original",
|
5
|
+
"withInterfaces": "true",
|
6
|
+
"fileNaming": "PascalCase",
|
7
|
+
"stringEnums": "true",
|
8
|
+
"enumPropertyNaming": "UPPERCASE",
|
9
|
+
"inlineSchemaOptions": {
|
10
|
+
"ARRAY_ITEM_SUFFIX": "",
|
11
|
+
"MAP_ITEM_SUFFIX": "",
|
12
|
+
"SKIP_SCHEMA_REUSE": "true"
|
13
|
+
}
|
14
|
+
}
|