@trapi/swagger 0.3.8 → 1.0.0-alpha.11

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.
Files changed (154) hide show
  1. package/dist/config/index.d.ts +3 -0
  2. package/dist/config/index.d.ts.map +1 -0
  3. package/dist/config/index.js +25 -0
  4. package/dist/config/index.js.map +1 -0
  5. package/dist/config/type.d.ts +83 -0
  6. package/dist/config/type.d.ts.map +1 -0
  7. package/dist/config/type.js +9 -0
  8. package/dist/config/type.js.map +1 -0
  9. package/dist/config/utils.d.ts +3 -0
  10. package/dist/config/utils.d.ts.map +1 -0
  11. package/dist/config/utils.js +54 -0
  12. package/dist/config/utils.js.map +1 -0
  13. package/dist/constants.d.ts +15 -0
  14. package/dist/constants.d.ts.map +1 -0
  15. package/dist/constants.js +27 -0
  16. package/dist/constants.js.map +1 -0
  17. package/dist/generator/abstract.d.ts +35 -0
  18. package/dist/generator/abstract.d.ts.map +1 -0
  19. package/dist/generator/abstract.js +252 -0
  20. package/dist/generator/abstract.js.map +1 -0
  21. package/dist/{specification → generator}/index.d.ts +0 -2
  22. package/dist/generator/index.d.ts.map +1 -0
  23. package/dist/{specification → generator}/index.js +1 -3
  24. package/dist/generator/index.js.map +1 -0
  25. package/dist/generator/module.d.ts +14 -0
  26. package/dist/generator/module.d.ts.map +1 -0
  27. package/dist/generator/module.js +35 -0
  28. package/dist/generator/module.js.map +1 -0
  29. package/dist/generator/v2/index.d.ts +2 -0
  30. package/dist/generator/v2/index.d.ts.map +1 -0
  31. package/dist/{specification/utils → generator/v2}/index.js +2 -2
  32. package/dist/generator/v2/index.js.map +1 -0
  33. package/dist/generator/v2/module.d.ts +25 -0
  34. package/dist/generator/v2/module.d.ts.map +1 -0
  35. package/dist/generator/v2/module.js +517 -0
  36. package/dist/generator/v2/module.js.map +1 -0
  37. package/dist/generator/v3/index.d.ts +2 -0
  38. package/dist/generator/v3/index.d.ts.map +1 -0
  39. package/dist/generator/v3/index.js +24 -0
  40. package/dist/generator/v3/index.js.map +1 -0
  41. package/dist/generator/v3/module.d.ts +30 -0
  42. package/dist/generator/v3/module.d.ts.map +1 -0
  43. package/dist/generator/v3/module.js +499 -0
  44. package/dist/generator/v3/module.js.map +1 -0
  45. package/dist/index.d.ts +4 -2
  46. package/dist/index.d.ts.map +1 -1
  47. package/dist/index.js +4 -2
  48. package/dist/index.js.map +1 -1
  49. package/dist/metadata.d.ts +3 -4
  50. package/dist/metadata.d.ts.map +1 -1
  51. package/dist/metadata.js +3 -15
  52. package/dist/metadata.js.map +1 -1
  53. package/dist/schema/constants.d.ts +28 -0
  54. package/dist/schema/constants.d.ts.map +1 -0
  55. package/dist/schema/constants.js +40 -0
  56. package/dist/schema/constants.js.map +1 -0
  57. package/dist/schema/index.d.ts +5 -0
  58. package/dist/schema/index.d.ts.map +1 -0
  59. package/dist/schema/index.js +27 -0
  60. package/dist/schema/index.js.map +1 -0
  61. package/dist/schema/type.d.ts +139 -0
  62. package/dist/schema/type.d.ts.map +1 -0
  63. package/dist/schema/type.js.map +1 -0
  64. package/dist/schema/v2/constants.d.ts +8 -0
  65. package/dist/schema/v2/constants.d.ts.map +1 -0
  66. package/dist/schema/v2/constants.js +18 -0
  67. package/dist/schema/v2/constants.js.map +1 -0
  68. package/dist/schema/v2/index.d.ts +3 -0
  69. package/dist/schema/v2/index.d.ts.map +1 -0
  70. package/dist/{specification/v3 → schema/v2}/index.js +1 -1
  71. package/dist/schema/v2/index.js.map +1 -0
  72. package/dist/schema/v2/type.d.ts +116 -0
  73. package/dist/schema/v2/type.d.ts.map +1 -0
  74. package/dist/schema/v2/type.js.map +1 -0
  75. package/dist/schema/v3/constants.d.ts +7 -0
  76. package/dist/schema/v3/constants.d.ts.map +1 -0
  77. package/dist/schema/v3/constants.js +17 -0
  78. package/dist/schema/v3/constants.js.map +1 -0
  79. package/dist/schema/v3/index.d.ts +3 -0
  80. package/dist/schema/v3/index.d.ts.map +1 -0
  81. package/dist/{specification/v2 → schema/v3}/index.js +1 -1
  82. package/dist/schema/v3/index.js.map +1 -0
  83. package/dist/schema/v3/type.d.ts +159 -0
  84. package/dist/schema/v3/type.d.ts.map +1 -0
  85. package/dist/schema/v3/type.js +9 -0
  86. package/dist/schema/v3/type.js.map +1 -0
  87. package/dist/type.d.ts +44 -2
  88. package/dist/type.d.ts.map +1 -1
  89. package/dist/utils/character.d.ts +3 -0
  90. package/dist/utils/character.d.ts.map +1 -0
  91. package/dist/{specification/utils → utils}/character.js +4 -5
  92. package/dist/utils/character.js.map +1 -0
  93. package/dist/utils/index.d.ts +2 -1
  94. package/dist/utils/index.d.ts.map +1 -1
  95. package/dist/utils/index.js +2 -1
  96. package/dist/utils/index.js.map +1 -1
  97. package/dist/utils/object.d.ts.map +1 -1
  98. package/dist/utils/object.js +1 -0
  99. package/dist/utils/object.js.map +1 -1
  100. package/dist/utils/value.d.ts +2 -0
  101. package/dist/utils/value.d.ts.map +1 -0
  102. package/dist/utils/value.js +26 -0
  103. package/dist/utils/value.js.map +1 -0
  104. package/package.json +7 -10
  105. package/dist/module.d.ts +0 -8
  106. package/dist/module.d.ts.map +0 -1
  107. package/dist/module.js +0 -31
  108. package/dist/module.js.map +0 -1
  109. package/dist/specification/abstract.d.ts +0 -29
  110. package/dist/specification/abstract.d.ts.map +0 -1
  111. package/dist/specification/abstract.js +0 -226
  112. package/dist/specification/abstract.js.map +0 -1
  113. package/dist/specification/index.d.ts.map +0 -1
  114. package/dist/specification/index.js.map +0 -1
  115. package/dist/specification/module.d.ts +0 -5
  116. package/dist/specification/module.d.ts.map +0 -1
  117. package/dist/specification/module.js +0 -29
  118. package/dist/specification/module.js.map +0 -1
  119. package/dist/specification/type.d.ts +0 -268
  120. package/dist/specification/type.d.ts.map +0 -1
  121. package/dist/specification/type.js +0 -18
  122. package/dist/specification/type.js.map +0 -1
  123. package/dist/specification/utils/character.d.ts +0 -3
  124. package/dist/specification/utils/character.d.ts.map +0 -1
  125. package/dist/specification/utils/character.js.map +0 -1
  126. package/dist/specification/utils/index.d.ts +0 -2
  127. package/dist/specification/utils/index.d.ts.map +0 -1
  128. package/dist/specification/utils/index.js.map +0 -1
  129. package/dist/specification/v2/index.d.ts +0 -3
  130. package/dist/specification/v2/index.d.ts.map +0 -1
  131. package/dist/specification/v2/index.js.map +0 -1
  132. package/dist/specification/v2/module.d.ts +0 -24
  133. package/dist/specification/v2/module.d.ts.map +0 -1
  134. package/dist/specification/v2/module.js +0 -389
  135. package/dist/specification/v2/module.js.map +0 -1
  136. package/dist/specification/v2/type.d.ts +0 -79
  137. package/dist/specification/v2/type.d.ts.map +0 -1
  138. package/dist/specification/v2/type.js.map +0 -1
  139. package/dist/specification/v3/index.d.ts +0 -3
  140. package/dist/specification/v3/index.d.ts.map +0 -1
  141. package/dist/specification/v3/index.js.map +0 -1
  142. package/dist/specification/v3/module.d.ts +0 -25
  143. package/dist/specification/v3/module.d.ts.map +0 -1
  144. package/dist/specification/v3/module.js +0 -377
  145. package/dist/specification/v3/module.js.map +0 -1
  146. package/dist/specification/v3/type.d.ts +0 -121
  147. package/dist/specification/v3/type.d.ts.map +0 -1
  148. package/dist/specification/v3/type.js.map +0 -1
  149. package/dist/utils/package-json.d.ts +0 -3
  150. package/dist/utils/package-json.d.ts.map +0 -1
  151. package/dist/utils/package-json.js +0 -35
  152. package/dist/utils/package-json.js.map +0 -1
  153. /package/dist/{specification/v2 → schema}/type.js +0 -0
  154. /package/dist/{specification/v3 → schema/v2}/type.js +0 -0
