@autifyhq/autify-sdk 0.1.0-beta.2

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.
Files changed (31) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +18 -0
  3. package/dist/debug.d.ts +1 -0
  4. package/dist/debug.js +11 -0
  5. package/dist/generated/mobile/client.d.ts +32 -0
  6. package/dist/generated/mobile/client.js +62 -0
  7. package/dist/generated/mobile/openapi/api.d.ts +316 -0
  8. package/dist/generated/mobile/openapi/api.js +277 -0
  9. package/dist/generated/mobile/openapi/base.d.ts +55 -0
  10. package/dist/generated/mobile/openapi/base.js +61 -0
  11. package/dist/generated/mobile/openapi/common.d.ts +66 -0
  12. package/dist/generated/mobile/openapi/common.js +144 -0
  13. package/dist/generated/mobile/openapi/configuration.d.ts +83 -0
  14. package/dist/generated/mobile/openapi/configuration.js +44 -0
  15. package/dist/generated/mobile/openapi/index.d.ts +13 -0
  16. package/dist/generated/mobile/openapi/index.js +18 -0
  17. package/dist/generated/web/client.d.ts +117 -0
  18. package/dist/generated/web/client.js +165 -0
  19. package/dist/generated/web/openapi/api.d.ts +1402 -0
  20. package/dist/generated/web/openapi/api.js +1135 -0
  21. package/dist/generated/web/openapi/base.d.ts +55 -0
  22. package/dist/generated/web/openapi/base.js +61 -0
  23. package/dist/generated/web/openapi/common.d.ts +66 -0
  24. package/dist/generated/web/openapi/common.js +144 -0
  25. package/dist/generated/web/openapi/configuration.d.ts +83 -0
  26. package/dist/generated/web/openapi/configuration.js +44 -0
  27. package/dist/generated/web/openapi/index.d.ts +13 -0
  28. package/dist/generated/web/openapi/index.js +18 -0
  29. package/dist/index.d.ts +3 -0
  30. package/dist/index.js +10 -0
  31. package/package.json +60 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Autify Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,18 @@
