@checkdigit/eslint-athena-plugin 1.0.0-PR.2-dcdf

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 (66) hide show
  1. package/LICENSE.txt +21 -0
  2. package/README.md +17 -0
  3. package/SECURITY.md +13 -0
  4. package/dist-mjs/athena/api-locator.mjs +66 -0
  5. package/dist-mjs/athena/api-matcher.mjs +206 -0
  6. package/dist-mjs/athena/athena.mjs +165 -0
  7. package/dist-mjs/athena/column.mjs +1 -0
  8. package/dist-mjs/athena/context.mjs +21 -0
  9. package/dist-mjs/athena/index.mjs +1 -0
  10. package/dist-mjs/athena/service-table.mjs +45 -0
  11. package/dist-mjs/athena/sql-file.mjs +123 -0
  12. package/dist-mjs/athena/types.mjs +1 -0
  13. package/dist-mjs/athena/validate.mjs +619 -0
  14. package/dist-mjs/athena/visitor.mjs +291 -0
  15. package/dist-mjs/get-documentation-url.mjs +9 -0
  16. package/dist-mjs/index.mjs +56 -0
  17. package/dist-mjs/openapi/deref-schema.mjs +20 -0
  18. package/dist-mjs/openapi/generate-schema.mjs +375 -0
  19. package/dist-mjs/openapi/service-schema-generator.mjs +176 -0
  20. package/dist-mjs/peggy/athena-peggy.mjs +20700 -0
  21. package/dist-mjs/service.mjs +9 -0
  22. package/dist-mjs/sql-parser.mjs +28 -0
  23. package/dist-types/athena/api-locator.d.ts +2 -0
  24. package/dist-types/athena/api-matcher.d.ts +14 -0
  25. package/dist-types/athena/athena.d.ts +5 -0
  26. package/dist-types/athena/column.d.ts +1 -0
  27. package/dist-types/athena/context.d.ts +21 -0
  28. package/dist-types/athena/index.d.ts +8 -0
  29. package/dist-types/athena/service-table.d.ts +8 -0
  30. package/dist-types/athena/sql-file.d.ts +5 -0
  31. package/dist-types/athena/types.d.ts +493 -0
  32. package/dist-types/athena/validate.d.ts +14 -0
  33. package/dist-types/athena/visitor.d.ts +75 -0
  34. package/dist-types/get-documentation-url.d.ts +1 -0
  35. package/dist-types/index.d.ts +5 -0
  36. package/dist-types/openapi/deref-schema.d.ts +1 -0
  37. package/dist-types/openapi/generate-schema.d.ts +33 -0
  38. package/dist-types/openapi/service-schema-generator.d.ts +5 -0
  39. package/dist-types/peggy/athena-peggy.d.ts +13 -0
  40. package/dist-types/service.d.ts +2 -0
  41. package/dist-types/sql-parser.d.ts +25 -0
  42. package/package.json +1 -0
  43. package/src/api/v1/swagger.yml +619 -0
  44. package/src/api/v2/swagger.yml +477 -0
  45. package/src/athena/api-locator.ts +78 -0
  46. package/src/athena/api-matcher.ts +323 -0
  47. package/src/athena/athena.ts +224 -0
  48. package/src/athena/column.ts +4 -0
  49. package/src/athena/context.ts +47 -0
  50. package/src/athena/index.ts +13 -0
  51. package/src/athena/service-table.ts +78 -0
  52. package/src/athena/sql-file.ts +161 -0
  53. package/src/athena/types.ts +568 -0
  54. package/src/athena/validate.ts +902 -0
  55. package/src/athena/visitor.ts +406 -0
  56. package/src/get-documentation-url.ts +7 -0
  57. package/src/index.ts +67 -0
  58. package/src/openapi/deref-schema.ts +20 -0
  59. package/src/openapi/generate-schema.ts +553 -0
  60. package/src/openapi/service-schema-generator.ts +241 -0
  61. package/src/peggy/athena-peggy.ts +22149 -0
  62. package/src/peggy/athena.peggy +2971 -0
  63. package/src/service.ts +11 -0
  64. package/src/services/eslintAthenaPlugin/v1/swagger.schema.deref.json +1931 -0
  65. package/src/services/eslintAthenaPlugin/v2/swagger.schema.deref.json +978 -0
  66. package/src/sql-parser.ts +53 -0
