@crvouga/mockingbird-service-rxvortex 1.8.1 → 2.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/openapi.yaml ADDED
@@ -0,0 +1,579 @@
1
+ openapi: 3.1.0
2
+ info:
3
+ title: RxVortex (Strive) pharmacy API (Mockingbird subset)
4
+ description: |
5
+ Stateful mock subset of the RxVortex / Strive compounding-pharmacy API: client-credentials
6
+ token, order submit, status, cancel, lookup by sender order id (recovery), and the preset
7
+ catalog. Hand-authored from the consumer's adapters (the vendor publishes no spec).
8
+ version: "1"
9
+ x-mockingbird-upstream:
10
+ note: >-
11
+ Hand-authored from the wire shapes our consumer reads and writes
12
+ (rxvortex-auth.service.ts, rxvortex-fulfillment.adapter.ts, rxvortex-live.client.ts).
13
+ servers:
14
+ - url: https://sandbox.rxvortex.com
15
+ security:
16
+ - bearerAuth: []
17
+ paths:
18
+ /api/v1/generate-access-token:
19
+ post:
20
+ operationId: GenerateAccessToken
21
+ security: []
22
+ x-mockingbird:
23
+ supported: true
24
+ parity:
25
+ enabled: true
26
+ safe: true
27
+ requestBody:
28
+ required: true
29
+ content:
30
+ application/json:
31
+ schema:
32
+ type: object
33
+ required: [client_id, client_secret]
34
+ properties:
35
+ client_id:
36
+ type: string
37
+ minLength: 1
38
+ maxLength: 64
39
+ client_secret:
40
+ type: string
41
+ minLength: 1
42
+ maxLength: 64
43
+ responses:
44
+ "200":
45
+ description: Access token
46
+ content:
47
+ application/json:
48
+ schema:
49
+ $ref: "#/components/schemas/TokenResponse"
50
+ "401":
51
+ description: Bad credentials
52
+ content:
53
+ application/json:
54
+ schema:
55
+ $ref: "#/components/schemas/ErrorBody"
56
+ "422":
57
+ description: Validation failed
58
+ content:
59
+ application/json:
60
+ schema:
61
+ $ref: "#/components/schemas/ValidationError"
62
+ /api/v1/orders:
63
+ post:
64
+ operationId: CreateOrder
65
+ x-mockingbird:
66
+ supported: true
67
+ parity:
68
+ enabled: true
69
+ safe: false
70
+ requestBody:
71
+ required: true
72
+ content:
73
+ application/json:
74
+ schema:
75
+ $ref: "#/components/schemas/CreateOrderBody"
76
+ responses:
77
+ "200":
78
+ description: Order accepted
79
+ content:
80
+ application/json:
81
+ schema:
82
+ $ref: "#/components/schemas/CreateOrderResponse"
83
+ "401":
84
+ description: Unauthenticated
85
+ content:
86
+ application/json:
87
+ schema:
88
+ $ref: "#/components/schemas/ErrorBody"
89
+ "409":
90
+ description: Duplicate sender_order_id
91
+ content:
92
+ application/json:
93
+ schema:
94
+ $ref: "#/components/schemas/ErrorBody"
95
+ "422":
96
+ description: Validation failed
97
+ content:
98
+ application/json:
99
+ schema:
100
+ $ref: "#/components/schemas/ValidationError"
101
+ /api/v1/orders/{orderId}:
102
+ parameters:
103
+ - name: orderId
104
+ in: path
105
+ required: true
106
+ description: The vendor order tracking id, or the sender order id (our payment id).
107
+ schema:
108
+ type: string
109
+ x-mockingbird-resource-ref:
110
+ type: order
111
+ missing: RXV-00000000-MISSING
112
+ get:
113
+ operationId: GetOrder
114
+ x-mockingbird:
115
+ supported: true
116
+ parity:
117
+ enabled: true
118
+ safe: true
119
+ responses:
120
+ "200":
121
+ description: Order status
122
+ content:
123
+ application/json:
124
+ schema:
125
+ $ref: "#/components/schemas/OrderStatus"
126
+ "401":
127
+ description: Unauthenticated
128
+ content:
129
+ application/json:
130
+ schema:
131
+ $ref: "#/components/schemas/ErrorBody"
132
+ "404":
133
+ description: Unknown order
134
+ content:
135
+ application/json:
136
+ schema:
137
+ $ref: "#/components/schemas/ErrorBody"
138
+ delete:
139
+ operationId: CancelOrder
140
+ x-mockingbird:
141
+ supported: true
142
+ parity:
143
+ enabled: true
144
+ safe: false
145
+ responses:
146
+ "200":
147
+ description: Cancelled
148
+ content:
149
+ application/json:
150
+ schema:
151
+ $ref: "#/components/schemas/CancelResponse"
152
+ "401":
153
+ description: Unauthenticated
154
+ content:
155
+ application/json:
156
+ schema:
157
+ $ref: "#/components/schemas/ErrorBody"
158
+ "404":
159
+ description: Unknown order
160
+ content:
161
+ application/json:
162
+ schema:
163
+ $ref: "#/components/schemas/ErrorBody"
164
+ "409":
165
+ description: Not cancellable in its current status
166
+ content:
167
+ application/json:
168
+ schema:
169
+ $ref: "#/components/schemas/ErrorBody"
170
+ /api/v1/preset-catalog-items:
171
+ get:
172
+ operationId: ListPresetCatalogItems
173
+ x-mockingbird:
174
+ supported: true
175
+ parity:
176
+ enabled: true
177
+ safe: true
178
+ responses:
179
+ "200":
180
+ description: Preset catalog
181
+ content:
182
+ application/json:
183
+ schema:
184
+ type: object
185
+ required: [data]
186
+ properties:
187
+ data:
188
+ type: array
189
+ items:
190
+ $ref: "#/components/schemas/CatalogItem"
191
+ "401":
192
+ description: Unauthenticated
193
+ content:
194
+ application/json:
195
+ schema:
196
+ $ref: "#/components/schemas/ErrorBody"
197
+ components:
198
+ securitySchemes:
199
+ bearerAuth:
200
+ type: http
201
+ scheme: bearer
202
+ schemas:
203
+ TokenResponse:
204
+ type: object
205
+ required: [access_token, token_type, expires_in]
206
+ properties:
207
+ access_token:
208
+ type: string
209
+ x-mockingbird-volatile:
210
+ kind: token
211
+ token_type:
212
+ type: string
213
+ enum: [Bearer]
214
+ expires_in:
215
+ type: integer
216
+ Address:
217
+ type: object
218
+ required: [line1, city, state, postal_code, country]
219
+ properties:
220
+ line1:
221
+ type: string
222
+ minLength: 1
223
+ maxLength: 80
224
+ line2:
225
+ type: string
226
+ maxLength: 80
227
+ city:
228
+ type: string
229
+ minLength: 1
230
+ maxLength: 40
231
+ state:
232
+ type: string
233
+ pattern: "^[A-Z]{2}$"
234
+ postal_code:
235
+ type: string
236
+ pattern: "^[0-9]{5}(-[0-9]{4})?$"
237
+ country:
238
+ type: string
239
+ enum: [US]
240
+ Patient:
241
+ type: object
242
+ required: [sender_patient_id, first_name, last_name, dob, gender, email, phone, address]
243
+ properties:
244
+ sender_patient_id:
245
+ type: string
246
+ minLength: 1
247
+ maxLength: 64
248
+ first_name:
249
+ type: string
250
+ minLength: 1
251
+ maxLength: 40
252
+ last_name:
253
+ type: string
254
+ minLength: 1
255
+ maxLength: 40
256
+ dob:
257
+ type: string
258
+ pattern: "^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$"
259
+ gender:
260
+ type: string
261
+ enum: [male, female]
262
+ email:
263
+ type: string
264
+ format: email
265
+ maxLength: 120
266
+ phone:
267
+ type: string
268
+ pattern: "^[0-9]{3}-[0-9]{3}-[0-9]{4}$"
269
+ address:
270
+ $ref: "#/components/schemas/Address"
271
+ Prescriber:
272
+ type: object
273
+ required: [first_name, last_name, npi]
274
+ properties:
275
+ first_name:
276
+ type: string
277
+ minLength: 1
278
+ maxLength: 40
279
+ last_name:
280
+ type: string
281
+ minLength: 1
282
+ maxLength: 40
283
+ npi:
284
+ type: string
285
+ pattern: "^[0-9]{10}$"
286
+ dea_number:
287
+ type: string
288
+ maxLength: 20
289
+ license_number:
290
+ type: string
291
+ maxLength: 20
292
+ license_state:
293
+ type: string
294
+ maxLength: 2
295
+ phone:
296
+ type: string
297
+ maxLength: 20
298
+ address:
299
+ $ref: "#/components/schemas/Address"
300
+ MedicationRequest:
301
+ type: object
302
+ required:
303
+ - type
304
+ - preset_catalog_id
305
+ - sender_med_request_id
306
+ - medication_name
307
+ - quantity
308
+ - quantity_units
309
+ - days_supply_duration
310
+ - refills
311
+ - instructions
312
+ properties:
313
+ type:
314
+ type: string
315
+ enum: [new]
316
+ preset_catalog_id:
317
+ type: string
318
+ x-mockingbird-resource-ref:
319
+ type: catalog_item
320
+ missing: 00000000-0000-4000-8000-000000000000
321
+ sender_med_request_id:
322
+ type: string
323
+ minLength: 1
324
+ maxLength: 64
325
+ medication_name:
326
+ type: string
327
+ minLength: 1
328
+ maxLength: 120
329
+ medication_strength:
330
+ type: string
331
+ maxLength: 60
332
+ medication_form:
333
+ type: string
334
+ maxLength: 40
335
+ quantity:
336
+ type: number
337
+ exclusiveMinimum: 0
338
+ maximum: 1000
339
+ quantity_units:
340
+ type: string
341
+ enum: [mL, grams, each]
342
+ days_supply_duration:
343
+ type: integer
344
+ minimum: 1
345
+ maximum: 365
346
+ refills:
347
+ type: integer
348
+ minimum: 0
349
+ maximum: 12
350
+ instructions:
351
+ type: string
352
+ minLength: 1
353
+ maxLength: 500
354
+ note:
355
+ type: string
356
+ maxLength: 1000
357
+ authored_on_datetime:
358
+ type: string
359
+ maxLength: 40
360
+ clinical_difference:
361
+ type: string
362
+ maxLength: 1000
363
+ schedule_code:
364
+ type: string
365
+ enum: ["2", "3", "4", "5"]
366
+ ClinicalList:
367
+ type: object
368
+ properties:
369
+ has_known_allergies:
370
+ type: boolean
371
+ has_known_diseases:
372
+ type: boolean
373
+ has_known_medications:
374
+ type: boolean
375
+ entries:
376
+ type: array
377
+ maxItems: 5
378
+ items:
379
+ type: object
380
+ required: [description]
381
+ properties:
382
+ description:
383
+ type: string
384
+ maxLength: 200
385
+ CreateOrderBody:
386
+ type: object
387
+ required: [patient, prescriber, order, medication_requests]
388
+ properties:
389
+ patient:
390
+ $ref: "#/components/schemas/Patient"
391
+ prescriber:
392
+ $ref: "#/components/schemas/Prescriber"
393
+ order:
394
+ type: object
395
+ required: [bill_to, ship_to, sender_order_id]
396
+ properties:
397
+ bill_to:
398
+ type: string
399
+ enum: [practice, patient]
400
+ ship_to:
401
+ type: string
402
+ enum: [patient, practice]
403
+ sender_order_id:
404
+ type: string
405
+ minLength: 1
406
+ maxLength: 64
407
+ medication_requests:
408
+ type: array
409
+ minItems: 1
410
+ maxItems: 3
411
+ items:
412
+ $ref: "#/components/schemas/MedicationRequest"
413
+ clinical:
414
+ type: object
415
+ properties:
416
+ allergies:
417
+ $ref: "#/components/schemas/ClinicalList"
418
+ diseases:
419
+ $ref: "#/components/schemas/ClinicalList"
420
+ medications:
421
+ $ref: "#/components/schemas/ClinicalList"
422
+ shipment:
423
+ type: object
424
+ properties:
425
+ recipient_first_name:
426
+ type: string
427
+ maxLength: 40
428
+ recipient_last_name:
429
+ type: string
430
+ maxLength: 40
431
+ recipient_email:
432
+ type: string
433
+ maxLength: 80
434
+ recipient_phone:
435
+ type: string
436
+ maxLength: 20
437
+ address:
438
+ $ref: "#/components/schemas/Address"
439
+ CreateOrderResponse:
440
+ type: object
441
+ required: [success, message, order_tracking_id, sender_order_id, status]
442
+ properties:
443
+ success:
444
+ type: boolean
445
+ message:
446
+ type: string
447
+ order_tracking_id:
448
+ type: string
449
+ x-mockingbird-resource:
450
+ type: order
451
+ identity: true
452
+ x-mockingbird-volatile:
453
+ kind: id
454
+ sender_order_id:
455
+ type: string
456
+ status:
457
+ type: string
458
+ OrderStatus:
459
+ type: object
460
+ required:
461
+ - order_tracking_id
462
+ - tracking_id
463
+ - orderReferenceID
464
+ - sender_order_id
465
+ - rxstatus
466
+ - orderstatus
467
+ - shipping_status
468
+ - cancellable
469
+ - created_at
470
+ - updated_at
471
+ properties:
472
+ order_tracking_id:
473
+ type: string
474
+ x-mockingbird-volatile:
475
+ kind: id
476
+ tracking_id:
477
+ type: string
478
+ x-mockingbird-volatile:
479
+ kind: id
480
+ orderReferenceID:
481
+ type: string
482
+ x-mockingbird-volatile:
483
+ kind: id
484
+ sender_order_id:
485
+ type: string
486
+ rxstatus:
487
+ type: string
488
+ orderstatus:
489
+ type: string
490
+ shipping_status:
491
+ type: string
492
+ delivered_date:
493
+ type: ["string", "null"]
494
+ trackingnumber:
495
+ type: ["string", "null"]
496
+ shippingservice:
497
+ type: ["string", "null"]
498
+ shippingcarrier:
499
+ type: ["string", "null"]
500
+ shipmenttrackingurl:
501
+ type: ["string", "null"]
502
+ cancellable:
503
+ type: boolean
504
+ created_at:
505
+ type: string
506
+ x-mockingbird-volatile:
507
+ kind: timestamp
508
+ updated_at:
509
+ type: string
510
+ x-mockingbird-volatile:
511
+ kind: timestamp
512
+ CancelResponse:
513
+ type: object
514
+ required: [success, message, order_tracking_id, rxstatus]
515
+ properties:
516
+ success:
517
+ type: boolean
518
+ message:
519
+ type: string
520
+ order_tracking_id:
521
+ type: string
522
+ x-mockingbird-volatile:
523
+ kind: id
524
+ rxstatus:
525
+ type: string
526
+ CatalogItem:
527
+ type: object
528
+ required: [catalog_id, medication_name, status]
529
+ properties:
530
+ catalog_id:
531
+ type: string
532
+ x-mockingbird-resource:
533
+ type: catalog_item
534
+ identity: true
535
+ medication_name:
536
+ type: string
537
+ medication_strength:
538
+ type: ["string", "null"]
539
+ package_size:
540
+ type: ["string", "null"]
541
+ quantity:
542
+ type: ["number", "null"]
543
+ quantity_units:
544
+ type: ["string", "null"]
545
+ medication_form:
546
+ type: ["string", "null"]
547
+ route:
548
+ type: ["string", "null"]
549
+ states:
550
+ type: array
551
+ items:
552
+ type: string
553
+ status:
554
+ type: string
555
+ enum: [active, inactive]
556
+ ErrorBody:
557
+ type: object
558
+ required: [message]
559
+ properties:
560
+ message:
561
+ type: string
562
+ success:
563
+ type: boolean
564
+ ValidationError:
565
+ type: object
566
+ required: [message, errors]
567
+ properties:
568
+ message:
569
+ type: string
570
+ errors:
571
+ oneOf:
572
+ - type: object
573
+ additionalProperties:
574
+ type: array
575
+ items:
576
+ type: string
577
+ - type: array
578
+ items:
579
+ type: object
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crvouga/mockingbird-service-rxvortex",
3
- "version": "1.8.1",
3
+ "version": "2.0.0",
4
4
  "description": "Stateful mock of the RxVortex (Strive) pharmacy API: OAuth token, order submit, status, cancel, recovery by sender order id, preset catalog, and signed status webhooks.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -8,7 +8,10 @@