1
+ # Autify SDK for JavaScript
2
+
3
+ **NOTE: This package is primarily designed for [Autify CLI](https://github.com/autifyhq/autify-cli) so far.**
4
+
5
+ ## Install
6
+
7
+ ```shell
8
+ npm install @autifyhq/autify-sdk
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```javascript
14
+ import { WebClient } from "@autifyhq/autify-sdk";
15
+
16
+ const client = new WebClient(token);
17
+ await client.listCapabilities(projectId);
18
+ ```
@@ -0,0 +1 @@
1
+ export {};
package/dist/debug.js ADDED
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const debug_1 = tslib_1.__importDefault(require("debug"));
5
+ const axios_1 = tslib_1.__importDefault(require("axios"));
6
+ const axios_logger_1 = require("axios-logger");
7
+ (0, axios_logger_1.setGlobalConfig)({
8
+ logger: (0, debug_1.default)("axios"),
9
+ });
10
+ axios_1.default.interceptors.request.use(axios_logger_1.requestLogger, axios_logger_1.errorLogger);
11
+ axios_1.default.interceptors.response.use(axios_logger_1.responseLogger, axios_logger_1.errorLogger);
@@ -0,0 +1,32 @@
1
+ import { AxiosRequestConfig } from "axios";
2
+ import { RunTestPlan201Response, RunTestPlanRequest, UploadBuild201Response } from "./openapi";
3
+ export { BASE_PATH } from "./openapi/base";
4
+ declare type Options = Readonly<{
5
+ basePath?: string;
6
+ userAgent?: string;
7
+ }>;
8
+ export declare class Client {
9
+ constructor(accessToken: string, { basePath, userAgent }?: Options);
10
+ private readonly buildsApi;
11
+ /**
12
+ * Upload the build file.
13
+ * @summary Upload a build
14
+ * @param {string} projectId The ID of the project to upload the build file to.
15
+ * @param {any} file Build file.
16
+ * @param {*} [options] Override http request option.
17
+ * @throws {RequiredError}
18
+ * @memberof BuildsApi
19
+ */
20
+ uploadBuild(projectId: string, file: any, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<UploadBuild201Response, any>>;
21
+ private readonly testPlansApi;
22
+ /**
23
+ * Run a test plan
24
+ * @summary Run a test plan
25
+ * @param {string} testPlanId The ID of the test plan to run.
26
+ * @param {RunTestPlanRequest} runTestPlanRequest The build_id to execute the test plan.
27
+ * @param {*} [options] Override http request option.
28
+ * @throws {RequiredError}
29
+ * @memberof TestPlansApi
30
+ */
31
+ runTestPlan(testPlanId: string, runTestPlanRequest: RunTestPlanRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<RunTestPlan201Response, any>>;
32
+ }
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Client = exports.BASE_PATH = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const form_data_1 = tslib_1.__importDefault(require("form-data"));
6
+ const fs_1 = require("fs");
7
+ const openapi_1 = require("./openapi");
8
+ var base_1 = require("./openapi/base");
9
+ Object.defineProperty(exports, "BASE_PATH", { enumerable: true, get: function () { return base_1.BASE_PATH; } });
10
+ class CustomFormData extends form_data_1.default {
11
+ append(key, filename) {
12
+ const blob = (0, fs_1.readFileSync)(filename);
13
+ super.append(key, blob, { filename });
14
+ }
15
+ }
16
+ class Client {
17
+ constructor(accessToken, { basePath, userAgent } = {}) {
18
+ if (!accessToken) {
19
+ throw new Error("accessToken is required.");
20
+ }
21
+ const baseOptions = {
22
+ ...(userAgent && {
23
+ headers: {
24
+ "User-Agent": userAgent,
25
+ },
26
+ }),
27
+ };
28
+ const configuration = new openapi_1.Configuration({
29
+ accessToken,
30
+ basePath,
31
+ formDataCtor: CustomFormData,
32
+ baseOptions,
33
+ });
34
+ this.buildsApi = new openapi_1.BuildsApi(configuration);
35
+ this.testPlansApi = new openapi_1.TestPlansApi(configuration);
36
+ }
37
+ /**
38
+ * Upload the build file.
39
+ * @summary Upload a build
40
+ * @param {string} projectId The ID of the project to upload the build file to.
41
+ * @param {any} file Build file.
42
+ * @param {*} [options] Override http request option.
43
+ * @throws {RequiredError}
44
+ * @memberof BuildsApi
45
+ */
46
+ uploadBuild(projectId, file, options) {
47
+ return this.buildsApi.uploadBuild(projectId, file, options);
48
+ }
49
+ /**
50
+ * Run a test plan
51
+ * @summary Run a test plan
52
+ * @param {string} testPlanId The ID of the test plan to run.
53
+ * @param {RunTestPlanRequest} runTestPlanRequest The build_id to execute the test plan.
54
+ * @param {*} [options] Override http request option.
55
+ * @throws {RequiredError}
56
+ * @memberof TestPlansApi
57
+ */
58
+ runTestPlan(testPlanId, runTestPlanRequest, options) {
59
+ return this.testPlansApi.runTestPlan(testPlanId, runTestPlanRequest, options);
60
+ }
61
+ }
62
+ exports.Client = Client;
@@ -0,0 +1,316 @@
1
+ /**
2
+ * Autify for Mobile API
3
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
+ *
5
+ * The version of the OpenAPI document: v1
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import { Configuration } from "./configuration";
13
+ import { AxiosPromise, AxiosInstance, AxiosRequestConfig } from "axios";
14
+ import { RequestArgs, BaseAPI } from "./base";
15
+ /**
16
+ *
17
+ * @export
18
+ * @interface RunTestPlan201Response
19
+ */
20
+ export interface RunTestPlan201Response {
21
+ /**
22
+ *
23
+ * @type {string}
24
+ * @memberof RunTestPlan201Response
25
+ */
26
+ id?: string;
27
+ /**
28
+ *
29
+ * @type {RunTestPlan201ResponseTestPlan}
30
+ * @memberof RunTestPlan201Response
31
+ */
32
+ test_plan?: RunTestPlan201ResponseTestPlan;
33
+ }
34
+ /**
35
+ *
36
+ * @export
37
+ * @interface RunTestPlan201ResponseTestPlan
38
+ */
39
+ export interface RunTestPlan201ResponseTestPlan {
40
+ /**
41
+ *
42
+ * @type {string}
43
+ * @memberof RunTestPlan201ResponseTestPlan
44
+ */
45
+ id?: string;
46
+ /**
47
+ *
48
+ * @type {string}
49
+ * @memberof RunTestPlan201ResponseTestPlan
50
+ */
51
+ name?: string;
52
+ /**
53
+ *
54
+ * @type {string}
55
+ * @memberof RunTestPlan201ResponseTestPlan
56
+ */
57
+ created_at?: string;
58
+ /**
59
+ *
60
+ * @type {string}
61
+ * @memberof RunTestPlan201ResponseTestPlan
62
+ */
63
+ updated_at?: string;
64
+ /**
65
+ *
66
+ * @type {RunTestPlan201ResponseTestPlanBuild}
67
+ * @memberof RunTestPlan201ResponseTestPlan
68
+ */
69
+ build?: RunTestPlan201ResponseTestPlanBuild;
70
+ /**
71
+ *
72
+ * @type {Array<RunTestPlan201ResponseTestPlanExecuteEnvironmentsInner>}
73
+ * @memberof RunTestPlan201ResponseTestPlan
74
+ */
75
+ execute_environments?: Array<RunTestPlan201ResponseTestPlanExecuteEnvironmentsInner>;
76
+ }
77
+ /**
78
+ *
79
+ * @export
80
+ * @interface RunTestPlan201ResponseTestPlanBuild
81
+ */
82
+ export interface RunTestPlan201ResponseTestPlanBuild {
83
+ /**
84
+ *
85
+ * @type {string}
86
+ * @memberof RunTestPlan201ResponseTestPlanBuild
87
+ */
88
+ id?: string;
89
+ /**
90
+ *
91
+ * @type {string}
92
+ * @memberof RunTestPlan201ResponseTestPlanBuild
93
+ */
94
+ name?: string;
95
+ /**
96
+ *
97
+ * @type {string}
98
+ * @memberof RunTestPlan201ResponseTestPlanBuild
99
+ */
100
+ version?: string;
101
+ /**
102
+ *
103
+ * @type {string}
104
+ * @memberof RunTestPlan201ResponseTestPlanBuild
105
+ */
106
+ created_at?: string;
107
+ /**
108
+ *
109
+ * @type {string}
110
+ * @memberof RunTestPlan201ResponseTestPlanBuild
111
+ */
112
+ updated_at?: string;
113
+ }
114
+ /**
115
+ *
116
+ * @export
117
+ * @interface RunTestPlan201ResponseTestPlanExecuteEnvironmentsInner
118
+ */
119
+ export interface RunTestPlan201ResponseTestPlanExecuteEnvironmentsInner {
120
+ /**
121
+ *
122
+ * @type {string}
123
+ * @memberof RunTestPlan201ResponseTestPlanExecuteEnvironmentsInner
124
+ */
125
+ os?: string;
126
+ /**
127
+ *
128
+ * @type {string}
129
+ * @memberof RunTestPlan201ResponseTestPlanExecuteEnvironmentsInner
130
+ */
131
+ os_version?: string;
132
+ /**
133
+ *
134
+ * @type {string}
135
+ * @memberof RunTestPlan201ResponseTestPlanExecuteEnvironmentsInner
136
+ */
137
+ device?: string;
138
+ }
139
+ /**
140
+ *
141
+ * @export
142
+ * @interface RunTestPlanRequest
143
+ */
144
+ export interface RunTestPlanRequest {
145
+ /**
146
+ *
147
+ * @type {string}
148
+ * @memberof RunTestPlanRequest
149
+ */
150
+ build_id?: string;
151
+ }
152
+ /**
153
+ *
154
+ * @export
155
+ * @interface UploadBuild201Response
156
+ */
157
+ export interface UploadBuild201Response {
158
+ /**
159
+ *
160
+ * @type {string}
161
+ * @memberof UploadBuild201Response
162
+ */
163
+ id?: string;
164
+ }
165
+ /**
166
+ *
167
+ * @export
168
+ * @interface UploadBuild400Response
169
+ */
170
+ export interface UploadBuild400Response {
171
+ /**
172
+ *
173
+ * @type {Array<UploadBuild400ResponseErrorsInner>}
174
+ * @memberof UploadBuild400Response
175
+ */
176
+ errors?: Array<UploadBuild400ResponseErrorsInner>;
177
+ }
178
+ /**
179
+ *
180
+ * @export
181
+ * @interface UploadBuild400ResponseErrorsInner
182
+ */
183
+ export interface UploadBuild400ResponseErrorsInner {
184
+ /**
185
+ *
186
+ * @type {string}
187
+ * @memberof UploadBuild400ResponseErrorsInner
188
+ */
189
+ message?: string;
190
+ }
191
+ /**
192
+ * BuildsApi - axios parameter creator
193
+ * @export
194
+ */
195
+ export declare const BuildsApiAxiosParamCreator: (configuration?: Configuration) => {
196
+ /**
197
+ * Upload the build file.
198
+ * @summary Upload a build
199
+ * @param {string} projectId The ID of the project to upload the build file to.
200
+ * @param {any} file Build file.
201
+ * @param {*} [options] Override http request option.
202
+ * @throws {RequiredError}
203
+ */
204
+ uploadBuild: (projectId: string, file: any, options?: AxiosRequestConfig) => Promise<RequestArgs>;
205
+ };
206
+ /**
207
+ * BuildsApi - functional programming interface
208
+ * @export
209
+ */
210
+ export declare const BuildsApiFp: (configuration?: Configuration) => {
211
+ /**
212
+ * Upload the build file.
213
+ * @summary Upload a build
214
+ * @param {string} projectId The ID of the project to upload the build file to.
215
+ * @param {any} file Build file.
216
+ * @param {*} [options] Override http request option.
217
+ * @throws {RequiredError}
218
+ */
219
+ uploadBuild(projectId: string, file: any, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<UploadBuild201Response>>;
220
+ };
221
+ /**
222
+ * BuildsApi - factory interface
223
+ * @export
224
+ */
225
+ export declare const BuildsApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => {
226
+ /**
227
+ * Upload the build file.
228
+ * @summary Upload a build
229
+ * @param {string} projectId The ID of the project to upload the build file to.
230
+ * @param {any} file Build file.
231
+ * @param {*} [options] Override http request option.
232
+ * @throws {RequiredError}
233
+ */
234
+ uploadBuild(projectId: string, file: any, options?: any): AxiosPromise<UploadBuild201Response>;
235
+ };
236
+ /**
237
+ * BuildsApi - object-oriented interface
238
+ * @export
239
+ * @class BuildsApi
240
+ * @extends {BaseAPI}
241
+ */
242
+ export declare class BuildsApi extends BaseAPI {
243
+ /**
244
+ * Upload the build file.
245
+ * @summary Upload a build
246
+ * @param {string} projectId The ID of the project to upload the build file to.
247
+ * @param {any} file Build file.
248
+ * @param {*} [options] Override http request option.
249
+ * @throws {RequiredError}
250
+ * @memberof BuildsApi
251
+ */
252
+ uploadBuild(projectId: string, file: any, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<UploadBuild201Response, any>>;
253
+ }
254
+ /**
255
+ * TestPlansApi - axios parameter creator
256
+ * @export
257
+ */
258
+ export declare const TestPlansApiAxiosParamCreator: (configuration?: Configuration) => {
259
+ /**
260
+ * Run a test plan
261
+ * @summary Run a test plan
262
+ * @param {string} testPlanId The ID of the test plan to run.
263
+ * @param {RunTestPlanRequest} runTestPlanRequest The build_id to execute the test plan.
264
+ * @param {*} [options] Override http request option.
265
+ * @throws {RequiredError}
266
+ */
267
+ runTestPlan: (testPlanId: string, runTestPlanRequest: RunTestPlanRequest, options?: AxiosRequestConfig) => Promise<RequestArgs>;
268
+ };
269
+ /**
270
+ * TestPlansApi - functional programming interface
271
+ * @export
272
+ */
273
+ export declare const TestPlansApiFp: (configuration?: Configuration) => {
274
+ /**
275
+ * Run a test plan
276
+ * @summary Run a test plan
277
+ * @param {string} testPlanId The ID of the test plan to run.
278
+ * @param {RunTestPlanRequest} runTestPlanRequest The build_id to execute the test plan.
279
+ * @param {*} [options] Override http request option.
280
+ * @throws {RequiredError}
281
+ */
282
+ runTestPlan(testPlanId: string, runTestPlanRequest: RunTestPlanRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<RunTestPlan201Response>>;
283
+ };
284
+ /**
285
+ * TestPlansApi - factory interface
286
+ * @export
287
+ */
288
+ export declare const TestPlansApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => {
289
+ /**
290
+ * Run a test plan
291
+ * @summary Run a test plan
292
+ * @param {string} testPlanId The ID of the test plan to run.
293
+ * @param {RunTestPlanRequest} runTestPlanRequest The build_id to execute the test plan.
294
+ * @param {*} [options] Override http request option.
295
+ * @throws {RequiredError}
296
+ */
297
+ runTestPlan(testPlanId: string, runTestPlanRequest: RunTestPlanRequest, options?: any): AxiosPromise<RunTestPlan201Response>;
298
+ };
299
+ /**
300
+ * TestPlansApi - object-oriented interface
301
+ * @export
302
+ * @class TestPlansApi
303
+ * @extends {BaseAPI}
304
+ */
305
+ export declare class TestPlansApi extends BaseAPI {
306
+ /**
307
+ * Run a test plan
308
+ * @summary Run a test plan
309
+ * @param {string} testPlanId The ID of the test plan to run.
310
+ * @param {RunTestPlanRequest} runTestPlanRequest The build_id to execute the test plan.
311
+ * @param {*} [options] Override http request option.
312
+ * @throws {RequiredError}
313
+ * @memberof TestPlansApi
314
+ */
315
+ runTestPlan(testPlanId: string, runTestPlanRequest: RunTestPlanRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<RunTestPlan201Response, any>>;
316
+ }