@dichovsky/testrail-api-client 1.0.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.
- package/LICENSE +21 -0
- package/README.md +537 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.js +268 -0
- package/dist/client-core.d.ts +103 -0
- package/dist/client-core.js +601 -0
- package/dist/client.d.ts +652 -0
- package/dist/client.js +1106 -0
- package/dist/constants.d.ts +12 -0
- package/dist/constants.js +14 -0
- package/dist/errors.d.ts +20 -0
- package/dist/errors.js +29 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +3 -0
- package/dist/types.d.ts +762 -0
- package/dist/types.js +2 -0
- package/dist/utils.d.ts +5 -0
- package/dist/utils.js +13 -0
- package/package.json +76 -0
- package/src/cli.ts +287 -0
- package/src/client-core.ts +761 -0
- package/src/client.ts +1338 -0
- package/src/constants.ts +15 -0
- package/src/errors.ts +28 -0
- package/src/index.ts +74 -0
- package/src/types.ts +853 -0
- package/src/utils.ts +15 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const BASE_RETRY_DELAY_MS = 1000;
|
|
2
|
+
export declare const MAX_RETRY_DELAY_MS = 10000;
|
|
3
|
+
/** Maximum allowed request timeout: 5 minutes */
|
|
4
|
+
export declare const MAX_TIMEOUT_MS: number;
|
|
5
|
+
export declare const DEFAULT_TIMEOUT_MS = 30000;
|
|
6
|
+
export declare const DEFAULT_MAX_RETRIES = 3;
|
|
7
|
+
export declare const DEFAULT_CACHE_TTL_MS = 300000;
|
|
8
|
+
export declare const DEFAULT_CACHE_CLEANUP_INTERVAL_MS = 60000;
|
|
9
|
+
export declare const DEFAULT_MAX_CACHE_SIZE = 1000;
|
|
10
|
+
export declare const DEFAULT_RATE_LIMIT_MAX_REQUESTS = 100;
|
|
11
|
+
export declare const DEFAULT_RATE_LIMIT_WINDOW_MS = 60000;
|
|
12
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Retry backoff bounds
|
|
2
|
+
export const BASE_RETRY_DELAY_MS = 1000;
|
|
3
|
+
export const MAX_RETRY_DELAY_MS = 10000;
|
|
4
|
+
/** Maximum allowed request timeout: 5 minutes */
|
|
5
|
+
export const MAX_TIMEOUT_MS = 5 * 60 * 1000;
|
|
6
|
+
// TestRailConfig defaults
|
|
7
|
+
export const DEFAULT_TIMEOUT_MS = 30000;
|
|
8
|
+
export const DEFAULT_MAX_RETRIES = 3;
|
|
9
|
+
export const DEFAULT_CACHE_TTL_MS = 300000; // 5 minutes
|
|
10
|
+
export const DEFAULT_CACHE_CLEANUP_INTERVAL_MS = 60000; // 1 minute
|
|
11
|
+
export const DEFAULT_MAX_CACHE_SIZE = 1000;
|
|
12
|
+
export const DEFAULT_RATE_LIMIT_MAX_REQUESTS = 100;
|
|
13
|
+
export const DEFAULT_RATE_LIMIT_WINDOW_MS = 60000; // 1 minute
|
|
14
|
+
//# sourceMappingURL=constants.js.map
|
package/dist/errors.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Thrown when the TestRail API returns a non-2xx response or a network error occurs.
|
|
3
|
+
*
|
|
4
|
+
* @property status - HTTP status code (if available)
|
|
5
|
+
* @property statusText - HTTP status text (if available)
|
|
6
|
+
* @property response - Raw response body (if available)
|
|
7
|
+
*/
|
|
8
|
+
export declare class TestRailApiError extends Error {
|
|
9
|
+
readonly status?: number | undefined;
|
|
10
|
+
readonly statusText?: string | undefined;
|
|
11
|
+
readonly response?: string | undefined;
|
|
12
|
+
constructor(message: string, status?: number | undefined, statusText?: string | undefined, response?: string | undefined);
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Thrown when client configuration or method parameters fail validation.
|
|
16
|
+
*/
|
|
17
|
+
export declare class TestRailValidationError extends Error {
|
|
18
|
+
constructor(message: string);
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=errors.d.ts.map
|
package/dist/errors.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Thrown when the TestRail API returns a non-2xx response or a network error occurs.
|
|
3
|
+
*
|
|
4
|
+
* @property status - HTTP status code (if available)
|
|
5
|
+
* @property statusText - HTTP status text (if available)
|
|
6
|
+
* @property response - Raw response body (if available)
|
|
7
|
+
*/
|
|
8
|
+
export class TestRailApiError extends Error {
|
|
9
|
+
status;
|
|
10
|
+
statusText;
|
|
11
|
+
response;
|
|
12
|
+
constructor(message, status, statusText, response) {
|
|
13
|
+
super(message);
|
|
14
|
+
this.status = status;
|
|
15
|
+
this.statusText = statusText;
|
|
16
|
+
this.response = response;
|
|
17
|
+
this.name = 'TestRailApiError';
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Thrown when client configuration or method parameters fail validation.
|
|
22
|
+
*/
|
|
23
|
+
export class TestRailValidationError extends Error {
|
|
24
|
+
constructor(message) {
|
|
25
|
+
super(message);
|
|
26
|
+
this.name = 'TestRailValidationError';
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=errors.js.map
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { TestRailClient } from './client.js';
|
|
2
|
+
export { TestRailApiError, TestRailValidationError } from './errors.js';
|
|
3
|
+
export type { TestRailConfig, RateLimiterConfig, Case, Suite, AddSuitePayload, UpdateSuitePayload, Section, Project, Plan, PlanEntry, Run, Test, Result, Milestone, User, Status, Priority, AddCasePayload, UpdateCasePayload, AddPlanPayload, UpdatePlanPayload, AddPlanEntryPayload, UpdatePlanEntryPayload, AddRunPayload, UpdateRunPayload, AddResultPayload, AddResultsForCasesPayload, AddResultForCasePayload, AddSectionPayload, UpdateSectionPayload, AddMilestonePayload, UpdateMilestonePayload, AddProjectPayload, UpdateProjectPayload, GetCasesOptions, GetPlansOptions, GetTestsOptions, GetResultsOptions, GetMilestonesOptions, GetRunsOptions, ResultField, ResultFieldConfig, CaseField, CaseFieldConfig, CaseType, Template, ConfigurationGroup, Configuration, AddConfigurationGroupPayload, UpdateConfigurationGroupPayload, AddConfigurationPayload, UpdateConfigurationPayload, AddUserPayload, UpdateUserPayload, Role, Group, AddGroupPayload, UpdateGroupPayload, Attachment, SharedStep, AddSharedStepPayload, UpdateSharedStepPayload, Variable, AddVariablePayload, UpdateVariablePayload, Dataset, AddDatasetPayload, UpdateDatasetPayload, Report, ReportResult, } from './types.js';
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
ADDED