@dotflash/openapi-semantic-generator 0.1.0 → 0.1.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.
- package/README.md +5 -5
- package/dist/{chunk-JGV5ULAN.js → chunk-IUOJNB6I.js} +14 -4
- package/dist/cli.cjs +14 -4
- package/dist/cli.js +1 -1
- package/dist/index.cjs +14 -4
- package/dist/index.js +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# OpenAPI
|
|
1
|
+
# OpenAPI Semantic Generator (@dotflash/openapi-semantic-generator)
|
|
2
2
|
|
|
3
3
|
[English](#english) | [한국어](#한국어)
|
|
4
4
|
|
|
@@ -41,13 +41,13 @@ It provides an index and guide that allows LLMs to understand large-scale API co
|
|
|
41
41
|
### Installation
|
|
42
42
|
|
|
43
43
|
```bash
|
|
44
|
-
npm install -g
|
|
44
|
+
npm install -g @dotflash/openapi-semantic-generator
|
|
45
45
|
```
|
|
46
46
|
|
|
47
47
|
### Usage
|
|
48
48
|
|
|
49
49
|
```bash
|
|
50
|
-
npx
|
|
50
|
+
npx openapi-semantic-generator <spec-url-or-path> -o <generated-code-dir> [options]
|
|
51
51
|
```
|
|
52
52
|
|
|
53
53
|
#### Required Arguments
|
|
@@ -91,13 +91,13 @@ OpenAPI Generator로 생성된 코드들을 분석하여 LLM 에이전트가 활
|
|
|
91
91
|
### 설치 방법
|
|
92
92
|
|
|
93
93
|
```bash
|
|
94
|
-
npm install -g
|
|
94
|
+
npm install -g @dotflash/openapi-semantic-generator
|
|
95
95
|
```
|
|
96
96
|
|
|
97
97
|
### 사용 방법
|
|
98
98
|
|
|
99
99
|
```bash
|
|
100
|
-
npx
|
|
100
|
+
npx openapi-semantic-generator <spec-url-or-path> -o <generated-code-dir> [options]
|
|
101
101
|
```
|
|
102
102
|
|
|
103
103
|
#### 필수 인자
|
|
@@ -143,10 +143,20 @@ async function renderDocs(metadata, outputDir) {
|
|
|
143
143
|
});
|
|
144
144
|
const groupedOperations = Object.entries(operationsByTag).map(([tag, ops]) => ({
|
|
145
145
|
tag,
|
|
146
|
-
ops: ops.map((op, index) =>
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
146
|
+
ops: ops.map((op, index) => {
|
|
147
|
+
let relativePath = op.sourceFile;
|
|
148
|
+
if (path2.isAbsolute(op.sourceFile)) {
|
|
149
|
+
relativePath = path2.relative(outputDir, op.sourceFile);
|
|
150
|
+
}
|
|
151
|
+
if (!relativePath.startsWith("./") && !relativePath.startsWith("../")) {
|
|
152
|
+
relativePath = "./" + relativePath;
|
|
153
|
+
}
|
|
154
|
+
return {
|
|
155
|
+
...op,
|
|
156
|
+
sourceFile: relativePath,
|
|
157
|
+
last: index === ops.length - 1
|
|
158
|
+
};
|
|
159
|
+
})
|
|
150
160
|
}));
|
|
151
161
|
const enrichedMetadata = {
|
|
152
162
|
...metadata,
|
package/dist/cli.cjs
CHANGED
|
@@ -181,10 +181,20 @@ async function renderDocs(metadata, outputDir) {
|
|
|
181
181
|
});
|
|
182
182
|
const groupedOperations = Object.entries(operationsByTag).map(([tag, ops]) => ({
|
|
183
183
|
tag,
|
|
184
|
-
ops: ops.map((op, index) =>
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
184
|
+
ops: ops.map((op, index) => {
|
|
185
|
+
let relativePath = op.sourceFile;
|
|
186
|
+
if (import_path2.default.isAbsolute(op.sourceFile)) {
|
|
187
|
+
relativePath = import_path2.default.relative(outputDir, op.sourceFile);
|
|
188
|
+
}
|
|
189
|
+
if (!relativePath.startsWith("./") && !relativePath.startsWith("../")) {
|
|
190
|
+
relativePath = "./" + relativePath;
|
|
191
|
+
}
|
|
192
|
+
return {
|
|
193
|
+
...op,
|
|
194
|
+
sourceFile: relativePath,
|
|
195
|
+
last: index === ops.length - 1
|
|
196
|
+
};
|
|
197
|
+
})
|
|
188
198
|
}));
|
|
189
199
|
const enrichedMetadata = {
|
|
190
200
|
...metadata,
|
package/dist/cli.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -190,10 +190,20 @@ async function renderDocs(metadata, outputDir) {
|
|
|
190
190
|
});
|
|
191
191
|
const groupedOperations = Object.entries(operationsByTag).map(([tag, ops]) => ({
|
|
192
192
|
tag,
|
|
193
|
-
ops: ops.map((op, index) =>
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
193
|
+
ops: ops.map((op, index) => {
|
|
194
|
+
let relativePath = op.sourceFile;
|
|
195
|
+
if (import_path2.default.isAbsolute(op.sourceFile)) {
|
|
196
|
+
relativePath = import_path2.default.relative(outputDir, op.sourceFile);
|
|
197
|
+
}
|
|
198
|
+
if (!relativePath.startsWith("./") && !relativePath.startsWith("../")) {
|
|
199
|
+
relativePath = "./" + relativePath;
|
|
200
|
+
}
|
|
201
|
+
return {
|
|
202
|
+
...op,
|
|
203
|
+
sourceFile: relativePath,
|
|
204
|
+
last: index === ops.length - 1
|
|
205
|
+
};
|
|
206
|
+
})
|
|
197
207
|
}));
|
|
198
208
|
const enrichedMetadata = {
|
|
199
209
|
...metadata,
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dotflash/openapi-semantic-generator",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Semantic mapping automation tool for LLM agents and OpenAPI generated code",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.mjs",
|
|
8
8
|
"types": "dist/index.d.ts",
|
|
9
9
|
"bin": {
|
|
10
|
-
"
|
|
10
|
+
"openapi-semantic-generator": "dist/cli.js"
|
|
11
11
|
},
|
|
12
12
|
"files": [
|
|
13
13
|
"dist",
|