@argos-ci/api-client 0.0.1-alpha.347
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/LICENSE +7 -0
- package/README.md +15 -0
- package/dist/index.d.ts +114 -0
- package/dist/index.mjs +15 -0
- package/package.json +51 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Copyright 2022 Smooth Code
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
|
+
|
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://argos-ci.com/?utm_source=github&utm_medium=logo" target="_blank">
|
|
3
|
+
<img src="https://raw.githubusercontent.com/argos-ci/argos/main/resources/logos/logo-github-readme.png" alt="Argos" width="300" height="61">
|
|
4
|
+
</a>
|
|
5
|
+
</p>
|
|
6
|
+
|
|
7
|
+
_Argos is a visual testing solution that fits in your workflow to avoid visual regression. Takes screenshots on each commit and be notified if something changes._
|
|
8
|
+
|
|
9
|
+
# Argos API Client
|
|
10
|
+
|
|
11
|
+
Argos API Client to interact with Argos API.
|
|
12
|
+
|
|
13
|
+
[](https://www.npmjs.com/package/@argos-ci/api-client)
|
|
14
|
+
[](https://www.npmjs.com/package/@argos-ci/api-client)
|
|
15
|
+
[](https://www.npmjs.com/package/@argos-ci/api-client)
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by openapi-typescript.
|
|
3
|
+
* Do not make direct changes to the file.
|
|
4
|
+
*/
|
|
5
|
+
interface paths {
|
|
6
|
+
"/project/builds": {
|
|
7
|
+
get: operations["getAuthProjectBuilds"];
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
interface components {
|
|
11
|
+
schemas: {
|
|
12
|
+
/** @description Build */
|
|
13
|
+
Build: {
|
|
14
|
+
id: string;
|
|
15
|
+
number: number;
|
|
16
|
+
status: ("accepted" | "rejected") | ("stable" | "diffDetected") | ("expired" | "pending" | "progress" | "error" | "aborted");
|
|
17
|
+
/** Format: uri */
|
|
18
|
+
url: string;
|
|
19
|
+
notification: {
|
|
20
|
+
description: string;
|
|
21
|
+
context: string;
|
|
22
|
+
github: {
|
|
23
|
+
/** @enum {string} */
|
|
24
|
+
state: "pending" | "success" | "error" | "failure";
|
|
25
|
+
};
|
|
26
|
+
gitlab: {
|
|
27
|
+
/** @enum {string} */
|
|
28
|
+
state: "pending" | "running" | "success" | "failed" | "canceled";
|
|
29
|
+
};
|
|
30
|
+
} | null;
|
|
31
|
+
};
|
|
32
|
+
/** @description Error response */
|
|
33
|
+
Error: {
|
|
34
|
+
error: string;
|
|
35
|
+
details: {
|
|
36
|
+
message: string;
|
|
37
|
+
}[];
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
responses: never;
|
|
41
|
+
parameters: never;
|
|
42
|
+
requestBodies: never;
|
|
43
|
+
headers: never;
|
|
44
|
+
pathItems: never;
|
|
45
|
+
}
|
|
46
|
+
interface operations {
|
|
47
|
+
getAuthProjectBuilds: {
|
|
48
|
+
parameters: {
|
|
49
|
+
query?: {
|
|
50
|
+
/** @description Number of items per page (max 100) */
|
|
51
|
+
perPage?: string;
|
|
52
|
+
/** @description Page number */
|
|
53
|
+
page?: string;
|
|
54
|
+
/** @description Commit hash. */
|
|
55
|
+
commit?: string;
|
|
56
|
+
/** @description Only return the latest builds created, unique by name and commit. */
|
|
57
|
+
distinctName?: string;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
responses: {
|
|
61
|
+
/** @description List of builds */
|
|
62
|
+
200: {
|
|
63
|
+
content: {
|
|
64
|
+
"application/json": {
|
|
65
|
+
results: components["schemas"]["Build"][];
|
|
66
|
+
pageInfo: {
|
|
67
|
+
total: number;
|
|
68
|
+
page: number;
|
|
69
|
+
perPage: number;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
/** @description Invalid parameters */
|
|
75
|
+
400: {
|
|
76
|
+
content: {
|
|
77
|
+
"application/json": components["schemas"]["Error"];
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
/** @description Unauthorized */
|
|
81
|
+
401: {
|
|
82
|
+
content: {
|
|
83
|
+
"application/json": components["schemas"]["Error"];
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
/** @description Server error */
|
|
87
|
+
500: {
|
|
88
|
+
content: {
|
|
89
|
+
"application/json": components["schemas"]["Error"];
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
type ArgosAPIClient = ReturnType<typeof createClient>;
|
|
96
|
+
/**
|
|
97
|
+
* Create Argos API client.
|
|
98
|
+
*/
|
|
99
|
+
declare function createClient(options: {
|
|
100
|
+
baseUrl?: string;
|
|
101
|
+
authToken: string;
|
|
102
|
+
}): {
|
|
103
|
+
GET: import("openapi-fetch").ClientMethod<paths, "get">;
|
|
104
|
+
PUT: import("openapi-fetch").ClientMethod<paths, "put">;
|
|
105
|
+
POST: import("openapi-fetch").ClientMethod<paths, "post">;
|
|
106
|
+
DELETE: import("openapi-fetch").ClientMethod<paths, "delete">;
|
|
107
|
+
OPTIONS: import("openapi-fetch").ClientMethod<paths, "options">;
|
|
108
|
+
HEAD: import("openapi-fetch").ClientMethod<paths, "head">;
|
|
109
|
+
PATCH: import("openapi-fetch").ClientMethod<paths, "patch">;
|
|
110
|
+
TRACE: import("openapi-fetch").ClientMethod<paths, "trace">;
|
|
111
|
+
use(...middleware: import("openapi-fetch").Middleware[]): void;
|
|
112
|
+
eject(...middleware: import("openapi-fetch").Middleware[]): void;
|
|
113
|
+
};
|
|
114
|
+
export { ArgosAPIClient, createClient };
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import createFetchClient from 'openapi-fetch';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Create Argos API client.
|
|
5
|
+
*/ function createClient(options) {
|
|
6
|
+
const { baseUrl } = options || {};
|
|
7
|
+
return createFetchClient({
|
|
8
|
+
baseUrl: baseUrl || "https://api.argos-ci.com/v2/",
|
|
9
|
+
headers: {
|
|
10
|
+
Authorization: `Bearer ${options.authToken}`
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export { createClient };
|
package/package.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@argos-ci/api-client",
|
|
3
|
+
"description": "Argos API client.",
|
|
4
|
+
"version": "0.0.1-alpha.347+294bbba",
|
|
5
|
+
"author": "Smooth Code",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/argos-ci/argos-javascript.git",
|
|
10
|
+
"directory": "packages/api-client"
|
|
11
|
+
},
|
|
12
|
+
"keywords": [
|
|
13
|
+
"browser",
|
|
14
|
+
"argos",
|
|
15
|
+
"automation",
|
|
16
|
+
"test automation",
|
|
17
|
+
"testing",
|
|
18
|
+
"visual testing",
|
|
19
|
+
"regression",
|
|
20
|
+
"visual regression"
|
|
21
|
+
],
|
|
22
|
+
"publishConfig": {
|
|
23
|
+
"access": "public"
|
|
24
|
+
},
|
|
25
|
+
"type": "module",
|
|
26
|
+
"exports": {
|
|
27
|
+
".": {
|
|
28
|
+
"types": "./dist/index.d.ts",
|
|
29
|
+
"import": "./dist/index.mjs",
|
|
30
|
+
"default": "./dist/index.mjs"
|
|
31
|
+
},
|
|
32
|
+
"./package.json": "./package.json"
|
|
33
|
+
},
|
|
34
|
+
"types": "./dist/index.d.ts",
|
|
35
|
+
"engines": {
|
|
36
|
+
"node": ">=18.0.0"
|
|
37
|
+
},
|
|
38
|
+
"scripts": {
|
|
39
|
+
"prebuild": "rm -rf dist",
|
|
40
|
+
"build-schema-types": "openapi-typescript https://api.argos-ci.com/v2/openapi.yaml -o src/schema.ts",
|
|
41
|
+
"build": "rollup -c"
|
|
42
|
+
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"@types/node": "^18.0.0",
|
|
45
|
+
"openapi-typescript": "^6.7.5"
|
|
46
|
+
},
|
|
47
|
+
"dependencies": {
|
|
48
|
+
"openapi-fetch": "^0.9.3"
|
|
49
|
+
},
|
|
50
|
+
"gitHead": "294bbba6b1d3e757aa436af9f4f8ac6f684424a7"
|
|
51
|
+
}
|