qase-javascript-commons 2.6.3 → 2.6.4

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,96 +1,19 @@
1
1
  import { Attachment, TestResultType } from '../models';
2
2
  import { TestOpsOptionsType } from '../models/config/TestOpsOptionsType';
3
- import { QaseError } from '../utils/qase-error';
4
- import { IClient } from './interface';
5
3
  import { LoggerInterface } from '../utils/logger';
4
+ import { IClient } from './interface';
5
+ import { AttachmentService } from './services/attachment-service';
6
+ import { RunService } from './services/run-service';
6
7
  export declare class ClientV1 implements IClient {
7
8
  protected readonly logger: LoggerInterface;
8
9
  protected readonly config: TestOpsOptionsType;
9
- private readonly environment;
10
- private readonly appUrl;
11
- private readonly runClient;
12
- private readonly environmentClient;
13
- private readonly attachmentClient;
14
- private readonly configurationClient;
10
+ protected readonly environment: string | undefined;
11
+ protected readonly attachmentService: AttachmentService;
12
+ protected readonly runService: RunService;
15
13
  constructor(logger: LoggerInterface, config: TestOpsOptionsType, environment: string | undefined);
16
- private createApiConfig;
17
14
  uploadResults(_runId: number, _results: TestResultType[]): Promise<void>;
18
15
  createRun(): Promise<number>;
19
16
  completeRun(runId: number): Promise<void>;
20
17
  enablePublicReport(runId: number): Promise<void>;
21
- private getErrorMessage;
22
18
  uploadAttachment(attachment: Attachment): Promise<string>;
23
- protected uploadAttachments(attachments: Attachment[]): Promise<string[]>;
24
- /**
25
- * Group attachments into batches respecting API limits:
26
- * - Up to 20 files per batch
27
- * - Up to 128 MB per batch
28
- * @param attachments Array of attachments to group
29
- * @returns Array of attachment batches
30
- */
31
- private groupAttachmentsIntoBatches;
32
- /**
33
- * Upload attachment with retry logic for 429 errors
34
- * @param project Project code
35
- * @param data Attachment data array (can contain multiple files)
36
- * @param attachmentNames Attachment names for logging (comma-separated for batches)
37
- * @param maxRetries Maximum number of retry attempts
38
- * @param initialDelay Initial delay in milliseconds
39
- * @returns Promise with upload response
40
- */
41
- private uploadAttachmentWithRetry;
42
- /**
43
- * Extract Retry-After header value from response or return null
44
- * @param error Axios error
45
- * @returns Retry-After value in milliseconds or null
46
- */
47
- private getRetryAfter;
48
- /**
49
- * Delay execution for specified milliseconds
50
- * @param ms Milliseconds to delay
51
- */
52
- private delay;
53
- /**
54
- * Ensure attachment size is calculated if not set or is 0
55
- * @param attachment Attachment to ensure size for
56
- */
57
- private ensureAttachmentSize;
58
- private prepareAttachmentData;
59
- private getEnvironmentId;
60
- private prepareRunObject;
61
- /**
62
- * Get all configuration groups with their configurations
63
- * @returns Promise<ConfigurationGroup[]> Array of configuration groups
64
- * @private
65
- */
66
- private getConfigurations;
67
- /**
68
- * Create a configuration group
69
- * @param title Group title
70
- * @returns Promise<number | undefined> Created group ID
71
- * @private
72
- */
73
- private createConfigurationGroup;
74
- /**
75
- * Create a configuration in a group
76
- * @param title Configuration title
77
- * @param groupId Group ID
78
- * @returns Promise<number | undefined> Created configuration ID
79
- * @private
80
- */
81
- private createConfiguration;
82
- /**
83
- * Handle configuration creation based on config settings
84
- * @returns Promise<number[]> Array of configuration IDs
85
- * @private
86
- */
87
- private handleConfigurations;
88
- /**
89
- * Process error and throw QaseError
90
- * @param {Error | AxiosError} error
91
- * @param {string} message
92
- * @param {object} model
93
- * @private
94
- */
95
- protected processError(error: unknown, message: string, model?: object): QaseError;
96
19
  }