@argos-ci/api-client 0.24.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/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/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.24.
|
|
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
|
}
|