@mintlify/scraping 4.0.136 → 4.0.138
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/__test__/fixtures/openapi.ts +358 -0
- package/__test__/generateOpenApiPages.test.ts +82 -0
- package/__test__/generateOpenApiPagesForDocsConfig.test.ts +41 -102
- package/bin/openapi/common.d.ts +2 -0
- package/bin/openapi/common.js +39 -0
- package/bin/openapi/common.js.map +1 -1
- package/bin/openapi/generateOpenApiPages.js +24 -8
- package/bin/openapi/generateOpenApiPages.js.map +1 -1
- package/bin/openapi/generateOpenApiPagesForDocsConfig.js +24 -8
- package/bin/openapi/generateOpenApiPagesForDocsConfig.js.map +1 -1
- package/bin/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/src/openapi/common.ts +58 -0
- package/src/openapi/generateOpenApiPages.ts +49 -17
- package/src/openapi/generateOpenApiPagesForDocsConfig.ts +48 -17
|
@@ -0,0 +1,358 @@
|
|
|
1
|
+
import { DocumentV3 } from '@mintlify/common';
|
|
2
|
+
|
|
3
|
+
export const emptyDoc: DocumentV3 = {
|
|
4
|
+
openapi: '3.0.0',
|
|
5
|
+
info: {
|
|
6
|
+
title: 'Test API',
|
|
7
|
+
version: '1.0.0',
|
|
8
|
+
},
|
|
9
|
+
paths: {},
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const simpleDoc: DocumentV3 = {
|
|
13
|
+
openapi: '3.0.0',
|
|
14
|
+
info: {
|
|
15
|
+
title: 'Test API',
|
|
16
|
+
version: '1.0.0',
|
|
17
|
+
},
|
|
18
|
+
paths: {
|
|
19
|
+
'/users': {
|
|
20
|
+
get: {
|
|
21
|
+
operationId: 'getUsers',
|
|
22
|
+
summary: 'Get Users',
|
|
23
|
+
responses: {
|
|
24
|
+
200: {
|
|
25
|
+
description: 'Successful response',
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export const docWithTags: DocumentV3 = {
|
|
34
|
+
openapi: '3.0.0',
|
|
35
|
+
info: {
|
|
36
|
+
title: 'Test API',
|
|
37
|
+
version: '1.0.0',
|
|
38
|
+
},
|
|
39
|
+
paths: {
|
|
40
|
+
'/users': {
|
|
41
|
+
get: {
|
|
42
|
+
operationId: 'getUsers',
|
|
43
|
+
summary: 'Get Users',
|
|
44
|
+
tags: ['Users'],
|
|
45
|
+
responses: {
|
|
46
|
+
200: {
|
|
47
|
+
description: 'Successful response',
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export const complexDoc: DocumentV3 = {
|
|
56
|
+
openapi: '3.0.0',
|
|
57
|
+
info: {
|
|
58
|
+
title: 'Test API',
|
|
59
|
+
version: '1.0.0',
|
|
60
|
+
},
|
|
61
|
+
paths: {
|
|
62
|
+
'/users': {
|
|
63
|
+
get: {
|
|
64
|
+
operationId: 'getUsers',
|
|
65
|
+
summary: 'Get Users',
|
|
66
|
+
tags: ['Users'],
|
|
67
|
+
responses: {
|
|
68
|
+
200: {
|
|
69
|
+
description: 'Successful response',
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
post: {
|
|
74
|
+
operationId: 'createUser',
|
|
75
|
+
summary: 'Create User',
|
|
76
|
+
tags: ['Users'],
|
|
77
|
+
responses: {
|
|
78
|
+
201: {
|
|
79
|
+
description: 'User created',
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
'/products': {
|
|
85
|
+
get: {
|
|
86
|
+
operationId: 'getProducts',
|
|
87
|
+
summary: 'Get Products',
|
|
88
|
+
tags: ['Products'],
|
|
89
|
+
responses: {
|
|
90
|
+
200: {
|
|
91
|
+
description: 'Successful response',
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
export const webhooksDoc: DocumentV3 = {
|
|
100
|
+
openapi: '3.1.0',
|
|
101
|
+
info: {
|
|
102
|
+
title: 'Webhook Example',
|
|
103
|
+
version: '1.0.0',
|
|
104
|
+
},
|
|
105
|
+
webhooks: {
|
|
106
|
+
newPet: {
|
|
107
|
+
description: 'A new pet has been added to the system',
|
|
108
|
+
post: {
|
|
109
|
+
requestBody: {
|
|
110
|
+
description: 'Information about a new pet in the system',
|
|
111
|
+
content: {
|
|
112
|
+
'application/json': {
|
|
113
|
+
schema: {
|
|
114
|
+
$ref: '#/components/schemas/Pet',
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
responses: {
|
|
120
|
+
200: {
|
|
121
|
+
description: 'Return a 200 status to indicate that the data was received successfully',
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
components: {
|
|
128
|
+
schemas: {
|
|
129
|
+
Pet: {
|
|
130
|
+
required: ['id', 'name'],
|
|
131
|
+
properties: {
|
|
132
|
+
id: {
|
|
133
|
+
type: 'integer',
|
|
134
|
+
format: 'int64',
|
|
135
|
+
},
|
|
136
|
+
name: {
|
|
137
|
+
type: 'string',
|
|
138
|
+
},
|
|
139
|
+
tag: {
|
|
140
|
+
type: 'string',
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
export const pathsAndWebhooksDoc: DocumentV3 = {
|
|
149
|
+
openapi: '3.1.0',
|
|
150
|
+
info: {
|
|
151
|
+
title: 'OpenAPI Plant Store',
|
|
152
|
+
description:
|
|
153
|
+
'A sample API that uses a plant store as an example to demonstrate features in the OpenAPI specification',
|
|
154
|
+
license: {
|
|
155
|
+
name: 'MIT',
|
|
156
|
+
},
|
|
157
|
+
version: '1.0.0',
|
|
158
|
+
},
|
|
159
|
+
servers: [
|
|
160
|
+
{
|
|
161
|
+
url: 'http://sandbox.mintlify.com',
|
|
162
|
+
},
|
|
163
|
+
],
|
|
164
|
+
security: [
|
|
165
|
+
{
|
|
166
|
+
bearerAuth: [],
|
|
167
|
+
},
|
|
168
|
+
],
|
|
169
|
+
paths: {
|
|
170
|
+
'/plants': {
|
|
171
|
+
get: {
|
|
172
|
+
description: 'Returns all plants from the system that the user has access to',
|
|
173
|
+
parameters: [
|
|
174
|
+
{
|
|
175
|
+
name: 'limit',
|
|
176
|
+
in: 'query',
|
|
177
|
+
description: 'The maximum number of results to return',
|
|
178
|
+
schema: {
|
|
179
|
+
type: 'integer',
|
|
180
|
+
format: 'int32',
|
|
181
|
+
},
|
|
182
|
+
},
|
|
183
|
+
],
|
|
184
|
+
responses: {
|
|
185
|
+
200: {
|
|
186
|
+
description: 'Plant response',
|
|
187
|
+
content: {
|
|
188
|
+
'application/json': {
|
|
189
|
+
schema: {
|
|
190
|
+
type: 'array',
|
|
191
|
+
items: {
|
|
192
|
+
$ref: '#/components/schemas/Plant',
|
|
193
|
+
},
|
|
194
|
+
},
|
|
195
|
+
},
|
|
196
|
+
},
|
|
197
|
+
},
|
|
198
|
+
400: {
|
|
199
|
+
description: 'Unexpected error',
|
|
200
|
+
content: {
|
|
201
|
+
'application/json': {
|
|
202
|
+
schema: {
|
|
203
|
+
$ref: '#/components/schemas/Error',
|
|
204
|
+
},
|
|
205
|
+
},
|
|
206
|
+
},
|
|
207
|
+
},
|
|
208
|
+
},
|
|
209
|
+
},
|
|
210
|
+
post: {
|
|
211
|
+
description: 'Creates a new plant in the store',
|
|
212
|
+
requestBody: {
|
|
213
|
+
description: 'Plant to add to the store',
|
|
214
|
+
content: {
|
|
215
|
+
'application/json': {
|
|
216
|
+
schema: {
|
|
217
|
+
$ref: '#/components/schemas/NewPlant',
|
|
218
|
+
},
|
|
219
|
+
},
|
|
220
|
+
},
|
|
221
|
+
required: true,
|
|
222
|
+
},
|
|
223
|
+
responses: {
|
|
224
|
+
200: {
|
|
225
|
+
description: 'plant response',
|
|
226
|
+
content: {
|
|
227
|
+
'application/json': {
|
|
228
|
+
schema: {
|
|
229
|
+
$ref: '#/components/schemas/Plant',
|
|
230
|
+
},
|
|
231
|
+
},
|
|
232
|
+
},
|
|
233
|
+
},
|
|
234
|
+
400: {
|
|
235
|
+
description: 'unexpected error',
|
|
236
|
+
content: {
|
|
237
|
+
'application/json': {
|
|
238
|
+
schema: {
|
|
239
|
+
$ref: '#/components/schemas/Error',
|
|
240
|
+
},
|
|
241
|
+
},
|
|
242
|
+
},
|
|
243
|
+
},
|
|
244
|
+
},
|
|
245
|
+
},
|
|
246
|
+
},
|
|
247
|
+
'/plants/{id}': {
|
|
248
|
+
delete: {
|
|
249
|
+
description: 'Deletes a single plant based on the ID supplied',
|
|
250
|
+
parameters: [
|
|
251
|
+
{
|
|
252
|
+
name: 'id',
|
|
253
|
+
in: 'path',
|
|
254
|
+
description: 'ID of plant to delete',
|
|
255
|
+
required: true,
|
|
256
|
+
schema: {
|
|
257
|
+
type: 'integer',
|
|
258
|
+
format: 'int64',
|
|
259
|
+
},
|
|
260
|
+
},
|
|
261
|
+
],
|
|
262
|
+
responses: {
|
|
263
|
+
204: {
|
|
264
|
+
description: 'Plant deleted',
|
|
265
|
+
content: {},
|
|
266
|
+
},
|
|
267
|
+
400: {
|
|
268
|
+
description: 'unexpected error',
|
|
269
|
+
content: {
|
|
270
|
+
'application/json': {
|
|
271
|
+
schema: {
|
|
272
|
+
$ref: '#/components/schemas/Error',
|
|
273
|
+
},
|
|
274
|
+
},
|
|
275
|
+
},
|
|
276
|
+
},
|
|
277
|
+
},
|
|
278
|
+
},
|
|
279
|
+
},
|
|
280
|
+
},
|
|
281
|
+
webhooks: {
|
|
282
|
+
newPlant: {
|
|
283
|
+
post: {
|
|
284
|
+
description: 'A new plant has been added to the store',
|
|
285
|
+
requestBody: {
|
|
286
|
+
description: 'Information about a new plant added to the store',
|
|
287
|
+
content: {
|
|
288
|
+
'application/json': {
|
|
289
|
+
schema: {
|
|
290
|
+
$ref: '#/components/schemas/NewPlant',
|
|
291
|
+
},
|
|
292
|
+
},
|
|
293
|
+
},
|
|
294
|
+
},
|
|
295
|
+
responses: {
|
|
296
|
+
200: {
|
|
297
|
+
description: 'Return a 200 status to indicate that the data was received successfully',
|
|
298
|
+
},
|
|
299
|
+
},
|
|
300
|
+
},
|
|
301
|
+
},
|
|
302
|
+
},
|
|
303
|
+
components: {
|
|
304
|
+
schemas: {
|
|
305
|
+
Plant: {
|
|
306
|
+
required: ['name'],
|
|
307
|
+
type: 'object',
|
|
308
|
+
properties: {
|
|
309
|
+
name: {
|
|
310
|
+
description: 'The name of the plant',
|
|
311
|
+
type: 'string',
|
|
312
|
+
},
|
|
313
|
+
tag: {
|
|
314
|
+
description: 'Tag to specify the type',
|
|
315
|
+
type: 'string',
|
|
316
|
+
},
|
|
317
|
+
},
|
|
318
|
+
},
|
|
319
|
+
NewPlant: {
|
|
320
|
+
allOf: [
|
|
321
|
+
{
|
|
322
|
+
$ref: '#/components/schemas/Plant',
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
required: ['id'],
|
|
326
|
+
type: 'object',
|
|
327
|
+
properties: {
|
|
328
|
+
id: {
|
|
329
|
+
description: 'Identification number of the plant',
|
|
330
|
+
type: 'integer',
|
|
331
|
+
format: 'int64',
|
|
332
|
+
},
|
|
333
|
+
},
|
|
334
|
+
},
|
|
335
|
+
],
|
|
336
|
+
},
|
|
337
|
+
Error: {
|
|
338
|
+
required: ['error', 'message'],
|
|
339
|
+
type: 'object',
|
|
340
|
+
properties: {
|
|
341
|
+
error: {
|
|
342
|
+
type: 'integer',
|
|
343
|
+
format: 'int32',
|
|
344
|
+
},
|
|
345
|
+
message: {
|
|
346
|
+
type: 'string',
|
|
347
|
+
},
|
|
348
|
+
},
|
|
349
|
+
},
|
|
350
|
+
},
|
|
351
|
+
securitySchemes: {
|
|
352
|
+
bearerAuth: {
|
|
353
|
+
type: 'http',
|
|
354
|
+
scheme: 'bearer',
|
|
355
|
+
},
|
|
356
|
+
},
|
|
357
|
+
},
|
|
358
|
+
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
|
|
3
|
+
import { DEFAULT_API_GROUP_NAME, DEFAULT_WEBHOOK_GROUP_NAME } from '../src/openapi/common.js';
|
|
4
|
+
import { generateOpenApiPages } from '../src/openapi/generateOpenApiPages.js';
|
|
5
|
+
import {
|
|
6
|
+
emptyDoc,
|
|
7
|
+
simpleDoc,
|
|
8
|
+
docWithTags,
|
|
9
|
+
complexDoc,
|
|
10
|
+
webhooksDoc,
|
|
11
|
+
pathsAndWebhooksDoc,
|
|
12
|
+
} from './fixtures/openapi.js';
|
|
13
|
+
|
|
14
|
+
describe('generateOpenApiPages', () => {
|
|
15
|
+
it('should throw error for empty paths', async () => {
|
|
16
|
+
await expect(generateOpenApiPages(emptyDoc)).rejects.toThrow('No paths defined.');
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it('should generate navigation structure for simple API', async () => {
|
|
20
|
+
const result = await generateOpenApiPages(simpleDoc);
|
|
21
|
+
|
|
22
|
+
// Check nav structure
|
|
23
|
+
expect(result.nav).toHaveLength(1);
|
|
24
|
+
expect(result.nav[0]).toHaveProperty('group', DEFAULT_API_GROUP_NAME);
|
|
25
|
+
expect(result.nav[0]).toHaveProperty('pages');
|
|
26
|
+
|
|
27
|
+
// Check decorated nav structure
|
|
28
|
+
expect(result.decoratedNav).toHaveLength(1);
|
|
29
|
+
expect(result.decoratedNav[0]).toHaveProperty('group', DEFAULT_API_GROUP_NAME);
|
|
30
|
+
expect(result.decoratedNav[0]).toHaveProperty('pages');
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
it('should handle custom group names', async () => {
|
|
34
|
+
const result = await generateOpenApiPages(docWithTags);
|
|
35
|
+
|
|
36
|
+
// Check that the group name matches the tag
|
|
37
|
+
expect(result.nav).toHaveLength(1);
|
|
38
|
+
expect(result.nav[0]).toHaveProperty('group', 'Users');
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
it('should handle multiple paths and methods', async () => {
|
|
42
|
+
const result = await generateOpenApiPages(complexDoc);
|
|
43
|
+
|
|
44
|
+
// Should have two groups (Users and Products)
|
|
45
|
+
expect(result.nav).toHaveLength(2);
|
|
46
|
+
|
|
47
|
+
// Check that pages were generated for all operations
|
|
48
|
+
const allPages = result.nav.flatMap((group) => group.pages);
|
|
49
|
+
expect(allPages).toHaveLength(3); // getUsers, createUser, getProducts
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
it('should handle URL input', async () => {
|
|
53
|
+
const validUrl = new URL('https://api.example.com/openapi.json');
|
|
54
|
+
|
|
55
|
+
// Mock fetch implementation would be needed for this test
|
|
56
|
+
// This is just to show the structure
|
|
57
|
+
await expect(generateOpenApiPages(validUrl)).rejects.toThrow();
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
it('should handle creating pages for webhooks', async () => {
|
|
61
|
+
const result = await generateOpenApiPages(webhooksDoc);
|
|
62
|
+
|
|
63
|
+
expect(result.nav).toHaveLength(1);
|
|
64
|
+
expect(result.nav[0]).toHaveProperty('group', DEFAULT_WEBHOOK_GROUP_NAME);
|
|
65
|
+
expect(result.nav[0]).toHaveProperty('pages');
|
|
66
|
+
expect(result.nav[0]?.pages[0]).toMatch(/webhooks(?:\/|\\)newpet/);
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
it('should handle creating pages for paths and webhooks', async () => {
|
|
70
|
+
const result = await generateOpenApiPages(pathsAndWebhooksDoc);
|
|
71
|
+
|
|
72
|
+
expect(result.nav).toHaveLength(2);
|
|
73
|
+
expect(result.nav[0]).toHaveProperty('group', DEFAULT_API_GROUP_NAME);
|
|
74
|
+
expect(result.nav[0]).toHaveProperty('pages');
|
|
75
|
+
expect(result.nav[1]).toHaveProperty('group', DEFAULT_WEBHOOK_GROUP_NAME);
|
|
76
|
+
expect(result.nav[1]).toHaveProperty('pages');
|
|
77
|
+
expect(result.nav[0]?.pages[0]).toBe('get-plants');
|
|
78
|
+
expect(result.nav[0]?.pages[1]).toBe('post-plants');
|
|
79
|
+
expect(result.nav[0]?.pages[2]).toBe('delete-plants');
|
|
80
|
+
expect(result.nav[1]?.pages[0]).toMatch(/webhooks(?:\/|\\)newplant/);
|
|
81
|
+
});
|
|
82
|
+
});
|
|
@@ -1,46 +1,26 @@
|
|
|
1
|
-
import { OpenAPI } from 'openapi-types';
|
|
1
|
+
import { OpenAPI, OpenAPIV3_1 } from 'openapi-types';
|
|
2
2
|
import { describe, it, expect } from 'vitest';
|
|
3
3
|
|
|
4
|
-
import { DEFAULT_API_GROUP_NAME } from '../src/openapi/common.js';
|
|
4
|
+
import { DEFAULT_API_GROUP_NAME, DEFAULT_WEBHOOK_GROUP_NAME } from '../src/openapi/common.js';
|
|
5
5
|
import { generateOpenApiPagesForDocsConfig } from '../src/openapi/generateOpenApiPagesForDocsConfig.js';
|
|
6
|
+
import {
|
|
7
|
+
emptyDoc,
|
|
8
|
+
simpleDoc,
|
|
9
|
+
docWithTags,
|
|
10
|
+
complexDoc,
|
|
11
|
+
webhooksDoc,
|
|
12
|
+
pathsAndWebhooksDoc,
|
|
13
|
+
} from './fixtures/openapi.js';
|
|
6
14
|
|
|
7
15
|
describe('generateOpenApiPagesForDocsConfig', () => {
|
|
8
16
|
it('should throw error for empty paths', async () => {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
title: 'Test API',
|
|
13
|
-
version: '1.0.0',
|
|
14
|
-
},
|
|
15
|
-
paths: {},
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
await expect(generateOpenApiPagesForDocsConfig(emptyDoc)).rejects.toThrow('No paths defined.');
|
|
17
|
+
await expect(generateOpenApiPagesForDocsConfig(emptyDoc as OpenAPI.Document)).rejects.toThrow(
|
|
18
|
+
'No paths defined.'
|
|
19
|
+
);
|
|
19
20
|
});
|
|
20
21
|
|
|
21
22
|
it('should generate navigation structure for simple API', async () => {
|
|
22
|
-
const simpleDoc
|
|
23
|
-
openapi: '3.0.0',
|
|
24
|
-
info: {
|
|
25
|
-
title: 'Test API',
|
|
26
|
-
version: '1.0.0',
|
|
27
|
-
},
|
|
28
|
-
paths: {
|
|
29
|
-
'/users': {
|
|
30
|
-
get: {
|
|
31
|
-
operationId: 'getUsers',
|
|
32
|
-
summary: 'Get Users',
|
|
33
|
-
responses: {
|
|
34
|
-
'200': {
|
|
35
|
-
description: 'Successful response',
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
const result = await generateOpenApiPagesForDocsConfig(simpleDoc);
|
|
23
|
+
const result = await generateOpenApiPagesForDocsConfig(simpleDoc as OpenAPI.Document);
|
|
44
24
|
|
|
45
25
|
// Check nav structure
|
|
46
26
|
expect(result.nav).toHaveLength(1);
|
|
@@ -54,29 +34,7 @@ describe('generateOpenApiPagesForDocsConfig', () => {
|
|
|
54
34
|
});
|
|
55
35
|
|
|
56
36
|
it('should handle custom group names', async () => {
|
|
57
|
-
const docWithTags
|
|
58
|
-
openapi: '3.0.0',
|
|
59
|
-
info: {
|
|
60
|
-
title: 'Test API',
|
|
61
|
-
version: '1.0.0',
|
|
62
|
-
},
|
|
63
|
-
paths: {
|
|
64
|
-
'/users': {
|
|
65
|
-
get: {
|
|
66
|
-
operationId: 'getUsers',
|
|
67
|
-
summary: 'Get Users',
|
|
68
|
-
tags: ['Users'],
|
|
69
|
-
responses: {
|
|
70
|
-
'200': {
|
|
71
|
-
description: 'Successful response',
|
|
72
|
-
},
|
|
73
|
-
},
|
|
74
|
-
},
|
|
75
|
-
},
|
|
76
|
-
},
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
const result = await generateOpenApiPagesForDocsConfig(docWithTags);
|
|
37
|
+
const result = await generateOpenApiPagesForDocsConfig(docWithTags as OpenAPI.Document);
|
|
80
38
|
|
|
81
39
|
// Check that the group name matches the tag
|
|
82
40
|
expect(result.nav).toHaveLength(1);
|
|
@@ -84,51 +42,7 @@ describe('generateOpenApiPagesForDocsConfig', () => {
|
|
|
84
42
|
});
|
|
85
43
|
|
|
86
44
|
it('should handle multiple paths and methods', async () => {
|
|
87
|
-
const complexDoc
|
|
88
|
-
openapi: '3.0.0',
|
|
89
|
-
info: {
|
|
90
|
-
title: 'Test API',
|
|
91
|
-
version: '1.0.0',
|
|
92
|
-
},
|
|
93
|
-
paths: {
|
|
94
|
-
'/users': {
|
|
95
|
-
get: {
|
|
96
|
-
operationId: 'getUsers',
|
|
97
|
-
summary: 'Get Users',
|
|
98
|
-
tags: ['Users'],
|
|
99
|
-
responses: {
|
|
100
|
-
'200': {
|
|
101
|
-
description: 'Successful response',
|
|
102
|
-
},
|
|
103
|
-
},
|
|
104
|
-
},
|
|
105
|
-
post: {
|
|
106
|
-
operationId: 'createUser',
|
|
107
|
-
summary: 'Create User',
|
|
108
|
-
tags: ['Users'],
|
|
109
|
-
responses: {
|
|
110
|
-
'201': {
|
|
111
|
-
description: 'User created',
|
|
112
|
-
},
|
|
113
|
-
},
|
|
114
|
-
},
|
|
115
|
-
},
|
|
116
|
-
'/products': {
|
|
117
|
-
get: {
|
|
118
|
-
operationId: 'getProducts',
|
|
119
|
-
summary: 'Get Products',
|
|
120
|
-
tags: ['Products'],
|
|
121
|
-
responses: {
|
|
122
|
-
'200': {
|
|
123
|
-
description: 'Successful response',
|
|
124
|
-
},
|
|
125
|
-
},
|
|
126
|
-
},
|
|
127
|
-
},
|
|
128
|
-
},
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
const result = await generateOpenApiPagesForDocsConfig(complexDoc);
|
|
45
|
+
const result = await generateOpenApiPagesForDocsConfig(complexDoc as OpenAPI.Document);
|
|
132
46
|
|
|
133
47
|
// Should have two groups (Users and Products)
|
|
134
48
|
expect(result.nav).toHaveLength(2);
|
|
@@ -146,4 +60,29 @@ describe('generateOpenApiPagesForDocsConfig', () => {
|
|
|
146
60
|
// This is just to show the structure
|
|
147
61
|
await expect(generateOpenApiPagesForDocsConfig(validUrl)).rejects.toThrow();
|
|
148
62
|
});
|
|
63
|
+
|
|
64
|
+
it('should handle creating pages for webhooks', async () => {
|
|
65
|
+
const result = await generateOpenApiPagesForDocsConfig(webhooksDoc as OpenAPIV3_1.Document);
|
|
66
|
+
|
|
67
|
+
expect(result.nav).toHaveLength(1);
|
|
68
|
+
expect(result.nav[0]).toHaveProperty('group', DEFAULT_WEBHOOK_GROUP_NAME);
|
|
69
|
+
expect(result.nav[0]).toHaveProperty('pages');
|
|
70
|
+
expect((result.nav[0] as { pages: string[] }).pages[0]).toMatch(/webhooks(?:\/|\\)newpet/);
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
it('should handle creating pages for paths and webhooks', async () => {
|
|
74
|
+
const result = await generateOpenApiPagesForDocsConfig(
|
|
75
|
+
pathsAndWebhooksDoc as OpenAPIV3_1.Document
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
expect(result.nav).toHaveLength(2);
|
|
79
|
+
expect(result.nav[0]).toHaveProperty('group', DEFAULT_API_GROUP_NAME);
|
|
80
|
+
expect(result.nav[0]).toHaveProperty('pages');
|
|
81
|
+
expect(result.nav[1]).toHaveProperty('group', DEFAULT_WEBHOOK_GROUP_NAME);
|
|
82
|
+
expect(result.nav[1]).toHaveProperty('pages');
|
|
83
|
+
expect((result.nav[0] as { pages: string[] }).pages[0]).toBe('get-plants');
|
|
84
|
+
expect((result.nav[0] as { pages: string[] }).pages[1]).toBe('post-plants');
|
|
85
|
+
expect((result.nav[0] as { pages: string[] }).pages[2]).toBe('delete-plants');
|
|
86
|
+
expect((result.nav[1] as { pages: string[] }).pages[0]).toMatch(/webhooks(?:\/|\\)newplant/);
|
|
87
|
+
});
|
|
149
88
|
});
|
package/bin/openapi/common.d.ts
CHANGED
|
@@ -24,3 +24,5 @@ export type OpenApiPageGenerationResult<N, DN> = {
|
|
|
24
24
|
};
|
|
25
25
|
export declare function processOpenApiPath<N, DN>(path: string, pathItemObject: OpenAPIV3.PathItemObject, schema: OpenAPI.Document, nav: N, decoratedNav: DN, writePromises: Promise<void>[], pagesAcc: Record<string, DecoratedNavigationPage>, options: GenerateOpenApiPagesOptions, findNavGroup: (nav: any, groupName?: string) => any): void;
|
|
26
26
|
export declare const DEFAULT_API_GROUP_NAME = "API Reference";
|
|
27
|
+
export declare const DEFAULT_WEBHOOK_GROUP_NAME = "Webhooks";
|
|
28
|
+
export declare function processOpenApiWebhook<N, DN>(webhook: string, webhookObject: OpenAPIV3.PathItemObject, _schema: OpenAPI.Document, nav: N, decoratedNav: DN, writePromises: Promise<void>[], pagesAcc: Record<string, DecoratedNavigationPage>, options: GenerateOpenApiPagesOptions, findNavGroup: (nav: any, groupName?: string) => any): void;
|
package/bin/openapi/common.js
CHANGED
|
@@ -109,4 +109,43 @@ findNavGroup) {
|
|
|
109
109
|
});
|
|
110
110
|
}
|
|
111
111
|
export const DEFAULT_API_GROUP_NAME = 'API Reference';
|
|
112
|
+
export const DEFAULT_WEBHOOK_GROUP_NAME = 'Webhooks';
|
|
113
|
+
export function processOpenApiWebhook(webhook, webhookObject, _schema, nav, decoratedNav, writePromises, pagesAcc, options,
|
|
114
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
115
|
+
findNavGroup) {
|
|
116
|
+
const openApiFilePathFromRoot = options.openApiFilePath
|
|
117
|
+
? optionallyAddLeadingSlash(options.openApiFilePath)
|
|
118
|
+
: undefined;
|
|
119
|
+
Object.values(OpenAPIV3.HttpMethods).forEach((method) => {
|
|
120
|
+
if (method in webhookObject) {
|
|
121
|
+
const operation = webhookObject[method];
|
|
122
|
+
const groupName = operation?.tags?.[0] ?? DEFAULT_WEBHOOK_GROUP_NAME;
|
|
123
|
+
const title = prepareStringToBeValidFilename(operation?.summary) ??
|
|
124
|
+
`${prepareStringToBeValidFilename(webhook)}`;
|
|
125
|
+
const folder = prepareStringToBeValidFilename(groupName) ?? '';
|
|
126
|
+
const base = join(options.outDir ?? '', folder, title);
|
|
127
|
+
const navGroup = findNavGroup(nav, groupName);
|
|
128
|
+
const decoratedNavGroup = findNavGroup(decoratedNav, groupName);
|
|
129
|
+
const filenameWithoutExtension = generateUniqueFilenameWithoutExtension(navGroup, base);
|
|
130
|
+
const openapiMetaTag = `${openApiFilePathFromRoot ? `${openApiFilePathFromRoot} ` : ''}webhook ${webhook}`;
|
|
131
|
+
const description = operation?.description;
|
|
132
|
+
navGroup.push(filenameWithoutExtension);
|
|
133
|
+
const page = {
|
|
134
|
+
openapi: openapiMetaTag,
|
|
135
|
+
href: resolve('/', filenameWithoutExtension),
|
|
136
|
+
title: slugToTitle(filenameWithoutExtension),
|
|
137
|
+
description,
|
|
138
|
+
version: options.version,
|
|
139
|
+
};
|
|
140
|
+
decoratedNavGroup.push(page);
|
|
141
|
+
pagesAcc[filenameWithoutExtension] = page;
|
|
142
|
+
const targetPath = options.outDirBasePath
|
|
143
|
+
? join(options.outDirBasePath, `${filenameWithoutExtension}.mdx`)
|
|
144
|
+
: `${filenameWithoutExtension}.mdx`;
|
|
145
|
+
if (options.writeFiles && (!fse.pathExistsSync(targetPath) || options.overwrite)) {
|
|
146
|
+
writePromises.push(createOpenApiFrontmatter(targetPath, openapiMetaTag, options.version));
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
}
|
|
112
151
|
//# sourceMappingURL=common.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/openapi/common.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,6BAA6B,EAC7B,yBAAyB,EACzB,WAAW,GACZ,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,GAAG,MAAM,U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