@argos-ci/api-client 0.6.1 → 0.7.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 +16 -577
- package/dist/index.js +39 -0
- package/package.json +16 -18
- package/dist/index.mjs +0 -35
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import * as openapi_fetch from 'openapi-fetch';
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* This file was auto-generated by openapi-typescript.
|
|
3
5
|
* Do not make direct changes to the file.
|
|
@@ -84,6 +86,7 @@ interface paths {
|
|
|
84
86
|
trace?: never;
|
|
85
87
|
};
|
|
86
88
|
}
|
|
89
|
+
type webhooks = Record<string, never>;
|
|
87
90
|
interface components {
|
|
88
91
|
schemas: {
|
|
89
92
|
/** @description SHA1 hash */
|
|
@@ -210,6 +213,7 @@ interface components {
|
|
|
210
213
|
headers: never;
|
|
211
214
|
pathItems: never;
|
|
212
215
|
}
|
|
216
|
+
type $defs = Record<string, never>;
|
|
213
217
|
interface operations {
|
|
214
218
|
createBuild: {
|
|
215
219
|
parameters: {
|
|
@@ -570,582 +574,16 @@ interface operations {
|
|
|
570
574
|
};
|
|
571
575
|
};
|
|
572
576
|
}
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
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
|
-
parentCommits?: components["schemas"]["Sha1Hash"][] | null;
|
|
811
|
-
/** @enum {string|null} */
|
|
812
|
-
mode?: "ci" | "monitoring" | null;
|
|
813
|
-
ciProvider?: string | null;
|
|
814
|
-
argosSdk?: string | null;
|
|
815
|
-
runId?: string | null;
|
|
816
|
-
runAttempt?: number | null;
|
|
817
|
-
};
|
|
818
|
-
};
|
|
819
|
-
};
|
|
820
|
-
responses: {
|
|
821
|
-
/** @description Result of build creation */
|
|
822
|
-
201: {
|
|
823
|
-
headers: {
|
|
824
|
-
[name: string]: unknown;
|
|
825
|
-
};
|
|
826
|
-
content: {
|
|
827
|
-
"application/json": {
|
|
828
|
-
build: components["schemas"]["Build"];
|
|
829
|
-
screenshots: {
|
|
830
|
-
key: string;
|
|
831
|
-
/** Format: uri */
|
|
832
|
-
putUrl: string;
|
|
833
|
-
}[];
|
|
834
|
-
pwTraces: {
|
|
835
|
-
key: string;
|
|
836
|
-
/** Format: uri */
|
|
837
|
-
putUrl: string;
|
|
838
|
-
}[];
|
|
839
|
-
};
|
|
840
|
-
};
|
|
841
|
-
};
|
|
842
|
-
/** @description Invalid parameters */
|
|
843
|
-
400: {
|
|
844
|
-
headers: {
|
|
845
|
-
[name: string]: unknown;
|
|
846
|
-
};
|
|
847
|
-
content: {
|
|
848
|
-
"application/json": components["schemas"]["Error"];
|
|
849
|
-
};
|
|
850
|
-
};
|
|
851
|
-
/** @description Unauthorized */
|
|
852
|
-
401: {
|
|
853
|
-
headers: {
|
|
854
|
-
[name: string]: unknown;
|
|
855
|
-
};
|
|
856
|
-
content: {
|
|
857
|
-
"application/json": components["schemas"]["Error"];
|
|
858
|
-
};
|
|
859
|
-
};
|
|
860
|
-
/** @description Conflict */
|
|
861
|
-
409: {
|
|
862
|
-
headers: {
|
|
863
|
-
[name: string]: unknown;
|
|
864
|
-
};
|
|
865
|
-
content: {
|
|
866
|
-
"application/json": components["schemas"]["Error"];
|
|
867
|
-
};
|
|
868
|
-
};
|
|
869
|
-
/** @description Server error */
|
|
870
|
-
500: {
|
|
871
|
-
headers: {
|
|
872
|
-
[name: string]: unknown;
|
|
873
|
-
};
|
|
874
|
-
content: {
|
|
875
|
-
"application/json": components["schemas"]["Error"];
|
|
876
|
-
};
|
|
877
|
-
};
|
|
878
|
-
};
|
|
879
|
-
};
|
|
880
|
-
finalizeBuilds: {
|
|
881
|
-
parameters: {
|
|
882
|
-
query?: never;
|
|
883
|
-
header?: never;
|
|
884
|
-
path?: never;
|
|
885
|
-
cookie?: never;
|
|
886
|
-
};
|
|
887
|
-
requestBody?: {
|
|
888
|
-
content: {
|
|
889
|
-
"application/json": {
|
|
890
|
-
parallelNonce: string;
|
|
891
|
-
};
|
|
892
|
-
};
|
|
893
|
-
};
|
|
894
|
-
responses: {
|
|
895
|
-
/** @description Result of build finalization */
|
|
896
|
-
200: {
|
|
897
|
-
headers: {
|
|
898
|
-
[name: string]: unknown;
|
|
899
|
-
};
|
|
900
|
-
content: {
|
|
901
|
-
"application/json": {
|
|
902
|
-
builds: components["schemas"]["Build"][];
|
|
903
|
-
};
|
|
904
|
-
};
|
|
905
|
-
};
|
|
906
|
-
/** @description Invalid parameters */
|
|
907
|
-
400: {
|
|
908
|
-
headers: {
|
|
909
|
-
[name: string]: unknown;
|
|
910
|
-
};
|
|
911
|
-
content: {
|
|
912
|
-
"application/json": components["schemas"]["Error"];
|
|
913
|
-
};
|
|
914
|
-
};
|
|
915
|
-
/** @description Unauthorized */
|
|
916
|
-
401: {
|
|
917
|
-
headers: {
|
|
918
|
-
[name: string]: unknown;
|
|
919
|
-
};
|
|
920
|
-
content: {
|
|
921
|
-
"application/json": components["schemas"]["Error"];
|
|
922
|
-
};
|
|
923
|
-
};
|
|
924
|
-
/** @description Forbidden */
|
|
925
|
-
403: {
|
|
926
|
-
headers: {
|
|
927
|
-
[name: string]: unknown;
|
|
928
|
-
};
|
|
929
|
-
content: {
|
|
930
|
-
"application/json": components["schemas"]["Error"];
|
|
931
|
-
};
|
|
932
|
-
};
|
|
933
|
-
/** @description Not found */
|
|
934
|
-
404: {
|
|
935
|
-
headers: {
|
|
936
|
-
[name: string]: unknown;
|
|
937
|
-
};
|
|
938
|
-
content: {
|
|
939
|
-
"application/json": components["schemas"]["Error"];
|
|
940
|
-
};
|
|
941
|
-
};
|
|
942
|
-
/** @description Conflict */
|
|
943
|
-
409: {
|
|
944
|
-
headers: {
|
|
945
|
-
[name: string]: unknown;
|
|
946
|
-
};
|
|
947
|
-
content: {
|
|
948
|
-
"application/json": components["schemas"]["Error"];
|
|
949
|
-
};
|
|
950
|
-
};
|
|
951
|
-
/** @description Server error */
|
|
952
|
-
500: {
|
|
953
|
-
headers: {
|
|
954
|
-
[name: string]: unknown;
|
|
955
|
-
};
|
|
956
|
-
content: {
|
|
957
|
-
"application/json": components["schemas"]["Error"];
|
|
958
|
-
};
|
|
959
|
-
};
|
|
960
|
-
};
|
|
961
|
-
};
|
|
962
|
-
updateBuild: {
|
|
963
|
-
parameters: {
|
|
964
|
-
query?: never;
|
|
965
|
-
header?: never;
|
|
966
|
-
path: {
|
|
967
|
-
/** @description A unique identifier for the build */
|
|
968
|
-
buildId: components["schemas"]["buildId"];
|
|
969
|
-
};
|
|
970
|
-
cookie?: never;
|
|
971
|
-
};
|
|
972
|
-
requestBody?: {
|
|
973
|
-
content: {
|
|
974
|
-
"application/json": {
|
|
975
|
-
screenshots: components["schemas"]["ScreenshotInput"][];
|
|
976
|
-
parallel?: boolean | null;
|
|
977
|
-
parallelTotal?: number | null;
|
|
978
|
-
parallelIndex?: number | null;
|
|
979
|
-
metadata?: components["schemas"]["BuildMetadata"];
|
|
980
|
-
};
|
|
981
|
-
};
|
|
982
|
-
};
|
|
983
|
-
responses: {
|
|
984
|
-
/** @description Result of build update */
|
|
985
|
-
200: {
|
|
986
|
-
headers: {
|
|
987
|
-
[name: string]: unknown;
|
|
988
|
-
};
|
|
989
|
-
content: {
|
|
990
|
-
"application/json": {
|
|
991
|
-
build: components["schemas"]["Build"];
|
|
992
|
-
};
|
|
993
|
-
};
|
|
994
|
-
};
|
|
995
|
-
/** @description Invalid parameters */
|
|
996
|
-
400: {
|
|
997
|
-
headers: {
|
|
998
|
-
[name: string]: unknown;
|
|
999
|
-
};
|
|
1000
|
-
content: {
|
|
1001
|
-
"application/json": components["schemas"]["Error"];
|
|
1002
|
-
};
|
|
1003
|
-
};
|
|
1004
|
-
/** @description Unauthorized */
|
|
1005
|
-
401: {
|
|
1006
|
-
headers: {
|
|
1007
|
-
[name: string]: unknown;
|
|
1008
|
-
};
|
|
1009
|
-
content: {
|
|
1010
|
-
"application/json": components["schemas"]["Error"];
|
|
1011
|
-
};
|
|
1012
|
-
};
|
|
1013
|
-
/** @description Forbidden */
|
|
1014
|
-
403: {
|
|
1015
|
-
headers: {
|
|
1016
|
-
[name: string]: unknown;
|
|
1017
|
-
};
|
|
1018
|
-
content: {
|
|
1019
|
-
"application/json": components["schemas"]["Error"];
|
|
1020
|
-
};
|
|
1021
|
-
};
|
|
1022
|
-
/** @description Not found */
|
|
1023
|
-
404: {
|
|
1024
|
-
headers: {
|
|
1025
|
-
[name: string]: unknown;
|
|
1026
|
-
};
|
|
1027
|
-
content: {
|
|
1028
|
-
"application/json": components["schemas"]["Error"];
|
|
1029
|
-
};
|
|
1030
|
-
};
|
|
1031
|
-
/** @description Conflict */
|
|
1032
|
-
409: {
|
|
1033
|
-
headers: {
|
|
1034
|
-
[name: string]: unknown;
|
|
1035
|
-
};
|
|
1036
|
-
content: {
|
|
1037
|
-
"application/json": components["schemas"]["Error"];
|
|
1038
|
-
};
|
|
1039
|
-
};
|
|
1040
|
-
/** @description Server error */
|
|
1041
|
-
500: {
|
|
1042
|
-
headers: {
|
|
1043
|
-
[name: string]: unknown;
|
|
1044
|
-
};
|
|
1045
|
-
content: {
|
|
1046
|
-
"application/json": components["schemas"]["Error"];
|
|
1047
|
-
};
|
|
1048
|
-
};
|
|
1049
|
-
};
|
|
1050
|
-
};
|
|
1051
|
-
getAuthProject: {
|
|
1052
|
-
parameters: {
|
|
1053
|
-
query?: never;
|
|
1054
|
-
header?: never;
|
|
1055
|
-
path?: never;
|
|
1056
|
-
cookie?: never;
|
|
1057
|
-
};
|
|
1058
|
-
requestBody?: never;
|
|
1059
|
-
responses: {
|
|
1060
|
-
/** @description Project */
|
|
1061
|
-
200: {
|
|
1062
|
-
headers: {
|
|
1063
|
-
[name: string]: unknown;
|
|
1064
|
-
};
|
|
1065
|
-
content: {
|
|
1066
|
-
"application/json": components["schemas"]["Project"];
|
|
1067
|
-
};
|
|
1068
|
-
};
|
|
1069
|
-
/** @description Unauthorized */
|
|
1070
|
-
401: {
|
|
1071
|
-
headers: {
|
|
1072
|
-
[name: string]: unknown;
|
|
1073
|
-
};
|
|
1074
|
-
content: {
|
|
1075
|
-
"application/json": components["schemas"]["Error"];
|
|
1076
|
-
};
|
|
1077
|
-
};
|
|
1078
|
-
/** @description Server error */
|
|
1079
|
-
500: {
|
|
1080
|
-
headers: {
|
|
1081
|
-
[name: string]: unknown;
|
|
1082
|
-
};
|
|
1083
|
-
content: {
|
|
1084
|
-
"application/json": components["schemas"]["Error"];
|
|
1085
|
-
};
|
|
1086
|
-
};
|
|
1087
|
-
};
|
|
1088
|
-
};
|
|
1089
|
-
getAuthProjectBuilds: {
|
|
1090
|
-
parameters: {
|
|
1091
|
-
query?: {
|
|
1092
|
-
/** @description Number of items per page (max 100) */
|
|
1093
|
-
perPage?: string;
|
|
1094
|
-
/** @description Page number */
|
|
1095
|
-
page?: string;
|
|
1096
|
-
commit?: components["schemas"]["Sha1Hash"];
|
|
1097
|
-
/** @description Only return the latest builds created, unique by name and commit. */
|
|
1098
|
-
distinctName?: string;
|
|
1099
|
-
};
|
|
1100
|
-
header?: never;
|
|
1101
|
-
path?: never;
|
|
1102
|
-
cookie?: never;
|
|
1103
|
-
};
|
|
1104
|
-
requestBody?: never;
|
|
1105
|
-
responses: {
|
|
1106
|
-
/** @description List of builds */
|
|
1107
|
-
200: {
|
|
1108
|
-
headers: {
|
|
1109
|
-
[name: string]: unknown;
|
|
1110
|
-
};
|
|
1111
|
-
content: {
|
|
1112
|
-
"application/json": {
|
|
1113
|
-
pageInfo: components["schemas"]["PageInfo"];
|
|
1114
|
-
results: components["schemas"]["Build"][];
|
|
1115
|
-
};
|
|
1116
|
-
};
|
|
1117
|
-
};
|
|
1118
|
-
/** @description Invalid parameters */
|
|
1119
|
-
400: {
|
|
1120
|
-
headers: {
|
|
1121
|
-
[name: string]: unknown;
|
|
1122
|
-
};
|
|
1123
|
-
content: {
|
|
1124
|
-
"application/json": components["schemas"]["Error"];
|
|
1125
|
-
};
|
|
1126
|
-
};
|
|
1127
|
-
/** @description Unauthorized */
|
|
1128
|
-
401: {
|
|
1129
|
-
headers: {
|
|
1130
|
-
[name: string]: unknown;
|
|
1131
|
-
};
|
|
1132
|
-
content: {
|
|
1133
|
-
"application/json": components["schemas"]["Error"];
|
|
1134
|
-
};
|
|
1135
|
-
};
|
|
1136
|
-
/** @description Server error */
|
|
1137
|
-
500: {
|
|
1138
|
-
headers: {
|
|
1139
|
-
[name: string]: unknown;
|
|
1140
|
-
};
|
|
1141
|
-
content: {
|
|
1142
|
-
"application/json": components["schemas"]["Error"];
|
|
1143
|
-
};
|
|
1144
|
-
};
|
|
1145
|
-
};
|
|
1146
|
-
};
|
|
1147
|
-
}
|
|
577
|
+
|
|
578
|
+
type schema_$defs = $defs;
|
|
579
|
+
type schema_components = components;
|
|
580
|
+
type schema_operations = operations;
|
|
581
|
+
type schema_paths = paths;
|
|
582
|
+
type schema_webhooks = webhooks;
|
|
583
|
+
declare namespace schema {
|
|
584
|
+
export type { schema_$defs as $defs, schema_components as components, schema_operations as operations, schema_paths as paths, schema_webhooks as webhooks };
|
|
1148
585
|
}
|
|
586
|
+
|
|
1149
587
|
type ArgosAPIClient = ReturnType<typeof createClient>;
|
|
1150
588
|
/**
|
|
1151
589
|
* Create Argos API client.
|
|
@@ -1153,7 +591,7 @@ type ArgosAPIClient = ReturnType<typeof createClient>;
|
|
|
1153
591
|
declare function createClient(options: {
|
|
1154
592
|
baseUrl?: string;
|
|
1155
593
|
authToken: string;
|
|
1156
|
-
}):
|
|
594
|
+
}): openapi_fetch.Client<paths, `${string}/${string}`>;
|
|
1157
595
|
declare class APIError extends Error {
|
|
1158
596
|
constructor(message: string);
|
|
1159
597
|
}
|
|
@@ -1166,4 +604,5 @@ declare function throwAPIError(error: {
|
|
|
1166
604
|
message: string;
|
|
1167
605
|
}[];
|
|
1168
606
|
}): never;
|
|
1169
|
-
|
|
607
|
+
|
|
608
|
+
export { APIError, type ArgosAPIClient, schema as ArgosAPISchema, createClient, throwAPIError };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// src/index.ts
|
|
2
|
+
import createFetchClient from "openapi-fetch";
|
|
3
|
+
|
|
4
|
+
// src/debug.ts
|
|
5
|
+
import createDebug from "debug";
|
|
6
|
+
var KEY = "@argos-ci/api-client";
|
|
7
|
+
var debug = createDebug(KEY);
|
|
8
|
+
|
|
9
|
+
// src/schema.ts
|
|
10
|
+
var schema_exports = {};
|
|
11
|
+
|
|
12
|
+
// src/index.ts
|
|
13
|
+
function createClient(options) {
|
|
14
|
+
const { baseUrl } = options || {};
|
|
15
|
+
return createFetchClient({
|
|
16
|
+
baseUrl: baseUrl || "https://api.argos-ci.com/v2/",
|
|
17
|
+
headers: {
|
|
18
|
+
Authorization: `Bearer ${options.authToken}`
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
var APIError = class extends Error {
|
|
23
|
+
constructor(message) {
|
|
24
|
+
super(message);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
function throwAPIError(error) {
|
|
28
|
+
debug("API error", error);
|
|
29
|
+
const detailMessage = error.details?.map((detail) => detail.message).join(", ");
|
|
30
|
+
throw new APIError(
|
|
31
|
+
detailMessage ? `${error.error}: ${detailMessage}` : error.error
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
export {
|
|
35
|
+
APIError,
|
|
36
|
+
schema_exports as ArgosAPISchema,
|
|
37
|
+
createClient,
|
|
38
|
+
throwAPIError
|
|
39
|
+
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@argos-ci/api-client",
|
|
3
|
-
"description": "Argos API
|
|
4
|
-
"version": "0.
|
|
3
|
+
"description": "Argos API Client library.",
|
|
4
|
+
"version": "0.7.0",
|
|
5
5
|
"author": "Smooth Code",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -9,15 +9,14 @@
|
|
|
9
9
|
"url": "https://github.com/argos-ci/argos-javascript.git",
|
|
10
10
|
"directory": "packages/api-client"
|
|
11
11
|
},
|
|
12
|
+
"homepage": "https://github.com/argos-ci/argos-javascript/blob/main/packages/api-client/README.md",
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/argos-ci/argos-javascript/issues"
|
|
15
|
+
},
|
|
12
16
|
"keywords": [
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"test automation",
|
|
17
|
-
"testing",
|
|
18
|
-
"visual testing",
|
|
19
|
-
"regression",
|
|
20
|
-
"visual regression"
|
|
17
|
+
"api",
|
|
18
|
+
"openapi",
|
|
19
|
+
"argos"
|
|
21
20
|
],
|
|
22
21
|
"publishConfig": {
|
|
23
22
|
"access": "public"
|
|
@@ -26,8 +25,8 @@
|
|
|
26
25
|
"exports": {
|
|
27
26
|
".": {
|
|
28
27
|
"types": "./dist/index.d.ts",
|
|
29
|
-
"import": "./dist/index.
|
|
30
|
-
"default": "./dist/index.
|
|
28
|
+
"import": "./dist/index.js",
|
|
29
|
+
"default": "./dist/index.js"
|
|
31
30
|
},
|
|
32
31
|
"./package.json": "./package.json"
|
|
33
32
|
},
|
|
@@ -36,19 +35,18 @@
|
|
|
36
35
|
"node": ">=18.0.0"
|
|
37
36
|
},
|
|
38
37
|
"scripts": {
|
|
39
|
-
"prebuild": "rm -rf dist",
|
|
40
38
|
"build-schema-types": "openapi-typescript https://api.argos-ci.com/v2/openapi.yaml -o src/schema.ts",
|
|
41
39
|
"build-schema-types-dev": "NODE_TLS_REJECT_UNAUTHORIZED=0 openapi-typescript https://api.argos-ci.dev:4001/v2/openapi.yaml -o src/schema.ts",
|
|
42
|
-
"build": "
|
|
40
|
+
"build": "tsup"
|
|
43
41
|
},
|
|
44
42
|
"devDependencies": {
|
|
45
43
|
"@types/debug": "^4.1.12",
|
|
46
44
|
"@types/node": "^18.19.44",
|
|
47
|
-
"openapi-typescript": "^7.
|
|
45
|
+
"openapi-typescript": "^7.4.2"
|
|
48
46
|
},
|
|
49
47
|
"dependencies": {
|
|
50
|
-
"debug": "^4.3.
|
|
51
|
-
"openapi-fetch": "^0.
|
|
48
|
+
"debug": "^4.3.7",
|
|
49
|
+
"openapi-fetch": "^0.13.0"
|
|
52
50
|
},
|
|
53
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "fe6e055a43e955e7df362ddaec59c84dc274bbb2"
|
|
54
52
|
}
|
package/dist/index.mjs
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import createFetchClient from 'openapi-fetch';
|
|
2
|
-
import createDebug from 'debug';
|
|
3
|
-
|
|
4
|
-
const KEY = "@argos-ci/api-client";
|
|
5
|
-
const debug = createDebug(KEY);
|
|
6
|
-
|
|
7
|
-
var schema = /*#__PURE__*/Object.freeze({
|
|
8
|
-
__proto__: null
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Create Argos API client.
|
|
13
|
-
*/ function createClient(options) {
|
|
14
|
-
const { baseUrl } = options || {};
|
|
15
|
-
return createFetchClient({
|
|
16
|
-
baseUrl: baseUrl || "https://api.argos-ci.com/v2/",
|
|
17
|
-
headers: {
|
|
18
|
-
Authorization: `Bearer ${options.authToken}`
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
class APIError extends Error {
|
|
23
|
-
constructor(message){
|
|
24
|
-
super(message);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Handle API errors.
|
|
29
|
-
*/ function throwAPIError(error) {
|
|
30
|
-
debug("API error", error);
|
|
31
|
-
const detailMessage = error.details?.map((detail)=>detail.message).join(", ");
|
|
32
|
-
throw new APIError(detailMessage ? `${error.error}: ${detailMessage}` : error.error);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export { APIError, schema as ArgosAPISchema, createClient, throwAPIError };
|