openapi-ts-request 1.10.1 → 1.12.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.
@@ -0,0 +1,63 @@
1
+ /* eslint-disable */
2
+ // @ts-ignore
3
+ {%- if enumImports and enumImports.length > 0 %}
4
+ import type { {{ enumImports.join(', ') }} } from './enum';
5
+ {%- endif %}
6
+ {%- if commonImports and commonImports.length > 0 %}
7
+ import type { {{ commonImports.join(', ') }} } from './common.type';
8
+ {%- endif %}
9
+
10
+ {%- if list.length > 0 %}
11
+ {% for type in list -%}
12
+ {%- if type.props.length %}
13
+ export type {{ type.typeName | safe }} =
14
+ {%- for prop in type.props %}
15
+ {%- if prop.length > 1 %}
16
+ {
17
+ {%- endif %}
18
+ {%- if prop.length == 1 %}
19
+ {%- if not prop[0].$ref or prop[0].name %}
20
+ {
21
+ {%- endif %}
22
+ {%- endif %}
23
+ {%- for p in prop %}
24
+ {%- if p.desc %}
25
+ /** {{ p.desc }} */
26
+ {%- endif %}
27
+ {%- if p["$ref"] and not p.name %}
28
+ // {{ p.$ref }}
29
+ {{ p.type | safe }}
30
+ {%- else %}
31
+ {%- if nullable %}
32
+ '{{ p.name }}': {{ p.type | safe }}{{'' if p.required else '| null'}};
33
+ {%- else %}
34
+ '{{ p.name }}'{{ '' if p.required else '?' }}: {{ p.type | safe }};
35
+ {%- endif %}
36
+ {%- endif %}
37
+ {%- endfor %}
38
+ {%- if prop.length > 1 %}
39
+ }
40
+ {%- endif %}
41
+ {%- if prop.length == 1 %}
42
+ {%- if not prop[0].$ref or prop[0].name %}
43
+ }
44
+ {%- endif %}
45
+ {%- endif %}
46
+ {%- if prop.length == 0 %}
47
+ {}
48
+ {%- endif %}
49
+ {{ '' if loop.last === true else ' & ' }}
50
+ {%- endfor %}
51
+ {%- else %}
52
+ {%- if type.isEnum %}
53
+ export enum {{ type.typeName | safe }} {{ type.type }};
54
+
55
+ export type I{{ type.typeName | safe }} = keyof typeof {{ type.typeName }}
56
+ {%- else %}
57
+ export type {{ type.typeName | safe }} = {{ type.type }};
58
+ {%- endif %}
59
+ {%- endif %}
60
+ {% endfor %}
61
+ {%- else %}
62
+ export {}
63
+ {%- endif %}
@@ -0,0 +1,17 @@
1
+ /* eslint-disable */
2
+ // @ts-ignore
3
+
4
+ // 导出枚举类型
5
+ {%- if hasEnumTypes %}
6
+ export * from './enum';
7
+ {%- endif %}
8
+
9
+ // 导出公共类型
10
+ {%- if hasCommonTypes %}
11
+ export * from './common.type';
12
+ {%- endif %}
13
+
14
+ // 导出各模块类型
15
+ {%- for module in moduleList %}
16
+ export * from './{{ module }}.type';
17
+ {%- endfor %}