@autifyhq/autify-sdk 0.18.0 → 0.19.0

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.
@@ -1,5 +1,5 @@
1
1
  import { AxiosRequestConfig } from "axios";
2
- import { AccessPoint, CapabilityOption, CreateAccessPointRequest, CreateAccessPointResult, CreateUrlReplacementRequest, DeleteAccessPointRequest, DescribeResult200Response, ExecuteScenariosRequest, ExecuteScenariosResult, ExecuteSchedule200Response, ExecuteScheduleRequest, Scenario, TestPlanResult, UpdateUrlReplacementRequest, UrlReplacement } from "./openapi";
2
+ import { AccessPoint, CapabilityOption, CreateAccessPointRequest, CreateAccessPointResult, CreateUrlReplacementRequest, DeleteAccessPointRequest, DescribeResult200Response, ExecuteScenariosRequest, ExecuteScenariosResult, ExecuteSchedule200Response, ExecuteScheduleRequest, ProjectInfo, Scenario, TestPlanResult, UpdateUrlReplacementRequest, UrlReplacement, UsedCredits } from "./openapi";
3
3
  export { BASE_PATH as WEB_BASE_PATH } from "./openapi/base";
4
4
  type Options = Readonly<{
5
5
  basePath?: string;
@@ -48,6 +48,29 @@ export declare class WebClient {
48
48
  * @memberof CapabilityApi
49
49
  */
50
50
  listCapabilities(projectId: number, os?: string, browser?: string, deviceType?: string, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<CapabilityOption[], any>>;
51
+ private readonly creditApi;
52
+ /**
53
+ * Get the number of credits used in the project\\ \\ Notes:\\ This endpoint works only for organizations on credit-based plans. It always returns 0 for `credits_consumed` and `credit_consumption_event_count` if your organization is on a run-based plan.
54
+ * @param {number} projectId For example, 1 for the following URL: https://app.autify.com/projects/1/credits
55
+ * @param {string} [dateFrom] The date to start counting used credits from.\\ If not specified, the date will be set to 1 week ago.\\ Up to 90 days in advance can be specified. If the specified date is more than 90 days in the past, the date will be set to 90 days ago.\\ Date must follow the format YYYY-MM-DD (example: \&quot;2023-09-21\&quot;).
56
+ * @param {string} [dateTo] The date to end counting used credits from.\\ If not specified, the date will be set to today.\\ Date must follow the format YYYY-MM-DD (example: \&quot;2023-09-28\&quot;).
57
+ * @param {number} [scenarioId] The scenario ID to filter used credits by.
58
+ * @param {number} [testPlanId] The test plan ID to filter used credits by.
59
+ * @param {number} [userId] The user ID that executed tests to filter used credits by.
60
+ * @param {*} [options] Override http request option.
61
+ * @throws {RequiredError}
62
+ * @memberof CreditApi
63
+ */
64
+ getCreditUsage(projectId: number, dateFrom?: string, dateTo?: string, scenarioId?: number, testPlanId?: number, userId?: number, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<UsedCredits, any>>;
65
+ private readonly projectApi;
66
+ /**
67
+ * Get project information.
68
+ * @param {number} projectId For example, 1 for the following URL: https://app.autify.com/projects/1/project_info
69
+ * @param {*} [options] Override http request option.
70
+ * @throws {RequiredError}
71
+ * @memberof ProjectApi
72
+ */
73
+ getProjectInfo(projectId: number, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<ProjectInfo, any>>;
51
74
  private readonly resultApi;
52
75
  /**
53
76
  * Get a test result.
@@ -38,6 +38,8 @@ class WebClient {
38
38
  });
39
39
  this.autifyConnectApi = new openapi_1.AutifyConnectApi(configuration);
40
40
  this.capabilityApi = new openapi_1.CapabilityApi(configuration);
41
+ this.creditApi = new openapi_1.CreditApi(configuration);
42
+ this.projectApi = new openapi_1.ProjectApi(configuration);
41
43
  this.resultApi = new openapi_1.ResultApi(configuration);
42
44
  this.scenarioApi = new openapi_1.ScenarioApi(configuration);
43
45
  this.scheduleApi = new openapi_1.ScheduleApi(configuration);
@@ -89,6 +91,31 @@ class WebClient {
89
91
  listCapabilities(projectId, os, browser, deviceType, options) {
90
92
  return this.capabilityApi.listCapabilities(projectId, os, browser, deviceType, options);
91
93
  }
94
+ /**
95
+ * Get the number of credits used in the project\\ \\ Notes:\\ This endpoint works only for organizations on credit-based plans. It always returns 0 for `credits_consumed` and `credit_consumption_event_count` if your organization is on a run-based plan.
96
+ * @param {number} projectId For example, 1 for the following URL: https://app.autify.com/projects/1/credits
97
+ * @param {string} [dateFrom] The date to start counting used credits from.\\ If not specified, the date will be set to 1 week ago.\\ Up to 90 days in advance can be specified. If the specified date is more than 90 days in the past, the date will be set to 90 days ago.\\ Date must follow the format YYYY-MM-DD (example: \&quot;2023-09-21\&quot;).
98
+ * @param {string} [dateTo] The date to end counting used credits from.\\ If not specified, the date will be set to today.\\ Date must follow the format YYYY-MM-DD (example: \&quot;2023-09-28\&quot;).
99
+ * @param {number} [scenarioId] The scenario ID to filter used credits by.
100
+ * @param {number} [testPlanId] The test plan ID to filter used credits by.
101
+ * @param {number} [userId] The user ID that executed tests to filter used credits by.
102
+ * @param {*} [options] Override http request option.
103
+ * @throws {RequiredError}
104
+ * @memberof CreditApi
105
+ */
106
+ getCreditUsage(projectId, dateFrom, dateTo, scenarioId, testPlanId, userId, options) {
107
+ return this.creditApi.getCreditUsage(projectId, dateFrom, dateTo, scenarioId, testPlanId, userId, options);
108
+ }
109
+ /**
110
+ * Get project information.
111
+ * @param {number} projectId For example, 1 for the following URL: https://app.autify.com/projects/1/project_info
112
+ * @param {*} [options] Override http request option.
113
+ * @throws {RequiredError}
114
+ * @memberof ProjectApi
115
+ */
116
+ getProjectInfo(projectId, options) {
117
+ return this.projectApi.getProjectInfo(projectId, options);
118
+ }
92
119
  /**
93
120
  * Get a test result.
94
121
  * @summary Get a test result.
@@ -744,6 +744,37 @@ export interface Label {
744
744
  */
745
745
  updated_at?: string;
746
746
  }
747
+ /**
748
+ *
749
+ * @export
750
+ * @interface ProjectInfo
751
+ */
752
+ export interface ProjectInfo {
753
+ /**
754
+ *
755
+ * @type {number}
756
+ * @memberof ProjectInfo
757
+ */
758
+ id?: number;
759
+ /**
760
+ *
761
+ * @type {string}
762
+ * @memberof ProjectInfo
763
+ */
764
+ name?: string;
765
+ /**
766
+ *
767
+ * @type {number}
768
+ * @memberof ProjectInfo
769
+ */
770
+ scenarios_count?: number;
771
+ /**
772
+ *
773
+ * @type {number}
774
+ * @memberof ProjectInfo
775
+ */
776
+ test_plans_count?: number;
777
+ }
747
778
  /**
748
779
  *
749
780
  * @export
@@ -847,6 +878,12 @@ export interface TestCaseResult {
847
878
  * @memberof TestCaseResult
848
879
  */
849
880
  review_needed?: number;
881
+ /**
882
+ * Number of credits consumed by this test result. (default 0 for test result created before credit based system)
883
+ * @type {number}
884
+ * @memberof TestCaseResult
885
+ */
886
+ number_of_credits_consumed?: number;
850
887
  /**
851
888
  * THIS FEATURE IS FOR LIMITED NUMBER OF CUSTOMERS. Variables imported from previously executed test results in a test plan.
852
889
  * @type {Array<TestCaseResultImportVariablesInner>}
@@ -1133,6 +1170,37 @@ export interface UrlReplacement {
1133
1170
  */
1134
1171
  updated_at: string;
1135
1172
  }
1173
+ /**
1174
+ *
1175
+ * @export
1176
+ * @interface UsedCredits
1177
+ */
1178
+ export interface UsedCredits {
1179
+ /**
1180
+ *
1181
+ * @type {string}
1182
+ * @memberof UsedCredits
1183
+ */
1184
+ date_from?: string;
1185
+ /**
1186
+ *
1187
+ * @type {string}
1188
+ * @memberof UsedCredits
1189
+ */
1190
+ date_to?: string;
1191
+ /**
1192
+ *
1193
+ * @type {number}
1194
+ * @memberof UsedCredits
1195
+ */
1196
+ credits_consumed?: number;
1197
+ /**
1198
+ *
1199
+ * @type {number}
1200
+ * @memberof UsedCredits
1201
+ */
1202
+ credit_consumption_event_count?: number;
1203
+ }
1136
1204
  /**
1137
1205
  * AutifyConnectApi - axios parameter creator
1138
1206
  * @export
@@ -1325,6 +1393,136 @@ export declare class CapabilityApi extends BaseAPI {
1325
1393
  */
1326
1394
  listCapabilities(projectId: number, os?: string, browser?: string, deviceType?: string, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<CapabilityOption[], any>>;
1327
1395
  }
1396
+ /**
1397
+ * CreditApi - axios parameter creator
1398
+ * @export
1399
+ */
1400
+ export declare const CreditApiAxiosParamCreator: (configuration?: Configuration) => {
1401
+ /**
1402
+ * Get the number of credits used in the project\\ \\ Notes:\\ This endpoint works only for organizations on credit-based plans. It always returns 0 for `credits_consumed` and `credit_consumption_event_count` if your organization is on a run-based plan.
1403
+ * @param {number} projectId For example, 1 for the following URL: https://app.autify.com/projects/1/credits
1404
+ * @param {string} [dateFrom] The date to start counting used credits from.\\ If not specified, the date will be set to 1 week ago.\\ Up to 90 days in advance can be specified. If the specified date is more than 90 days in the past, the date will be set to 90 days ago.\\ Date must follow the format YYYY-MM-DD (example: \&quot;2023-09-21\&quot;).
1405
+ * @param {string} [dateTo] The date to end counting used credits from.\\ If not specified, the date will be set to today.\\ Date must follow the format YYYY-MM-DD (example: \&quot;2023-09-28\&quot;).
1406
+ * @param {number} [scenarioId] The scenario ID to filter used credits by.
1407
+ * @param {number} [testPlanId] The test plan ID to filter used credits by.
1408
+ * @param {number} [userId] The user ID that executed tests to filter used credits by.
1409
+ * @param {*} [options] Override http request option.
1410
+ * @throws {RequiredError}
1411
+ */
1412
+ getCreditUsage: (projectId: number, dateFrom?: string, dateTo?: string, scenarioId?: number, testPlanId?: number, userId?: number, options?: AxiosRequestConfig) => Promise<RequestArgs>;
1413
+ };
1414
+ /**
1415
+ * CreditApi - functional programming interface
1416
+ * @export
1417
+ */
1418
+ export declare const CreditApiFp: (configuration?: Configuration) => {
1419
+ /**
1420
+ * Get the number of credits used in the project\\ \\ Notes:\\ This endpoint works only for organizations on credit-based plans. It always returns 0 for `credits_consumed` and `credit_consumption_event_count` if your organization is on a run-based plan.
1421
+ * @param {number} projectId For example, 1 for the following URL: https://app.autify.com/projects/1/credits
1422
+ * @param {string} [dateFrom] The date to start counting used credits from.\\ If not specified, the date will be set to 1 week ago.\\ Up to 90 days in advance can be specified. If the specified date is more than 90 days in the past, the date will be set to 90 days ago.\\ Date must follow the format YYYY-MM-DD (example: \&quot;2023-09-21\&quot;).
1423
+ * @param {string} [dateTo] The date to end counting used credits from.\\ If not specified, the date will be set to today.\\ Date must follow the format YYYY-MM-DD (example: \&quot;2023-09-28\&quot;).
1424
+ * @param {number} [scenarioId] The scenario ID to filter used credits by.
1425
+ * @param {number} [testPlanId] The test plan ID to filter used credits by.
1426
+ * @param {number} [userId] The user ID that executed tests to filter used credits by.
1427
+ * @param {*} [options] Override http request option.
1428
+ * @throws {RequiredError}
1429
+ */
1430
+ getCreditUsage(projectId: number, dateFrom?: string, dateTo?: string, scenarioId?: number, testPlanId?: number, userId?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<UsedCredits>>;
1431
+ };
1432
+ /**
1433
+ * CreditApi - factory interface
1434
+ * @export
1435
+ */
1436
+ export declare const CreditApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => {
1437
+ /**
1438
+ * Get the number of credits used in the project\\ \\ Notes:\\ This endpoint works only for organizations on credit-based plans. It always returns 0 for `credits_consumed` and `credit_consumption_event_count` if your organization is on a run-based plan.
1439
+ * @param {number} projectId For example, 1 for the following URL: https://app.autify.com/projects/1/credits
1440
+ * @param {string} [dateFrom] The date to start counting used credits from.\\ If not specified, the date will be set to 1 week ago.\\ Up to 90 days in advance can be specified. If the specified date is more than 90 days in the past, the date will be set to 90 days ago.\\ Date must follow the format YYYY-MM-DD (example: \&quot;2023-09-21\&quot;).
1441
+ * @param {string} [dateTo] The date to end counting used credits from.\\ If not specified, the date will be set to today.\\ Date must follow the format YYYY-MM-DD (example: \&quot;2023-09-28\&quot;).
1442
+ * @param {number} [scenarioId] The scenario ID to filter used credits by.
1443
+ * @param {number} [testPlanId] The test plan ID to filter used credits by.
1444
+ * @param {number} [userId] The user ID that executed tests to filter used credits by.
1445
+ * @param {*} [options] Override http request option.
1446
+ * @throws {RequiredError}
1447
+ */
1448
+ getCreditUsage(projectId: number, dateFrom?: string, dateTo?: string, scenarioId?: number, testPlanId?: number, userId?: number, options?: any): AxiosPromise<UsedCredits>;
1449
+ };
1450
+ /**
1451
+ * CreditApi - object-oriented interface
1452
+ * @export
1453
+ * @class CreditApi
1454
+ * @extends {BaseAPI}
1455
+ */
1456
+ export declare class CreditApi extends BaseAPI {
1457
+ /**
1458
+ * Get the number of credits used in the project\\ \\ Notes:\\ This endpoint works only for organizations on credit-based plans. It always returns 0 for `credits_consumed` and `credit_consumption_event_count` if your organization is on a run-based plan.
1459
+ * @param {number} projectId For example, 1 for the following URL: https://app.autify.com/projects/1/credits
1460
+ * @param {string} [dateFrom] The date to start counting used credits from.\\ If not specified, the date will be set to 1 week ago.\\ Up to 90 days in advance can be specified. If the specified date is more than 90 days in the past, the date will be set to 90 days ago.\\ Date must follow the format YYYY-MM-DD (example: \&quot;2023-09-21\&quot;).
1461
+ * @param {string} [dateTo] The date to end counting used credits from.\\ If not specified, the date will be set to today.\\ Date must follow the format YYYY-MM-DD (example: \&quot;2023-09-28\&quot;).
1462
+ * @param {number} [scenarioId] The scenario ID to filter used credits by.
1463
+ * @param {number} [testPlanId] The test plan ID to filter used credits by.
1464
+ * @param {number} [userId] The user ID that executed tests to filter used credits by.
1465
+ * @param {*} [options] Override http request option.
1466
+ * @throws {RequiredError}
1467
+ * @memberof CreditApi
1468
+ */
1469
+ getCreditUsage(projectId: number, dateFrom?: string, dateTo?: string, scenarioId?: number, testPlanId?: number, userId?: number, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<UsedCredits, any>>;
1470
+ }
1471
+ /**
1472
+ * ProjectApi - axios parameter creator
1473
+ * @export
1474
+ */
1475
+ export declare const ProjectApiAxiosParamCreator: (configuration?: Configuration) => {
1476
+ /**
1477
+ * Get project information.
1478
+ * @param {number} projectId For example, 1 for the following URL: https://app.autify.com/projects/1/project_info
1479
+ * @param {*} [options] Override http request option.
1480
+ * @throws {RequiredError}
1481
+ */
1482
+ getProjectInfo: (projectId: number, options?: AxiosRequestConfig) => Promise<RequestArgs>;
1483
+ };
1484
+ /**
1485
+ * ProjectApi - functional programming interface
1486
+ * @export
1487
+ */
1488
+ export declare const ProjectApiFp: (configuration?: Configuration) => {
1489
+ /**
1490
+ * Get project information.
1491
+ * @param {number} projectId For example, 1 for the following URL: https://app.autify.com/projects/1/project_info
1492
+ * @param {*} [options] Override http request option.
1493
+ * @throws {RequiredError}
1494
+ */
1495
+ getProjectInfo(projectId: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ProjectInfo>>;
1496
+ };
1497
+ /**
1498
+ * ProjectApi - factory interface
1499
+ * @export
1500
+ */
1501
+ export declare const ProjectApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => {
1502
+ /**
1503
+ * Get project information.
1504
+ * @param {number} projectId For example, 1 for the following URL: https://app.autify.com/projects/1/project_info
1505
+ * @param {*} [options] Override http request option.
1506
+ * @throws {RequiredError}
1507
+ */
1508
+ getProjectInfo(projectId: number, options?: any): AxiosPromise<ProjectInfo>;
1509
+ };
1510
+ /**
1511
+ * ProjectApi - object-oriented interface
1512
+ * @export
1513
+ * @class ProjectApi
1514
+ * @extends {BaseAPI}
1515
+ */
1516
+ export declare class ProjectApi extends BaseAPI {
1517
+ /**
1518
+ * Get project information.
1519
+ * @param {number} projectId For example, 1 for the following URL: https://app.autify.com/projects/1/project_info
1520
+ * @param {*} [options] Override http request option.
1521
+ * @throws {RequiredError}
1522
+ * @memberof ProjectApi
1523
+ */
1524
+ getProjectInfo(projectId: number, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<ProjectInfo, any>>;
1525
+ }
1328
1526
  /**
1329
1527
  * ResultApi - axios parameter creator
1330
1528
  * @export
@@ -13,7 +13,7 @@
13
13
  * Do not edit the class manually.
14
14
  */
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.UrlReplacementApi = exports.UrlReplacementApiFactory = exports.UrlReplacementApiFp = exports.UrlReplacementApiAxiosParamCreator = exports.ScheduleApi = exports.ScheduleApiFactory = exports.ScheduleApiFp = exports.ScheduleApiAxiosParamCreator = exports.ScenarioApi = exports.ScenarioApiFactory = exports.ScenarioApiFp = exports.ScenarioApiAxiosParamCreator = exports.ResultApi = exports.ResultApiFactory = exports.ResultApiFp = exports.ResultApiAxiosParamCreator = exports.CapabilityApi = exports.CapabilityApiFactory = exports.CapabilityApiFp = exports.CapabilityApiAxiosParamCreator = exports.AutifyConnectApi = exports.AutifyConnectApiFactory = exports.AutifyConnectApiFp = exports.AutifyConnectApiAxiosParamCreator = exports.TestPlanResultStatus = exports.TestCaseResultStatus = exports.ExecuteScenariosRequestExecutionTypeEnum = void 0;
16
+ exports.UrlReplacementApi = exports.UrlReplacementApiFactory = exports.UrlReplacementApiFp = exports.UrlReplacementApiAxiosParamCreator = exports.ScheduleApi = exports.ScheduleApiFactory = exports.ScheduleApiFp = exports.ScheduleApiAxiosParamCreator = exports.ScenarioApi = exports.ScenarioApiFactory = exports.ScenarioApiFp = exports.ScenarioApiAxiosParamCreator = exports.ResultApi = exports.ResultApiFactory = exports.ResultApiFp = exports.ResultApiAxiosParamCreator = exports.ProjectApi = exports.ProjectApiFactory = exports.ProjectApiFp = exports.ProjectApiAxiosParamCreator = exports.CreditApi = exports.CreditApiFactory = exports.CreditApiFp = exports.CreditApiAxiosParamCreator = exports.CapabilityApi = exports.CapabilityApiFactory = exports.CapabilityApiFp = exports.CapabilityApiAxiosParamCreator = exports.AutifyConnectApi = exports.AutifyConnectApiFactory = exports.AutifyConnectApiFp = exports.AutifyConnectApiAxiosParamCreator = exports.TestPlanResultStatus = exports.TestCaseResultStatus = exports.ExecuteScenariosRequestExecutionTypeEnum = void 0;
17
17
  const tslib_1 = require("tslib");
18
18
  const axios_1 = tslib_1.__importDefault(require("axios"));
19
19
  // URLSearchParams not necessarily used
@@ -461,6 +461,265 @@ class CapabilityApi extends base_1.BaseAPI {
461
461
  }
462
462
  }
463
463
  exports.CapabilityApi = CapabilityApi;
464
+ /**
465
+ * CreditApi - axios parameter creator
466
+ * @export
467
+ */
468
+ const CreditApiAxiosParamCreator = function (configuration) {
469
+ return {
470
+ /**
471
+ * Get the number of credits used in the project\\ \\ Notes:\\ This endpoint works only for organizations on credit-based plans. It always returns 0 for `credits_consumed` and `credit_consumption_event_count` if your organization is on a run-based plan.
472
+ * @param {number} projectId For example, 1 for the following URL: https://app.autify.com/projects/1/credits
473
+ * @param {string} [dateFrom] The date to start counting used credits from.\\ If not specified, the date will be set to 1 week ago.\\ Up to 90 days in advance can be specified. If the specified date is more than 90 days in the past, the date will be set to 90 days ago.\\ Date must follow the format YYYY-MM-DD (example: \&quot;2023-09-21\&quot;).
474
+ * @param {string} [dateTo] The date to end counting used credits from.\\ If not specified, the date will be set to today.\\ Date must follow the format YYYY-MM-DD (example: \&quot;2023-09-28\&quot;).
475
+ * @param {number} [scenarioId] The scenario ID to filter used credits by.
476
+ * @param {number} [testPlanId] The test plan ID to filter used credits by.
477
+ * @param {number} [userId] The user ID that executed tests to filter used credits by.
478
+ * @param {*} [options] Override http request option.
479
+ * @throws {RequiredError}
480
+ */
481
+ getCreditUsage: async (projectId, dateFrom, dateTo, scenarioId, testPlanId, userId, options = {}) => {
482
+ // verify required parameter 'projectId' is not null or undefined
483
+ (0, common_1.assertParamExists)("getCreditUsage", "projectId", projectId);
484
+ const localVarPath = `/projects/{project_id}/credits`.replace(`{${"project_id"}}`, encodeURIComponent(String(projectId)));
485
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
486
+ const localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
487
+ let baseOptions;
488
+ if (configuration) {
489
+ baseOptions = configuration.baseOptions;
490
+ }
491
+ const localVarRequestOptions = {
492
+ method: "GET",
493
+ ...baseOptions,
494
+ ...options,
495
+ };
496
+ const localVarHeaderParameter = {};
497
+ const localVarQueryParameter = {};
498
+ // authentication bearerAuth required
499
+ // http bearer authentication required
500
+ await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
501
+ if (dateFrom !== undefined) {
502
+ localVarQueryParameter["date_from"] =
503
+ dateFrom instanceof Date
504
+ ? dateFrom.toISOString().substr(0, 10)
505
+ : dateFrom;
506
+ }
507
+ if (dateTo !== undefined) {
508
+ localVarQueryParameter["date_to"] =
509
+ dateTo instanceof Date
510
+ ? dateTo.toISOString().substr(0, 10)
511
+ : dateTo;
512
+ }
513
+ if (scenarioId !== undefined) {
514
+ localVarQueryParameter["scenario_id"] = scenarioId;
515
+ }
516
+ if (testPlanId !== undefined) {
517
+ localVarQueryParameter["test_plan_id"] = testPlanId;
518
+ }
519
+ if (userId !== undefined) {
520
+ localVarQueryParameter["user_id"] = userId;
521
+ }
522
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
523
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
524
+ localVarRequestOptions.headers = {
525
+ ...localVarHeaderParameter,
526
+ ...headersFromBaseOptions,
527
+ ...options.headers,
528
+ };
529
+ return {
530
+ url: (0, common_1.toPathString)(localVarUrlObj),
531
+ options: localVarRequestOptions,
532
+ };
533
+ },
534
+ };
535
+ };
536
+ exports.CreditApiAxiosParamCreator = CreditApiAxiosParamCreator;
537
+ /**
538
+ * CreditApi - functional programming interface
539
+ * @export
540
+ */
541
+ const CreditApiFp = function (configuration) {
542
+ const localVarAxiosParamCreator = (0, exports.CreditApiAxiosParamCreator)(configuration);
543
+ return {
544
+ /**
545
+ * Get the number of credits used in the project\\ \\ Notes:\\ This endpoint works only for organizations on credit-based plans. It always returns 0 for `credits_consumed` and `credit_consumption_event_count` if your organization is on a run-based plan.
546
+ * @param {number} projectId For example, 1 for the following URL: https://app.autify.com/projects/1/credits
547
+ * @param {string} [dateFrom] The date to start counting used credits from.\\ If not specified, the date will be set to 1 week ago.\\ Up to 90 days in advance can be specified. If the specified date is more than 90 days in the past, the date will be set to 90 days ago.\\ Date must follow the format YYYY-MM-DD (example: \&quot;2023-09-21\&quot;).
548
+ * @param {string} [dateTo] The date to end counting used credits from.\\ If not specified, the date will be set to today.\\ Date must follow the format YYYY-MM-DD (example: \&quot;2023-09-28\&quot;).
549
+ * @param {number} [scenarioId] The scenario ID to filter used credits by.
550
+ * @param {number} [testPlanId] The test plan ID to filter used credits by.
551
+ * @param {number} [userId] The user ID that executed tests to filter used credits by.
552
+ * @param {*} [options] Override http request option.
553
+ * @throws {RequiredError}
554
+ */
555
+ async getCreditUsage(projectId, dateFrom, dateTo, scenarioId, testPlanId, userId, options) {
556
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getCreditUsage(projectId, dateFrom, dateTo, scenarioId, testPlanId, userId, options);
557
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
558
+ },
559
+ };
560
+ };
561
+ exports.CreditApiFp = CreditApiFp;
562
+ /**
563
+ * CreditApi - factory interface
564
+ * @export
565
+ */
566
+ const CreditApiFactory = function (configuration, basePath, axios) {
567
+ const localVarFp = (0, exports.CreditApiFp)(configuration);
568
+ return {
569
+ /**
570
+ * Get the number of credits used in the project\\ \\ Notes:\\ This endpoint works only for organizations on credit-based plans. It always returns 0 for `credits_consumed` and `credit_consumption_event_count` if your organization is on a run-based plan.
571
+ * @param {number} projectId For example, 1 for the following URL: https://app.autify.com/projects/1/credits
572
+ * @param {string} [dateFrom] The date to start counting used credits from.\\ If not specified, the date will be set to 1 week ago.\\ Up to 90 days in advance can be specified. If the specified date is more than 90 days in the past, the date will be set to 90 days ago.\\ Date must follow the format YYYY-MM-DD (example: \&quot;2023-09-21\&quot;).
573
+ * @param {string} [dateTo] The date to end counting used credits from.\\ If not specified, the date will be set to today.\\ Date must follow the format YYYY-MM-DD (example: \&quot;2023-09-28\&quot;).
574
+ * @param {number} [scenarioId] The scenario ID to filter used credits by.
575
+ * @param {number} [testPlanId] The test plan ID to filter used credits by.
576
+ * @param {number} [userId] The user ID that executed tests to filter used credits by.
577
+ * @param {*} [options] Override http request option.
578
+ * @throws {RequiredError}
579
+ */
580
+ getCreditUsage(projectId, dateFrom, dateTo, scenarioId, testPlanId, userId, options) {
581
+ return localVarFp
582
+ .getCreditUsage(projectId, dateFrom, dateTo, scenarioId, testPlanId, userId, options)
583
+ .then((request) => request(axios, basePath));
584
+ },
585
+ };
586
+ };
587
+ exports.CreditApiFactory = CreditApiFactory;
588
+ /**
589
+ * CreditApi - object-oriented interface
590
+ * @export
591
+ * @class CreditApi
592
+ * @extends {BaseAPI}
593
+ */
594
+ class CreditApi extends base_1.BaseAPI {
595
+ /**
596
+ * Get the number of credits used in the project\\ \\ Notes:\\ This endpoint works only for organizations on credit-based plans. It always returns 0 for `credits_consumed` and `credit_consumption_event_count` if your organization is on a run-based plan.
597
+ * @param {number} projectId For example, 1 for the following URL: https://app.autify.com/projects/1/credits
598
+ * @param {string} [dateFrom] The date to start counting used credits from.\\ If not specified, the date will be set to 1 week ago.\\ Up to 90 days in advance can be specified. If the specified date is more than 90 days in the past, the date will be set to 90 days ago.\\ Date must follow the format YYYY-MM-DD (example: \&quot;2023-09-21\&quot;).
599
+ * @param {string} [dateTo] The date to end counting used credits from.\\ If not specified, the date will be set to today.\\ Date must follow the format YYYY-MM-DD (example: \&quot;2023-09-28\&quot;).
600
+ * @param {number} [scenarioId] The scenario ID to filter used credits by.
601
+ * @param {number} [testPlanId] The test plan ID to filter used credits by.
602
+ * @param {number} [userId] The user ID that executed tests to filter used credits by.
603
+ * @param {*} [options] Override http request option.
604
+ * @throws {RequiredError}
605
+ * @memberof CreditApi
606
+ */
607
+ getCreditUsage(projectId, dateFrom, dateTo, scenarioId, testPlanId, userId, options) {
608
+ return (0, exports.CreditApiFp)(this.configuration)
609
+ .getCreditUsage(projectId, dateFrom, dateTo, scenarioId, testPlanId, userId, options)
610
+ .then((request) => request(this.axios, this.basePath));
611
+ }
612
+ }
613
+ exports.CreditApi = CreditApi;
614
+ /**
615
+ * ProjectApi - axios parameter creator
616
+ * @export
617
+ */
618
+ const ProjectApiAxiosParamCreator = function (configuration) {
619
+ return {
620
+ /**
621
+ * Get project information.
622
+ * @param {number} projectId For example, 1 for the following URL: https://app.autify.com/projects/1/project_info
623
+ * @param {*} [options] Override http request option.
624
+ * @throws {RequiredError}
625
+ */
626
+ getProjectInfo: async (projectId, options = {}) => {
627
+ // verify required parameter 'projectId' is not null or undefined
628
+ (0, common_1.assertParamExists)("getProjectInfo", "projectId", projectId);
629
+ const localVarPath = `/projects/{project_id}/project_info`.replace(`{${"project_id"}}`, encodeURIComponent(String(projectId)));
630
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
631
+ const localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
632
+ let baseOptions;
633
+ if (configuration) {
634
+ baseOptions = configuration.baseOptions;
635
+ }
636
+ const localVarRequestOptions = {
637
+ method: "GET",
638
+ ...baseOptions,
639
+ ...options,
640
+ };
641
+ const localVarHeaderParameter = {};
642
+ const localVarQueryParameter = {};
643
+ // authentication bearerAuth required
644
+ // http bearer authentication required
645
+ await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
646
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
647
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
648
+ localVarRequestOptions.headers = {
649
+ ...localVarHeaderParameter,
650
+ ...headersFromBaseOptions,
651
+ ...options.headers,
652
+ };
653
+ return {
654
+ url: (0, common_1.toPathString)(localVarUrlObj),
655
+ options: localVarRequestOptions,
656
+ };
657
+ },
658
+ };
659
+ };
660
+ exports.ProjectApiAxiosParamCreator = ProjectApiAxiosParamCreator;
661
+ /**
662
+ * ProjectApi - functional programming interface
663
+ * @export
664
+ */
665
+ const ProjectApiFp = function (configuration) {
666
+ const localVarAxiosParamCreator = (0, exports.ProjectApiAxiosParamCreator)(configuration);
667
+ return {
668
+ /**
669
+ * Get project information.
670
+ * @param {number} projectId For example, 1 for the following URL: https://app.autify.com/projects/1/project_info
671
+ * @param {*} [options] Override http request option.
672
+ * @throws {RequiredError}
673
+ */
674
+ async getProjectInfo(projectId, options) {
675
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectInfo(projectId, options);
676
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
677
+ },
678
+ };
679
+ };
680
+ exports.ProjectApiFp = ProjectApiFp;
681
+ /**
682
+ * ProjectApi - factory interface
683
+ * @export
684
+ */
685
+ const ProjectApiFactory = function (configuration, basePath, axios) {
686
+ const localVarFp = (0, exports.ProjectApiFp)(configuration);
687
+ return {
688
+ /**
689
+ * Get project information.
690
+ * @param {number} projectId For example, 1 for the following URL: https://app.autify.com/projects/1/project_info
691
+ * @param {*} [options] Override http request option.
692
+ * @throws {RequiredError}
693
+ */
694
+ getProjectInfo(projectId, options) {
695
+ return localVarFp
696
+ .getProjectInfo(projectId, options)
697
+ .then((request) => request(axios, basePath));
698
+ },
699
+ };
700
+ };
701
+ exports.ProjectApiFactory = ProjectApiFactory;
702
+ /**
703
+ * ProjectApi - object-oriented interface
704
+ * @export
705
+ * @class ProjectApi
706
+ * @extends {BaseAPI}
707
+ */
708
+ class ProjectApi extends base_1.BaseAPI {
709
+ /**
710
+ * Get project information.
711
+ * @param {number} projectId For example, 1 for the following URL: https://app.autify.com/projects/1/project_info
712
+ * @param {*} [options] Override http request option.
713
+ * @throws {RequiredError}
714
+ * @memberof ProjectApi
715
+ */
716
+ getProjectInfo(projectId, options) {
717
+ return (0, exports.ProjectApiFp)(this.configuration)
718
+ .getProjectInfo(projectId, options)
719
+ .then((request) => request(this.axios, this.basePath));
720
+ }
721
+ }
722
+ exports.ProjectApi = ProjectApi;
464
723
  /**
465
724
  * ResultApi - axios parameter creator
466
725
  * @export
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autifyhq/autify-sdk",
3
- "version": "0.18.0",
3
+ "version": "0.19.0",
4
4
  "description": "Autify SDK for JavaScript",
5
5
  "author": "Autify",
6
6
  "homepage": "https://github.com/autifyhq/autify-sdk-js",