@argos-ci/api-client 0.23.0 → 0.24.1
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/README.md +37 -3
- package/dist/index.d.mts +142 -5
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,15 +1,49 @@
|
|
|
1
1
|
<p align="center">
|
|
2
2
|
<a href="https://argos-ci.com/?utm_source=github&utm_medium=logo" target="_blank">
|
|
3
|
-
|
|
3
|
+
<picture>
|
|
4
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/argos-ci/argos/main/resources/logos/github-readme-logo-dark.png">
|
|
5
|
+
<img alt="Argos" src="https://raw.githubusercontent.com/argos-ci/argos/main/resources/logos/github-readme-logo-light.png" width="360" height="70">
|
|
6
|
+
</picture>
|
|
4
7
|
</a>
|
|
5
8
|
</p>
|
|
6
9
|
|
|
7
|
-
|
|
10
|
+
<p align="center"><strong>The open source visual testing platform for AI-native engineering teams.</strong></p>
|
|
8
11
|
|
|
9
12
|
# Argos API Client
|
|
10
13
|
|
|
11
|
-
|
|
14
|
+
A typed client for the [Argos API](https://api.argos-ci.com/v2/), built on [openapi-fetch](https://openapi-ts.dev/openapi-fetch/).
|
|
12
15
|
|
|
13
16
|
[](https://www.npmjs.com/package/@argos-ci/api-client)
|
|
14
17
|
[](https://www.npmjs.com/package/@argos-ci/api-client)
|
|
15
18
|
[](https://www.npmjs.com/package/@argos-ci/api-client)
|
|
19
|
+
|
|
20
|
+
## Installation
|
|
21
|
+
|
|
22
|
+
```sh
|
|
23
|
+
npm install @argos-ci/api-client
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Usage
|
|
27
|
+
|
|
28
|
+
Create a client and call any endpoint. Requests and responses are fully typed from the Argos OpenAPI schema:
|
|
29
|
+
|
|
30
|
+
```ts
|
|
31
|
+
import { createClient } from "@argos-ci/api-client";
|
|
32
|
+
|
|
33
|
+
const client = createClient({
|
|
34
|
+
authToken: process.env.ARGOS_TOKEN,
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
const { data, error } = await client.GET("/project");
|
|
38
|
+
|
|
39
|
+
if (error) {
|
|
40
|
+
throw new Error(error.error);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
console.log(data);
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Links
|
|
47
|
+
|
|
48
|
+
- [Official Docs](https://argos-ci.com/docs)
|
|
49
|
+
- [Discord](https://argos-ci.com/discord)
|
package/dist/index.d.mts
CHANGED
|
@@ -126,6 +126,26 @@ interface paths {
|
|
|
126
126
|
patch?: never;
|
|
127
127
|
trace?: never;
|
|
128
128
|
};
|
|
129
|
+
"/baseline": {
|
|
130
|
+
parameters: {
|
|
131
|
+
query?: never;
|
|
132
|
+
header?: never;
|
|
133
|
+
path?: never;
|
|
134
|
+
cookie?: never;
|
|
135
|
+
};
|
|
136
|
+
get?: never;
|
|
137
|
+
put?: never;
|
|
138
|
+
/**
|
|
139
|
+
* Find an eligible baseline from a list of commits
|
|
140
|
+
* @description Find the build eligible to be used as a baseline among a list of commits. Useful when no Git provider is connected: the CLI can send the candidate ancestor commits and let Argos pick the closest one that has an eligible (complete, valid, approved and not rejected) baseline build.
|
|
141
|
+
*/
|
|
142
|
+
post: operations["findBaseline"];
|
|
143
|
+
delete?: never;
|
|
144
|
+
options?: never;
|
|
145
|
+
head?: never;
|
|
146
|
+
patch?: never;
|
|
147
|
+
trace?: never;
|
|
148
|
+
};
|
|
129
149
|
"/auth/cli/token": {
|
|
130
150
|
parameters: {
|
|
131
151
|
query?: never;
|
|
@@ -186,6 +206,26 @@ interface paths {
|
|
|
186
206
|
patch?: never;
|
|
187
207
|
trace?: never;
|
|
188
208
|
};
|
|
209
|
+
"/me": {
|
|
210
|
+
parameters: {
|
|
211
|
+
query?: never;
|
|
212
|
+
header?: never;
|
|
213
|
+
path?: never;
|
|
214
|
+
cookie?: never;
|
|
215
|
+
};
|
|
216
|
+
/**
|
|
217
|
+
* Get the current user
|
|
218
|
+
* @description Retrieve the user associated with the personal access token used to authenticate the request.
|
|
219
|
+
*/
|
|
220
|
+
get: operations["getMe"];
|
|
221
|
+
put?: never;
|
|
222
|
+
post?: never;
|
|
223
|
+
delete?: never;
|
|
224
|
+
options?: never;
|
|
225
|
+
head?: never;
|
|
226
|
+
patch?: never;
|
|
227
|
+
trace?: never;
|
|
228
|
+
};
|
|
189
229
|
"/project": {
|
|
190
230
|
parameters: {
|
|
191
231
|
query?: never;
|
|
@@ -646,6 +686,11 @@ interface components {
|
|
|
646
686
|
details?: {
|
|
647
687
|
message: string;
|
|
648
688
|
}[];
|
|
689
|
+
}; /** @description A user. */
|
|
690
|
+
User: {
|
|
691
|
+
id: string;
|
|
692
|
+
slug: string;
|
|
693
|
+
name: string | null;
|
|
649
694
|
}; /** @description Project */
|
|
650
695
|
Project: {
|
|
651
696
|
id: string;
|
|
@@ -826,11 +871,6 @@ interface components {
|
|
|
826
871
|
dismissedAt: string | null; /** @description The user who dismissed the review, if any. */
|
|
827
872
|
dismissedBy: components["schemas"]["User"] | null; /** @description Date the review was created. */
|
|
828
873
|
date: string;
|
|
829
|
-
}; /** @description A user. */
|
|
830
|
-
User: {
|
|
831
|
-
id: string;
|
|
832
|
-
slug: string;
|
|
833
|
-
name: string | null;
|
|
834
874
|
}; /** @description A comment posted on a build. */
|
|
835
875
|
Comment: {
|
|
836
876
|
id: string;
|
|
@@ -1311,6 +1351,68 @@ interface operations {
|
|
|
1311
1351
|
};
|
|
1312
1352
|
};
|
|
1313
1353
|
};
|
|
1354
|
+
findBaseline: {
|
|
1355
|
+
parameters: {
|
|
1356
|
+
query?: never;
|
|
1357
|
+
header?: never;
|
|
1358
|
+
path?: never;
|
|
1359
|
+
cookie?: never;
|
|
1360
|
+
};
|
|
1361
|
+
requestBody?: {
|
|
1362
|
+
content: {
|
|
1363
|
+
"application/json": {
|
|
1364
|
+
/** @description The commits to look for an eligible baseline, ordered from the closest to the furthest ancestor. The first commit with an eligible baseline wins. */commits: components["schemas"]["Sha1Hash"][];
|
|
1365
|
+
/**
|
|
1366
|
+
* @description The name of the build to find a baseline for.
|
|
1367
|
+
* @default default
|
|
1368
|
+
*/
|
|
1369
|
+
name?: string;
|
|
1370
|
+
/**
|
|
1371
|
+
* @description The mode of the build to find a baseline for.
|
|
1372
|
+
* @default ci
|
|
1373
|
+
* @enum {string}
|
|
1374
|
+
*/
|
|
1375
|
+
mode?: "ci" | "monitoring";
|
|
1376
|
+
};
|
|
1377
|
+
};
|
|
1378
|
+
};
|
|
1379
|
+
responses: {
|
|
1380
|
+
/** @description The eligible baseline build, or null when none is found */200: {
|
|
1381
|
+
headers: {
|
|
1382
|
+
[name: string]: unknown;
|
|
1383
|
+
};
|
|
1384
|
+
content: {
|
|
1385
|
+
"application/json": {
|
|
1386
|
+
/** @description The eligible baseline build found among the commits, or null when none is found. */baseline: components["schemas"]["Build"] | null;
|
|
1387
|
+
};
|
|
1388
|
+
};
|
|
1389
|
+
}; /** @description Invalid parameters */
|
|
1390
|
+
400: {
|
|
1391
|
+
headers: {
|
|
1392
|
+
[name: string]: unknown;
|
|
1393
|
+
};
|
|
1394
|
+
content: {
|
|
1395
|
+
"application/json": components["schemas"]["Error"];
|
|
1396
|
+
};
|
|
1397
|
+
}; /** @description Unauthorized */
|
|
1398
|
+
401: {
|
|
1399
|
+
headers: {
|
|
1400
|
+
[name: string]: unknown;
|
|
1401
|
+
};
|
|
1402
|
+
content: {
|
|
1403
|
+
"application/json": components["schemas"]["Error"];
|
|
1404
|
+
};
|
|
1405
|
+
}; /** @description Server error */
|
|
1406
|
+
500: {
|
|
1407
|
+
headers: {
|
|
1408
|
+
[name: string]: unknown;
|
|
1409
|
+
};
|
|
1410
|
+
content: {
|
|
1411
|
+
"application/json": components["schemas"]["Error"];
|
|
1412
|
+
};
|
|
1413
|
+
};
|
|
1414
|
+
};
|
|
1415
|
+
};
|
|
1314
1416
|
exchangeCliToken: {
|
|
1315
1417
|
parameters: {
|
|
1316
1418
|
query?: never;
|
|
@@ -1503,6 +1605,41 @@ interface operations {
|
|
|
1503
1605
|
};
|
|
1504
1606
|
};
|
|
1505
1607
|
};
|
|
1608
|
+
getMe: {
|
|
1609
|
+
parameters: {
|
|
1610
|
+
query?: never;
|
|
1611
|
+
header?: never;
|
|
1612
|
+
path?: never;
|
|
1613
|
+
cookie?: never;
|
|
1614
|
+
};
|
|
1615
|
+
requestBody?: never;
|
|
1616
|
+
responses: {
|
|
1617
|
+
/** @description The authenticated user */200: {
|
|
1618
|
+
headers: {
|
|
1619
|
+
[name: string]: unknown;
|
|
1620
|
+
};
|
|
1621
|
+
content: {
|
|
1622
|
+
"application/json": components["schemas"]["User"];
|
|
1623
|
+
};
|
|
1624
|
+
}; /** @description Unauthorized */
|
|
1625
|
+
401: {
|
|
1626
|
+
headers: {
|
|
1627
|
+
[name: string]: unknown;
|
|
1628
|
+
};
|
|
1629
|
+
content: {
|
|
1630
|
+
"application/json": components["schemas"]["Error"];
|
|
1631
|
+
};
|
|
1632
|
+
}; /** @description Server error */
|
|
1633
|
+
500: {
|
|
1634
|
+
headers: {
|
|
1635
|
+
[name: string]: unknown;
|
|
1636
|
+
};
|
|
1637
|
+
content: {
|
|
1638
|
+
"application/json": components["schemas"]["Error"];
|
|
1639
|
+
};
|
|
1640
|
+
};
|
|
1641
|
+
};
|
|
1642
|
+
};
|
|
1506
1643
|
getAuthProject: {
|
|
1507
1644
|
parameters: {
|
|
1508
1645
|
query?: never;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@argos-ci/api-client",
|
|
3
3
|
"description": "Argos API Client library.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.24.1",
|
|
5
5
|
"author": "Smooth Code",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"openapi-fetch": "^0.17.0",
|
|
55
55
|
"p-retry": "^8.0.0"
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "7fddaad1a6bb251a1f2eecbf8f4ecfa3e84e9b97"
|
|
58
58
|
}
|