@@ -0,0 +1,159 @@
1
+ import type { SecurityType } from '../../constants';
2
+ import type { ApiKeySecurity, BaseSecurity } from '../../type';
3
+ import type { DataFormatName, DataTypeName } from '../constants';
4
+ import type { BaseOperation, BaseResponse, BaseSchema, BaseSpec, BodyParameter, Example, FormDataParameter, HeaderParameter, Path, PathParameter, QueryParameter } from '../type';
5
+ import type { ParameterSourceV3 } from './constants';
6
+ export interface SpecV3 extends BaseSpec {
7
+ openapi: string;
8
+ servers: ServerV3[];
9
+ components: ComponentsV3;
10
+ paths: PathsV3;
11
+ }
12
+ export interface ServerV3 {
13
+ url: string;
14
+ description?: string;
15
+ variables?: Record<string, VariableV3>;
16
+ }
17
+ export interface VariableV3 {
18
+ enum?: string[];
19
+ description?: string;
20
+ default: string;
21
+ }
22
+ export interface ComponentsV3 {
23
+ callbacks?: {
24
+ [name: string]: any;
25
+ };
26
+ examples?: {
27
+ [name: string]: Example | string;
28
+ };
29
+ headers?: {
30
+ [name: string]: any;
31
+ };
32
+ links?: {
33
+ [name: string]: any;
34
+ };
35
+ parameters?: {
36
+ [name: string]: ParameterV3;
37
+ };
38
+ requestBodies?: {
39
+ [name: string]: any;
40
+ };
41
+ responses?: {
42
+ [name: string]: ResponseV3;
43
+ };
44
+ schemas?: {
45
+ [name: string]: SchemaV3;
46
+ };
47
+ securitySchemes?: {
48
+ [name: string]: SecurityV3;
49
+ };
50
+ }
51
+ export interface PathsV3 {
52
+ [key: string]: Path<OperationV3, ParameterV3>;
53
+ }
54
+ export interface BaseParameterV3 {
55
+ /**
56
+ * Default: false
57
+ */
58
+ deprecated?: boolean;
59
+ /**
60
+ * Default: false
61
+ */
62
+ allowEmptyValue?: boolean;
63
+ style?: string;
64
+ explode?: boolean;
65
+ allowReserved?: boolean;
66
+ schema?: BaseSchema<SchemaV3>;
67
+ example?: unknown;
68
+ examples?: Record<string, Example | string>;
69
+ content?: Record<string, any>;
70
+ }
71
+ export interface BodyParameterV3 extends BodyParameter, BaseParameterV3 {
72
+ }
73
+ export interface CookieParameterV3 extends BaseParameterV3 {
74
+ in: `${ParameterSourceV3.COOKIE}`;
75
+ }
76
+ export interface QueryParameterV3 extends QueryParameter, BaseParameterV3 {
77
+ }
78
+ export interface PathParameterV3 extends PathParameter, BaseParameterV3 {
79
+ }
80
+ export interface HeaderParameterV3 extends HeaderParameter, BaseParameterV3 {
81
+ }
82
+ export interface FormDataParameterV3 extends FormDataParameter, BaseParameterV3 {
83
+ }
84
+ export type ParameterV3 = BodyParameterV3 | CookieParameterV3 | QueryParameterV3 | PathParameterV3 | HeaderParameterV3 | FormDataParameterV3;
85
+ export interface OperationV3 extends BaseOperation<ParameterV3, ResponseV3> {
86
+ requestBody?: RequestBodyV3;
87
+ [key: string]: unknown;
88
+ }
89
+ export interface ResponseV3 extends BaseResponse {
90
+ content?: Record<string, {
91
+ schema: SchemaV3;
92
+ examples?: Record<string, Example>;
93
+ }>;
94
+ headers?: {
95
+ [name: string]: HeaderV3;
96
+ };
97
+ }
98
+ export interface HeaderV3 extends Omit<BaseSchema<SchemaV3>, 'required'> {
99
+ required?: boolean;
100
+ description?: string;
101
+ example?: unknown;
102
+ examples?: Record<string, Example | string>;
103
+ schema: BaseSchema<SchemaV3>;
104
+ type?: `${DataTypeName}`;
105
+ format?: `${DataFormatName}`;
106
+ }
107
+ export interface RequestBodyV3 {
108
+ content: {
109
+ [name: string]: MediaTypeV3;
110
+ };
111
+ description?: string;
112
+ required?: boolean;
113
+ }
114
+ export interface MediaTypeV3 {
115
+ schema?: SchemaV3;
116
+ example?: Example;
117
+ examples?: Record<string, Example | string>;
118
+ encoding?: {
119
+ [name: string]: any;
120
+ };
121
+ }
122
+ export interface SchemaV3 extends BaseSchema<SchemaV3> {
123
+ nullable?: boolean;
124
+ anyOf?: SchemaV3[];
125
+ allOf?: SchemaV3[];
126
+ deprecated?: boolean;
127
+ }
128
+ export interface BasicSecurityV3 extends BaseSecurity {
129
+ type: `${SecurityType.HTTP}`;
130
+ schema: 'basic';
131
+ }
132
+ export interface OAuth2SecurityV3 extends BaseSecurity {
133
+ type: `${SecurityType.OAUTH2}`;
134
+ flows: {
135
+ implicit?: OAuth2ImplicitFlowV3;
136
+ password?: OAuth2PasswordFlowV3;
137
+ authorizationCode?: OAuth2AuthorizationCodeFlowV3;
138
+ clientCredentials?: OAuth2ClientCredentialsFlowV3;
139
+ };
140
+ }
141
+ export interface Oauth2BaseFlowV3 {
142
+ scopes?: Record<string, string>;
143
+ refreshUrl?: string;
144
+ }
145
+ export interface OAuth2ImplicitFlowV3 extends Oauth2BaseFlowV3 {
146
+ authorizationUrl: string;
147
+ }
148
+ export interface OAuth2PasswordFlowV3 extends Oauth2BaseFlowV3 {
149
+ tokenUrl: string;
150
+ }
151
+ export interface OAuth2AuthorizationCodeFlowV3 extends Oauth2BaseFlowV3 {
152
+ authorizationUrl: string;
153
+ tokenUrl: string;
154
+ }
155
+ export interface OAuth2ClientCredentialsFlowV3 extends Oauth2BaseFlowV3 {
156
+ tokenUrl: string;
157
+ }
158
+ export type SecurityV3 = BasicSecurityV3 | OAuth2SecurityV3 | ApiKeySecurity;
159
+ //# sourceMappingURL=type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../../src/schema/v3/type.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjE,OAAO,KAAK,EACR,aAAa,EAAE,YAAY,EAC3B,UAAU,EAAE,QAAQ,EAAE,aAAa,EAAE,OAAO,EAC5C,iBAAiB,EAAE,eAAe,EAAE,IAAI,EAAE,aAAa,EAAE,cAAc,EAC1E,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD,MAAM,WAAW,MAAO,SAAQ,QAAQ;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,QAAQ,EAAE,CAAC;IACpB,UAAU,EAAE,YAAY,CAAC;IACzB,KAAK,EAAE,OAAO,CAAC;CAClB;AAGD,MAAM,WAAW,QAAQ;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC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M,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,gBAAiB,SAAQ,YAAY;IAClD,IAAI,EAAE,GAAG,YAAY,CAAC,MAAM,EAAE,CAAC;IAC/B,KAAK,EAAE;QACH,QAAQ,CAAC,EAAE,oBAAoB,CAAC;QAChC,QAAQ,CAAC,EAAE,oBAAoB,CAAC;QAChC,iBAAiB,CAAC,EAAE,6BAA6B,CAAC;QAClD,iBAAiB,CAAC,EAAE,6BAA6B,CAAA;KACpD,CAAC;CACL;AAED,MAAM,WAAW,gBAAgB;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,oBAAqB,SAAQ,gBAAgB;IAC1D,gBAAgB,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,oBAAqB,SAAQ,gBAAgB;IAC1D,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,6BAA8B,SAAQ,gBAAgB;IACnE,gBAAgB,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,6BAA8B,SAAQ,gBAAgB;IACnE,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,MAAM,UAAU,GACd,eAAe,GACf,gBAAgB,GAChB,cAAc,CAAC"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2021.
4
+ * Author Peter Placzek (tada5hi)
5
+ * For the full copyright and license information,
6
+ * view the LICENSE file that was distributed with this source code.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ //# sourceMappingURL=type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type.js","sourceRoot":"","sources":["../../../src/schema/v3/type.ts"],"names":[],"mappings":";AAAA;;;;;GAKG"}
package/dist/type.d.ts CHANGED
@@ -1,7 +1,49 @@
1
- export type SwaggerDocFormatType = 'yaml' | 'json';
2
- export interface SwaggerDocFormatData {
1
+ import type { SecurityType } from './constants';
2
+ export interface DocumentFormatData {
3
3
  path: string;
4
4
  name: string;
5
5
  content?: string;
6
6
  }
7
+ export interface BaseSecurity {
8
+ description?: string;
9
+ }
10
+ export interface ApiKeySecurity extends BaseSecurity {
11
+ type: `${SecurityType.API_KEY}`;
12
+ name: string;
13
+ in: 'query' | 'header';
14
+ }
15
+ export interface BasicSecurity extends BaseSecurity {
16
+ type: `${SecurityType.HTTP}`;
17
+ schema: 'basic';
18
+ }
19
+ export interface OAuth2Security extends BaseSecurity {
20
+ type: `${SecurityType.OAUTH2}`;
21
+ flows: {
22
+ implicit?: OAuth2ImplicitFlow;
23
+ password?: OAuth2PasswordFlow;
24
+ authorizationCode?: OAuth2AuthorizationCodeFlow;
25
+ clientCredentials?: OAuth2ClientCredentialsFlow;
26
+ };
27
+ }
28
+ export interface Oauth2BaseFlow {
29
+ scopes?: Record<string, string>;
30
+ refreshUrl?: string;
31
+ }
32
+ export interface OAuth2ImplicitFlow extends Oauth2BaseFlow {
33
+ authorizationUrl: string;
34
+ }
35
+ export interface OAuth2PasswordFlow extends Oauth2BaseFlow {
36
+ tokenUrl: string;
37
+ }
38
+ export interface OAuth2AuthorizationCodeFlow extends Oauth2BaseFlow {
39
+ authorizationUrl: string;
40
+ tokenUrl: string;
41
+ }
42
+ export interface OAuth2ClientCredentialsFlow extends Oauth2BaseFlow {
43
+ tokenUrl: string;
44
+ }
45
+ export type SecurityDefinition = ApiKeySecurity | BasicSecurity | OAuth2Security;
46
+ export interface SecurityDefinitions {
47
+ [key: string]: SecurityDefinition;
48
+ }
7
49
  //# sourceMappingURL=type.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../src/type.ts"],"names":[],"mappings":"AAOA,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,MAAM,CAAC;AAEnD,MAAM,WAAW,oBAAoB;IACjC,IAAI,EAAE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c;IACtD,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,2BAA4B,SAAQ,cAAc;IAC/D,gBAAgB,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,2BAA4B,SAAQ,cAAc;IAC/D,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,MAAM,kBAAkB,GAAG,cAAc,GAAG,aAAa,GAAG,cAAc,CAAC;AAEjF,MAAM,WAAW,mBAAmB;IAChC,CAAC,GAAG,EAAE,MAAM,GAAG,kBAAkB,CAAC;CACrC"}
@@ -0,0 +1,3 @@
1
+ export declare function removeDuplicateSlashes(str: string): string;
2
+ export declare function removeFinalCharacter(str: string, character: string): string;
3
+ //# sourceMappingURL=character.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"character.d.ts","sourceRoot":"","sources":["../../src/utils/character.ts"],"names":[],"mappings":"AAOA,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,MAAM,GAAI,MAAM,CAE3D;AAED,wBAAgB,oBAAoB,CAChC,GAAG,EAAE,MAAM,EACX,SAAS,EAAE,MAAM,UAOpB"}
@@ -6,12 +6,11 @@
6
6
  * view the LICENSE file that was distributed with this source code.
7
7
  */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.removeFinalCharacter = exports.removeRepeatingCharacter = void 0;
10
- // todo: implement character in regex matching
11
- function removeRepeatingCharacter(str, character) {
12
- return str.replace('/([^:]$)\/+/g', '$1');
9
+ exports.removeFinalCharacter = exports.removeDuplicateSlashes = void 0;
10
+ function removeDuplicateSlashes(str) {
11
+ return str.replace('/([^:]$)/+/g', '$1');
13
12
  }
14
- exports.removeRepeatingCharacter = removeRepeatingCharacter;
13
+ exports.removeDuplicateSlashes = removeDuplicateSlashes;
15
14
  function removeFinalCharacter(str, character) {
16
15
  while (str.charAt(str.length - 1) === character && str.length > 0) {
17
16
  str = str.slice(0, -1);
@@ -0,0 +1 @@
1
+ {"version":3,"file":"character.js","sourceRoot":"","sources":["../../src/utils/character.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,SAAgB,sBAAsB,CAAC,GAAW;IAC9C,OAAO,GAAG,CAAC,OAAO,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC;AAC7C,CAAC;AAFD,wDAEC;AAED,SAAgB,oBAAoB,CAChC,GAAW,EACX,SAAiB;IAEjB,OAAO,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,SAAS,IAAI,GAAG,CAAC,MAAM,GAAG,CAAC,EAAE;QAC/D,GAAG,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;KAC1B;IAED,OAAO,GAAG,CAAC;AACf,CAAC;AATD,oDASC"}
@@ -1,4 +1,5 @@
1
+ export * from './character';
1
2
  export * from './path';
2
3
  export * from './object';
3
- export * from './package-json';
4
+ export * from './value';
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAOA,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAOA,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC"}
@@ -20,7 +20,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
20
20
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
21
21
  };
22
22
  Object.defineProperty(exports, "__esModule", { value: true });
23
+ __exportStar(require("./character"), exports);
23
24
  __exportStar(require("./path"), exports);
24
25
  __exportStar(require("./object"), exports);
25
- __exportStar(require("./package-json"), exports);
26
+ __exportStar(require("./value"), exports);
26
27
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;AAEH,yCAAuB;AACvB,2CAAyB;AACzB,iDAA+B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;AAEH,8CAA4B;AAC5B,yCAAuB;AACvB,2CAAyB;AACzB,0CAAwB"}
@@ -1 +1 @@
1
- {"version":3,"file":"object.d.ts","sourceRoot":"","sources":["../../src/utils/object.ts"],"names":[],"mappings":"AAOA,wBAAgB,cAAc,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,WAAW,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,CAElH"}
1
+ {"version":3,"file":"object.d.ts","sourceRoot":"","sources":["../../src/utils/object.ts"],"names":[],"mappings":"AAQA,wBAAgB,cAAc,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,WAAW,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,CAElH"}
@@ -7,6 +7,7 @@
7
7
  */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.hasOwnProperty = void 0;
10
+ // eslint-disable-next-line @typescript-eslint/ban-types
10
11
  function hasOwnProperty(obj, prop) {
11
12
  return Object.prototype.hasOwnProperty.call(obj, prop);
12
13
  }
@@ -1 +1 @@
1
- {"version":3,"file":"object.js","sourceRoot":"","sources":["../../src/utils/object.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,SAAgB,cAAc,CAAsC,GAAM,EAAE,IAAO;IAC/E,OAAO,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;AAC3D,CAAC;AAFD,wCAEC"}
1
+ {"version":3,"file":"object.js","sourceRoot":"","sources":["../../src/utils/object.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,wDAAwD;AACxD,SAAgB,cAAc,CAAsC,GAAM,EAAE,IAAO;IAC/E,OAAO,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;AAC3D,CAAC;AAFD,wCAEC"}
@@ -0,0 +1,2 @@
1
+ export declare function transformValueTo(type: 'string' | 'number' | 'integer' | 'boolean' | 'bigint', value: unknown): string | number | boolean | null;
2
+ //# sourceMappingURL=value.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"value.d.ts","sourceRoot":"","sources":["../../src/utils/value.ts"],"names":[],"mappings":"AAOA,wBAAgB,gBAAgB,CAC5B,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,EAC5D,KAAK,EAAE,OAAO,GACf,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAelC"}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2023.
4
+ * Author Peter Placzek (tada5hi)
5
+ * For the full copyright and license information,
6
+ * view the LICENSE file that was distributed with this source code.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.transformValueTo = void 0;
10
+ function transformValueTo(type, value) {
11
+ if (value === null) {
12
+ return null;
13
+ }
14
+ switch (type) {
15
+ case 'integer':
16
+ case 'number':
17
+ return Number(value);
18
+ case 'boolean':
19
+ return !!value;
20
+ case 'string':
21
+ default:
22
+ return String(value);
23
+ }
24
+ }
25
+ exports.transformValueTo = transformValueTo;
26
+ //# sourceMappingURL=value.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"value.js","sourceRoot":"","sources":["../../src/utils/value.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,SAAgB,gBAAgB,CAC5B,IAA4D,EAC5D,KAAc;IAEd,IAAI,KAAK,KAAK,IAAI,EAAE;QAChB,OAAO,IAAI,CAAC;KACf;IAED,QAAQ,IAAI,EAAE;QACV,KAAK,SAAS,CAAC;QACf,KAAK,QAAQ;YACT,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;QACzB,KAAK,SAAS;YACV,OAAO,CAAC,CAAC,KAAK,CAAC;QACnB,KAAK,QAAQ,CAAC;QACd;YACI,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;KAC5B;AACL,CAAC;AAlBD,4CAkBC"}
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "url": "https://github.com/tada5hi"
7
7
  },
8
8
  "license": "MIT",
9
- "version": "0.3.8",
9
+ "version": "1.0.0-alpha.11",
10
10
  "description": "Generate Swagger files from a decorator APIs.",
11
11
  "keywords": [
12
12
  "typescript",
@@ -26,6 +26,7 @@
26
26
  "dist/"
27
27
  ],
28
28
  "scripts": {
29
+ "refresh": "node bin/metadata.js",
29
30
  "start": "tsc -p tsconfig.build.json -w",
30
31
  "build": "npm run clean && tsc -p tsconfig.build.json",
31
32
  "clean": "rimraf dist && rimraf tsconfig.tsbuildinfo",
@@ -35,20 +36,16 @@
35
36
  "preblushOnly": "npm run build"
36
37
  },
37
38
  "devDependencies": {
38
- "@trapi/decorators": "^0.1.1",
39
- "@trapi/metadata": "^0.4.1",
40
39
  "@types/yamljs": "^0.2.31",
41
40
  "jest": "^27.5.1",
42
- "rimraf": "^3.0.2"
41
+ "jsonata": "^2.0.2",
42
+ "locter": "^1.0.9"
43
43
  },
44
44
  "dependencies": {
45
- "smob": "^0.0.6",
45
+ "@trapi/metadata": "^1.0.0-alpha.7",
46
+ "smob": "^0.1.0",
46
47
  "yamljs": "^0.3.0"
47
48
  },
48
- "peerDependencies": {
49
- "@trapi/decorators": ">=0.1.1 <1.0.0",
50
- "@trapi/metadata": ">=0.4.1 <1.0.0"
51
- },
52
49
  "repository": {
53
50
  "type": "git",
54
51
  "url": "git+https://github.com/Tada5hi/trapi.git",
@@ -65,5 +62,5 @@
65
62
  "access": "public"
66
63
  },
67
64
  "engineStrict": true,
68
- "gitHead": "48e5d03e959cffbf7d429fc6b825f3d47fb23a7f"
65
+ "gitHead": "6d462ec6a345cb45427d3a8bb0d108b540d722f2"
69
66
  }
package/dist/module.d.ts DELETED
@@ -1,8 +0,0 @@
1
- import { CompilerOptions, Config as MetadataConfig } from '@trapi/metadata';
2
- import { Specification } from './specification';
3
- import { SwaggerDocFormatData, SwaggerDocFormatType } from './type';
4
- export declare function generateDocumentation(config: {
5
- metadata: MetadataConfig;
6
- swagger: Specification.Config;
7
- }, tsConfig?: CompilerOptions): Promise<Record<SwaggerDocFormatType, SwaggerDocFormatData>>;
8
- //# sourceMappingURL=module.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,eAAe,EAAE,MAAM,IAAI,cAAc,EAA2B,MAAM,iBAAiB,CAAC;AACrG,OAAO,EAAE,aAAa,EAAgC,MAAM,iBAAiB,CAAC;AAC9E,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAAC;AAEpE,wBAAsB,qBAAqB,CACvC,MAAM,EAAE;IACJ,QAAQ,EAAE,cAAc,CAAC;IACzB,OAAO,EAAE,aAAa,CAAC,MAAM,CAAA;CAChC,EACD,QAAQ,CAAC,EAAE,eAAe,GAC3B,OAAO,CAAC,MAAM,CAAC,oBAAoB,EAAE,oBAAoB,CAAC,CAAC,CAS7D"}
package/dist/module.js DELETED
@@ -1,31 +0,0 @@
1
- "use strict";
2
- /*
3
- * Copyright (c) 2021-2022.
4
- * Author Peter Placzek (tada5hi)
5
- * For the full copyright and license information,
6
- * view the LICENSE file that was distributed with this source code.
7
- */
8
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
9
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
10
- return new (P || (P = Promise))(function (resolve, reject) {
11
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
12
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
13
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
14
- step((generator = generator.apply(thisArg, _arguments || [])).next());
15
- });
16
- };
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.generateDocumentation = void 0;
19
- const metadata_1 = require("@trapi/metadata");
20
- const specification_1 = require("./specification");
21
- function generateDocumentation(config, tsConfig) {
22
- return __awaiter(this, void 0, void 0, function* () {
23
- const metadataGenerator = (0, metadata_1.createMetadataGenerator)(config.metadata, tsConfig);
24
- const metadata = metadataGenerator.generate();
25
- const specGenerator = (0, specification_1.createSpecificationGenerator)(metadata, config.swagger);
26
- specGenerator.build();
27
- return specGenerator.save();
28
- });
29
- }
30
- exports.generateDocumentation = generateDocumentation;
31
- //# sourceMappingURL=module.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"module.js","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;AAEH,8CAAqG;AACrG,mDAA8E;AAG9E,SAAsB,qBAAqB,CACvC,MAGC,EACD,QAA0B;;QAE1B,MAAM,iBAAiB,GAAG,IAAA,kCAAuB,EAAC,MAAM,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QAE7E,MAAM,QAAQ,GAAG,iBAAiB,CAAC,QAAQ,EAAE,CAAC;QAE9C,MAAM,aAAa,GAAG,IAAA,4CAA4B,EAAC,QAAQ,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;QAE7E,aAAa,CAAC,KAAK,EAAE,CAAC;QACtB,OAAO,aAAa,CAAC,IAAI,EAAE,CAAC;IAChC,CAAC;CAAA;AAfD,sDAeC"}
@@ -1,29 +0,0 @@
1
- import { BaseType, EnumType, IntersectionType, NestedObjectLiteralType, ReferenceType, ResolverProperty, UnionType } from '@trapi/decorators';
2
- import { GeneratorOutput } from '@trapi/metadata';
3
- import { SpecificationV2 } from './v2/type';
4
- import { SpecificationV3 } from './v3/type';
5
- import { SwaggerDocFormatData, SwaggerDocFormatType } from '../type';
6
- import { Specification } from './type';
7
- export declare abstract class AbstractSpecGenerator<Spec extends SpecificationV2.Spec | SpecificationV3.Spec, Schema extends SpecificationV3.Schema | SpecificationV2.Schema> {
8
- protected spec: Spec;
9
- protected readonly metadata: GeneratorOutput;
10
- protected readonly config: Specification.Config;
11
- constructor(metadata: GeneratorOutput, config: Specification.Config);
12
- save(): Promise<Record<SwaggerDocFormatType, SwaggerDocFormatData>>;
13
- getMetaData(): GeneratorOutput;
14
- abstract getSwaggerSpec(): Spec;
15
- abstract build(): Spec;
16
- protected buildInfo(): Specification.Info;
17
- protected getSwaggerType(type: BaseType): Schema | Specification.BaseSchema<Schema>;
18
- protected abstract getSwaggerTypeForIntersectionType(type: IntersectionType): Schema;
19
- protected abstract getSwaggerTypeForEnumType(enumType: EnumType): Schema;
20
- protected getSwaggerTypeForUnionType(type: UnionType): Schema | Specification.BaseSchema<Schema>;
21
- private getSwaggerTypeForPrimitiveType;
22
- private getSwaggerTypeForArrayType;
23
- getSwaggerTypeForObjectLiteral(objectLiteral: NestedObjectLiteralType): Specification.BaseSchema<Schema>;
24
- protected abstract getSwaggerTypeForReferenceType(referenceType: ReferenceType): Schema;
25
- protected abstract buildProperties(properties: ResolverProperty[]): Record<string, Schema>;
26
- protected determineTypesUsedInEnum(anEnum: Array<string | number | boolean | null>): Set<"string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function">;
27
- protected getOperationId(methodName: string): string;
28
- }
29
- //# sourceMappingURL=abstract.d.ts.map
@@ -1 +0,0 @@
1
- {"version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