@checkdigit/eslint-plugin 7.17.1 → 7.18.0-PR.143-9946

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 (80) hide show
  1. package/dist-mjs/athena/api-locator.mjs +30 -0
  2. package/dist-mjs/athena/api-matcher.mjs +108 -0
  3. package/dist-mjs/athena/athena.mjs +328 -0
  4. package/dist-mjs/athena/column.mjs +1 -0
  5. package/dist-mjs/athena/context.mjs +21 -0
  6. package/dist-mjs/athena/index.mjs +1 -0
  7. package/dist-mjs/athena/service-table.mjs +32 -0
  8. package/dist-mjs/athena/types.mjs +1 -0
  9. package/dist-mjs/athena/visitor.mjs +258 -0
  10. package/dist-mjs/index.mjs +8 -4
  11. package/dist-mjs/no-status-code-assert.mjs +1 -1
  12. package/dist-mjs/openapi/deref-schema.mjs +14 -0
  13. package/dist-mjs/openapi/generate-schema.mjs +273 -0
  14. package/dist-mjs/openapi/service-schema-generator.mjs +147 -0
  15. package/dist-mjs/peggy/athena-peggy.mjs +20629 -0
  16. package/dist-types/athena/api-locator.d.ts +2 -0
  17. package/dist-types/athena/api-matcher.d.ts +14 -0
  18. package/dist-types/athena/athena.d.ts +6 -0
  19. package/dist-types/athena/column.d.ts +1 -0
  20. package/dist-types/athena/context.d.ts +21 -0
  21. package/dist-types/athena/index.d.ts +8 -0
  22. package/dist-types/athena/service-table.d.ts +8 -0
  23. package/dist-types/athena/types.d.ts +474 -0
  24. package/dist-types/athena/visitor.d.ts +63 -0
  25. package/dist-types/no-status-code-assert.d.ts +1 -1
  26. package/dist-types/openapi/deref-schema.d.ts +1 -0
  27. package/dist-types/openapi/generate-schema.d.ts +33 -0
  28. package/dist-types/openapi/service-schema-generator.d.ts +5 -0
  29. package/dist-types/peggy/athena-peggy.d.ts +13 -0
  30. package/package.json +1 -96
  31. package/src/athena/ATHENA.md +387 -0
  32. package/src/athena/PLAN.md +355 -0
  33. package/src/athena/api-locator.ts +39 -0
  34. package/src/athena/api-matcher.ts +169 -0
  35. package/src/athena/athena.ts +488 -0
  36. package/src/athena/column.ts +2 -0
  37. package/src/athena/context.ts +47 -0
  38. package/src/athena/index.ts +11 -0
  39. package/src/athena/service-table.ts +55 -0
  40. package/src/athena/types.ts +526 -0
  41. package/src/athena/visitor.ts +365 -0
  42. package/src/index.ts +4 -0
  43. package/src/no-side-effects.ts +1 -1
  44. package/src/no-status-code-assert.ts +2 -2
  45. package/src/openapi/deref-schema.ts +14 -0
  46. package/src/openapi/generate-schema.ts +422 -0
  47. package/src/openapi/service-schema-generator.ts +189 -0
  48. package/src/peggy/athena-chat.peggy +608 -0
  49. package/src/peggy/athena-peggy.ts +22078 -0
  50. package/src/peggy/athena.peggy +2967 -0
  51. package/src/require-service-call-response-declaration.ts +2 -2
  52. package/src/services/interchange/v1/swagger.schema.deref.json +849 -0
  53. package/src/services/interchange/v1/swagger.schema.json +473 -0
  54. package/src/services/interchange/v1/swagger.yml +414 -0
  55. package/src/services/ledger/v1/swagger.schema.deref.json +6694 -0
  56. package/src/services/ledger/v1/swagger.schema.json +1820 -0
  57. package/src/services/ledger/v1/swagger.yml +1094 -0
  58. package/src/services/link/v1/swagger.schema.deref.json +648 -0
  59. package/src/services/link/v1/swagger.schema.json +444 -0
  60. package/src/services/link/v1/swagger.yml +343 -0
  61. package/src/services/message/v1/swagger.schema.deref.json +22049 -0
  62. package/src/services/message/v1/swagger.schema.json +3470 -0
  63. package/src/services/message/v1/swagger.yml +2798 -0
  64. package/src/services/message/v2/swagger.schema.deref.json +72221 -0
  65. package/src/services/message/v2/swagger.schema.json +3558 -0
  66. package/src/services/message/v2/swagger.yml +3009 -0
  67. package/src/services/paymentCard/v1/swagger.schema.deref.json +4346 -0
  68. package/src/services/paymentCard/v1/swagger.schema.json +2181 -0
  69. package/src/services/paymentCard/v1/swagger.yml +1161 -0
  70. package/src/services/paymentCard/v2/swagger.schema.deref.json +4336 -0
  71. package/src/services/paymentCard/v2/swagger.schema.json +2155 -0
  72. package/src/services/paymentCard/v2/swagger.yml +1149 -0
  73. package/src/services/person/v1/swagger.schema.deref.json +6786 -0
  74. package/src/services/person/v1/swagger.schema.json +1445 -0
  75. package/src/services/person/v1/swagger.yml +1157 -0
  76. package/src/services/teampayApproval/v1/swagger.schema.deref.json +9898 -0
  77. package/src/services/teampayCardManagement/v1/swagger.schema.deref.json +6187 -0
  78. package/src/services/teampayClientManagement/v1/swagger.schema.deref.json +4914 -0
  79. package/src/services/teampayClientManagement/v1/swagger.schema.json +1964 -0
  80. package/src/services/teampayClientManagement/v1/swagger.yml +1376 -0
