-
Notifications
You must be signed in to change notification settings - Fork 381
Expand file tree
/
Copy pathclient.ts
More file actions
1264 lines (1052 loc) · 30.9 KB
/
client.ts
File metadata and controls
1264 lines (1052 loc) · 30.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/**
* Generated by orval v7.9.0 🍺
* Do not edit manually.
* FastAPI
* OpenAPI spec version: 0.1.0
*/
import { fetchAPI } from './instance'
export type ApiExceptionPayloadStatus = number | null
export type ApiExceptionPayloadTrigger = string | null
export type ApiExceptionPayloadType = string | null
export type ApiExceptionPayloadDescription = string | null
export type ApiExceptionPayloadTraceback = string | null
export type ApiExceptionPayloadStack = string[] | null
export interface ApiExceptionPayload {
timestamp: number
message: string
origin: string
status?: ApiExceptionPayloadStatus
trigger?: ApiExceptionPayloadTrigger
type?: ApiExceptionPayloadType
description?: ApiExceptionPayloadDescription
traceback?: ApiExceptionPayloadTraceback
stack?: ApiExceptionPayloadStack
}
export interface BackfillDetails {
name: string
view_name: string
node_type?: NodeType
parents?: string[]
interval: string[]
batches: number
}
export type BackfillTaskEnd = number | null
export type BackfillTaskInterval = string[] | null
export interface BackfillTask {
name: string
view_name: string
node_type?: NodeType
parents?: string[]
completed: number
total: number
start: number
end?: BackfillTaskEnd
interval?: BackfillTaskInterval
}
export type BodyInitiateApplyApiCommandsApplyPostEnvironment = string | null
export type BodyInitiateApplyApiCommandsApplyPostPlanDates = PlanDates | null
export type BodyInitiateApplyApiCommandsApplyPostPlanOptions =
PlanOptions | null
export type BodyInitiateApplyApiCommandsApplyPostCategoriesAnyOf = {
[key: string]: SnapshotChangeCategory
}
export type BodyInitiateApplyApiCommandsApplyPostCategories =
BodyInitiateApplyApiCommandsApplyPostCategoriesAnyOf | null
export interface BodyInitiateApplyApiCommandsApplyPost {
environment?: BodyInitiateApplyApiCommandsApplyPostEnvironment
plan_dates?: BodyInitiateApplyApiCommandsApplyPostPlanDates
plan_options?: BodyInitiateApplyApiCommandsApplyPostPlanOptions
categories?: BodyInitiateApplyApiCommandsApplyPostCategories
}
export type BodyInitiatePlanApiPlanPostEnvironment = string | null
export type BodyInitiatePlanApiPlanPostPlanDates = PlanDates | null
export type BodyInitiatePlanApiPlanPostPlanOptions = PlanOptions | null
export type BodyInitiatePlanApiPlanPostCategoriesAnyOf = {
[key: string]: SnapshotChangeCategory
}
export type BodyInitiatePlanApiPlanPostCategories =
BodyInitiatePlanApiPlanPostCategoriesAnyOf | null
export interface BodyInitiatePlanApiPlanPost {
environment?: BodyInitiatePlanApiPlanPostEnvironment
plan_dates?: BodyInitiatePlanApiPlanPostPlanDates
plan_options?: BodyInitiatePlanApiPlanPostPlanOptions
categories?: BodyInitiatePlanApiPlanPostCategories
}
export type BodyWriteDirectoryApiDirectoriesPathPostNewPath = string | null
export interface BodyWriteDirectoryApiDirectoriesPathPost {
new_path?: BodyWriteDirectoryApiDirectoriesPathPostNewPath
}
export type BodyWriteFileApiFilesPathPostNewPath = string | null
export interface BodyWriteFileApiFilesPathPost {
content?: string
new_path?: BodyWriteFileApiFilesPathPostNewPath
}
export type ChangeDirectChangeCategory = SnapshotChangeCategory | null
export interface ChangeDirect {
name: string
view_name: string
node_type?: NodeType
parents?: string[]
diff: string
indirect?: ChangeDisplay[]
direct?: ChangeDisplay[]
change_category?: ChangeDirectChangeCategory
}
export interface ChangeDisplay {
name: string
view_name: string
node_type?: NodeType
parents?: string[]
}
export interface ChangeIndirect {
name: string
view_name: string
node_type?: NodeType
parents?: string[]
}
export type ColumnDescription = string | null
export interface Column {
name: string
type: string
description?: ColumnDescription
}
export interface Directory {
name: string
path: string
directories?: Directory[]
files?: File[]
}
export type EnvironmentStartAt = string | string | string | number | number
export type EnvironmentEndAt = string | string | string | number | number | null
export type EnvironmentPreviousPlanId = string | null
export type EnvironmentExpirationTs = number | null
export type EnvironmentFinalizedTs = number | null
export type EnvironmentCatalogNameOverride = string | null
export type EnvironmentPromotedSnapshotIds = unknown[] | null
export type EnvironmentPreviousFinalizedSnapshots = unknown[] | null
export type EnvironmentRequirements = { [key: string]: string }
/**
* Represents an isolated environment.
Environments are isolated workspaces that hold pointers to physical tables.
Args:
snapshots: The snapshots that are part of this environment.
promoted_snapshot_ids: The IDs of the snapshots that are promoted in this environment
(i.e. for which the views are created). If not specified, all snapshots are promoted.
previous_finalized_snapshots: Snapshots that were part of this environment last time it was finalized.
requirements: A mapping of library versions for all the snapshots in this environment.
*/
export interface Environment {
name?: string
start_at: EnvironmentStartAt
end_at?: EnvironmentEndAt
plan_id: string
previous_plan_id?: EnvironmentPreviousPlanId
expiration_ts?: EnvironmentExpirationTs
finalized_ts?: EnvironmentFinalizedTs
suffix_target?: EnvironmentSuffixTarget
catalog_name_override?: EnvironmentCatalogNameOverride
normalize_name?: boolean
gateway_managed?: boolean
snapshots: unknown[]
promoted_snapshot_ids?: EnvironmentPromotedSnapshotIds
previous_finalized_snapshots?: EnvironmentPreviousFinalizedSnapshots
requirements?: EnvironmentRequirements
}
export type EnvironmentSuffixTarget =
(typeof EnvironmentSuffixTarget)[keyof typeof EnvironmentSuffixTarget]
// eslint-disable-next-line @typescript-eslint/no-redeclare
export const EnvironmentSuffixTarget = {
schema: 'schema',
table: 'table',
} as const
export type EnvironmentsEnvironments = { [key: string]: Environment }
export interface Environments {
environments?: EnvironmentsEnvironments
pinned_environments?: string[]
default_target_environment?: string
}
export type EvaluateInputStart = string | string | string | number | number
export type EvaluateInputEnd = string | string | string | number | number
export type EvaluateInputExecutionTime =
| string
| string
| string
| number
| number
export interface EvaluateInput {
model: string
start: EvaluateInputStart
end: EvaluateInputEnd
execution_time: EvaluateInputExecutionTime
limit?: number
}
export interface FetchdfInput {
sql: string
limit?: number
}
export type FileContent = string | null
export interface File {
name: string
path: string
extension?: string
content?: FileContent
}
export interface HTTPValidationError {
detail?: ValidationError[]
}
/**
* IntervalUnit is the inferred granularity of an incremental node.
IntervalUnit can be one of 5 types, YEAR, MONTH, DAY, HOUR, MINUTE. The unit is inferred
based on the cron schedule of a node. The minimum time delta between a sample set of dates
is used to determine which unit a node's schedule is.
*/
export type IntervalUnit = (typeof IntervalUnit)[keyof typeof IntervalUnit]
// eslint-disable-next-line @typescript-eslint/no-redeclare
export const IntervalUnit = {
year: 'year',
month: 'month',
day: 'day',
hour: 'hour',
half_hour: 'half_hour',
quarter_hour: 'quarter_hour',
five_minute: 'five_minute',
} as const
export type LineageColumnSource = string | null
export type LineageColumnExpression = string | null
export type LineageColumnModels = { [key: string]: string[] }
export interface LineageColumn {
source?: LineageColumnSource
expression?: LineageColumnExpression
models: LineageColumnModels
}
export interface Meta {
version: string
has_running_task?: boolean
}
export type ModelPath = string | null
export type ModelFullPath = string | null
export type ModelDescription = string | null
export type ModelDetailsProperty = ModelDetails | null
export type ModelSql = string | null
export type ModelDefinition = string | null
export type ModelDefaultCatalog = string | null
export interface Model {
name: string
fqn: string
path?: ModelPath
full_path?: ModelFullPath
dialect: string
type: ModelType
columns: Column[]
description?: ModelDescription
details?: ModelDetailsProperty
sql?: ModelSql
definition?: ModelDefinition
default_catalog?: ModelDefaultCatalog
hash: string
}
export type ModelDetailsOwner = string | null
export type ModelDetailsKind = string | null
export type ModelDetailsBatchSize = number | null
export type ModelDetailsCron = string | null
export type ModelDetailsStamp =
| string
| string
| string
| number
| number
| null
export type ModelDetailsStart =
| string
| string
| string
| number
| number
| null
export type ModelDetailsRetention = number | null
export type ModelDetailsTableFormat = string | null
export type ModelDetailsStorageFormat = string | null
export type ModelDetailsTimeColumn = string | null
export type ModelDetailsTags = string | null
export type ModelDetailsPartitionedBy = string | null
export type ModelDetailsClusteredBy = string | null
export type ModelDetailsLookback = number | null
export type ModelDetailsCronPrev =
| string
| string
| string
| number
| number
| null
export type ModelDetailsCronNext =
| string
| string
| string
| number
| number
| null
export type ModelDetailsIntervalUnit = IntervalUnit | null
export type ModelDetailsAnnotated = boolean | null
export interface ModelDetails {
owner?: ModelDetailsOwner
kind?: ModelDetailsKind
batch_size?: ModelDetailsBatchSize
cron?: ModelDetailsCron
stamp?: ModelDetailsStamp
start?: ModelDetailsStart
retention?: ModelDetailsRetention
table_format?: ModelDetailsTableFormat
storage_format?: ModelDetailsStorageFormat
time_column?: ModelDetailsTimeColumn
tags?: ModelDetailsTags
references?: Reference[]
partitioned_by?: ModelDetailsPartitionedBy
clustered_by?: ModelDetailsClusteredBy
lookback?: ModelDetailsLookback
cron_prev?: ModelDetailsCronPrev
cron_next?: ModelDetailsCronNext
interval_unit?: ModelDetailsIntervalUnit
annotated?: ModelDetailsAnnotated
}
export type ModelType = (typeof ModelType)[keyof typeof ModelType]
// eslint-disable-next-line @typescript-eslint/no-redeclare
export const ModelType = {
python: 'python',
sql: 'sql',
seed: 'seed',
external: 'external',
source: 'source',
} as const
export interface ModelsDiff {
direct?: ChangeDirect[]
indirect?: ChangeIndirect[]
metadata?: ChangeDisplay[]
}
export type Modules = (typeof Modules)[keyof typeof Modules]
// eslint-disable-next-line @typescript-eslint/no-redeclare
export const Modules = {
editor: 'editor',
files: 'files',
'data-catalog': 'data-catalog',
plans: 'plans',
tests: 'tests',
audits: 'audits',
errors: 'errors',
data: 'data',
lineage: 'lineage',
} as const
export type NodeType = (typeof NodeType)[keyof typeof NodeType]
// eslint-disable-next-line @typescript-eslint/no-redeclare
export const NodeType = {
model: 'model',
audit: 'audit',
} as const
export type PlanApplyStageTrackerStart =
| string
| string
| string
| number
| number
| null
export type PlanApplyStageTrackerEnd =
| string
| string
| string
| number
| number
| null
export type PlanApplyStageTrackerEnvironment = string | null
export type PlanApplyStageTrackerPlanOptions = PlanOptions | null
export type PlanApplyStageTrackerCreation = PlanStageCreation | null
export type PlanApplyStageTrackerRestate = PlanStageRestate | null
export type PlanApplyStageTrackerBackfill = PlanStageBackfill | null
export type PlanApplyStageTrackerPromote = PlanStagePromote | null
export interface PlanApplyStageTracker {
start?: PlanApplyStageTrackerStart
end?: PlanApplyStageTrackerEnd
meta?: TrackableMeta
environment?: PlanApplyStageTrackerEnvironment
plan_options?: PlanApplyStageTrackerPlanOptions
creation?: PlanApplyStageTrackerCreation
restate?: PlanApplyStageTrackerRestate
backfill?: PlanApplyStageTrackerBackfill
promote?: PlanApplyStageTrackerPromote
}
export type PlanCancelStageTrackerStart =
| string
| string
| string
| number
| number
| null
export type PlanCancelStageTrackerEnd =
| string
| string
| string
| number
| number
| null
export type PlanCancelStageTrackerEnvironment = string | null
export type PlanCancelStageTrackerPlanOptions = PlanOptions | null
export type PlanCancelStageTrackerCancel = PlanStageCancel | null
export interface PlanCancelStageTracker {
start?: PlanCancelStageTrackerStart
end?: PlanCancelStageTrackerEnd
meta?: TrackableMeta
environment?: PlanCancelStageTrackerEnvironment
plan_options?: PlanCancelStageTrackerPlanOptions
cancel?: PlanCancelStageTrackerCancel
}
export type PlanDatesStart = string | string | string | number | number | null
export type PlanDatesEnd = string | string | string | number | number | null
export interface PlanDates {
start?: PlanDatesStart
end?: PlanDatesEnd
}
export type PlanOptionsCreateFrom = string | null
export type PlanOptionsRestateModels = string | null
export interface PlanOptions {
skip_tests?: boolean
skip_backfill?: boolean
no_gaps?: boolean
forward_only?: boolean
no_auto_categorization?: boolean
include_unmodified?: boolean
create_from?: PlanOptionsCreateFrom
restate_models?: PlanOptionsRestateModels
auto_apply?: boolean
}
export type PlanOverviewStageTrackerStart =
| string
| string
| string
| number
| number
| null
export type PlanOverviewStageTrackerEnd =
| string
| string
| string
| number
| number
| null
export type PlanOverviewStageTrackerEnvironment = string | null
export type PlanOverviewStageTrackerPlanOptions = PlanOptions | null
export type PlanOverviewStageTrackerValidation = PlanStageValidation | null
export type PlanOverviewStageTrackerChanges = PlanStageChanges | null
export type PlanOverviewStageTrackerBackfills = PlanStageBackfills | null
export interface PlanOverviewStageTracker {
start?: PlanOverviewStageTrackerStart
end?: PlanOverviewStageTrackerEnd
meta?: TrackableMeta
environment?: PlanOverviewStageTrackerEnvironment
plan_options?: PlanOverviewStageTrackerPlanOptions
validation?: PlanOverviewStageTrackerValidation
changes?: PlanOverviewStageTrackerChanges
backfills?: PlanOverviewStageTrackerBackfills
}
export type PlanStageBackfillTasks = { [key: string]: BackfillTask }
export interface PlanStageBackfill {
meta?: TrackableMeta
queue?: string[]
tasks?: PlanStageBackfillTasks
}
export type PlanStageBackfillsModels = BackfillDetails[] | null
export interface PlanStageBackfills {
meta?: TrackableMeta
models?: PlanStageBackfillsModels
}
export interface PlanStageCancel {
meta?: TrackableMeta
}
export type PlanStageChangesAdded = ChangeDisplay[] | null
export type PlanStageChangesRemoved = ChangeDisplay[] | null
export type PlanStageChangesModified = ModelsDiff | null
export interface PlanStageChanges {
added?: PlanStageChangesAdded
removed?: PlanStageChangesRemoved
modified?: PlanStageChangesModified
meta?: TrackableMeta
}
export interface PlanStageCreation {
meta?: TrackableMeta
total_tasks: number
num_tasks: number
}
export interface PlanStagePromote {
meta?: TrackableMeta
total_tasks: number
num_tasks: number
target_environment: string
}
export interface PlanStageRestate {
meta?: TrackableMeta
}
export interface PlanStageValidation {
meta?: TrackableMeta
}
export interface Query {
sql: string
}
export interface Reference {
name: string
expression: string
unique: boolean
}
export type RenderInputStart = string | string | string | number | number | null
export type RenderInputEnd = string | string | string | number | number | null
export type RenderInputExecutionTime =
| string
| string
| string
| number
| number
| null
export type RenderInputExpand = boolean | string[]
export type RenderInputDialect = string | null
export interface RenderInput {
model: string
start?: RenderInputStart
end?: RenderInputEnd
execution_time?: RenderInputExecutionTime
expand?: RenderInputExpand
pretty?: boolean
dialect?: RenderInputDialect
}
export type RowDiffStats = { [key: string]: number }
export type RowDiffSample = { [key: string]: unknown }
export interface RowDiff {
source: string
target: string
stats: RowDiffStats
sample: RowDiffSample
source_count: number
target_count: number
count_pct_change: number
}
export type SchemaDiffSourceSchema = { [key: string]: string }
export type SchemaDiffTargetSchema = { [key: string]: string }
export type SchemaDiffAdded = { [key: string]: string }
export type SchemaDiffRemoved = { [key: string]: string }
export type SchemaDiffModified = { [key: string]: string }
export interface SchemaDiff {
source: string
target: string
source_schema: SchemaDiffSourceSchema
target_schema: SchemaDiffTargetSchema
added: SchemaDiffAdded
removed: SchemaDiffRemoved
modified: SchemaDiffModified
}
/**
* Values are ordered by decreasing severity and that ordering is required.
BREAKING: The change requires that snapshot modified and downstream dependencies be rebuilt
NON_BREAKING: The change requires that only the snapshot modified be rebuilt
FORWARD_ONLY: The change requires no rebuilding
INDIRECT_BREAKING: The change was caused indirectly and is breaking.
INDIRECT_NON_BREAKING: The change was caused indirectly by a non-breaking change.
METADATA: The change was caused by a metadata update.
*/
export type SnapshotChangeCategory =
(typeof SnapshotChangeCategory)[keyof typeof SnapshotChangeCategory]
// eslint-disable-next-line @typescript-eslint/no-redeclare
export const SnapshotChangeCategory = {
NUMBER_1: 1,
NUMBER_2: 2,
NUMBER_3: 3,
NUMBER_4: 4,
NUMBER_5: 5,
NUMBER_6: 6,
} as const
/**
* An enumeration of statuses.
*/
export type Status = (typeof Status)[keyof typeof Status]
// eslint-disable-next-line @typescript-eslint/no-redeclare
export const Status = {
init: 'init',
success: 'success',
fail: 'fail',
} as const
export interface TableDiff {
schema_diff: SchemaDiff
row_diff: RowDiff
on: string[][]
}
export interface TestCase {
name: string
path: string
}
export interface TestErrorOrFailure {
name: string
path: string
tb: string
}
export interface TestResult {
tests_run: number
failures: TestErrorOrFailure[]
errors: TestErrorOrFailure[]
skipped: TestSkipped[]
successes: TestCase[]
}
export interface TestSkipped {
name: string
path: string
reason: string
}
export type TrackableMetaEnd = number | null
export interface TrackableMeta {
status?: Status
start?: number
end?: TrackableMetaEnd
done?: boolean
}
export type ValidationErrorLocItem = string | number
export interface ValidationError {
loc: ValidationErrorLocItem[]
msg: string
type: string
}
/**
* Verbosity levels for SQLMesh output.
*/
export type Verbosity = (typeof Verbosity)[keyof typeof Verbosity]
// eslint-disable-next-line @typescript-eslint/no-redeclare
export const Verbosity = {
NUMBER_0: 0,
NUMBER_1: 1,
NUMBER_2: 2,
} as const
export type InitiateApplyApiCommandsApplyPost200 = PlanApplyStageTracker | null
export type TestApiCommandsTestGetParams = {
test?: string | null
verbosity?: Verbosity
}
export type WriteFileApiFilesPathPost200 = File | null
export type InitiatePlanApiPlanPost200 = PlanOverviewStageTracker | null
export type CancelPlanApiPlanCancelPost200 = PlanCancelStageTracker | null
export type ColumnLineageApiLineageModelNameColumnNameGetParams = {
models_only?: boolean
}
export type ColumnLineageApiLineageModelNameColumnNameGet200 = {
[key: string]: { [key: string]: LineageColumn }
}
export type ModelLineageApiLineageModelNameGet200 = { [key: string]: string[] }
export type GetModelsApiModelsGet200 = Model[] | ApiExceptionPayload
export type GetTableDiffApiTableDiffGetParams = {
source: string
target: string
on?: string | null
model_or_snapshot?: string | null
where?: string | null
temp_schema?: string | null
limit?: number
}
export type GetTableDiffApiTableDiffGet200 = TableDiff | null
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1]
/**
* Apply a plan
* @summary Initiate Apply
*/
export const initiateApplyApiCommandsApplyPost = (
bodyInitiateApplyApiCommandsApplyPost: BodyInitiateApplyApiCommandsApplyPost,
options?: SecondParameter<typeof fetchAPI>,
) => {
return fetchAPI<InitiateApplyApiCommandsApplyPost200>(
{
url: `/api/commands/apply`,
method: 'POST',
headers: { 'Content-Type': 'application/json' },
data: bodyInitiateApplyApiCommandsApplyPost,
},
options,
)
}
/**
* Evaluate a model with a default limit of 1000
* @summary Evaluate
*/
export const evaluateApiCommandsEvaluatePost = (
evaluateInput: EvaluateInput,
options?: SecondParameter<typeof fetchAPI>,
) => {
return fetchAPI<unknown>(
{
url: `/api/commands/evaluate`,
method: 'POST',
headers: { 'Content-Type': 'application/json' },
data: evaluateInput,
},
options,
)
}
/**
* Fetches a dataframe given a sql string
* @summary Fetchdf
*/
export const fetchdfApiCommandsFetchdfPost = (
fetchdfInput: FetchdfInput,
options?: SecondParameter<typeof fetchAPI>,
) => {
return fetchAPI<unknown>(
{
url: `/api/commands/fetchdf`,
method: 'POST',
headers: { 'Content-Type': 'application/json' },
data: fetchdfInput,
},
options,
)
}
/**
* Renders a model's query, optionally expanding referenced models
* @summary Render
*/
export const renderApiCommandsRenderPost = (
renderInput: RenderInput,
options?: SecondParameter<typeof fetchAPI>,
) => {
return fetchAPI<Query>(
{
url: `/api/commands/render`,
method: 'POST',
headers: { 'Content-Type': 'application/json' },
data: renderInput,
},
options,
)
}
/**
* Run one or all model tests
* @summary Test
*/
export const testApiCommandsTestGet = (
params?: TestApiCommandsTestGetParams,
options?: SecondParameter<typeof fetchAPI>,
) => {
return fetchAPI<TestResult>(
{ url: `/api/commands/test`, method: 'GET', params },
options,
)
}
/**
* Get all project files.
* @summary Get Files
*/
export const getFilesApiFilesGet = (
options?: SecondParameter<typeof fetchAPI>,
) => {
return fetchAPI<Directory>({ url: `/api/files`, method: 'GET' }, options)
}
/**
* Get a file, including its contents.
* @summary Get File
*/
export const getFileApiFilesPathGet = (
path: string,
options?: SecondParameter<typeof fetchAPI>,
) => {
return fetchAPI<File>({ url: `/api/files/${path}`, method: 'GET' }, options)
}
/**
* Create, update, or rename a file.
* @summary Write File
*/
export const writeFileApiFilesPathPost = (
path: string,
bodyWriteFileApiFilesPathPost: BodyWriteFileApiFilesPathPost,
options?: SecondParameter<typeof fetchAPI>,
) => {
return fetchAPI<WriteFileApiFilesPathPost200>(
{
url: `/api/files/${path}`,
method: 'POST',
headers: { 'Content-Type': 'application/json' },
data: bodyWriteFileApiFilesPathPost,
},
options,
)
}
/**
* Delete a file.
* @summary Delete File
*/
export const deleteFileApiFilesPathDelete = (
path: string,
options?: SecondParameter<typeof fetchAPI>,
) => {
return fetchAPI<null>(
{ url: `/api/files/${path}`, method: 'DELETE' },
options,
)
}
/**
* Create or rename a directory.
* @summary Write Directory
*/
export const writeDirectoryApiDirectoriesPathPost = (
path: string,
bodyWriteDirectoryApiDirectoriesPathPost: BodyWriteDirectoryApiDirectoriesPathPost,
options?: SecondParameter<typeof fetchAPI>,
) => {
return fetchAPI<Directory>(
{
url: `/api/directories/${path}`,
method: 'POST',
headers: { 'Content-Type': 'application/json' },
data: bodyWriteDirectoryApiDirectoriesPathPost,
},
options,
)
}
/**
* Delete a directory.