@voyant-travel/openapi 0.0.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 ADDED
@@ -0,0 +1,40 @@
1
+ # @voyant-travel/openapi
2
+
3
+ The generated **OpenAPI 3.1** specification for the Voyant framework's standard
4
+ API surface. This package ships JSON only — it has no runtime dependencies.
5
+
6
+ ## What's in it
7
+
8
+ The spec is generated from the framework's standard module composition, so it is
9
+ the union of every standard module's `createRoute(...).openapi(...)` contract at
10
+ its real mounted path. Deployment-specific routes (a starter's payment-provider
11
+ webhooks, niche modules like MICE or cruises) are **not** included — this is the
12
+ portable framework contract, not any one deployment's surface.
13
+
14
+ | Export | File | Surface |
15
+ | --- | --- | --- |
16
+ | `@voyant-travel/openapi` | `spec/framework-openapi.json` | everything (admin + storefront + legacy) |
17
+ | `@voyant-travel/openapi/admin` | `spec/framework-admin.json` | `/v1/admin/*` |
18
+ | `@voyant-travel/openapi/storefront` | `spec/framework-storefront.json` | `/v1/public/*` |
19
+
20
+ ```ts
21
+ import frameworkSpec from "@voyant-travel/openapi"
22
+ import adminSpec from "@voyant-travel/openapi/admin"
23
+ ```
24
+
25
+ A docs site (or any consumer) depends on this package like any other and reads
26
+ the JSON — a decoupled producer→consumer relationship with no cross-repo wiring.
27
+
28
+ ## Regenerating
29
+
30
+ The committed `spec/*.json` files are the source of truth and are guarded by a
31
+ drift gate: `pnpm --filter @voyant-travel/openapi test` regenerates the docs
32
+ in-memory and fails if they differ from what's committed. After an intentional
33
+ framework route change:
34
+
35
+ ```sh
36
+ pnpm --filter @voyant-travel/openapi generate
37
+ ```
38
+
39
+ This composes the framework-only app (with stub providers — no request is ever
40
+ served) and rewrites the artifacts. See voyant#2114.
package/package.json ADDED
@@ -0,0 +1,37 @@
1
+ {
2
+ "name": "@voyant-travel/openapi",
3
+ "version": "0.0.0",
4
+ "license": "Apache-2.0",
5
+ "description": "Generated OpenAPI 3.1 specification for the Voyant framework's standard API surface (admin + storefront).",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/voyant-travel/voyant.git",
9
+ "directory": "packages/openapi"
10
+ },
11
+ "type": "module",
12
+ "exports": {
13
+ ".": "./spec/framework-openapi.json",
14
+ "./admin": "./spec/framework-admin.json",
15
+ "./storefront": "./spec/framework-storefront.json"
16
+ },
17
+ "files": [
18
+ "spec"
19
+ ],
20
+ "scripts": {
21
+ "typecheck": "tsc --noEmit",
22
+ "lint": "biome check src/",
23
+ "test": "vitest run",
24
+ "generate": "UPDATE_OPENAPI=1 vitest run"
25
+ },
26
+ "publishConfig": {
27
+ "access": "public"
28
+ },
29
+ "devDependencies": {
30
+ "@hono/zod-openapi": "^1.4.0",
31
+ "@voyant-travel/framework": "workspace:^",
32
+ "@voyant-travel/hono": "workspace:^",
33
+ "@voyant-travel/voyant-typescript-config": "workspace:^",
34
+ "typescript": "^6.0.2",
35
+ "vitest": "4.1.2"
36
+ }
37
+ }
@@ -0,0 +1,480 @@
1
+ {
2
+ "openapi": "3.1.0",
3
+ "info": {
4
+ "title": "Voyant Framework API",
5
+ "version": "0.0.0",
6
+ "description": "Generated from the Voyant framework's standard module composition. Do not edit by hand."
7
+ },
8
+ "components": {
9
+ "schemas": {},
10
+ "parameters": {}
11
+ },
12
+ "paths": {
13
+ "/v1/admin/promotions": {
14
+ "get": {
15
+ "parameters": [
16
+ {
17
+ "schema": {
18
+ "anyOf": [
19
+ {
20
+ "type": "string",
21
+ "enum": [
22
+ "true"
23
+ ]
24
+ },
25
+ {
26
+ "type": "string",
27
+ "enum": [
28
+ "false"
29
+ ]
30
+ }
31
+ ]
32
+ },
33
+ "required": false,
34
+ "name": "active",
35
+ "in": "query"
36
+ },
37
+ {
38
+ "schema": {
39
+ "type": "string",
40
+ "minLength": 1,
41
+ "maxLength": 80
42
+ },
43
+ "required": false,
44
+ "name": "code",
45
+ "in": "query"
46
+ },
47
+ {
48
+ "schema": {
49
+ "type": "string",
50
+ "minLength": 1,
51
+ "maxLength": 200
52
+ },
53
+ "required": false,
54
+ "name": "search",
55
+ "in": "query"
56
+ },
57
+ {
58
+ "schema": {
59
+ "type": "string",
60
+ "enum": [
61
+ "auto",
62
+ "code"
63
+ ]
64
+ },
65
+ "required": false,
66
+ "name": "applicationMode",
67
+ "in": "query"
68
+ },
69
+ {
70
+ "schema": {
71
+ "type": "string",
72
+ "enum": [
73
+ "active",
74
+ "scheduled",
75
+ "expired",
76
+ "archived"
77
+ ]
78
+ },
79
+ "required": false,
80
+ "name": "status",
81
+ "in": "query"
82
+ },
83
+ {
84
+ "schema": {
85
+ "type": "string",
86
+ "enum": [
87
+ "global",
88
+ "products",
89
+ "categories",
90
+ "destinations",
91
+ "markets",
92
+ "audiences",
93
+ "fare_codes",
94
+ "cabin_grades"
95
+ ]
96
+ },
97
+ "required": false,
98
+ "name": "scopeKind",
99
+ "in": "query"
100
+ },
101
+ {
102
+ "schema": {
103
+ "type": "string",
104
+ "format": "date"
105
+ },
106
+ "required": false,
107
+ "name": "validFrom",
108
+ "in": "query"
109
+ },
110
+ {
111
+ "schema": {
112
+ "type": "string",
113
+ "format": "date"
114
+ },
115
+ "required": false,
116
+ "name": "validUntil",
117
+ "in": "query"
118
+ },
119
+ {
120
+ "schema": {
121
+ "type": "integer",
122
+ "exclusiveMinimum": 0,
123
+ "maximum": 200,
124
+ "default": 50
125
+ },
126
+ "required": false,
127
+ "name": "limit",
128
+ "in": "query"
129
+ },
130
+ {
131
+ "schema": {
132
+ "type": [
133
+ "integer",
134
+ "null"
135
+ ],
136
+ "minimum": 0,
137
+ "default": 0
138
+ },
139
+ "required": false,
140
+ "name": "offset",
141
+ "in": "query"
142
+ }
143
+ ],
144
+ "responses": {
145
+ "200": {
146
+ "description": "Paginated list of promotional offers",
147
+ "content": {
148
+ "application/json": {
149
+ "schema": {
150
+ "type": "object",
151
+ "properties": {
152
+ "data": {
153
+ "type": "array",
154
+ "items": {
155
+ "type": "object",
156
+ "properties": {
157
+ "id": {
158
+ "type": "string"
159
+ },
160
+ "name": {
161
+ "type": "string"
162
+ },
163
+ "slug": {
164
+ "type": "string"
165
+ },
166
+ "description": {
167
+ "type": [
168
+ "string",
169
+ "null"
170
+ ]
171
+ },
172
+ "discountType": {
173
+ "type": "string",
174
+ "enum": [
175
+ "percentage",
176
+ "fixed_amount"
177
+ ]
178
+ },
179
+ "discountPercent": {
180
+ "type": [
181
+ "string",
182
+ "null"
183
+ ]
184
+ },
185
+ "discountAmountCents": {
186
+ "type": [
187
+ "integer",
188
+ "null"
189
+ ]
190
+ },
191
+ "currency": {
192
+ "type": [
193
+ "string",
194
+ "null"
195
+ ]
196
+ },
197
+ "scope": {
198
+ "oneOf": [
199
+ {
200
+ "type": "object",
201
+ "properties": {
202
+ "kind": {
203
+ "type": "string",
204
+ "enum": [
205
+ "global"
206
+ ]
207
+ }
208
+ },
209
+ "required": [
210
+ "kind"
211
+ ]
212
+ },
213
+ {
214
+ "type": "object",
215
+ "properties": {
216
+ "kind": {
217
+ "type": "string",
218
+ "enum": [
219
+ "products"
220
+ ]
221
+ },
222
+ "productIds": {
223
+ "type": "array",
224
+ "items": {
225
+ "type": "string",
226
+ "minLength": 1
227
+ },
228
+ "minItems": 1
229
+ }
230
+ },
231
+ "required": [
232
+ "kind",
233
+ "productIds"
234
+ ]
235
+ },
236
+ {
237
+ "type": "object",
238
+ "properties": {
239
+ "kind": {
240
+ "type": "string",
241
+ "enum": [
242
+ "categories"
243
+ ]
244
+ },
245
+ "categoryIds": {
246
+ "type": "array",
247
+ "items": {
248
+ "type": "string",
249
+ "minLength": 1
250
+ },
251
+ "minItems": 1
252
+ }
253
+ },
254
+ "required": [
255
+ "kind",
256
+ "categoryIds"
257
+ ]
258
+ },
259
+ {
260
+ "type": "object",
261
+ "properties": {
262
+ "kind": {
263
+ "type": "string",
264
+ "enum": [
265
+ "destinations"
266
+ ]
267
+ },
268
+ "destinationIds": {
269
+ "type": "array",
270
+ "items": {
271
+ "type": "string",
272
+ "minLength": 1
273
+ },
274
+ "minItems": 1
275
+ }
276
+ },
277
+ "required": [
278
+ "kind",
279
+ "destinationIds"
280
+ ]
281
+ },
282
+ {
283
+ "type": "object",
284
+ "properties": {
285
+ "kind": {
286
+ "type": "string",
287
+ "enum": [
288
+ "markets"
289
+ ]
290
+ },
291
+ "marketIds": {
292
+ "type": "array",
293
+ "items": {
294
+ "type": "string",
295
+ "minLength": 1
296
+ },
297
+ "minItems": 1
298
+ }
299
+ },
300
+ "required": [
301
+ "kind",
302
+ "marketIds"
303
+ ]
304
+ },
305
+ {
306
+ "type": "object",
307
+ "properties": {
308
+ "kind": {
309
+ "type": "string",
310
+ "enum": [
311
+ "audiences"
312
+ ]
313
+ },
314
+ "audiences": {
315
+ "type": "array",
316
+ "items": {
317
+ "type": "string",
318
+ "enum": [
319
+ "staff",
320
+ "customer",
321
+ "partner",
322
+ "supplier"
323
+ ]
324
+ },
325
+ "minItems": 1
326
+ }
327
+ },
328
+ "required": [
329
+ "kind",
330
+ "audiences"
331
+ ]
332
+ },
333
+ {
334
+ "type": "object",
335
+ "properties": {
336
+ "kind": {
337
+ "type": "string",
338
+ "enum": [
339
+ "fare_codes"
340
+ ]
341
+ },
342
+ "fareCodes": {
343
+ "type": "array",
344
+ "items": {
345
+ "type": "string",
346
+ "minLength": 1
347
+ },
348
+ "minItems": 1
349
+ }
350
+ },
351
+ "required": [
352
+ "kind",
353
+ "fareCodes"
354
+ ]
355
+ },
356
+ {
357
+ "type": "object",
358
+ "properties": {
359
+ "kind": {
360
+ "type": "string",
361
+ "enum": [
362
+ "cabin_grades"
363
+ ]
364
+ },
365
+ "cabinGradeCodes": {
366
+ "type": "array",
367
+ "items": {
368
+ "type": "string",
369
+ "minLength": 1
370
+ },
371
+ "minItems": 1
372
+ }
373
+ },
374
+ "required": [
375
+ "kind",
376
+ "cabinGradeCodes"
377
+ ]
378
+ }
379
+ ]
380
+ },
381
+ "conditions": {
382
+ "type": "object",
383
+ "properties": {
384
+ "minPax": {
385
+ "type": "integer",
386
+ "exclusiveMinimum": 0
387
+ },
388
+ "pastGuestOnly": {
389
+ "type": "boolean"
390
+ },
391
+ "soloTravelerOnly": {
392
+ "type": "boolean"
393
+ },
394
+ "childTravelerOnly": {
395
+ "type": "boolean"
396
+ },
397
+ "familyOnly": {
398
+ "type": "boolean"
399
+ }
400
+ }
401
+ },
402
+ "validFrom": {
403
+ "type": [
404
+ "string",
405
+ "null"
406
+ ]
407
+ },
408
+ "validUntil": {
409
+ "type": [
410
+ "string",
411
+ "null"
412
+ ]
413
+ },
414
+ "code": {
415
+ "type": [
416
+ "string",
417
+ "null"
418
+ ]
419
+ },
420
+ "stackable": {
421
+ "type": "boolean"
422
+ },
423
+ "active": {
424
+ "type": "boolean"
425
+ },
426
+ "metadata": {},
427
+ "createdAt": {
428
+ "type": "string"
429
+ },
430
+ "updatedAt": {
431
+ "type": "string"
432
+ }
433
+ },
434
+ "required": [
435
+ "id",
436
+ "name",
437
+ "slug",
438
+ "description",
439
+ "discountType",
440
+ "discountPercent",
441
+ "discountAmountCents",
442
+ "currency",
443
+ "scope",
444
+ "conditions",
445
+ "validFrom",
446
+ "validUntil",
447
+ "code",
448
+ "stackable",
449
+ "active",
450
+ "createdAt",
451
+ "updatedAt"
452
+ ]
453
+ }
454
+ },
455
+ "total": {
456
+ "type": "integer"
457
+ },
458
+ "limit": {
459
+ "type": "integer"
460
+ },
461
+ "offset": {
462
+ "type": "integer"
463
+ }
464
+ },
465
+ "required": [
466
+ "data",
467
+ "total",
468
+ "limit",
469
+ "offset"
470
+ ]
471
+ }
472
+ }
473
+ }
474
+ }
475
+ }
476
+ }
477
+ }
478
+ },
479
+ "webhooks": {}
480
+ }