@argos-ci/api-client 0.3.0 → 0.4.1-alpha.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/dist/index.d.ts +679 -65
- package/dist/index.mjs +19 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { FetchResponse } from "openapi-fetch";
|
|
1
2
|
/**
|
|
2
3
|
* This file was auto-generated by openapi-typescript.
|
|
3
4
|
* Do not make direct changes to the file.
|
|
@@ -86,17 +87,23 @@ interface paths {
|
|
|
86
87
|
}
|
|
87
88
|
interface components {
|
|
88
89
|
schemas: {
|
|
90
|
+
/** @description SHA1 hash */
|
|
91
|
+
Sha1Hash: string;
|
|
92
|
+
/** @description SHA256 hash */
|
|
93
|
+
Sha256Hash: string;
|
|
89
94
|
/** @description Build */
|
|
90
95
|
Build: {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
* @example 12345
|
|
94
|
-
*/
|
|
95
|
-
id: string;
|
|
96
|
+
id: components["schemas"]["BuildId"];
|
|
97
|
+
/** @description The build number */
|
|
96
98
|
number: number;
|
|
99
|
+
/** @description The status of the build */
|
|
97
100
|
status: ("accepted" | "rejected") | ("stable" | "diffDetected") | ("expired" | "pending" | "progress" | "error" | "aborted");
|
|
98
|
-
/**
|
|
101
|
+
/**
|
|
102
|
+
* Format: uri
|
|
103
|
+
* @description The URL of the build
|
|
104
|
+
*/
|
|
99
105
|
url: string;
|
|
106
|
+
/** @description The notification payload for the build */
|
|
100
107
|
notification: {
|
|
101
108
|
description: string;
|
|
102
109
|
context: string;
|
|
@@ -110,6 +117,11 @@ interface components {
|
|
|
110
117
|
};
|
|
111
118
|
} | null;
|
|
112
119
|
};
|
|
120
|
+
/**
|
|
121
|
+
* @description A unique identifier for the build
|
|
122
|
+
* @example 12345
|
|
123
|
+
*/
|
|
124
|
+
BuildId: string;
|
|
113
125
|
/** @description Error response */
|
|
114
126
|
Error: {
|
|
115
127
|
error: string;
|
|
@@ -122,6 +134,76 @@ interface components {
|
|
|
122
134
|
* @example 12345
|
|
123
135
|
*/
|
|
124
136
|
buildId: string;
|
|
137
|
+
/** @description Screenshot input */
|
|
138
|
+
ScreenshotInput: {
|
|
139
|
+
key: string;
|
|
140
|
+
name: string;
|
|
141
|
+
baseName?: string | null;
|
|
142
|
+
metadata?: {
|
|
143
|
+
url?: string;
|
|
144
|
+
viewport?: {
|
|
145
|
+
width: number;
|
|
146
|
+
height: number;
|
|
147
|
+
};
|
|
148
|
+
/** @enum {string} */
|
|
149
|
+
colorScheme?: "light" | "dark";
|
|
150
|
+
/** @enum {string} */
|
|
151
|
+
mediaType?: "screen" | "print";
|
|
152
|
+
test?: {
|
|
153
|
+
id?: string;
|
|
154
|
+
title: string;
|
|
155
|
+
titlePath: string[];
|
|
156
|
+
retries?: number;
|
|
157
|
+
retry?: number;
|
|
158
|
+
repeat?: number;
|
|
159
|
+
location?: {
|
|
160
|
+
file: string;
|
|
161
|
+
line: number;
|
|
162
|
+
column: number;
|
|
163
|
+
};
|
|
164
|
+
} | null;
|
|
165
|
+
browser?: {
|
|
166
|
+
name: string;
|
|
167
|
+
version: string;
|
|
168
|
+
};
|
|
169
|
+
automationLibrary: {
|
|
170
|
+
name: string;
|
|
171
|
+
version: string;
|
|
172
|
+
};
|
|
173
|
+
sdk: {
|
|
174
|
+
name: string;
|
|
175
|
+
version: string;
|
|
176
|
+
};
|
|
177
|
+
} | null;
|
|
178
|
+
pwTraceKey?: string | null;
|
|
179
|
+
threshold?: number | null;
|
|
180
|
+
};
|
|
181
|
+
/** @description Build metadata */
|
|
182
|
+
BuildMetadata: {
|
|
183
|
+
testReport?: {
|
|
184
|
+
/** @enum {string} */
|
|
185
|
+
status: "passed" | "failed" | "timedout" | "interrupted";
|
|
186
|
+
stats?: {
|
|
187
|
+
startTime?: string;
|
|
188
|
+
duration?: number;
|
|
189
|
+
};
|
|
190
|
+
};
|
|
191
|
+
};
|
|
192
|
+
/** @description Project */
|
|
193
|
+
Project: {
|
|
194
|
+
id: string;
|
|
195
|
+
defaultBaseBranch: string;
|
|
196
|
+
hasRemoteContentAccess: boolean;
|
|
197
|
+
};
|
|
198
|
+
/** @description Page information */
|
|
199
|
+
PageInfo: {
|
|
200
|
+
/** @description Total number of items */
|
|
201
|
+
total: number;
|
|
202
|
+
/** @description Current page number */
|
|
203
|
+
page: number;
|
|
204
|
+
/** @description Number of items per page */
|
|
205
|
+
perPage: number;
|
|
206
|
+
};
|
|
125
207
|
};
|
|
126
208
|
responses: never;
|
|
127
209
|
parameters: never;
|
|
@@ -140,10 +222,10 @@ interface operations {
|
|
|
140
222
|
requestBody?: {
|
|
141
223
|
content: {
|
|
142
224
|
"application/json": {
|
|
143
|
-
commit:
|
|
225
|
+
commit: components["schemas"]["Sha1Hash"];
|
|
144
226
|
branch: string;
|
|
145
|
-
screenshotKeys:
|
|
146
|
-
pwTraceKeys?:
|
|
227
|
+
screenshotKeys: components["schemas"]["Sha256Hash"][];
|
|
228
|
+
pwTraceKeys?: components["schemas"]["Sha256Hash"][];
|
|
147
229
|
name?: string | null;
|
|
148
230
|
parallel?: boolean | null;
|
|
149
231
|
parallelNonce?: string | null;
|
|
@@ -315,52 +397,11 @@ interface operations {
|
|
|
315
397
|
requestBody?: {
|
|
316
398
|
content: {
|
|
317
399
|
"application/json": {
|
|
318
|
-
screenshots:
|
|
319
|
-
key: string;
|
|
320
|
-
name: string;
|
|
321
|
-
baseName?: string | null;
|
|
322
|
-
metadata?: {
|
|
323
|
-
url?: string;
|
|
324
|
-
viewport?: {
|
|
325
|
-
width: number;
|
|
326
|
-
height: number;
|
|
327
|
-
};
|
|
328
|
-
/** @enum {string} */
|
|
329
|
-
colorScheme?: "light" | "dark";
|
|
330
|
-
/** @enum {string} */
|
|
331
|
-
mediaType?: "screen" | "print";
|
|
332
|
-
test?: {
|
|
333
|
-
id?: string;
|
|
334
|
-
title: string;
|
|
335
|
-
titlePath: string[];
|
|
336
|
-
retries?: number;
|
|
337
|
-
retry?: number;
|
|
338
|
-
repeat?: number;
|
|
339
|
-
location?: {
|
|
340
|
-
file: string;
|
|
341
|
-
line: number;
|
|
342
|
-
column: number;
|
|
343
|
-
};
|
|
344
|
-
} | null;
|
|
345
|
-
browser?: {
|
|
346
|
-
name: string;
|
|
347
|
-
version: string;
|
|
348
|
-
};
|
|
349
|
-
automationLibrary: {
|
|
350
|
-
name: string;
|
|
351
|
-
version: string;
|
|
352
|
-
};
|
|
353
|
-
sdk: {
|
|
354
|
-
name: string;
|
|
355
|
-
version: string;
|
|
356
|
-
};
|
|
357
|
-
} | null;
|
|
358
|
-
pwTraceKey?: string | null;
|
|
359
|
-
threshold?: number | null;
|
|
360
|
-
}[];
|
|
400
|
+
screenshots: components["schemas"]["ScreenshotInput"][];
|
|
361
401
|
parallel?: boolean | null;
|
|
362
402
|
parallelTotal?: number | null;
|
|
363
403
|
parallelIndex?: number | null;
|
|
404
|
+
metadata?: components["schemas"]["BuildMetadata"];
|
|
364
405
|
};
|
|
365
406
|
};
|
|
366
407
|
};
|
|
@@ -447,11 +488,7 @@ interface operations {
|
|
|
447
488
|
[name: string]: unknown;
|
|
448
489
|
};
|
|
449
490
|
content: {
|
|
450
|
-
"application/json":
|
|
451
|
-
id: string;
|
|
452
|
-
defaultBaseBranch: string;
|
|
453
|
-
hasRemoteContentAccess: boolean;
|
|
454
|
-
};
|
|
491
|
+
"application/json": components["schemas"]["Project"];
|
|
455
492
|
};
|
|
456
493
|
};
|
|
457
494
|
/** @description Unauthorized */
|
|
@@ -481,8 +518,7 @@ interface operations {
|
|
|
481
518
|
perPage?: string;
|
|
482
519
|
/** @description Page number */
|
|
483
520
|
page?: string;
|
|
484
|
-
|
|
485
|
-
commit?: string;
|
|
521
|
+
commit?: components["schemas"]["Sha1Hash"];
|
|
486
522
|
/** @description Only return the latest builds created, unique by name and commit. */
|
|
487
523
|
distinctName?: string;
|
|
488
524
|
};
|
|
@@ -499,11 +535,7 @@ interface operations {
|
|
|
499
535
|
};
|
|
500
536
|
content: {
|
|
501
537
|
"application/json": {
|
|
502
|
-
pageInfo:
|
|
503
|
-
total: number;
|
|
504
|
-
page: number;
|
|
505
|
-
perPage: number;
|
|
506
|
-
};
|
|
538
|
+
pageInfo: components["schemas"]["PageInfo"];
|
|
507
539
|
results: components["schemas"]["Build"][];
|
|
508
540
|
};
|
|
509
541
|
};
|
|
@@ -538,6 +570,581 @@ interface operations {
|
|
|
538
570
|
};
|
|
539
571
|
};
|
|
540
572
|
}
|
|
573
|
+
declare namespace ArgosAPISchema {
|
|
574
|
+
/**
|
|
575
|
+
* This file was auto-generated by openapi-typescript.
|
|
576
|
+
* Do not make direct changes to the file.
|
|
577
|
+
*/
|
|
578
|
+
interface paths {
|
|
579
|
+
"/builds": {
|
|
580
|
+
parameters: {
|
|
581
|
+
query?: never;
|
|
582
|
+
header?: never;
|
|
583
|
+
path?: never;
|
|
584
|
+
cookie?: never;
|
|
585
|
+
};
|
|
586
|
+
get?: never;
|
|
587
|
+
put?: never;
|
|
588
|
+
post: operations["createBuild"];
|
|
589
|
+
delete?: never;
|
|
590
|
+
options?: never;
|
|
591
|
+
head?: never;
|
|
592
|
+
patch?: never;
|
|
593
|
+
trace?: never;
|
|
594
|
+
};
|
|
595
|
+
"/builds/finalize": {
|
|
596
|
+
parameters: {
|
|
597
|
+
query?: never;
|
|
598
|
+
header?: never;
|
|
599
|
+
path?: never;
|
|
600
|
+
cookie?: never;
|
|
601
|
+
};
|
|
602
|
+
get?: never;
|
|
603
|
+
put?: never;
|
|
604
|
+
post: operations["finalizeBuilds"];
|
|
605
|
+
delete?: never;
|
|
606
|
+
options?: never;
|
|
607
|
+
head?: never;
|
|
608
|
+
patch?: never;
|
|
609
|
+
trace?: never;
|
|
610
|
+
};
|
|
611
|
+
"/builds/{buildId}": {
|
|
612
|
+
parameters: {
|
|
613
|
+
query?: never;
|
|
614
|
+
header?: never;
|
|
615
|
+
path?: never;
|
|
616
|
+
cookie?: never;
|
|
617
|
+
};
|
|
618
|
+
get?: never;
|
|
619
|
+
put: operations["updateBuild"];
|
|
620
|
+
post?: never;
|
|
621
|
+
delete?: never;
|
|
622
|
+
options?: never;
|
|
623
|
+
head?: never;
|
|
624
|
+
patch?: never;
|
|
625
|
+
trace?: never;
|
|
626
|
+
};
|
|
627
|
+
"/project": {
|
|
628
|
+
parameters: {
|
|
629
|
+
query?: never;
|
|
630
|
+
header?: never;
|
|
631
|
+
path?: never;
|
|
632
|
+
cookie?: never;
|
|
633
|
+
};
|
|
634
|
+
get: operations["getAuthProject"];
|
|
635
|
+
put?: never;
|
|
636
|
+
post?: never;
|
|
637
|
+
delete?: never;
|
|
638
|
+
options?: never;
|
|
639
|
+
head?: never;
|
|
640
|
+
patch?: never;
|
|
641
|
+
trace?: never;
|
|
642
|
+
};
|
|
643
|
+
"/project/builds": {
|
|
644
|
+
parameters: {
|
|
645
|
+
query?: never;
|
|
646
|
+
header?: never;
|
|
647
|
+
path?: never;
|
|
648
|
+
cookie?: never;
|
|
649
|
+
};
|
|
650
|
+
get: operations["getAuthProjectBuilds"];
|
|
651
|
+
put?: never;
|
|
652
|
+
post?: never;
|
|
653
|
+
delete?: never;
|
|
654
|
+
options?: never;
|
|
655
|
+
head?: never;
|
|
656
|
+
patch?: never;
|
|
657
|
+
trace?: never;
|
|
658
|
+
};
|
|
659
|
+
}
|
|
660
|
+
type webhooks = Record<string, never>;
|
|
661
|
+
interface components {
|
|
662
|
+
schemas: {
|
|
663
|
+
/** @description SHA1 hash */
|
|
664
|
+
Sha1Hash: string;
|
|
665
|
+
/** @description SHA256 hash */
|
|
666
|
+
Sha256Hash: string;
|
|
667
|
+
/** @description Build */
|
|
668
|
+
Build: {
|
|
669
|
+
id: components["schemas"]["BuildId"];
|
|
670
|
+
/** @description The build number */
|
|
671
|
+
number: number;
|
|
672
|
+
/** @description The status of the build */
|
|
673
|
+
status: ("accepted" | "rejected") | ("stable" | "diffDetected") | ("expired" | "pending" | "progress" | "error" | "aborted");
|
|
674
|
+
/**
|
|
675
|
+
* Format: uri
|
|
676
|
+
* @description The URL of the build
|
|
677
|
+
*/
|
|
678
|
+
url: string;
|
|
679
|
+
/** @description The notification payload for the build */
|
|
680
|
+
notification: {
|
|
681
|
+
description: string;
|
|
682
|
+
context: string;
|
|
683
|
+
github: {
|
|
684
|
+
/** @enum {string} */
|
|
685
|
+
state: "pending" | "success" | "error" | "failure";
|
|
686
|
+
};
|
|
687
|
+
gitlab: {
|
|
688
|
+
/** @enum {string} */
|
|
689
|
+
state: "pending" | "running" | "success" | "failed" | "canceled";
|
|
690
|
+
};
|
|
691
|
+
} | null;
|
|
692
|
+
};
|
|
693
|
+
/**
|
|
694
|
+
* @description A unique identifier for the build
|
|
695
|
+
* @example 12345
|
|
696
|
+
*/
|
|
697
|
+
BuildId: string;
|
|
698
|
+
/** @description Error response */
|
|
699
|
+
Error: {
|
|
700
|
+
error: string;
|
|
701
|
+
details: {
|
|
702
|
+
message: string;
|
|
703
|
+
}[];
|
|
704
|
+
};
|
|
705
|
+
/**
|
|
706
|
+
* @description A unique identifier for the build
|
|
707
|
+
* @example 12345
|
|
708
|
+
*/
|
|
709
|
+
buildId: string;
|
|
710
|
+
/** @description Screenshot input */
|
|
711
|
+
ScreenshotInput: {
|
|
712
|
+
key: string;
|
|
713
|
+
name: string;
|
|
714
|
+
baseName?: string | null;
|
|
715
|
+
metadata?: {
|
|
716
|
+
url?: string;
|
|
717
|
+
viewport?: {
|
|
718
|
+
width: number;
|
|
719
|
+
height: number;
|
|
720
|
+
};
|
|
721
|
+
/** @enum {string} */
|
|
722
|
+
colorScheme?: "light" | "dark";
|
|
723
|
+
/** @enum {string} */
|
|
724
|
+
mediaType?: "screen" | "print";
|
|
725
|
+
test?: {
|
|
726
|
+
id?: string;
|
|
727
|
+
title: string;
|
|
728
|
+
titlePath: string[];
|
|
729
|
+
retries?: number;
|
|
730
|
+
retry?: number;
|
|
731
|
+
repeat?: number;
|
|
732
|
+
location?: {
|
|
733
|
+
file: string;
|
|
734
|
+
line: number;
|
|
735
|
+
column: number;
|
|
736
|
+
};
|
|
737
|
+
} | null;
|
|
738
|
+
browser?: {
|
|
739
|
+
name: string;
|
|
740
|
+
version: string;
|
|
741
|
+
};
|
|
742
|
+
automationLibrary: {
|
|
743
|
+
name: string;
|
|
744
|
+
version: string;
|
|
745
|
+
};
|
|
746
|
+
sdk: {
|
|
747
|
+
name: string;
|
|
748
|
+
version: string;
|
|
749
|
+
};
|
|
750
|
+
} | null;
|
|
751
|
+
pwTraceKey?: string | null;
|
|
752
|
+
threshold?: number | null;
|
|
753
|
+
};
|
|
754
|
+
/** @description Build metadata */
|
|
755
|
+
BuildMetadata: {
|
|
756
|
+
testReport?: {
|
|
757
|
+
/** @enum {string} */
|
|
758
|
+
status: "passed" | "failed" | "timedout" | "interrupted";
|
|
759
|
+
stats?: {
|
|
760
|
+
startTime?: string;
|
|
761
|
+
duration?: number;
|
|
762
|
+
};
|
|
763
|
+
};
|
|
764
|
+
};
|
|
765
|
+
/** @description Project */
|
|
766
|
+
Project: {
|
|
767
|
+
id: string;
|
|
768
|
+
defaultBaseBranch: string;
|
|
769
|
+
hasRemoteContentAccess: boolean;
|
|
770
|
+
};
|
|
771
|
+
/** @description Page information */
|
|
772
|
+
PageInfo: {
|
|
773
|
+
/** @description Total number of items */
|
|
774
|
+
total: number;
|
|
775
|
+
/** @description Current page number */
|
|
776
|
+
page: number;
|
|
777
|
+
/** @description Number of items per page */
|
|
778
|
+
perPage: number;
|
|
779
|
+
};
|
|
780
|
+
};
|
|
781
|
+
responses: never;
|
|
782
|
+
parameters: never;
|
|
783
|
+
requestBodies: never;
|
|
784
|
+
headers: never;
|
|
785
|
+
pathItems: never;
|
|
786
|
+
}
|
|
787
|
+
type $defs = Record<string, never>;
|
|
788
|
+
interface operations {
|
|
789
|
+
createBuild: {
|
|
790
|
+
parameters: {
|
|
791
|
+
query?: never;
|
|
792
|
+
header?: never;
|
|
793
|
+
path?: never;
|
|
794
|
+
cookie?: never;
|
|
795
|
+
};
|
|
796
|
+
requestBody?: {
|
|
797
|
+
content: {
|
|
798
|
+
"application/json": {
|
|
799
|
+
commit: components["schemas"]["Sha1Hash"];
|
|
800
|
+
branch: string;
|
|
801
|
+
screenshotKeys: components["schemas"]["Sha256Hash"][];
|
|
802
|
+
pwTraceKeys?: components["schemas"]["Sha256Hash"][];
|
|
803
|
+
name?: string | null;
|
|
804
|
+
parallel?: boolean | null;
|
|
805
|
+
parallelNonce?: string | null;
|
|
806
|
+
prNumber?: number | null;
|
|
807
|
+
prHeadCommit?: string | null;
|
|
808
|
+
referenceCommit?: string | null;
|
|
809
|
+
referenceBranch?: string | null;
|
|
810
|
+
/** @enum {string|null} */
|
|
811
|
+
mode?: "ci" | "monitoring" | null;
|
|
812
|
+
ciProvider?: string | null;
|
|
813
|
+
argosSdk?: string | null;
|
|
814
|
+
runId?: string | null;
|
|
815
|
+
runAttempt?: number | null;
|
|
816
|
+
};
|
|
817
|
+
};
|
|
818
|
+
};
|
|
819
|
+
responses: {
|
|
820
|
+
/** @description Result of build creation */
|
|
821
|
+
201: {
|
|
822
|
+
headers: {
|
|
823
|
+
[name: string]: unknown;
|
|
824
|
+
};
|
|
825
|
+
content: {
|
|
826
|
+
"application/json": {
|
|
827
|
+
build: components["schemas"]["Build"];
|
|
828
|
+
screenshots: {
|
|
829
|
+
key: string;
|
|
830
|
+
/** Format: uri */
|
|
831
|
+
putUrl: string;
|
|
832
|
+
}[];
|
|
833
|
+
pwTraces: {
|
|
834
|
+
key: string;
|
|
835
|
+
/** Format: uri */
|
|
836
|
+
putUrl: string;
|
|
837
|
+
}[];
|
|
838
|
+
};
|
|
839
|
+
};
|
|
840
|
+
};
|
|
841
|
+
/** @description Invalid parameters */
|
|
842
|
+
400: {
|
|
843
|
+
headers: {
|
|
844
|
+
[name: string]: unknown;
|
|
845
|
+
};
|
|
846
|
+
content: {
|
|
847
|
+
"application/json": components["schemas"]["Error"];
|
|
848
|
+
};
|
|
849
|
+
};
|
|
850
|
+
/** @description Unauthorized */
|
|
851
|
+
401: {
|
|
852
|
+
headers: {
|
|
853
|
+
[name: string]: unknown;
|
|
854
|
+
};
|
|
855
|
+
content: {
|
|
856
|
+
"application/json": components["schemas"]["Error"];
|
|
857
|
+
};
|
|
858
|
+
};
|
|
859
|
+
/** @description Conflict */
|
|
860
|
+
409: {
|
|
861
|
+
headers: {
|
|
862
|
+
[name: string]: unknown;
|
|
863
|
+
};
|
|
864
|
+
content: {
|
|
865
|
+
"application/json": components["schemas"]["Error"];
|
|
866
|
+
};
|
|
867
|
+
};
|
|
868
|
+
/** @description Server error */
|
|
869
|
+
500: {
|
|
870
|
+
headers: {
|
|
871
|
+
[name: string]: unknown;
|
|
872
|
+
};
|
|
873
|
+
content: {
|
|
874
|
+
"application/json": components["schemas"]["Error"];
|
|
875
|
+
};
|
|
876
|
+
};
|
|
877
|
+
};
|
|
878
|
+
};
|
|
879
|
+
finalizeBuilds: {
|
|
880
|
+
parameters: {
|
|
881
|
+
query?: never;
|
|
882
|
+
header?: never;
|
|
883
|
+
path?: never;
|
|
884
|
+
cookie?: never;
|
|
885
|
+
};
|
|
886
|
+
requestBody?: {
|
|
887
|
+
content: {
|
|
888
|
+
"application/json": {
|
|
889
|
+
parallelNonce: string;
|
|
890
|
+
};
|
|
891
|
+
};
|
|
892
|
+
};
|
|
893
|
+
responses: {
|
|
894
|
+
/** @description Result of build finalization */
|
|
895
|
+
200: {
|
|
896
|
+
headers: {
|
|
897
|
+
[name: string]: unknown;
|
|
898
|
+
};
|
|
899
|
+
content: {
|
|
900
|
+
"application/json": {
|
|
901
|
+
builds: components["schemas"]["Build"][];
|
|
902
|
+
};
|
|
903
|
+
};
|
|
904
|
+
};
|
|
905
|
+
/** @description Invalid parameters */
|
|
906
|
+
400: {
|
|
907
|
+
headers: {
|
|
908
|
+
[name: string]: unknown;
|
|
909
|
+
};
|
|
910
|
+
content: {
|
|
911
|
+
"application/json": components["schemas"]["Error"];
|
|
912
|
+
};
|
|
913
|
+
};
|
|
914
|
+
/** @description Unauthorized */
|
|
915
|
+
401: {
|
|
916
|
+
headers: {
|
|
917
|
+
[name: string]: unknown;
|
|
918
|
+
};
|
|
919
|
+
content: {
|
|
920
|
+
"application/json": components["schemas"]["Error"];
|
|
921
|
+
};
|
|
922
|
+
};
|
|
923
|
+
/** @description Forbidden */
|
|
924
|
+
403: {
|
|
925
|
+
headers: {
|
|
926
|
+
[name: string]: unknown;
|
|
927
|
+
};
|
|
928
|
+
content: {
|
|
929
|
+
"application/json": components["schemas"]["Error"];
|
|
930
|
+
};
|
|
931
|
+
};
|
|
932
|
+
/** @description Not found */
|
|
933
|
+
404: {
|
|
934
|
+
headers: {
|
|
935
|
+
[name: string]: unknown;
|
|
936
|
+
};
|
|
937
|
+
content: {
|
|
938
|
+
"application/json": components["schemas"]["Error"];
|
|
939
|
+
};
|
|
940
|
+
};
|
|
941
|
+
/** @description Conflict */
|
|
942
|
+
409: {
|
|
943
|
+
headers: {
|
|
944
|
+
[name: string]: unknown;
|
|
945
|
+
};
|
|
946
|
+
content: {
|
|
947
|
+
"application/json": components["schemas"]["Error"];
|
|
948
|
+
};
|
|
949
|
+
};
|
|
950
|
+
/** @description Server error */
|
|
951
|
+
500: {
|
|
952
|
+
headers: {
|
|
953
|
+
[name: string]: unknown;
|
|
954
|
+
};
|
|
955
|
+
content: {
|
|
956
|
+
"application/json": components["schemas"]["Error"];
|
|
957
|
+
};
|
|
958
|
+
};
|
|
959
|
+
};
|
|
960
|
+
};
|
|
961
|
+
updateBuild: {
|
|
962
|
+
parameters: {
|
|
963
|
+
query?: never;
|
|
964
|
+
header?: never;
|
|
965
|
+
path: {
|
|
966
|
+
/** @description A unique identifier for the build */
|
|
967
|
+
buildId: components["schemas"]["buildId"];
|
|
968
|
+
};
|
|
969
|
+
cookie?: never;
|
|
970
|
+
};
|
|
971
|
+
requestBody?: {
|
|
972
|
+
content: {
|
|
973
|
+
"application/json": {
|
|
974
|
+
screenshots: components["schemas"]["ScreenshotInput"][];
|
|
975
|
+
parallel?: boolean | null;
|
|
976
|
+
parallelTotal?: number | null;
|
|
977
|
+
parallelIndex?: number | null;
|
|
978
|
+
metadata?: components["schemas"]["BuildMetadata"];
|
|
979
|
+
};
|
|
980
|
+
};
|
|
981
|
+
};
|
|
982
|
+
responses: {
|
|
983
|
+
/** @description Result of build update */
|
|
984
|
+
200: {
|
|
985
|
+
headers: {
|
|
986
|
+
[name: string]: unknown;
|
|
987
|
+
};
|
|
988
|
+
content: {
|
|
989
|
+
"application/json": {
|
|
990
|
+
build: components["schemas"]["Build"];
|
|
991
|
+
};
|
|
992
|
+
};
|
|
993
|
+
};
|
|
994
|
+
/** @description Invalid parameters */
|
|
995
|
+
400: {
|
|
996
|
+
headers: {
|
|
997
|
+
[name: string]: unknown;
|
|
998
|
+
};
|
|
999
|
+
content: {
|
|
1000
|
+
"application/json": components["schemas"]["Error"];
|
|
1001
|
+
};
|
|
1002
|
+
};
|
|
1003
|
+
/** @description Unauthorized */
|
|
1004
|
+
401: {
|
|
1005
|
+
headers: {
|
|
1006
|
+
[name: string]: unknown;
|
|
1007
|
+
};
|
|
1008
|
+
content: {
|
|
1009
|
+
"application/json": components["schemas"]["Error"];
|
|
1010
|
+
};
|
|
1011
|
+
};
|
|
1012
|
+
/** @description Forbidden */
|
|
1013
|
+
403: {
|
|
1014
|
+
headers: {
|
|
1015
|
+
[name: string]: unknown;
|
|
1016
|
+
};
|
|
1017
|
+
content: {
|
|
1018
|
+
"application/json": components["schemas"]["Error"];
|
|
1019
|
+
};
|
|
1020
|
+
};
|
|
1021
|
+
/** @description Not found */
|
|
1022
|
+
404: {
|
|
1023
|
+
headers: {
|
|
1024
|
+
[name: string]: unknown;
|
|
1025
|
+
};
|
|
1026
|
+
content: {
|
|
1027
|
+
"application/json": components["schemas"]["Error"];
|
|
1028
|
+
};
|
|
1029
|
+
};
|
|
1030
|
+
/** @description Conflict */
|
|
1031
|
+
409: {
|
|
1032
|
+
headers: {
|
|
1033
|
+
[name: string]: unknown;
|
|
1034
|
+
};
|
|
1035
|
+
content: {
|
|
1036
|
+
"application/json": components["schemas"]["Error"];
|
|
1037
|
+
};
|
|
1038
|
+
};
|
|
1039
|
+
/** @description Server error */
|
|
1040
|
+
500: {
|
|
1041
|
+
headers: {
|
|
1042
|
+
[name: string]: unknown;
|
|
1043
|
+
};
|
|
1044
|
+
content: {
|
|
1045
|
+
"application/json": components["schemas"]["Error"];
|
|
1046
|
+
};
|
|
1047
|
+
};
|
|
1048
|
+
};
|
|
1049
|
+
};
|
|
1050
|
+
getAuthProject: {
|
|
1051
|
+
parameters: {
|
|
1052
|
+
query?: never;
|
|
1053
|
+
header?: never;
|
|
1054
|
+
path?: never;
|
|
1055
|
+
cookie?: never;
|
|
1056
|
+
};
|
|
1057
|
+
requestBody?: never;
|
|
1058
|
+
responses: {
|
|
1059
|
+
/** @description Project */
|
|
1060
|
+
200: {
|
|
1061
|
+
headers: {
|
|
1062
|
+
[name: string]: unknown;
|
|
1063
|
+
};
|
|
1064
|
+
content: {
|
|
1065
|
+
"application/json": components["schemas"]["Project"];
|
|
1066
|
+
};
|
|
1067
|
+
};
|
|
1068
|
+
/** @description Unauthorized */
|
|
1069
|
+
401: {
|
|
1070
|
+
headers: {
|
|
1071
|
+
[name: string]: unknown;
|
|
1072
|
+
};
|
|
1073
|
+
content: {
|
|
1074
|
+
"application/json": components["schemas"]["Error"];
|
|
1075
|
+
};
|
|
1076
|
+
};
|
|
1077
|
+
/** @description Server error */
|
|
1078
|
+
500: {
|
|
1079
|
+
headers: {
|
|
1080
|
+
[name: string]: unknown;
|
|
1081
|
+
};
|
|
1082
|
+
content: {
|
|
1083
|
+
"application/json": components["schemas"]["Error"];
|
|
1084
|
+
};
|
|
1085
|
+
};
|
|
1086
|
+
};
|
|
1087
|
+
};
|
|
1088
|
+
getAuthProjectBuilds: {
|
|
1089
|
+
parameters: {
|
|
1090
|
+
query?: {
|
|
1091
|
+
/** @description Number of items per page (max 100) */
|
|
1092
|
+
perPage?: string;
|
|
1093
|
+
/** @description Page number */
|
|
1094
|
+
page?: string;
|
|
1095
|
+
commit?: components["schemas"]["Sha1Hash"];
|
|
1096
|
+
/** @description Only return the latest builds created, unique by name and commit. */
|
|
1097
|
+
distinctName?: string;
|
|
1098
|
+
};
|
|
1099
|
+
header?: never;
|
|
1100
|
+
path?: never;
|
|
1101
|
+
cookie?: never;
|
|
1102
|
+
};
|
|
1103
|
+
requestBody?: never;
|
|
1104
|
+
responses: {
|
|
1105
|
+
/** @description List of builds */
|
|
1106
|
+
200: {
|
|
1107
|
+
headers: {
|
|
1108
|
+
[name: string]: unknown;
|
|
1109
|
+
};
|
|
1110
|
+
content: {
|
|
1111
|
+
"application/json": {
|
|
1112
|
+
pageInfo: components["schemas"]["PageInfo"];
|
|
1113
|
+
results: components["schemas"]["Build"][];
|
|
1114
|
+
};
|
|
1115
|
+
};
|
|
1116
|
+
};
|
|
1117
|
+
/** @description Invalid parameters */
|
|
1118
|
+
400: {
|
|
1119
|
+
headers: {
|
|
1120
|
+
[name: string]: unknown;
|
|
1121
|
+
};
|
|
1122
|
+
content: {
|
|
1123
|
+
"application/json": components["schemas"]["Error"];
|
|
1124
|
+
};
|
|
1125
|
+
};
|
|
1126
|
+
/** @description Unauthorized */
|
|
1127
|
+
401: {
|
|
1128
|
+
headers: {
|
|
1129
|
+
[name: string]: unknown;
|
|
1130
|
+
};
|
|
1131
|
+
content: {
|
|
1132
|
+
"application/json": components["schemas"]["Error"];
|
|
1133
|
+
};
|
|
1134
|
+
};
|
|
1135
|
+
/** @description Server error */
|
|
1136
|
+
500: {
|
|
1137
|
+
headers: {
|
|
1138
|
+
[name: string]: unknown;
|
|
1139
|
+
};
|
|
1140
|
+
content: {
|
|
1141
|
+
"application/json": components["schemas"]["Error"];
|
|
1142
|
+
};
|
|
1143
|
+
};
|
|
1144
|
+
};
|
|
1145
|
+
};
|
|
1146
|
+
}
|
|
1147
|
+
}
|
|
541
1148
|
type ArgosAPIClient = ReturnType<typeof createClient>;
|
|
542
1149
|
/**
|
|
543
1150
|
* Create Argos API client.
|
|
@@ -546,4 +1153,11 @@ declare function createClient(options: {
|
|
|
546
1153
|
baseUrl?: string;
|
|
547
1154
|
authToken: string;
|
|
548
1155
|
}): import("openapi-fetch").Client<paths, `${string}/${string}`>;
|
|
549
|
-
|
|
1156
|
+
declare class APIError extends Error {
|
|
1157
|
+
constructor(message: string);
|
|
1158
|
+
}
|
|
1159
|
+
/**
|
|
1160
|
+
* Handle API errors.
|
|
1161
|
+
*/
|
|
1162
|
+
declare function throwAPIError(fetchResponse: FetchResponse<any, any, any>): never;
|
|
1163
|
+
export { ArgosAPISchema, ArgosAPIClient, createClient, APIError, throwAPIError };
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import createFetchClient from 'openapi-fetch';
|
|
2
2
|
|
|
3
|
+
var schema = /*#__PURE__*/Object.freeze({
|
|
4
|
+
__proto__: null
|
|
5
|
+
});
|
|
6
|
+
|
|
3
7
|
/**
|
|
4
8
|
* Create Argos API client.
|
|
5
9
|
*/ function createClient(options) {
|
|
@@ -11,5 +15,19 @@ import createFetchClient from 'openapi-fetch';
|
|
|
11
15
|
}
|
|
12
16
|
});
|
|
13
17
|
}
|
|
18
|
+
class APIError extends Error {
|
|
19
|
+
constructor(message){
|
|
20
|
+
super(message);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Handle API errors.
|
|
25
|
+
*/ function throwAPIError(fetchResponse) {
|
|
26
|
+
const { error, response } = fetchResponse;
|
|
27
|
+
if (error && typeof error === "object" && "error" in error && typeof error.error === "string") {
|
|
28
|
+
throw new APIError(error.error);
|
|
29
|
+
}
|
|
30
|
+
throw new APIError(`API error: ${response.status} ${response.statusText}`);
|
|
31
|
+
}
|
|
14
32
|
|
|
15
|
-
export { createClient };
|
|
33
|
+
export { APIError, schema as ArgosAPISchema, createClient, throwAPIError };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@argos-ci/api-client",
|
|
3
3
|
"description": "Argos API client.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.4.1-alpha.0+4ed9b25",
|
|
5
5
|
"author": "Smooth Code",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"openapi-fetch": "^0.11.1"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "4ed9b253b5037f2111d44bcd41fe3467371c41e3"
|
|
52
52
|
}
|