@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
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Autify for Mobile API
6
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+ *
8
+ * The version of the OpenAPI document: v1
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.Configuration = void 0;
17
+ class Configuration {
18
+ constructor(param = {}) {
19
+ this.apiKey = param.apiKey;
20
+ this.username = param.username;
21
+ this.password = param.password;
22
+ this.accessToken = param.accessToken;
23
+ this.basePath = param.basePath;
24
+ this.baseOptions = param.baseOptions;
25
+ this.formDataCtor = param.formDataCtor;
26
+ }
27
+ /**
28
+ * Check if the given MIME is a JSON MIME.
29
+ * JSON MIME examples:
30
+ * application/json
31
+ * application/json; charset=UTF8
32
+ * APPLICATION/JSON
33
+ * application/vnd.company+json
34
+ * @param mime - MIME (Multipurpose Internet Mail Extensions)
35
+ * @return True if the given MIME is JSON, false otherwise.
36
+ */
37
+ isJsonMime(mime) {
38
+ const jsonMime = new RegExp("^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$", "i");
39
+ return (mime !== null &&
40
+ (jsonMime.test(mime) ||
41
+ mime.toLowerCase() === "application/json-patch+json"));
42
+ }
43
+ }
44
+ exports.Configuration = Configuration;
@@ -0,0 +1,13 @@
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
+ export * from "./api";
13
+ export * from "./configuration";
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Autify for Mobile API
6
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+ *
8
+ * The version of the OpenAPI document: v1
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ const tslib_1 = require("tslib");
17
+ tslib_1.__exportStar(require("./api"), exports);
18
+ tslib_1.__exportStar(require("./configuration"), exports);
@@ -0,0 +1,117 @@
1
+ import { AxiosRequestConfig } from "axios";
2
+ import { CapabilityOption, CreateUrlReplacementRequest, DescribeResult200Response, ExecuteScenariosRequest, ExecuteScenariosResult, ExecuteSchedule200Response, Story, TestPlanResult, UpdateUrlReplacementRequest, UrlReplacement } 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 capabilityApi;
11
+ /**
12
+ * List available Capabilities.
13
+ * @param {number} projectId For example, 1 for the following URL: https://app.autify.com/projects/1/capabilities
14
+ * @param {string} [os] os name to filter
15
+ * @param {string} [browser] browser name to filter
16
+ * @param {string} [deviceType] device_type name to filter
17
+ * @param {*} [options] Override http request option.
18
+ * @throws {RequiredError}
19
+ * @memberof CapabilityApi
20
+ */
21
+ listCapabilities(projectId: number, os?: string, browser?: string, deviceType?: string, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<CapabilityOption[], any>>;
22
+ private readonly resultApi;
23
+ /**
24
+ * Get a result.
25
+ * @param {number} projectId For example, 1 for the following URL: https://app.autify.com/projects/1/results/4
26
+ * @param {number} resultId For example, 4 for the following URL: https://app.autify.com/projects/1/results/4
27
+ * @param {*} [options] Override http request option.
28
+ * @throws {RequiredError}
29
+ * @memberof ResultApi
30
+ */
31
+ describeResult(projectId: number, resultId: number, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<DescribeResult200Response, any>>;
32
+ /**
33
+ * List results.
34
+ * @param {number} projectId For example, 1 for the following URL: https://app.autify.com/projects/1/results
35
+ * @param {number} [page] The number of page returns.
36
+ * @param {number} [perPage] The number of items returns. Default number is 30 and up to a maximum of 100
37
+ * @param {number} [testPlanId] Test plan ID used to filter results.
38
+ * @param {*} [options] Override http request option.
39
+ * @throws {RequiredError}
40
+ * @memberof ResultApi
41
+ */
42
+ listResults(projectId: number, page?: number, perPage?: number, testPlanId?: number, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<TestPlanResult[], any>>;
43
+ private readonly scenarioApi;
44
+ /**
45
+ * Get a scenario.
46
+ * @param {number} projectId For example, 1 for the following URL: https://app.autify.com/projects/1/scenarios/2
47
+ * @param {number} scenarioId For example, 2 for the following URL: https://app.autify.com/projects/1/scenarios/2
48
+ * @param {*} [options] Override http request option.
49
+ * @throws {RequiredError}
50
+ * @memberof ScenarioApi
51
+ */
52
+ describeScenario(projectId: number, scenarioId: number, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<Story, any>>;
53
+ /**
54
+ * You can execute any scenarios in your workspace using any execution environments (which is called \"capabilities\" here).
55
+ * @param {number} projectId For example, 1 for the following URL: https://app.autify.com/projects/1/scenarios
56
+ * @param {ExecuteScenariosRequest} executeScenariosRequest The scenarios and settings to execute
57
+ * @param {*} [options] Override http request option.
58
+ * @throws {RequiredError}
59
+ * @memberof ScenarioApi
60
+ */
61
+ executeScenarios(projectId: number, executeScenariosRequest: ExecuteScenariosRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<ExecuteScenariosResult, any>>;
62
+ /**
63
+ * List scenarios.
64
+ * @param {number} projectId For example, 1 for the following URL: https://app.autify.com/projects/1/scenarios
65
+ * @param {number} [page] The number of page returns.
66
+ * @param {*} [options] Override http request option.
67
+ * @throws {RequiredError}
68
+ * @memberof ScenarioApi
69
+ */
70
+ listScenarios(projectId: number, page?: number, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<Story[], any>>;
71
+ private readonly scheduleApi;
72
+ /**
73
+ * Run a test plan. (Note: \"Schedule\" is called as \"TestPlan\" now.)
74
+ * @param {number} scheduleId For example, 3 for the following URL: https://app.autify.com/projects/1/test_plans/3
75
+ * @param {*} [options] Override http request option.
76
+ * @throws {RequiredError}
77
+ * @memberof ScheduleApi
78
+ */
79
+ executeSchedule(scheduleId: number, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<ExecuteSchedule200Response, any>>;
80
+ private readonly urlReplacementApi;
81
+ /**
82
+ * Create a new url replacement for the test plan
83
+ * @param {number} testPlanId For example, 15 for the following URL: https://app.autify.com/projects/1/test_plans/15
84
+ * @param {CreateUrlReplacementRequest} createUrlReplacementRequest The url to replace
85
+ * @param {*} [options] Override http request option.
86
+ * @throws {RequiredError}
87
+ * @memberof UrlReplacementApi
88
+ */
89
+ createUrlReplacement(testPlanId: number, createUrlReplacementRequest: CreateUrlReplacementRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<UrlReplacement, any>>;
90
+ /**
91
+ * Delete a url replacement for the test plan
92
+ * @param {number} testPlanId For example, 15 for the following URL: https://app.autify.com/projects/1/test_plans/15
93
+ * @param {number} urlReplacementId url_replacement id
94
+ * @param {*} [options] Override http request option.
95
+ * @throws {RequiredError}
96
+ * @memberof UrlReplacementApi
97
+ */
98
+ deleteUrlReplacement(testPlanId: number, urlReplacementId: number, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<string, any>>;
99
+ /**
100
+ * List url replacements for the test plan
101
+ * @param {number} testPlanId For example, 15 for the following URL: https://app.autify.com/projects/1/test_plans/15
102
+ * @param {*} [options] Override http request option.
103
+ * @throws {RequiredError}
104
+ * @memberof UrlReplacementApi
105
+ */
106
+ listUrlReplacements(testPlanId: number, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<UrlReplacement[], any>>;
107
+ /**
108
+ * Update a url replacement for the test plan
109
+ * @param {number} testPlanId For example, 15 for the following URL: https://app.autify.com/projects/1/test_plans/15
110
+ * @param {number} urlReplacementId url_replacement id
111
+ * @param {UpdateUrlReplacementRequest} updateUrlReplacementRequest The url to replace. Either pattern_url or replacement_url is required.
112
+ * @param {*} [options] Override http request option.
113
+ * @throws {RequiredError}
114
+ * @memberof UrlReplacementApi
115
+ */
116
+ updateUrlReplacement(testPlanId: number, urlReplacementId: number, updateUrlReplacementRequest: UpdateUrlReplacementRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<UrlReplacement, any>>;
117
+ }
@@ -0,0 +1,165 @@
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.capabilityApi = new openapi_1.CapabilityApi(configuration);
35
+ this.resultApi = new openapi_1.ResultApi(configuration);
36
+ this.scenarioApi = new openapi_1.ScenarioApi(configuration);
37
+ this.scheduleApi = new openapi_1.ScheduleApi(configuration);
38
+ this.urlReplacementApi = new openapi_1.UrlReplacementApi(configuration);
39
+ }
40
+ /**
41
+ * List available Capabilities.
42
+ * @param {number} projectId For example, 1 for the following URL: https://app.autify.com/projects/1/capabilities
43
+ * @param {string} [os] os name to filter
44
+ * @param {string} [browser] browser name to filter
45
+ * @param {string} [deviceType] device_type name to filter
46
+ * @param {*} [options] Override http request option.
47
+ * @throws {RequiredError}
48
+ * @memberof CapabilityApi
49
+ */
50
+ listCapabilities(projectId, os, browser, deviceType, options) {
51
+ return this.capabilityApi.listCapabilities(projectId, os, browser, deviceType, options);
52
+ }
53
+ /**
54
+ * Get a result.
55
+ * @param {number} projectId For example, 1 for the following URL: https://app.autify.com/projects/1/results/4
56
+ * @param {number} resultId For example, 4 for the following URL: https://app.autify.com/projects/1/results/4
57
+ * @param {*} [options] Override http request option.
58
+ * @throws {RequiredError}
59
+ * @memberof ResultApi
60
+ */
61
+ describeResult(projectId, resultId, options) {
62
+ return this.resultApi.describeResult(projectId, resultId, options);
63
+ }
64
+ /**
65
+ * List results.
66
+ * @param {number} projectId For example, 1 for the following URL: https://app.autify.com/projects/1/results
67
+ * @param {number} [page] The number of page returns.
68
+ * @param {number} [perPage] The number of items returns. Default number is 30 and up to a maximum of 100
69
+ * @param {number} [testPlanId] Test plan ID used to filter results.
70
+ * @param {*} [options] Override http request option.
71
+ * @throws {RequiredError}
72
+ * @memberof ResultApi
73
+ */
74
+ listResults(projectId, page, perPage, testPlanId, options) {
75
+ return this.resultApi.listResults(projectId, page, perPage, testPlanId, options);
76
+ }
77
+ /**
78
+ * Get a scenario.
79
+ * @param {number} projectId For example, 1 for the following URL: https://app.autify.com/projects/1/scenarios/2
80
+ * @param {number} scenarioId For example, 2 for the following URL: https://app.autify.com/projects/1/scenarios/2
81
+ * @param {*} [options] Override http request option.
82
+ * @throws {RequiredError}
83
+ * @memberof ScenarioApi
84
+ */
85
+ describeScenario(projectId, scenarioId, options) {
86
+ return this.scenarioApi.describeScenario(projectId, scenarioId, options);
87
+ }
88
+ /**
89
+ * You can execute any scenarios in your workspace using any execution environments (which is called \"capabilities\" here).
90
+ * @param {number} projectId For example, 1 for the following URL: https://app.autify.com/projects/1/scenarios
91
+ * @param {ExecuteScenariosRequest} executeScenariosRequest The scenarios and settings to execute
92
+ * @param {*} [options] Override http request option.
93
+ * @throws {RequiredError}
94
+ * @memberof ScenarioApi
95
+ */
96
+ executeScenarios(projectId, executeScenariosRequest, options) {
97
+ return this.scenarioApi.executeScenarios(projectId, executeScenariosRequest, options);
98
+ }
99
+ /**
100
+ * List scenarios.
101
+ * @param {number} projectId For example, 1 for the following URL: https://app.autify.com/projects/1/scenarios
102
+ * @param {number} [page] The number of page returns.
103
+ * @param {*} [options] Override http request option.
104
+ * @throws {RequiredError}
105
+ * @memberof ScenarioApi
106
+ */
107
+ listScenarios(projectId, page, options) {
108
+ return this.scenarioApi.listScenarios(projectId, page, options);
109
+ }
110
+ /**
111
+ * Run a test plan. (Note: \"Schedule\" is called as \"TestPlan\" now.)
112
+ * @param {number} scheduleId For example, 3 for the following URL: https://app.autify.com/projects/1/test_plans/3
113
+ * @param {*} [options] Override http request option.
114
+ * @throws {RequiredError}
115
+ * @memberof ScheduleApi
116
+ */
117
+ executeSchedule(scheduleId, options) {
118
+ return this.scheduleApi.executeSchedule(scheduleId, options);
119
+ }
120
+ /**
121
+ * Create a new url replacement for the test plan
122
+ * @param {number} testPlanId For example, 15 for the following URL: https://app.autify.com/projects/1/test_plans/15
123
+ * @param {CreateUrlReplacementRequest} createUrlReplacementRequest The url to replace
124
+ * @param {*} [options] Override http request option.
125
+ * @throws {RequiredError}
126
+ * @memberof UrlReplacementApi
127
+ */
128
+ createUrlReplacement(testPlanId, createUrlReplacementRequest, options) {
129
+ return this.urlReplacementApi.createUrlReplacement(testPlanId, createUrlReplacementRequest, options);
130
+ }
131
+ /**
132
+ * Delete a url replacement for the test plan
133
+ * @param {number} testPlanId For example, 15 for the following URL: https://app.autify.com/projects/1/test_plans/15
134
+ * @param {number} urlReplacementId url_replacement id
135
+ * @param {*} [options] Override http request option.
136
+ * @throws {RequiredError}
137
+ * @memberof UrlReplacementApi
138
+ */
139
+ deleteUrlReplacement(testPlanId, urlReplacementId, options) {
140
+ return this.urlReplacementApi.deleteUrlReplacement(testPlanId, urlReplacementId, options);
141
+ }
142
+ /**
143
+ * List url replacements for the test plan
144
+ * @param {number} testPlanId For example, 15 for the following URL: https://app.autify.com/projects/1/test_plans/15
145
+ * @param {*} [options] Override http request option.
146
+ * @throws {RequiredError}
147
+ * @memberof UrlReplacementApi
148
+ */
149
+ listUrlReplacements(testPlanId, options) {
150
+ return this.urlReplacementApi.listUrlReplacements(testPlanId, options);
151
+ }
152
+ /**
153
+ * Update a url replacement for the test plan
154
+ * @param {number} testPlanId For example, 15 for the following URL: https://app.autify.com/projects/1/test_plans/15
155
+ * @param {number} urlReplacementId url_replacement id
156
+ * @param {UpdateUrlReplacementRequest} updateUrlReplacementRequest The url to replace. Either pattern_url or replacement_url is required.
157
+ * @param {*} [options] Override http request option.
158
+ * @throws {RequiredError}
159
+ * @memberof UrlReplacementApi
160
+ */
161
+ updateUrlReplacement(testPlanId, urlReplacementId, updateUrlReplacementRequest, options) {
162
+ return this.urlReplacementApi.updateUrlReplacement(testPlanId, urlReplacementId, updateUrlReplacementRequest, options);
163
+ }
164
+ }
165
+ exports.Client = Client;