@argos-ci/api-client 0.4.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 CHANGED
@@ -87,17 +87,23 @@ interface paths {
87
87
  }
88
88
  interface components {
89
89
  schemas: {
90
+ /** @description SHA1 hash */
91
+ Sha1Hash: string;
92
+ /** @description SHA256 hash */
93
+ Sha256Hash: string;
90
94
  /** @description Build */
91
95
  Build: {
92
- /**
93
- * @description A unique identifier for the build
94
- * @example 12345
95
- */
96
- id: string;
96
+ id: components["schemas"]["BuildId"];
97
+ /** @description The build number */
97
98
  number: number;
99
+ /** @description The status of the build */
98
100
  status: ("accepted" | "rejected") | ("stable" | "diffDetected") | ("expired" | "pending" | "progress" | "error" | "aborted");
99
- /** Format: uri */
101
+ /**
102
+ * Format: uri
103
+ * @description The URL of the build
104
+ */
100
105
  url: string;
106
+ /** @description The notification payload for the build */
101
107
  notification: {
102
108
  description: string;
103
109
  context: string;
@@ -111,6 +117,11 @@ interface components {
111
117
  };
112
118
  } | null;
113
119
  };
120
+ /**
121
+ * @description A unique identifier for the build
122
+ * @example 12345
123
+ */
124
+ BuildId: string;
114
125
  /** @description Error response */
115
126
  Error: {
116
127
  error: string;
@@ -123,6 +134,76 @@ interface components {
123
134
  * @example 12345
124
135
  */
125
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
+ };
126
207
  };
127
208
  responses: never;
128
209
  parameters: never;
@@ -141,10 +222,10 @@ interface operations {
141
222
  requestBody?: {
142
223
  content: {
143
224
  "application/json": {
144
- commit: string;
225
+ commit: components["schemas"]["Sha1Hash"];
145
226
  branch: string;
146
- screenshotKeys: string[];
147
- pwTraceKeys?: string[];
227
+ screenshotKeys: components["schemas"]["Sha256Hash"][];
228
+ pwTraceKeys?: components["schemas"]["Sha256Hash"][];
148
229
  name?: string | null;
149
230
  parallel?: boolean | null;
150
231
  parallelNonce?: string | null;
@@ -316,52 +397,11 @@ interface operations {
316
397
  requestBody?: {
317
398
  content: {
318
399
  "application/json": {
319
- screenshots: {
320
- key: string;
321
- name: string;
322
- baseName?: string | null;
323
- metadata?: {
324
- url?: string;
325
- viewport?: {
326
- width: number;
327
- height: number;
328
- };
329
- /** @enum {string} */
330
- colorScheme?: "light" | "dark";
331
- /** @enum {string} */
332
- mediaType?: "screen" | "print";
333
- test?: {
334
- id?: string;
335
- title: string;
336
- titlePath: string[];
337
- retries?: number;
338
- retry?: number;
339
- repeat?: number;
340
- location?: {
341
- file: string;
342
- line: number;
343
- column: number;
344
- };
345
- } | null;
346
- browser?: {
347
- name: string;
348
- version: string;
349
- };
350
- automationLibrary: {
351
- name: string;
352
- version: string;
353
- };
354
- sdk: {
355
- name: string;
356
- version: string;
357
- };
358
- } | null;
359
- pwTraceKey?: string | null;
360
- threshold?: number | null;
361
- }[];
400
+ screenshots: components["schemas"]["ScreenshotInput"][];
362
401
  parallel?: boolean | null;
363
402
  parallelTotal?: number | null;
364
403
  parallelIndex?: number | null;
404
+ metadata?: components["schemas"]["BuildMetadata"];
365
405
  };
366
406
  };
367
407
  };
@@ -448,11 +488,7 @@ interface operations {
448
488
  [name: string]: unknown;
449
489
  };
450
490
  content: {
451
- "application/json": {
452
- id: string;
453
- defaultBaseBranch: string;
454
- hasRemoteContentAccess: boolean;
455
- };
491
+ "application/json": components["schemas"]["Project"];
456
492
  };
457
493
  };
458
494
  /** @description Unauthorized */
@@ -482,8 +518,7 @@ interface operations {
482
518
  perPage?: string;
483
519
  /** @description Page number */
484
520
  page?: string;
485
- /** @description Commit hash. */
486
- commit?: string;
521
+ commit?: components["schemas"]["Sha1Hash"];
487
522
  /** @description Only return the latest builds created, unique by name and commit. */
488
523
  distinctName?: string;
489
524
  };
@@ -500,11 +535,7 @@ interface operations {
500
535
  };
501
536
  content: {
502
537
  "application/json": {
503
- pageInfo: {
504
- total: number;
505
- page: number;
506
- perPage: number;
507
- };
538
+ pageInfo: components["schemas"]["PageInfo"];
508
539
  results: components["schemas"]["Build"][];
509
540
  };
510
541
  };
@@ -539,6 +570,581 @@ interface operations {
539
570
  };
540
571
  };
541
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
+ }
542
1148
  type ArgosAPIClient = ReturnType<typeof createClient>;
543
1149
  /**
544
1150
  * Create Argos API client.
@@ -554,4 +1160,4 @@ declare class APIError extends Error {
554
1160
  * Handle API errors.
555
1161
  */
556
1162
  declare function throwAPIError(fetchResponse: FetchResponse<any, any, any>): never;
557
- export { ArgosAPIClient, createClient, APIError, throwAPIError };
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) {
@@ -26,4 +30,4 @@ class APIError extends Error {
26
30
  throw new APIError(`API error: ${response.status} ${response.statusText}`);
27
31
  }
28
32
 
29
- export { APIError, createClient, throwAPIError };
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.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": "d5b9650164fd482ee2b4dbf5c93fcef591f447eb"
51
+ "gitHead": "4ed9b253b5037f2111d44bcd41fe3467371c41e3"
52
52
  }