@@ -0,0 +1,619 @@
1
+ openapi: 3.0.0
2
+ info:
3
+ title: Eslint Plugin Service
4
+ description: |
5
+ A service that accepts incoming pings. This is only used for testing.
6
+
7
+ © Check Digit LLC. 2019-2026
8
+ version: 1.0.0
9
+ contact:
10
+ name: Check Digit
11
+ servers:
12
+ - url: /eslint-athena-plugin/v1
13
+
14
+ tags:
15
+ - name: Service Health
16
+ - name: API
17
+
18
+ x-firehose-logged: true
19
+
20
+ paths:
21
+ /ping:
22
+ get:
23
+ description: Test service connectivity
24
+ tags:
25
+ - Service Health
26
+ operationId: ping-get
27
+ responses:
28
+ '200':
29
+ $ref: '#/components/responses/Ping'
30
+ default:
31
+ $ref: '#/components/responses/ServerError'
32
+ head:
33
+ description: Test service connectivity
34
+ tags:
35
+ - Service Health
36
+ operationId: ping-head
37
+ responses:
38
+ '200':
39
+ description: ping HEAD successful
40
+ content:
41
+ application/json:
42
+ schema: {}
43
+ default:
44
+ $ref: '#/components/responses/ServerError'
45
+
46
+ /request/{messageId}:
47
+ put:
48
+ tags:
49
+ - API
50
+ x-firehose-logged: true
51
+ operationId: 'request-put'
52
+ description: Creates a Request resource.
53
+ parameters:
54
+ - $ref: '#/components/parameters/messageId'
55
+ - $ref: '#/components/parameters/createdOn'
56
+ requestBody:
57
+ required: true
58
+ content:
59
+ application/json:
60
+ schema:
61
+ $ref: '#/components/schemas/NewRequest'
62
+ responses:
63
+ '204':
64
+ description: Operation successful.
65
+ content:
66
+ application/json:
67
+ schema: {}
68
+ headers:
69
+ Created-On:
70
+ $ref: '#/components/headers/Created-On'
71
+ Updated-On:
72
+ $ref: '#/components/headers/Updated-On'
73
+ default:
74
+ $ref: '#/components/responses/ServerError'
75
+
76
+ /entry/{entryId}:
77
+ put:
78
+ tags:
79
+ - API
80
+ operationId: 'entry-put'
81
+ x-firehose-logged: true
82
+ description: >-
83
+ Creates a journal entry with a specific id. This operation is
84
+ idempotent.
85
+ parameters:
86
+ - $ref: '#/components/parameters/entryId'
87
+ - $ref: '#/components/parameters/ifMatch'
88
+ - $ref: '#/components/parameters/createdOn'
89
+ - $ref: '#/components/parameters/lastModified'
90
+ requestBody:
91
+ required: true
92
+ content:
93
+ application/json:
94
+ schema:
95
+ $ref: '#/components/schemas/NewEntry'
96
+ responses:
97
+ '204':
98
+ $ref: '#/components/responses/Created'
99
+ '409':
100
+ $ref: '#/components/responses/Conflict'
101
+ '412':
102
+ $ref: '#/components/responses/PreConditionFailed'
103
+ default:
104
+ $ref: '#/components/responses/ServerError'
105
+ get:
106
+ tags:
107
+ - API
108
+ operationId: 'entry-get'
109
+ description: Obtains a journal entry with a specified id.
110
+ parameters:
111
+ - $ref: '#/components/parameters/entryId'
112
+ - $ref: '#/components/parameters/at'
113
+ responses:
114
+ '200':
115
+ description: Entry obtained successfully.
116
+ content:
117
+ application/json:
118
+ schema:
119
+ $ref: '#/components/schemas/ResponseEntry'
120
+ headers:
121
+ Created-On:
122
+ $ref: '#/components/headers/Created-On'
123
+ Updated-On:
124
+ $ref: '#/components/headers/Updated-On'
125
+ Last-Modified:
126
+ $ref: '#/components/headers/Last-Modified'
127
+ '404':
128
+ $ref: '#/components/responses/NotFound'
129
+ default:
130
+ $ref: '#/components/responses/ServerError'
131
+
132
+ /card/{cardId}:
133
+ get:
134
+ tags:
135
+ - API
136
+ operationId: 'card-get'
137
+ description: Retrieves a card by id.
138
+ parameters:
139
+ - $ref: '#/components/parameters/cardId'
140
+ - $ref: '#/components/parameters/at'
141
+ - $ref: '#/components/parameters/publicKeyHashQuery'
142
+ responses:
143
+ '200':
144
+ $ref: '#/components/responses/CardResponse'
145
+ '404':
146
+ $ref: '#/components/responses/NotFound'
147
+ default:
148
+ $ref: '#/components/responses/ServerError'
149
+ put:
150
+ x-firehose-logged: true
151
+ tags:
152
+ - API
153
+ operationId: 'card-put'
154
+ description: Creates a new card.
155
+ parameters:
156
+ - $ref: '#/components/parameters/cardId'
157
+ - $ref: '#/components/parameters/createdOn'
158
+ - $ref: '#/components/parameters/lastModified'
159
+ requestBody:
160
+ $ref: '#/components/requestBodies/NewCardRequest'
161
+ responses:
162
+ '200':
163
+ $ref: '#/components/responses/CardResponse'
164
+ '409':
165
+ $ref: '#/components/responses/Conflict'
166
+ '412':
167
+ $ref: '#/components/responses/PreconditionFailed'
168
+ default:
169
+ $ref: '#/components/responses/ServerError'
170
+
171
+ components:
172
+ schemas:
173
+ Ping:
174
+ type: object
175
+ additionalProperties: false
176
+ required:
177
+ - serverTime
178
+ - v1Only
179
+ properties:
180
+ serverTime:
181
+ type: string
182
+ format: date-time
183
+ description: Current server time
184
+ v1Only:
185
+ type: boolean
186
+ description: Indicates if the server is running in v1-only mode
187
+
188
+ Error:
189
+ type: object
190
+ additionalProperties: false
191
+ description: Error message
192
+ properties:
193
+ message:
194
+ type: string
195
+ code:
196
+ type: string
197
+
198
+ MessageId:
199
+ description: |
200
+ Uniquely identifies a message stored in the platform.
201
+
202
+ A message's request and response are stored and retrieved separately using this identifier.
203
+ type: string
204
+
205
+ NewRequest:
206
+ type: object
207
+ additionalProperties: false
208
+ required:
209
+ - messageId
210
+ - feeDetails
211
+ description: The incoming message request data received from the network to be processed.
212
+ properties:
213
+ messageId:
214
+ $ref: '#/components/schemas/MessageId'
215
+ feeDetails:
216
+ type: array
217
+ description: Details about the fees that went into the transaction and settlement fee amounts
218
+ items:
219
+ $ref: '#/components/schemas/Fee'
220
+
221
+ Fee:
222
+ type: object
223
+ description: Details about the fees applied to the transaction and settlement amounts.
224
+ additionalProperties: false
225
+ required:
226
+ - type
227
+ - application
228
+ - transaction
229
+ - settlement
230
+ properties:
231
+ type:
232
+ $ref: '#/components/schemas/FeeType'
233
+ application:
234
+ $ref: '#/components/schemas/FeeApplication'
235
+ transaction:
236
+ $ref: '#/components/schemas/Amount'
237
+ settlement:
238
+ $ref: '#/components/schemas/Amount'
239
+
240
+ FeeType:
241
+ type: string
242
+ description: The type of fee being applied to the transaction.
243
+ enum:
244
+ - CONVENIENCE
245
+ - TRANSACTION
246
+ - CURRENCY CONVERSION ASSESSMENT
247
+ - ISSUER CURRENCY CONVERSION ASSESSMENT
248
+ - SURCHARGE
249
+ - OPTIONAL ISSUER
250
+ - PROCESSING
251
+ - FOREIGN EXCHANGE
252
+
253
+ FeeApplication:
254
+ type: string
255
+ description: |
256
+ Indicates whether the fee should be applied to a cardholder's account (SETTLE) or recorded for information
257
+ purposes only (MEMO). Examples of MEMO fees are currency conversion fees (already in the settlement amount) and
258
+ interchange fees.
259
+ enum:
260
+ - MEMO
261
+ - SETTLE
262
+
263
+ Amount:
264
+ type: object
265
+ additionalProperties: false
266
+ description: |
267
+ An amount of money in the smallest monetary unit of the specified currency.
268
+ required:
269
+ - amount
270
+ - currency
271
+ properties:
272
+ amount:
273
+ type: string
274
+ pattern: '^[0-9]+$'
275
+ description: The amount of money in the smallest monetary unit of the specified currency.
276
+ currency:
277
+ $ref: '#/components/schemas/Currency'
278
+
279
+ Currency:
280
+ type: string
281
+ description: |
282
+ The alphabetic code that represents the currency.
283
+ enum:
284
+ - AED
285
+ - AFN
286
+
287
+ ResponseEntry:
288
+ type: object
289
+ additionalProperties: false
290
+ required:
291
+ - entryId
292
+ - createdOn
293
+ - postings
294
+ properties:
295
+ entryId:
296
+ type: string
297
+ description: Journal entry ID
298
+ createdOn:
299
+ type: string
300
+ format: date-time
301
+ description: Journal entry creation date/time
302
+ postings:
303
+ type: array
304
+ items:
305
+ $ref: '#/components/schemas/ResponsePost'
306
+
307
+ NewEntry:
308
+ type: object
309
+ additionalProperties: false
310
+ required:
311
+ - postings
312
+ properties:
313
+ postings:
314
+ type: array
315
+ description: List of posts contained within the journal entry.
316
+ items:
317
+ $ref: '#/components/schemas/Post'
318
+ v1OnlyNewEntryProperty:
319
+ type: string
320
+ description: This is a v1-only property for NewEntry schema.
321
+
322
+ Post:
323
+ type: object
324
+ additionalProperties: false
325
+ required:
326
+ - amount
327
+ - currency
328
+ - type
329
+ - createdOn
330
+ - accountId
331
+ properties:
332
+ amount:
333
+ type: string
334
+ currency:
335
+ $ref: '#/components/schemas/Currency'
336
+ type:
337
+ $ref: '#/components/schemas/Type'
338
+ createdOn:
339
+ type: string
340
+ format: date-time
341
+ accountId:
342
+ type: string
343
+ description: account ID
344
+
345
+ ResponsePost:
346
+ type: object
347
+ additionalProperties: false
348
+ required:
349
+ - amount
350
+ - currency
351
+ - type
352
+ - accountId
353
+ - createdOn
354
+ properties:
355
+ amount:
356
+ type: string
357
+ currency:
358
+ $ref: '#/components/schemas/Currency'
359
+ type:
360
+ $ref: '#/components/schemas/Type'
361
+ createdOn:
362
+ type: string
363
+ format: date-time
364
+ accountId:
365
+ type: string
366
+ description: account ID
367
+
368
+ Type:
369
+ type: string
370
+ description: CREDIT or DEBIT
371
+ enum:
372
+ - CREDIT
373
+ - DEBIT
374
+
375
+ CardId:
376
+ type: string
377
+ description: Card identifier
378
+ format: uuid
379
+
380
+ Hash:
381
+ type: string
382
+ format: uuid
383
+ example: '15a85f64-5717-4562-b3fc-2c963f66afa6'
384
+ description: UUID derived using @checkdigit/hash
385
+
386
+ CardResponse:
387
+ type: object
388
+ additionalProperties: false
389
+ required:
390
+ - dataEncryptionKeyId
391
+ - storageKeyId
392
+ - card
393
+ properties:
394
+ encryptedDataEncryptionKey:
395
+ description: |
396
+ Encrypted DEK matching the publicKeyHash sent in the request. Used to decrypt values in the Card object.
397
+ type: string
398
+ card:
399
+ $ref: '#/components/schemas/Card'
400
+
401
+ Card:
402
+ type: object
403
+ additionalProperties: false
404
+ required:
405
+ - last4
406
+ - cardNumber
407
+ - applicationTransactionCounter
408
+ properties:
409
+ last4:
410
+ type: string
411
+ pattern: '^\d+$'
412
+ description: Last four digits of the card number
413
+ minLength: 4
414
+ maxLength: 4
415
+ cardNumber:
416
+ type: string
417
+ description: Encrypted card number (PAN)
418
+ applicationTransactionCounter:
419
+ type: integer
420
+ description: Application transaction counter (ATC) for the card
421
+
422
+ NewCardRequest:
423
+ type: object
424
+ required:
425
+ - dataEncryptionKeyId
426
+ - cardNumberLength
427
+ - newCard
428
+ additionalProperties: false
429
+ properties:
430
+ dataEncryptionKeyId:
431
+ $ref: '#/components/schemas/DataEncryptionKeyId'
432
+ cardNumberLength:
433
+ type: integer
434
+ description: Desired number of digits in the card number.
435
+ minimum: 15
436
+ maximum: 19
437
+ newCard:
438
+ $ref: '#/components/schemas/NewCard'
439
+
440
+ DataEncryptionKeyId:
441
+ type: string
442
+ description: |
443
+ Reference to encryption keys Payment Card Service will use to encrypt the Card object.
444
+ format: uuid
445
+
446
+ NewCard:
447
+ type: object
448
+ additionalProperties: false
449
+ required:
450
+ - serviceCode
451
+ - sequenceNumber
452
+ properties:
453
+ serviceCode:
454
+ type: string
455
+ pattern: '^\d+$'
456
+ description: |
457
+ Used to set general guidelines for how the card can be used, e.g. domestic only or international, online authorizations only, etc.
458
+ minLength: 3
459
+ maxLength: 3
460
+ sequenceNumber:
461
+ type: integer
462
+ description: Used to differentiate issuing the same card and expiration date on multiple plastics.
463
+ minimum: 0
464
+ maximum: 10
465
+
466
+ parameters:
467
+ messageId:
468
+ in: path
469
+ name: messageId
470
+ required: true
471
+ schema:
472
+ $ref: '#/components/schemas/MessageId'
473
+
474
+ createdOn:
475
+ name: Created-On
476
+ in: header
477
+ description: Sets the created-on timestamp for the newly created record.
478
+ required: true
479
+ schema:
480
+ type: string
481
+ format: date-time
482
+
483
+ ifMatch:
484
+ in: header
485
+ name: If-Match
486
+ description: If-Match header
487
+ schema:
488
+ type: string
489
+
490
+ at:
491
+ in: query
492
+ name: at
493
+ description: Returns data createdOn before this time.
494
+ required: true
495
+ schema:
496
+ type: string
497
+ format: date-time
498
+
499
+ entryId:
500
+ in: path
501
+ name: entryId
502
+ description: Unique identifier for an entry.
503
+ required: true
504
+ schema:
505
+ type: string
506
+
507
+ lastModified:
508
+ in: header
509
+ name: Last-Modified
510
+ description: used to set resource creation date.
511
+ required: false
512
+ schema:
513
+ type: string
514
+ format: date-time
515
+
516
+ cardId:
517
+ name: cardId
518
+ in: path
519
+ description: An id unique to each card in uuid format
520
+ required: true
521
+ schema:
522
+ $ref: '#/components/schemas/CardId'
523
+
524
+ publicKeyHashQuery:
525
+ name: publicKeyHashQuery
526
+ in: query
527
+ description: UUID derived from a PEM formatted Public Key using @checkdigit/hash
528
+ required: false
529
+ schema:
530
+ $ref: '#/components/schemas/Hash'
531
+
532
+ requestBodies:
533
+ NewCardRequest:
534
+ required: true
535
+ content:
536
+ application/json:
537
+ schema:
538
+ $ref: '#/components/schemas/NewCardRequest'
539
+
540
+ responses:
541
+ ServerError:
542
+ description: Server Error response
543
+ content:
544
+ application/json:
545
+ schema:
546
+ $ref: '#/components/schemas/Error'
547
+
548
+ Ping:
549
+ description: ping successful response
550
+ content:
551
+ application/json:
552
+ schema:
553
+ $ref: '#/components/schemas/Ping'
554
+
555
+ NotFound:
556
+ description: Requested resource not found.
557
+
558
+ Conflict:
559
+ description: Conflict
560
+
561
+ PreConditionFailed:
562
+ description: Version tag mismatch
563
+
564
+ Created:
565
+ description: Created.
566
+ headers:
567
+ Created-On:
568
+ $ref: '#/components/headers/Created-On'
569
+ Updated-On:
570
+ $ref: '#/components/headers/Updated-On'
571
+ Last-Modified:
572
+ $ref: '#/components/headers/Last-Modified'
573
+
574
+ PreconditionFailed:
575
+ description: Precondition failed
576
+
577
+ CardResponse:
578
+ description: Card retrieved
579
+ content:
580
+ application/json:
581
+ schema:
582
+ $ref: '#/components/schemas/CardResponse'
583
+ headers:
584
+ Last-Modified:
585
+ $ref: '#/components/headers/Last-Modified'
586
+ Created-On:
587
+ $ref: '#/components/headers/Created-On'
588
+ Updated-On:
589
+ $ref: '#/components/headers/Updated-On'
590
+ ETag:
591
+ $ref: '#/components/headers/ETag'
592
+
593
+ headers:
594
+ Created-On:
595
+ description: The created-on timestamp for the record.
596
+ required: true
597
+ schema:
598
+ type: string
599
+ format: date-time
600
+
601
+ Updated-On:
602
+ description: The updated-on timestamp for the existing record.
603
+ required: true
604
+ schema:
605
+ type: string
606
+ format: date-time
607
+
608
+ Last-Modified:
609
+ description: When the resource was created (all resources are immutable).
610
+ required: true
611
+ schema:
612
+ type: string
613
+ format: date-time
614
+
615
+ ETag:
616
+ description: Version information for record
617
+ required: true
618
+ schema:
619
+ type: string