8
8
  "files": [
9
9
  "dist",
10
10
  "README.md",
11
- "CHANGELOG.md"
11
+ "CHANGELOG.md",
12
+ "DISCOVERY.md",
13
+ "SUPPORT.md",
14
+ "openapi.yaml"
12
15
  ],
13
16
  "main": "./dist/index.js",
14
17
  "types": "./dist/index.d.ts",
@@ -57,7 +60,29 @@
57
60
  "description": "RxVortex is a pharmacy order platform whose API lets telehealth partners submit, track and cancel prescription orders with pharmacies such as Strive."
58
61
  },
59
62
  "parity": "Orders and status webhooks",
60
- "parityTier": "cold"
63
+ "parityTier": "cold",
64
+ "discovery": {
65
+ "guide": "DISCOVERY.md",
66
+ "behavior": "README.md",
67
+ "capabilities": "SUPPORT.md",
68
+ "contract": "openapi.yaml",
69
+ "types": "dist/index.d.ts",
70
+ "oracle": {
71
+ "kind": "Live vendor API or sandbox",
72
+ "command": "bun run parity:service -- rxvortex",
73
+ "note": "Run from a Mockingbird checkout; credentials come only from .env.local or GitHub Actions secrets. Missing credentials exit 2."
74
+ },
75
+ "introspection": [
76
+ "GET /__admin/health",
77
+ "GET /__admin",
78
+ "GET /__admin/state",
79
+ "GET /__admin/requests",
80
+ "GET /__admin/metrics",
81
+ "GET /__admin/faults/presets",
82
+ "GET /__admin/ui"
83
+ ],
84
+ "reporting": "https://github.com/crvouga/mockingbird/blob/main/docs/REPORTING_ISSUES.md"
85
+ }
61
86
  },
62
87
  "scripts": {
63
88
  "generate": "bun ../../openapi/codegen/dist/cli.js",
@@ -72,7 +97,7 @@
72
97
  "pack:check": "bun ../../../scripts/pack-check.ts"
73
98
  },
74
99
  "dependencies": {
75
- "@crvouga/mockingbird-service-sqlite": "1.3.0",
100
+ "@crvouga/mockingbird-service-sqlite": "2.0.0",
76
101
  "hono": "4.11.9"
77
102
  },
78
103
  "devDependencies": {