@@ -0,0 +1,526 @@
1
+ // Type definitions for node-sql-parser 1.0
2
+ // Project: https://github.com/taozhi8833998/node-sql-parser#readme
3
+ // Definitions by: taozhi8833998 <https://github.com/taozhi8833998>
4
+ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5
+ // TypeScript Version: 2.4
6
+
7
+ /* eslint-disable @typescript-eslint/no-explicit-any */
8
+ /* eslint-disable @typescript-eslint/no-redundant-type-constituents */
9
+
10
+ export interface With {
11
+ name: { value: string };
12
+ stmt: {
13
+ _parentheses?: boolean;
14
+ tableList: string[];
15
+ columnList: string[];
16
+ ast: Select;
17
+ };
18
+ columns?: any[];
19
+ }
20
+ interface Location {
21
+ line: number;
22
+ column: number;
23
+ offset: number;
24
+ }
25
+
26
+ interface LocationRange {
27
+ start: Location;
28
+ end: Location;
29
+ }
30
+
31
+ export type WhilteListCheckMode = 'table' | 'column';
32
+ export interface ParseOptions {
33
+ includeLocations?: boolean;
34
+ }
35
+ export interface Option {
36
+ database?: string;
37
+ type?: string;
38
+ trimQuery?: boolean;
39
+ parseOptions?: ParseOptions;
40
+ }
41
+ export interface TableColumnAst {
42
+ tableList: string[];
43
+ columnList: string[];
44
+ ast: AST[] | AST;
45
+ loc?: LocationRange;
46
+ }
47
+ export interface BaseFrom {
48
+ db: string | null;
49
+ table: string;
50
+ as: string | null;
51
+ schema?: string;
52
+ loc?: LocationRange;
53
+ }
54
+ export interface Join extends BaseFrom {
55
+ join: 'INNER JOIN' | 'LEFT JOIN' | 'RIGHT JOIN';
56
+ using?: string[];
57
+ on?: Binary;
58
+ }
59
+ export interface TableExpr {
60
+ expr: {
61
+ ast: Select;
62
+ };
63
+ as?: string | null;
64
+ parentheses: boolean | { length: number };
65
+ }
66
+ export interface Dual {
67
+ type: 'dual';
68
+ loc?: LocationRange;
69
+ }
70
+ export type From = BaseFrom | Join | TableExpr | Dual;
71
+ export interface LimitValue {
72
+ type: string;
73
+ value: number;
74
+ loc?: LocationRange;
75
+ }
76
+ export interface Limit {
77
+ seperator: string;
78
+ value: LimitValue[];
79
+ loc?: LocationRange;
80
+ }
81
+ export interface OrderBy {
82
+ type: 'ASC' | 'DESC';
83
+ expr: any;
84
+ loc?: LocationRange;
85
+ }
86
+
87
+ export interface ValueExpr<T = string | number | boolean> {
88
+ type:
89
+ | 'backticks_quote_string'
90
+ | 'string'
91
+ | 'regex_string'
92
+ | 'hex_string'
93
+ | 'full_hex_string'
94
+ | 'natural_string'
95
+ | 'bit_string'
96
+ | 'double_quote_string'
97
+ | 'single_quote_string'
98
+ | 'boolean'
99
+ | 'bool'
100
+ | 'null'
101
+ | 'star'
102
+ | 'param'
103
+ | 'origin'
104
+ | 'date'
105
+ | 'datetime'
106
+ | 'default'
107
+ | 'time'
108
+ | 'timestamp'
109
+ | 'var_string';
110
+ value: T;
111
+ }
112
+
113
+ export interface ColumnRefItem {
114
+ type: 'column_ref';
115
+ table: string | null;
116
+ column: string | { expr: ValueExpr };
117
+ options?: ExprList;
118
+ loc?: LocationRange;
119
+ }
120
+ export interface ColumnRefExpr {
121
+ type: 'expr';
122
+ expr: ColumnRefItem;
123
+ as: string | null;
124
+ }
125
+
126
+ export type ColumnRef = ColumnRefItem | ColumnRefExpr;
127
+ export interface SetList {
128
+ column: string;
129
+ value: any;
130
+ table: string | null;
131
+ loc?: LocationRange;
132
+ }
133
+ export interface InsertReplaceValue {
134
+ type: 'expr_list';
135
+ value: any[];
136
+ loc?: LocationRange;
137
+ }
138
+
139
+ export interface Star {
140
+ type: 'star';
141
+ value: '*' | '';
142
+ loc?: LocationRange;
143
+ }
144
+ export interface Case {
145
+ type: 'case';
146
+ expr: null;
147
+ args: (
148
+ | {
149
+ cond: Binary;
150
+ result: ExpressionValue;
151
+ type: 'when';
152
+ }
153
+ | {
154
+ result: ExpressionValue;
155
+ type: 'else';
156
+ }
157
+ )[];
158
+ }
159
+ export interface Cast {
160
+ type: 'cast';
161
+ keyword: 'cast';
162
+ expr: ExpressionValue;
163
+ symbol: 'as';
164
+ target: {
165
+ dataType: string;
166
+ suffix: unknown[];
167
+ };
168
+ }
169
+ export interface AggrFunc {
170
+ type: 'aggr_func';
171
+ name: string;
172
+ args: {
173
+ expr: ExpressionValue;
174
+ distinct: 'DISTINCT' | null;
175
+ orderby: OrderBy[] | null;
176
+ parentheses?: boolean;
177
+ };
178
+ loc?: LocationRange;
179
+ }
180
+
181
+ export interface FunctionName {
182
+ schema?: { value: string; type: string };
183
+ name: ValueExpr<string>[];
184
+ }
185
+ export interface Function {
186
+ type: 'function';
187
+ name: FunctionName;
188
+ args?: ExprList;
189
+ suffix?: any;
190
+ loc?: LocationRange;
191
+ }
192
+ export interface Column {
193
+ expr: ExpressionValue;
194
+ as: ValueExpr<string> | string | null;
195
+ type?: string;
196
+ loc?: LocationRange;
197
+ }
198
+
199
+ export interface Interval {
200
+ type: 'interval';
201
+ unit: string;
202
+ expr: ValueExpr & { loc?: LocationRange };
203
+ }
204
+
205
+ export interface Param {
206
+ type: 'param';
207
+ value: string;
208
+ loc?: LocationRange;
209
+ }
210
+
211
+ export interface Value {
212
+ type: string;
213
+ value: any;
214
+ loc?: LocationRange;
215
+ }
216
+
217
+ export interface Binary {
218
+ type: 'binary_expr';
219
+ operator: string;
220
+ left: ExpressionValue | ExprList;
221
+ right: ExpressionValue | ExprList;
222
+ loc?: LocationRange;
223
+ parentheses?: boolean;
224
+ }
225
+
226
+ export type Expr = Binary;
227
+
228
+ export type ExpressionValue = ColumnRef | Param | Function | Case | AggrFunc | Value | Binary | Cast | Interval;
229
+
230
+ export interface ExprList {
231
+ type: 'expr_list';
232
+ value: ExpressionValue[];
233
+ loc?: LocationRange;
234
+ parentheses?: boolean;
235
+ separator?: string;
236
+ }
237
+
238
+ export type PartitionBy = {
239
+ type: 'expr';
240
+ expr: ColumnRef[];
241
+ }[];
242
+
243
+ export interface WindowSpec {
244
+ name: null;
245
+ partitionby: PartitionBy;
246
+ orderby: OrderBy[] | null;
247
+ window_frame_clause: string | null;
248
+ }
249
+
250
+ export type AsWindowSpec = string | { window_specification: WindowSpec; parentheses: boolean };
251
+
252
+ export interface NamedWindowExpr {
253
+ name: string;
254
+ as_window_specification: AsWindowSpec;
255
+ }
256
+
257
+ export interface WindowExpr {
258
+ keyword: 'window';
259
+ type: 'window';
260
+ expr: NamedWindowExpr[];
261
+ }
262
+
263
+ export interface Select {
264
+ with: With[] | null;
265
+ type: 'select';
266
+ options: any[] | null;
267
+ distinct: 'DISTINCT' | null;
268
+ columns: any[] | Column[];
269
+ from: From[] | TableExpr | null;
270
+ where: Binary | Function | null;
271
+ groupby: { columns: ColumnRef[] | null; modifiers: ValueExpr<string>[] };
272
+ having: any[] | null;
273
+ orderby: OrderBy[] | null;
274
+ limit: Limit | null;
275
+ window?: WindowExpr;
276
+ qualify?: any[] | null;
277
+ _orderby?: OrderBy[] | null;
278
+ _limit?: Limit | null;
279
+ parentheses_symbol?: boolean;
280
+ _parentheses?: boolean;
281
+ loc?: LocationRange;
282
+ _next?: Select;
283
+ set_op?: string;
284
+ }
285
+ export interface Insert_Replace {
286
+ type: 'replace' | 'insert';
287
+ table: any;
288
+ columns: string[] | null;
289
+ values: InsertReplaceValue[] | Select;
290
+ partition: any[];
291
+ prefix: string;
292
+ on_duplicate_update: {
293
+ keyword: 'on duplicate key update';
294
+ set: SetList[];
295
+ };
296
+ loc?: LocationRange;
297
+ }
298
+ export interface Update {
299
+ type: 'update';
300
+ db: string | null;
301
+ table: (From | Dual)[] | null;
302
+ set: SetList[];
303
+ where: Binary | Function | null;
304
+ loc?: LocationRange;
305
+ }
306
+ export interface Delete {
307
+ type: 'delete';
308
+ table: any;
309
+ from: (From | Dual)[];
310
+ where: Binary | Function | null;
311
+ loc?: LocationRange;
312
+ }
313
+
314
+ export interface Alter {
315
+ type: 'alter';
316
+ table: From[];
317
+ expr: any;
318
+ loc?: LocationRange;
319
+ }
320
+
321
+ export interface Use {
322
+ type: 'use';
323
+ db: string;
324
+ loc?: LocationRange;
325
+ }
326
+
327
+ type KW_UNSIGNED = 'UNSIGNED';
328
+ type KW_ZEROFILL = 'ZEROFILL';
329
+
330
+ type Timezone = ['WITHOUT' | 'WITH', 'TIME', 'ZONE'];
331
+
332
+ interface KeywordComment {
333
+ type: 'comment';
334
+ keyword: 'comment';
335
+ symbol?: '=';
336
+ value: string;
337
+ }
338
+
339
+ interface CollateExpr {
340
+ type: 'collate';
341
+ symbol?: '=';
342
+ value: string;
343
+ }
344
+
345
+ interface DataType {
346
+ dataType: string;
347
+ length?: number;
348
+ parentheses?: true;
349
+ suffix?: Timezone | (KW_UNSIGNED | KW_ZEROFILL)[];
350
+ array?: 'one' | 'two';
351
+ }
352
+
353
+ interface LiteralNotNull {
354
+ type: 'not null';
355
+ value: 'not null';
356
+ }
357
+
358
+ interface LiteralNull {
359
+ type: 'null';
360
+ value: null;
361
+ }
362
+
363
+ type LiteralNumeric = number | { type: 'bigint'; value: string };
364
+
365
+ interface ColumnConstraint {
366
+ default_val: {
367
+ type: 'default';
368
+ value: any;
369
+ };
370
+ nullable: LiteralNotNull | LiteralNull;
371
+ }
372
+
373
+ interface ColumnDefinitionOptList {
374
+ nullable?: ColumnConstraint['nullable'];
375
+ default_val?: ColumnConstraint['default_val'];
376
+ auto_increment?: 'auto_increment';
377
+ unique?: 'unique' | 'unique key';
378
+ primary?: 'key' | 'primary key';
379
+ comment?: KeywordComment;
380
+ collate?: { collate: CollateExpr };
381
+ column_format?: { column_format: any };
382
+ storage?: { storage: any };
383
+ reference_definition?: { reference_definition: any };
384
+ character_set?: { type: 'CHARACTER SET'; value: string; symbol?: '=' };
385
+ }
386
+
387
+ type CreateColumnDefinition = {
388
+ column: ColumnRef;
389
+ definition: DataType;
390
+ resource: 'column';
391
+ } & ColumnDefinitionOptList;
392
+
393
+ interface IndexType {
394
+ keyword: 'using';
395
+ type: 'btree' | 'hash' | 'gist' | 'gin';
396
+ }
397
+
398
+ interface IndexOption {
399
+ type: 'key_block_size';
400
+ symbol?: '=';
401
+ expr: LiteralNumeric;
402
+ }
403
+
404
+ interface CreateIndexDefinition {
405
+ index?: string;
406
+ definition: ColumnRef[];
407
+ keyword: 'index' | 'key';
408
+ index_type?: IndexType;
409
+ resource: 'index';
410
+ index_options?: IndexOption[];
411
+ }
412
+
413
+ interface CreateFulltextSpatialIndexDefinition {
414
+ index?: string;
415
+ definition: ColumnRef[];
416
+ keyword?: 'fulltext' | 'spatial' | 'fulltext key' | 'spatial key' | 'fulltext index' | 'spatial index';
417
+ index_options?: IndexOption[];
418
+ resource: 'index';
419
+ }
420
+
421
+ interface ConstraintName {
422
+ keyword: 'constraint';
423
+ constraint: string;
424
+ }
425
+
426
+ interface CreateConstraintPrimary {
427
+ constraint?: ConstraintName['constraint'];
428
+ definition: ColumnRef[];
429
+ constraint_type: 'primary key';
430
+ keyword?: ConstraintName['keyword'];
431
+ index_type?: IndexType;
432
+ resource: 'constraint';
433
+ index_options?: IndexOption[];
434
+ }
435
+
436
+ interface CreateConstraintUnique {
437
+ constraint?: ConstraintName['constraint'];
438
+ definition: ColumnRef[];
439
+ constraint_type: 'unique key' | 'unique' | 'unique index';
440
+ keyword?: ConstraintName['keyword'];
441
+ index_type?: IndexType;
442
+ index?: string;
443
+ resource: 'constraint';
444
+ index_options?: IndexOption[];
445
+ }
446
+
447
+ interface CreateConstraintForeign {
448
+ constraint?: ConstraintName['constraint'];
449
+ definition: ColumnRef[];
450
+ constraint_type: 'FOREIGN KEY';
451
+ keyword?: ConstraintName['keyword'];
452
+ index?: string;
453
+ resource: 'constraint';
454
+ reference_definition?: any;
455
+ }
456
+
457
+ interface CreateConstraintCheck {
458
+ constraint?: ConstraintName['constraint'];
459
+ definition: any[];
460
+ constraint_type: 'check';
461
+ keyword?: ConstraintName['keyword'];
462
+ resource: 'constraint';
463
+ }
464
+
465
+ type CreateConstraintDefinition =
466
+ | CreateConstraintPrimary
467
+ | CreateConstraintUnique
468
+ | CreateConstraintForeign
469
+ | CreateConstraintCheck;
470
+
471
+ type CreateDefinition =
472
+ | CreateColumnDefinition
473
+ | CreateIndexDefinition
474
+ | CreateFulltextSpatialIndexDefinition
475
+ | CreateConstraintDefinition;
476
+
477
+ export interface Create {
478
+ type: 'create';
479
+ keyword: 'table' | 'index' | 'database';
480
+ temporary?: 'temporary' | null;
481
+ table?: { db: string; table: string }[];
482
+ if_not_exists?: 'if not exists' | null;
483
+ like?: {
484
+ type: 'like';
485
+ table: string;
486
+ parentheses?: boolean;
487
+ } | null;
488
+ ignore_replace?: 'ignore' | 'replace' | null;
489
+ as?: string | null;
490
+ query_expr?: any | null;
491
+ create_definitions?: CreateDefinition[] | null;
492
+ table_options?: any[] | null;
493
+ index_using?: {
494
+ keyword: 'using';
495
+ type: 'btree' | 'hash';
496
+ } | null;
497
+ index?: string | null;
498
+ on_kw?: 'on' | null;
499
+ index_columns?: any[] | null;
500
+ index_type?: 'unique' | 'fulltext' | 'spatial' | null;
501
+ index_options?: any[] | null;
502
+ algorithm_option?: {
503
+ type: 'alter';
504
+ keyword: 'algorithm';
505
+ resource: 'algorithm';
506
+ symbol: '=' | null;
507
+ algorithm: 'default' | 'instant' | 'inplace' | 'copy';
508
+ } | null;
509
+ lock_option?: {
510
+ type: 'alter';
511
+ keyword: 'lock';
512
+ resource: 'lock';
513
+ symbol: '=' | null;
514
+ lock: 'default' | 'none' | 'shared' | 'exclusive';
515
+ } | null;
516
+ database?: string;
517
+ loc?: LocationRange;
518
+ }
519
+
520
+ export interface Drop {
521
+ type: 'drop';
522
+ keyword: string;
523
+ name: any[];
524
+ }
525
+
526
+ export type AST = Use | Select | Insert_Replace | Update | Delete | Alter | Create | Drop;