@yadsh/dsh-qa-integrations 0.5.0 → 0.7.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/README.md +636 -202
- package/compatibility.json +1 -1
- package/lib/broker.js +468 -9
- package/lib/broker.js.map +1 -1
- package/lib/client/bitrix24.js +67 -5
- package/lib/client/bitrix24.js.map +1 -1
- package/lib/client/card.js +8 -1
- package/lib/client/card.js.map +1 -1
- package/lib/client/confluence.js +98 -129
- package/lib/client/confluence.js.map +1 -1
- package/lib/client/gitlab.js +41 -5
- package/lib/client/gitlab.js.map +1 -1
- package/lib/client/index.js +33 -11
- package/lib/client/index.js.map +1 -1
- package/lib/client/integrations.js +40 -3
- package/lib/client/integrations.js.map +1 -1
- package/lib/client/jira.js +96 -127
- package/lib/client/jira.js.map +1 -1
- package/lib/client/operator-card.js +537 -0
- package/lib/client/operator-card.js.map +1 -0
- package/lib/client/operator-controls.js +232 -0
- package/lib/client/operator-controls.js.map +1 -0
- package/lib/client/provider-card.js +138 -4
- package/lib/client/provider-card.js.map +1 -1
- package/lib/client/styles.js +68 -5
- package/lib/client/styles.js.map +1 -1
- package/lib/client/teamcity.js +31 -4
- package/lib/client/teamcity.js.map +1 -1
- package/lib/client/testit.js +101 -0
- package/lib/client/testit.js.map +1 -0
- package/lib/client/weblate.js +105 -0
- package/lib/client/weblate.js.map +1 -0
- package/lib/client.js +5214 -1054
- package/lib/client.js.map +1 -1
- package/lib/coerce.js +16 -7
- package/lib/coerce.js.map +1 -1
- package/lib/config.js +12 -0
- package/lib/config.js.map +1 -1
- package/lib/errors.js.map +1 -1
- package/lib/index.js +444 -57
- package/lib/index.js.map +1 -1
- package/lib/providers/bitrix24/catalog.js +151 -8
- package/lib/providers/bitrix24/catalog.js.map +1 -1
- package/lib/providers/bitrix24/config.js +87 -13
- package/lib/providers/bitrix24/config.js.map +1 -1
- package/lib/providers/bitrix24/credential-help.js +24 -0
- package/lib/providers/bitrix24/credential-help.js.map +1 -0
- package/lib/providers/bitrix24/index.js +122 -0
- package/lib/providers/bitrix24/index.js.map +1 -1
- package/lib/providers/bitrix24/operations.js +60 -1
- package/lib/providers/bitrix24/operations.js.map +1 -1
- package/lib/providers/bitrix24/tools.js +95 -3
- package/lib/providers/bitrix24/tools.js.map +1 -1
- package/lib/providers/confluence/catalog.js +51 -3
- package/lib/providers/confluence/catalog.js.map +1 -1
- package/lib/providers/confluence/credential-help.js +29 -0
- package/lib/providers/confluence/credential-help.js.map +1 -0
- package/lib/providers/confluence/index.js +302 -35
- package/lib/providers/confluence/index.js.map +1 -1
- package/lib/providers/confluence/operations.js +1 -1
- package/lib/providers/confluence/operations.js.map +1 -1
- package/lib/providers/gitlab/catalog.js +108 -15
- package/lib/providers/gitlab/catalog.js.map +1 -1
- package/lib/providers/gitlab/config.js +11 -3
- package/lib/providers/gitlab/config.js.map +1 -1
- package/lib/providers/gitlab/credential-help.js +33 -0
- package/lib/providers/gitlab/credential-help.js.map +1 -0
- package/lib/providers/gitlab/index.js +337 -6
- package/lib/providers/gitlab/index.js.map +1 -1
- package/lib/providers/jira/catalog.js +73 -3
- package/lib/providers/jira/catalog.js.map +1 -1
- package/lib/providers/jira/credential-help.js +31 -0
- package/lib/providers/jira/credential-help.js.map +1 -0
- package/lib/providers/jira/index.js +275 -12
- package/lib/providers/jira/index.js.map +1 -1
- package/lib/providers/registry.js +4 -0
- package/lib/providers/registry.js.map +1 -1
- package/lib/providers/shared/credential-help.js +29 -0
- package/lib/providers/shared/credential-help.js.map +1 -0
- package/lib/providers/shared/service-boundary.js +44 -0
- package/lib/providers/shared/service-boundary.js.map +1 -0
- package/lib/providers/teamcity/catalog.js +56 -2
- package/lib/providers/teamcity/catalog.js.map +1 -1
- package/lib/providers/teamcity/credential-help.js +25 -0
- package/lib/providers/teamcity/credential-help.js.map +1 -0
- package/lib/providers/teamcity/index.js +254 -2
- package/lib/providers/teamcity/index.js.map +1 -1
- package/lib/providers/testit/attachments.js +131 -0
- package/lib/providers/testit/attachments.js.map +1 -0
- package/lib/providers/testit/catalog.js +302 -0
- package/lib/providers/testit/catalog.js.map +1 -0
- package/lib/providers/testit/config.js +175 -0
- package/lib/providers/testit/config.js.map +1 -0
- package/lib/providers/testit/credential-help.js +29 -0
- package/lib/providers/testit/credential-help.js.map +1 -0
- package/lib/providers/testit/index.js +458 -0
- package/lib/providers/testit/index.js.map +1 -0
- package/lib/providers/testit/operations.js +1070 -0
- package/lib/providers/testit/operations.js.map +1 -0
- package/lib/providers/testit/tools.js +717 -0
- package/lib/providers/testit/tools.js.map +1 -0
- package/lib/providers/testit/transport.js +158 -0
- package/lib/providers/testit/transport.js.map +1 -0
- package/lib/providers/weblate/catalog.js +279 -0
- package/lib/providers/weblate/catalog.js.map +1 -0
- package/lib/providers/weblate/config.js +147 -0
- package/lib/providers/weblate/config.js.map +1 -0
- package/lib/providers/weblate/credential-help.js +26 -0
- package/lib/providers/weblate/credential-help.js.map +1 -0
- package/lib/providers/weblate/index.js +419 -0
- package/lib/providers/weblate/index.js.map +1 -0
- package/lib/providers/weblate/operations.js +703 -0
- package/lib/providers/weblate/operations.js.map +1 -0
- package/lib/providers/weblate/query.js +80 -0
- package/lib/providers/weblate/query.js.map +1 -0
- package/lib/providers/weblate/tools.js +408 -0
- package/lib/providers/weblate/tools.js.map +1 -0
- package/lib/providers/weblate/transport.js +179 -0
- package/lib/providers/weblate/transport.js.map +1 -0
- package/lib/repository.js +197 -13
- package/lib/repository.js.map +1 -1
- package/lib/service-credentials/config.js +179 -0
- package/lib/service-credentials/config.js.map +1 -0
- package/lib/service-credentials/policy.js +92 -0
- package/lib/service-credentials/policy.js.map +1 -0
- package/lib/service-credentials/registry.js +142 -0
- package/lib/service-credentials/registry.js.map +1 -0
- package/lib/service-credentials/state.js +30 -0
- package/lib/service-credentials/state.js.map +1 -0
- package/lib/service-credentials/types.js +20 -0
- package/lib/service-credentials/types.js.map +1 -0
- package/lib/shared/settings.js +8 -13
- package/lib/shared/settings.js.map +1 -1
- package/lib/tools.js +27 -2
- package/lib/tools.js.map +1 -1
- package/lib/typert.host.js +1340 -100
- package/lib/typert.remote-client.d.ts +45 -11
- package/lib/typert.remote-client.js +1101 -38
- package/lib/types/broker.d.ts +79 -5
- package/lib/types/client/bitrix24.d.ts +24 -2
- package/lib/types/client/card.d.ts +3 -1
- package/lib/types/client/confluence.d.ts +19 -3
- package/lib/types/client/gitlab.d.ts +15 -2
- package/lib/types/client/index.d.ts +7 -5
- package/lib/types/client/integrations.d.ts +12 -3
- package/lib/types/client/jira.d.ts +20 -3
- package/lib/types/client/operator-card.d.ts +22 -0
- package/lib/types/client/operator-controls.d.ts +135 -0
- package/lib/types/client/provider-card.d.ts +50 -8
- package/lib/types/client/styles.d.ts +4 -3
- package/lib/types/client/teamcity.d.ts +15 -2
- package/lib/types/client/testit.d.ts +28 -0
- package/lib/types/client/weblate.d.ts +28 -0
- package/lib/types/coerce.d.ts +2 -2
- package/lib/types/config.d.ts +21 -0
- package/lib/types/errors.d.ts +9 -1
- package/lib/types/index.d.ts +183 -18
- package/lib/types/providers/bitrix24/catalog.d.ts +9 -1
- package/lib/types/providers/bitrix24/config.d.ts +23 -22
- package/lib/types/providers/bitrix24/credential-help.d.ts +8 -0
- package/lib/types/providers/bitrix24/index.d.ts +41 -1
- package/lib/types/providers/bitrix24/tools.d.ts +4 -0
- package/lib/types/providers/confluence/catalog.d.ts +11 -3
- package/lib/types/providers/confluence/credential-help.d.ts +9 -0
- package/lib/types/providers/confluence/index.d.ts +66 -7
- package/lib/types/providers/confluence/operations.d.ts +2 -0
- package/lib/types/providers/contract.d.ts +62 -1
- package/lib/types/providers/gitlab/catalog.d.ts +20 -5
- package/lib/types/providers/gitlab/config.d.ts +14 -3
- package/lib/types/providers/gitlab/credential-help.d.ts +9 -0
- package/lib/types/providers/gitlab/index.d.ts +51 -1
- package/lib/types/providers/jira/catalog.d.ts +13 -0
- package/lib/types/providers/jira/credential-help.d.ts +8 -0
- package/lib/types/providers/jira/index.d.ts +53 -1
- package/lib/types/providers/registry.d.ts +2 -0
- package/lib/types/providers/shared/credential-help.d.ts +17 -0
- package/lib/types/providers/shared/service-boundary.d.ts +25 -0
- package/lib/types/providers/teamcity/catalog.d.ts +18 -2
- package/lib/types/providers/teamcity/credential-help.d.ts +8 -0
- package/lib/types/providers/teamcity/index.d.ts +53 -2
- package/lib/types/providers/testit/attachments.d.ts +20 -0
- package/lib/types/providers/testit/catalog.d.ts +87 -0
- package/lib/types/providers/testit/config.d.ts +61 -0
- package/lib/types/providers/testit/credential-help.d.ts +8 -0
- package/lib/types/providers/testit/index.d.ts +119 -0
- package/lib/types/providers/testit/operations.d.ts +95 -0
- package/lib/types/providers/testit/tools.d.ts +15 -0
- package/lib/types/providers/testit/transport.d.ts +67 -0
- package/lib/types/providers/weblate/catalog.d.ts +60 -0
- package/lib/types/providers/weblate/config.d.ts +57 -0
- package/lib/types/providers/weblate/credential-help.d.ts +9 -0
- package/lib/types/providers/weblate/index.d.ts +92 -0
- package/lib/types/providers/weblate/operations.d.ts +77 -0
- package/lib/types/providers/weblate/query.d.ts +37 -0
- package/lib/types/providers/weblate/tools.d.ts +15 -0
- package/lib/types/providers/weblate/transport.d.ts +60 -0
- package/lib/types/repository.d.ts +38 -3
- package/lib/types/service-credentials/config.d.ts +73 -0
- package/lib/types/service-credentials/policy.d.ts +44 -0
- package/lib/types/service-credentials/registry.d.ts +43 -0
- package/lib/types/service-credentials/state.d.ts +14 -0
- package/lib/types/service-credentials/types.d.ts +97 -0
- package/lib/types/shared/settings.d.ts +8 -13
- package/lib/types/tools.d.ts +10 -1
- package/lib/types/types.d.ts +114 -10
- package/package.json +7 -7
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { OperationSecurityMetadata } from "../../service-credentials/types.js";
|
|
1
2
|
import type { IntegrationCapability, IntegrationCapabilityInfo } from "../../types.js";
|
|
2
3
|
import type { TeamCityFlags } from "./config.js";
|
|
3
4
|
/**
|
|
@@ -6,6 +7,10 @@ import type { TeamCityFlags } from "./config.js";
|
|
|
6
7
|
* purpose: a TeamCity token grants whole areas (or is limited per project), while
|
|
7
8
|
* the agent gets one switch per area, so a user who only needs "why did my build
|
|
8
9
|
* fail" can hand over failures and logs without projects or agents.
|
|
10
|
+
*
|
|
11
|
+
* Logs and artifacts live under their own capability because a build log is the
|
|
12
|
+
* classic place an internal address or a secret leaks from: the deployment's
|
|
13
|
+
* managed credential reads build metadata, never the text a build printed.
|
|
9
14
|
*/
|
|
10
15
|
export type TeamCityCapability = "identity.read" | "projects.read" | "buildConfigs.read" | "builds.read" | "failures.read" | "logs.read" | "queue.read" | "investigations.read" | "agents.read" | "artifacts.read";
|
|
11
16
|
/** Boolean deployment switches of this provider, one per capability. */
|
|
@@ -37,11 +42,20 @@ export interface TeamCityOperationDefinition {
|
|
|
37
42
|
* gate can assert that, instead of trusting the path names to look harmless.
|
|
38
43
|
*/
|
|
39
44
|
readonly method: "GET";
|
|
45
|
+
/** What this operation does, how sensitive it is, who may reach it. */
|
|
46
|
+
readonly security: OperationSecurityMetadata;
|
|
40
47
|
}
|
|
48
|
+
/** The resource kind every project-scoped operation of this provider is bounded by. */
|
|
49
|
+
export declare const TEAMCITY_RESOURCE_KIND = "projects";
|
|
50
|
+
/**
|
|
51
|
+
* This provider has one server per deployment, so deployment configuration names
|
|
52
|
+
* it by this instance id when it binds a managed credential to it.
|
|
53
|
+
*/
|
|
54
|
+
export declare const TEAMCITY_INSTANCE_ID = "teamcity";
|
|
41
55
|
/**
|
|
42
56
|
* Every model-reachable operation. The provider refuses any operation that is
|
|
43
|
-
* not listed here, so this table — together with `capability`
|
|
44
|
-
* permission surface. The catalog carries no operation that could change
|
|
57
|
+
* not listed here, so this table — together with `capability` and `security` —
|
|
58
|
+
* is the permission surface. The catalog carries no operation that could change
|
|
45
59
|
* TeamCity state: trigger, retry, cancel, comment and tags wait for the
|
|
46
60
|
* confirmation framework the specification requires for them.
|
|
47
61
|
*/
|
|
@@ -52,4 +66,6 @@ export declare function enabledCapabilities(flags: TeamCityFlags): readonly Team
|
|
|
52
66
|
export declare const TEAMCITY_CAPABILITY_INFO: Readonly<Record<TeamCityCapability, IntegrationCapabilityInfo>>;
|
|
53
67
|
/** Capability an operation needs, or undefined when the catalog has none. */
|
|
54
68
|
export declare function teamcityOperationCapability(operation: string): IntegrationCapability | undefined;
|
|
69
|
+
/** Security classification of an operation, or undefined when it is unknown. */
|
|
70
|
+
export declare function teamcityOperationMetadata(operation: string): OperationSecurityMetadata | undefined;
|
|
55
71
|
//# sourceMappingURL=catalog.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { CredentialHelp } from "@yadsh/dsh-plugin-kit";
|
|
2
|
+
/**
|
|
3
|
+
* TeamCity hands out access tokens in the user's own profile, and the value is
|
|
4
|
+
* shown exactly once — which is why the help says so rather than leaving a user
|
|
5
|
+
* to discover it after closing the page.
|
|
6
|
+
*/
|
|
7
|
+
export declare const TEAMCITY_CREDENTIAL_HELP: CredentialHelp;
|
|
8
|
+
//# sourceMappingURL=credential-help.d.ts.map
|
|
@@ -1,10 +1,28 @@
|
|
|
1
|
+
import { type CredentialHelp } from "@yadsh/dsh-plugin-kit";
|
|
1
2
|
import type { ResolvedQaIntegrationsConfig } from "../../config.js";
|
|
2
|
-
import type {
|
|
3
|
+
import type { OperationSecurityMetadata, ServiceCredentialHealth, ServiceResourceBoundary } from "../../service-credentials/types.js";
|
|
4
|
+
import type { CapabilityServiceState, IntegrationCapability, IntegrationCapabilityInfo, ProviderValidation } from "../../types.js";
|
|
3
5
|
import type { IntegrationProvider, ProviderContext } from "../contract.js";
|
|
4
6
|
export { configuredServer, credentialFromPlaintext, type TeamCityCredential, } from "./transport.js";
|
|
7
|
+
/**
|
|
8
|
+
* Whether one caller-named TeamCity project stays inside the boundary. A listed
|
|
9
|
+
* project covers its own subprojects, because that is what the identifier means
|
|
10
|
+
* upstream; an ancestor of a listed project is not covered, because asking for
|
|
11
|
+
* it would return the siblings nobody listed.
|
|
12
|
+
*/
|
|
13
|
+
export declare function projectAllowed(boundary: ServiceResourceBoundary, ref: string): boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Whether one build configuration stays inside the boundary: it is either
|
|
16
|
+
* listed itself, or it hangs off a listed project. TeamCity names a build
|
|
17
|
+
* configuration `<projectId>_<configId>`, which is the prefix a listed project
|
|
18
|
+
* matches on; the authoritative `projectId` from the API is preferred wherever
|
|
19
|
+
* the call already fetches it.
|
|
20
|
+
*/
|
|
21
|
+
export declare function buildTypeAllowed(boundary: ServiceResourceBoundary, ref: string, projectId?: string | undefined): boolean;
|
|
5
22
|
/**
|
|
6
23
|
* TeamCity provider: one TeamCity server per QA user, connected with that user's
|
|
7
|
-
* own personal access token
|
|
24
|
+
* own personal access token, or with the deployment's managed read-only
|
|
25
|
+
* credential when the user's binding asks for it.
|
|
8
26
|
*
|
|
9
27
|
* The server address is user input, so it is checked against the deployment's
|
|
10
28
|
* address policy when the connection is stored and again on every call, and the
|
|
@@ -17,6 +35,10 @@ export declare class TeamcityProvider implements IntegrationProvider {
|
|
|
17
35
|
/** What this deployment is willing to expose; TeamCity's own rights still apply. */
|
|
18
36
|
readonly capabilities: readonly IntegrationCapability[];
|
|
19
37
|
readonly capabilityInfo: Readonly<Record<IntegrationCapability, IntegrationCapabilityInfo>>;
|
|
38
|
+
/** Where the settings card says this provider's credential comes from. */
|
|
39
|
+
readonly credentialHelp: CredentialHelp | null;
|
|
40
|
+
/** Overrides the deployment got wrong; reported once at startup, never fatal. */
|
|
41
|
+
readonly credentialHelpProblems: readonly string[];
|
|
20
42
|
private readonly transport;
|
|
21
43
|
constructor(config: ResolvedQaIntegrationsConfig, fetcher?: typeof fetch);
|
|
22
44
|
/**
|
|
@@ -32,8 +54,37 @@ export declare class TeamcityProvider implements IntegrationProvider {
|
|
|
32
54
|
readonly portal: string;
|
|
33
55
|
};
|
|
34
56
|
operationCapability(operation: string): IntegrationCapability | undefined;
|
|
57
|
+
operationMetadata(operation: string): OperationSecurityMetadata | undefined;
|
|
58
|
+
resourceBoundaryKind(operation: string): string | undefined;
|
|
59
|
+
capabilityServiceState(capability: IntegrationCapability): CapabilityServiceState | undefined;
|
|
60
|
+
/** An empty id means this deployment's single server, as in `parseCredential`. */
|
|
61
|
+
instancePortal(instanceId: string): string | undefined;
|
|
35
62
|
validate(context: ProviderContext): Promise<ProviderValidation>;
|
|
63
|
+
/**
|
|
64
|
+
* Health of the deployment's managed token. TeamCity exposes no way to read a
|
|
65
|
+
* token's roles, so the probe answers what it can — whether the token is
|
|
66
|
+
* accepted and which identity it carries — and says so instead of implying a
|
|
67
|
+
* permission audit it did not perform.
|
|
68
|
+
*/
|
|
69
|
+
validateServiceCredential(context: ProviderContext): Promise<ServiceCredentialHealth>;
|
|
36
70
|
execute(context: ProviderContext, operation: string, input: Readonly<Record<string, unknown>>): Promise<unknown>;
|
|
71
|
+
/**
|
|
72
|
+
* Hold one call inside the deployment's boundary. Every service-safe TeamCity
|
|
73
|
+
* operation either names a project, a build configuration or a build — and a
|
|
74
|
+
* build is resolved to its project upstream, so a direct read by build id
|
|
75
|
+
* passes the same policy a listing does.
|
|
76
|
+
*/
|
|
77
|
+
private assertInsideBoundary;
|
|
78
|
+
/** Resolve a build id to the project it belongs to, then check the boundary. */
|
|
79
|
+
private assertBuildInBoundary;
|
|
80
|
+
/**
|
|
81
|
+
* The bounded project listing: a service profile names the projects it covers,
|
|
82
|
+
* so the answer is fetched from that list rather than from whatever the shared
|
|
83
|
+
* account can reach. A project the service token cannot see is reported as
|
|
84
|
+
* unavailable, which is what tells the operator their boundary and their token
|
|
85
|
+
* disagree.
|
|
86
|
+
*/
|
|
87
|
+
private listBoundedProjects;
|
|
37
88
|
/** Server identity: one answer out of the two documented discovery calls. */
|
|
38
89
|
private readConnection;
|
|
39
90
|
/**
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { TestitFlags } from "./config.js";
|
|
2
|
+
/** A file name as Test IT reported it, trimmed and safe to echo back. */
|
|
3
|
+
export declare function attachmentName(value: unknown): string;
|
|
4
|
+
/** Extension of a file name, lowercased and without the dot. */
|
|
5
|
+
export declare function attachmentExtension(name: string): string;
|
|
6
|
+
/** Why this attachment may not be read as text at all. */
|
|
7
|
+
export declare function attachmentBinaryProblem(name: string): string | undefined;
|
|
8
|
+
/**
|
|
9
|
+
* Byte budget of one attachment read: the caller may ask for less than the
|
|
10
|
+
* deployment allows, never for more, and an unasked budget is the configured
|
|
11
|
+
* default rather than the hard ceiling.
|
|
12
|
+
*/
|
|
13
|
+
export declare function attachmentByteLimit(requested: unknown, flags: TestitFlags): number;
|
|
14
|
+
/**
|
|
15
|
+
* Refuse a file Test IT already described as bigger than the budget, before a
|
|
16
|
+
* byte of it is requested. The declared size is the upstream's own answer, so
|
|
17
|
+
* this is a real bound and not a suggestion.
|
|
18
|
+
*/
|
|
19
|
+
export declare function assertReadableSize(declaredBytes: number | undefined, limit: number): void;
|
|
20
|
+
//# sourceMappingURL=attachments.d.ts.map
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import type { OperationSecurityMetadata } from "../../service-credentials/types.js";
|
|
2
|
+
import type { IntegrationCapability, IntegrationCapabilityInfo } from "../../types.js";
|
|
3
|
+
import type { TestitFlags } from "./config.js";
|
|
4
|
+
/**
|
|
5
|
+
* Capabilities this provider offers, one per kind of Test IT data a user may
|
|
6
|
+
* hand to the agent. They are narrower than Test IT's own permissions on
|
|
7
|
+
* purpose: a token grants areas (test library, test plans, runs), while the
|
|
8
|
+
* agent gets one switch per area, so a user who only needs "what failed in this
|
|
9
|
+
* run" can hand over runs and results without the test library.
|
|
10
|
+
*/
|
|
11
|
+
export type TestitCapability = "projects.read" | "sections.read" | "workItems.read" | "history.read" | "comments.read" | "testPlans.read" | "testRuns.read" | "testResults.read" | "autoTests.read" | "attachments.read" | "configurations.read";
|
|
12
|
+
/** Boolean deployment switches of this provider, one per capability. */
|
|
13
|
+
export type TestitReadFlag = "projectsRead" | "sectionsRead" | "workItemsRead" | "historyRead" | "commentsRead" | "testPlansRead" | "testRunsRead" | "testResultsRead" | "autoTestsRead" | "attachmentsRead" | "configurationsRead";
|
|
14
|
+
export interface TestitCapabilityDefinition {
|
|
15
|
+
readonly capability: TestitCapability;
|
|
16
|
+
readonly flag: TestitReadFlag;
|
|
17
|
+
readonly label: string;
|
|
18
|
+
readonly hint: string;
|
|
19
|
+
}
|
|
20
|
+
export declare const TESTIT_CAPABILITIES: readonly TestitCapabilityDefinition[];
|
|
21
|
+
/**
|
|
22
|
+
* What a list operation answers with upstream:
|
|
23
|
+
*
|
|
24
|
+
* - `paged` — the endpoint pages itself: the provider passes `Skip`/`Take` on
|
|
25
|
+
* and reports `Pagination-*` headers back as `pagination`;
|
|
26
|
+
* - `capped` — the endpoint answers the whole collection at once, so the
|
|
27
|
+
* provider slices it to the limit and says `truncated` when it had to.
|
|
28
|
+
*/
|
|
29
|
+
export type TestitListKind = "paged" | "capped";
|
|
30
|
+
export interface TestitOperationDefinition {
|
|
31
|
+
readonly capability: TestitCapability;
|
|
32
|
+
/**
|
|
33
|
+
* API path under `/api/v2`. `:placeholders` are filled by the handler built
|
|
34
|
+
* for that operation; the value is a fixed string, so the model can never
|
|
35
|
+
* pick an endpoint of its own.
|
|
36
|
+
*
|
|
37
|
+
* Where an operation needs a companion call, the provider makes it itself.
|
|
38
|
+
*/
|
|
39
|
+
readonly path: string;
|
|
40
|
+
/**
|
|
41
|
+
* Every operation of this catalog is a read. The field exists so the package
|
|
42
|
+
* gate can assert that, instead of trusting the path names to look harmless.
|
|
43
|
+
*/
|
|
44
|
+
readonly method: "GET";
|
|
45
|
+
readonly list?: TestitListKind;
|
|
46
|
+
/**
|
|
47
|
+
* True for the one operation whose answer is a byte stream rather than JSON:
|
|
48
|
+
* the provider reads it through its bounded text path instead.
|
|
49
|
+
*/
|
|
50
|
+
readonly stream?: boolean;
|
|
51
|
+
/** What this operation does, how sensitive it is, who may reach it. */
|
|
52
|
+
readonly security: OperationSecurityMetadata;
|
|
53
|
+
}
|
|
54
|
+
/** The resource kind every project-scoped operation of this provider is bounded by. */
|
|
55
|
+
export declare const TESTIT_RESOURCE_KIND = "projects";
|
|
56
|
+
/**
|
|
57
|
+
* Every model-reachable operation. The provider refuses any operation that is
|
|
58
|
+
* not listed here, so this table — together with `capability` — is the
|
|
59
|
+
* permission surface.
|
|
60
|
+
*
|
|
61
|
+
* The catalog holds GET endpoints only. Test IT offers richer filtering on
|
|
62
|
+
* `POST /api/v2/.../search` and reports statistics through
|
|
63
|
+
* `POST /api/v2/testRuns/{id}/statistics/filter`, but every search endpoint is a
|
|
64
|
+
* POST, and this package's read-only guarantee is written as "every catalog
|
|
65
|
+
* operation is a GET". The reads below cover the same ground through the GET
|
|
66
|
+
* surface Test IT serves; the tools that the POST-only endpoints would have
|
|
67
|
+
* backed are listed as missing in the README instead of being smuggled in.
|
|
68
|
+
* Three of them (`projects.list`, `workItems.list`, `autoTests.list`) are the
|
|
69
|
+
* endpoints Test IT marks deprecated: they are kept because they are the only
|
|
70
|
+
* GET reads of those collections, and a version that drops them answers
|
|
71
|
+
* `ResourceNotFound`, which the model sees as an honest "not available here".
|
|
72
|
+
*
|
|
73
|
+
* The catalog carries no operation that could change Test IT state — no test-case
|
|
74
|
+
* edits, comments, run lifecycle or attachment uploads; those wait for the
|
|
75
|
+
* confirmation framework the specification requires for them. What a managed
|
|
76
|
+
* credential reaches is decided per operation by `security`.
|
|
77
|
+
*/
|
|
78
|
+
export declare const TESTIT_OPERATIONS: Readonly<Record<string, TestitOperationDefinition>>;
|
|
79
|
+
/** Capabilities this deployment allows, in catalog order. */
|
|
80
|
+
export declare function enabledCapabilities(flags: TestitFlags): readonly TestitCapability[];
|
|
81
|
+
/** Label and hint per capability, for clients that render what we declare. */
|
|
82
|
+
export declare const TESTIT_CAPABILITY_INFO: Readonly<Record<TestitCapability, IntegrationCapabilityInfo>>;
|
|
83
|
+
/** Capability an operation needs, or undefined when the catalog has none. */
|
|
84
|
+
export declare function testitOperationCapability(operation: string): IntegrationCapability | undefined;
|
|
85
|
+
/** Security classification of an operation, or undefined when it is unknown. */
|
|
86
|
+
export declare function testitOperationMetadata(operation: string): OperationSecurityMetadata | undefined;
|
|
87
|
+
//# sourceMappingURL=catalog.d.ts.map
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import z from "@deepseek-ai/schemastery";
|
|
2
|
+
/**
|
|
3
|
+
* One Test IT installation the operator allows. Test IT ships as Cloud
|
|
4
|
+
* (`<team>.testit.software`) and as an on-premise TMS behind any hostname, so
|
|
5
|
+
* the list is how a deployment says which installations its users may connect
|
|
6
|
+
* to. A user never types a host: the connect form only picks from this list,
|
|
7
|
+
* which is what keeps the broker from dialling an origin nobody declared (the
|
|
8
|
+
* specification's SSRF rule).
|
|
9
|
+
*/
|
|
10
|
+
export interface TestitInstance {
|
|
11
|
+
readonly id: string;
|
|
12
|
+
readonly label: string;
|
|
13
|
+
/** Canonical `<origin><path>`, without a trailing slash. */
|
|
14
|
+
readonly baseUrl: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Deployment switches for the Test IT provider. Every read capability is on by
|
|
18
|
+
* default, and the switches bound what this deployment offers rather than grant
|
|
19
|
+
* it: Test IT authorizes each request against the permissions of the user the
|
|
20
|
+
* token belongs to, and a refusal is reported instead of being worked around.
|
|
21
|
+
*/
|
|
22
|
+
export interface TestitFlags {
|
|
23
|
+
readonly enabled: boolean;
|
|
24
|
+
/** Development escape hatch; production installations must answer over HTTPS. */
|
|
25
|
+
readonly allowInsecureHttp: boolean;
|
|
26
|
+
readonly instances: readonly TestitInstance[];
|
|
27
|
+
readonly projectsRead: boolean;
|
|
28
|
+
readonly sectionsRead: boolean;
|
|
29
|
+
readonly workItemsRead: boolean;
|
|
30
|
+
readonly historyRead: boolean;
|
|
31
|
+
readonly commentsRead: boolean;
|
|
32
|
+
readonly testPlansRead: boolean;
|
|
33
|
+
readonly testRunsRead: boolean;
|
|
34
|
+
readonly testResultsRead: boolean;
|
|
35
|
+
readonly autoTestsRead: boolean;
|
|
36
|
+
readonly attachmentsRead: boolean;
|
|
37
|
+
readonly configurationsRead: boolean;
|
|
38
|
+
/** Rows one list answer holds when the caller names no limit. */
|
|
39
|
+
readonly defaultResults: number;
|
|
40
|
+
/** Hard ceiling for one list answer, whatever the caller asks for. */
|
|
41
|
+
readonly maxResults: number;
|
|
42
|
+
/** Byte budget of one text attachment when the caller names none. */
|
|
43
|
+
readonly defaultAttachmentBytes: number;
|
|
44
|
+
/** Hard ceiling of one text attachment, whatever the caller asks for. */
|
|
45
|
+
readonly maxAttachmentBytes: number;
|
|
46
|
+
/** Timeout for the attachment read; JSON reads use the shared one. */
|
|
47
|
+
readonly attachmentTimeoutMs: number;
|
|
48
|
+
/** Extra attempts for a throttled or transient read. */
|
|
49
|
+
readonly retries: number;
|
|
50
|
+
}
|
|
51
|
+
export declare const TESTIT_DEFAULTS: TestitFlags;
|
|
52
|
+
/**
|
|
53
|
+
* Config slice of this provider, as it appears under `testit:` in YAML. The
|
|
54
|
+
* instance list is canonicalized by `resolveTestitConfig`, which is where a
|
|
55
|
+
* deployment typo fails loudly.
|
|
56
|
+
*/
|
|
57
|
+
export declare const testitConfigSchema: z<Partial<TestitFlags>>;
|
|
58
|
+
export declare function resolveTestitConfig(input?: Partial<TestitFlags>): TestitFlags;
|
|
59
|
+
/** The configured instance a stored credential names, or a fail-closed error. */
|
|
60
|
+
export declare function testitInstance(flags: TestitFlags, instanceId: string): TestitInstance | undefined;
|
|
61
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { CredentialHelp } from "@yadsh/dsh-plugin-kit";
|
|
2
|
+
/**
|
|
3
|
+
* Test IT calls the credential a private token and mints it in the user's own
|
|
4
|
+
* profile, where it is shown once and stays valid until it is deleted — the two
|
|
5
|
+
* facts a user needs before pasting it, plus where the API itself is documented.
|
|
6
|
+
*/
|
|
7
|
+
export declare const TESTIT_CREDENTIAL_HELP: CredentialHelp;
|
|
8
|
+
//# sourceMappingURL=credential-help.d.ts.map
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { type CredentialHelp } from "@yadsh/dsh-plugin-kit";
|
|
2
|
+
import type { ResolvedQaIntegrationsConfig } from "../../config.js";
|
|
3
|
+
import type { OperationSecurityMetadata, ServiceCredentialHealth, ServiceResourceBoundary } from "../../service-credentials/types.js";
|
|
4
|
+
import type { CapabilityServiceState, IntegrationCapability, IntegrationCapabilityInfo, ProviderValidation } from "../../types.js";
|
|
5
|
+
import type { IntegrationProvider, ProviderContext } from "../contract.js";
|
|
6
|
+
export { credentialFromPlaintext, credentialInstance, type TestitCredential, } from "./transport.js";
|
|
7
|
+
/**
|
|
8
|
+
* Whether one caller-named project stays inside the deployment's boundary.
|
|
9
|
+
* Test IT addresses projects by their id and offers no hierarchy a boundary
|
|
10
|
+
* entry could cover, so the match is the exact identifier the profile lists.
|
|
11
|
+
*/
|
|
12
|
+
export declare function projectAllowed(boundary: ServiceResourceBoundary, ref: string): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Test IT provider: one Test IT installation per QA user, connected with that
|
|
15
|
+
* user's own API token, or with the deployment's managed read-only credential
|
|
16
|
+
* when the user's binding asks for it.
|
|
17
|
+
*
|
|
18
|
+
* The installation is operator configuration — the connect form only picks from
|
|
19
|
+
* the configured list — so the broker cannot be pointed at a host of the
|
|
20
|
+
* caller's choosing, and the address is re-resolved from config on every call,
|
|
21
|
+
* which makes removing or repointing an instance take effect at once.
|
|
22
|
+
*/
|
|
23
|
+
export declare class TestitProvider implements IntegrationProvider {
|
|
24
|
+
private readonly config;
|
|
25
|
+
readonly id = "testit";
|
|
26
|
+
readonly displayName = "Test IT";
|
|
27
|
+
/** What this deployment is willing to expose; Test IT's own rights still apply. */
|
|
28
|
+
readonly capabilities: readonly IntegrationCapability[];
|
|
29
|
+
readonly capabilityInfo: Readonly<Record<IntegrationCapability, IntegrationCapabilityInfo>>;
|
|
30
|
+
/** Where the settings card says this provider's credential comes from. */
|
|
31
|
+
readonly credentialHelp: CredentialHelp | null;
|
|
32
|
+
/** Overrides the deployment got wrong; reported once at startup, never fatal. */
|
|
33
|
+
readonly credentialHelpProblems: readonly string[];
|
|
34
|
+
private readonly transport;
|
|
35
|
+
constructor(config: ResolvedQaIntegrationsConfig, fetcher?: typeof fetch);
|
|
36
|
+
/**
|
|
37
|
+
* Keep only the token, tagged with the installation it was minted for. The
|
|
38
|
+
* instance comes from the connect form and from operator config, never from a
|
|
39
|
+
* tool argument, which is what keeps the broker from dialling any host the
|
|
40
|
+
* caller names.
|
|
41
|
+
*/
|
|
42
|
+
parseCredential(raw: string, options?: Readonly<Record<string, string>>): {
|
|
43
|
+
readonly credential: string;
|
|
44
|
+
readonly portal: string;
|
|
45
|
+
};
|
|
46
|
+
operationCapability(operation: string): IntegrationCapability | undefined;
|
|
47
|
+
operationMetadata(operation: string): OperationSecurityMetadata | undefined;
|
|
48
|
+
/** Every project-scoped read is bounded by the profile's project list. */
|
|
49
|
+
resourceBoundaryKind(operation: string): string | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* Portal of a configured installation. An empty id means "the only
|
|
52
|
+
* installation", the same rule `parseCredential` applies, so deployment
|
|
53
|
+
* configuration and the connect form name installations alike.
|
|
54
|
+
*/
|
|
55
|
+
instancePortal(instanceId: string): string | undefined;
|
|
56
|
+
capabilityServiceState(capability: IntegrationCapability): CapabilityServiceState | undefined;
|
|
57
|
+
/**
|
|
58
|
+
* The documented first validation call is the project list: an authorized
|
|
59
|
+
* answer proves the address and the token at once, and an empty project list
|
|
60
|
+
* is a valid authorization result rather than a failure. Test IT API v2 has no
|
|
61
|
+
* endpoint that names the token owner, so no identity is stored — the answer
|
|
62
|
+
* reports what the probe proved and nothing more.
|
|
63
|
+
*/
|
|
64
|
+
validate(context: ProviderContext): Promise<ProviderValidation>;
|
|
65
|
+
/**
|
|
66
|
+
* Health of the deployment's managed token. Test IT reports neither the
|
|
67
|
+
* scopes of a token nor its owner, so the probe is the same read the personal
|
|
68
|
+
* validation makes — it never changes upstream state — and the answer says
|
|
69
|
+
* what was and was not learned instead of implying an audit it did not
|
|
70
|
+
* perform.
|
|
71
|
+
*/
|
|
72
|
+
validateServiceCredential(context: ProviderContext): Promise<ServiceCredentialHealth>;
|
|
73
|
+
execute(context: ProviderContext, operation: string, input: Readonly<Record<string, unknown>>): Promise<unknown>;
|
|
74
|
+
/**
|
|
75
|
+
* Hold one call inside the deployment's boundary. A call addressed by a
|
|
76
|
+
* project must name one the boundary lists; an id-addressed read resolves
|
|
77
|
+
* the project its object lives in first, and only then is answered. The
|
|
78
|
+
* project listing needs no check here: it is built from the allowlist
|
|
79
|
+
* itself, not from whatever the shared account can reach.
|
|
80
|
+
*/
|
|
81
|
+
private assertInsideBoundary;
|
|
82
|
+
/**
|
|
83
|
+
* Hold a fetched answer inside the boundary before it is returned. The
|
|
84
|
+
* object read names its project — directly, or through the run a test
|
|
85
|
+
* result belongs to — and a resource outside the boundary is discarded
|
|
86
|
+
* whole: upstream saw the read, the model never does.
|
|
87
|
+
*/
|
|
88
|
+
private assertAnswerInside;
|
|
89
|
+
/** Refuse unless the resolved project is one the boundary lists. */
|
|
90
|
+
private assertProject;
|
|
91
|
+
/**
|
|
92
|
+
* One companion read used to locate the project an id-addressed answer
|
|
93
|
+
* belongs to. It goes through the catalog handler of the operation it
|
|
94
|
+
* mirrors, so the id is validated exactly like a direct call's.
|
|
95
|
+
*/
|
|
96
|
+
private readFor;
|
|
97
|
+
/** The project of the object one companion read answers. */
|
|
98
|
+
private projectThrough;
|
|
99
|
+
/**
|
|
100
|
+
* The bounded project listing: a service profile names the projects it
|
|
101
|
+
* covers, so the answer is fetched from that list instead of from whatever
|
|
102
|
+
* the shared account can reach. A project the service token cannot see is
|
|
103
|
+
* reported as unavailable rather than silently dropped, which is what tells
|
|
104
|
+
* the operator their boundary and their token disagree.
|
|
105
|
+
*/
|
|
106
|
+
private listBoundedProjects;
|
|
107
|
+
/**
|
|
108
|
+
* One attachment, read as text. Test IT describes the file — its name and its
|
|
109
|
+
* size — before a byte is requested, and this provider trusts that description
|
|
110
|
+
* over anything the caller said: an archive, a screenshot, a document or a key
|
|
111
|
+
* is refused by name, a file bigger than the budget is refused by size, and
|
|
112
|
+
* the body that does come back is bounded, redacted and marked as external
|
|
113
|
+
* content.
|
|
114
|
+
*/
|
|
115
|
+
private readAttachment;
|
|
116
|
+
private resolveInstance;
|
|
117
|
+
}
|
|
118
|
+
export default TestitProvider;
|
|
119
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import type { TestitFlags } from "./config.js";
|
|
2
|
+
import type { TestitPage } from "./transport.js";
|
|
3
|
+
/**
|
|
4
|
+
* Request building and response shaping for the Test IT Open API v2.
|
|
5
|
+
*
|
|
6
|
+
* Every operation answers with a normalized object instead of Test IT's own
|
|
7
|
+
* DTO, and every list answers with the same `{ items, pagination }` envelope, so
|
|
8
|
+
* the model learns one shape rather than a dozen. Text a user typed into Test IT
|
|
9
|
+
* — descriptions, steps, comments, traces, names of configurations — is
|
|
10
|
+
* untrusted external content and reaches the model under `untrustedContent` or
|
|
11
|
+
* as a bounded block, never as a bare string that could read as an instruction.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Hard caps per collection, from the provider specification. They bound what one
|
|
15
|
+
* answer may carry; Test IT documents no ceiling of its own for `Take`.
|
|
16
|
+
*/
|
|
17
|
+
export declare const TESTIT_LIMITS: Readonly<{
|
|
18
|
+
projects: 100;
|
|
19
|
+
sections: 100;
|
|
20
|
+
workItems: 100;
|
|
21
|
+
history: 100;
|
|
22
|
+
comments: 100;
|
|
23
|
+
testPlans: 100;
|
|
24
|
+
testRuns: 50;
|
|
25
|
+
testResults: 100;
|
|
26
|
+
attachments: 100;
|
|
27
|
+
autoTests: 100;
|
|
28
|
+
configurations: 100;
|
|
29
|
+
}>;
|
|
30
|
+
/**
|
|
31
|
+
* Values Test IT accepts for the fields this provider exposes. The vocabulary is
|
|
32
|
+
* closed on purpose: an enum the model cannot spell is a 400 from upstream, and
|
|
33
|
+
* a 400 costs an answer where a refused argument costs one line.
|
|
34
|
+
*/
|
|
35
|
+
export declare const WORK_ITEM_STATES: readonly string[];
|
|
36
|
+
export declare const WORK_ITEM_PRIORITIES: readonly string[];
|
|
37
|
+
export declare const WORK_ITEM_ENTITY_TYPES: readonly string[];
|
|
38
|
+
export declare const TEST_RUN_STATES: readonly string[];
|
|
39
|
+
export declare const RESULT_OUTCOMES: readonly string[];
|
|
40
|
+
/**
|
|
41
|
+
* Rows one call may ask for: the caller's wish is clamped to the deployment cap
|
|
42
|
+
* rather than refused, because a model that asks for "the last 500 test cases"
|
|
43
|
+
* still gets a useful answer instead of an error.
|
|
44
|
+
*/
|
|
45
|
+
export declare function listLimit(requested: unknown, cap: number, flags: TestitFlags): number;
|
|
46
|
+
/** Rows to skip; `offset` is the model's only pagination cursor here. */
|
|
47
|
+
export declare function listOffset(requested: unknown): number;
|
|
48
|
+
export interface OperationContext {
|
|
49
|
+
readonly flags: TestitFlags;
|
|
50
|
+
}
|
|
51
|
+
export interface TestitRequest {
|
|
52
|
+
readonly path: string;
|
|
53
|
+
readonly query: Readonly<Record<string, string | undefined>>;
|
|
54
|
+
}
|
|
55
|
+
export type TestitOperationHandler = (input: Readonly<Record<string, unknown>>, context: OperationContext) => TestitRequest;
|
|
56
|
+
export declare const TESTIT_HANDLERS: Readonly<Record<string, TestitOperationHandler>>;
|
|
57
|
+
/** One bounded string field: an unbounded answer would drown the tool result. */
|
|
58
|
+
export declare function bounded(value: string | undefined, max: number): string | undefined;
|
|
59
|
+
/**
|
|
60
|
+
* One block of external text. Test IT content is written by people and by
|
|
61
|
+
* test tooling, so it is handed over as data with its size and a truncation
|
|
62
|
+
* marker, never as a string the model could read as an instruction.
|
|
63
|
+
*/
|
|
64
|
+
export declare function contentBlock(text: string | undefined, limit: number): Record<string, unknown> | undefined;
|
|
65
|
+
/**
|
|
66
|
+
* A page of a collection Test IT pages itself. The count comes from the
|
|
67
|
+
* `Pagination-Total-Items` header: the body is a bare array and the search
|
|
68
|
+
* endpoints that would report a total are POST-only, so without the header the
|
|
69
|
+
* model is told only whether the page looked full.
|
|
70
|
+
*/
|
|
71
|
+
export declare function paged(items: readonly unknown[], page: TestitPage | undefined, limit: number, offset: number): Record<string, unknown>;
|
|
72
|
+
/**
|
|
73
|
+
* A collection Test IT answers whole. The provider slices it to the limit and
|
|
74
|
+
* says `truncated`, so the model can narrow the request instead of believing a
|
|
75
|
+
* cut list is the complete one.
|
|
76
|
+
*/
|
|
77
|
+
export declare function capped(items: readonly unknown[], limit: number): Record<string, unknown>;
|
|
78
|
+
export interface TestitProjectionContext {
|
|
79
|
+
readonly flags: TestitFlags;
|
|
80
|
+
/** The validated tool arguments; filters the API cannot express live here. */
|
|
81
|
+
readonly input: Readonly<Record<string, unknown>>;
|
|
82
|
+
readonly page?: TestitPage | undefined;
|
|
83
|
+
/** Label of the configured instance, echoed so the model can name it. */
|
|
84
|
+
readonly instanceLabel?: string | undefined;
|
|
85
|
+
/** Canonical address of that instance, which is operator configuration. */
|
|
86
|
+
readonly baseUrl?: string | undefined;
|
|
87
|
+
}
|
|
88
|
+
export type TestitProjection = (data: unknown, context: TestitProjectionContext) => unknown;
|
|
89
|
+
/**
|
|
90
|
+
* Response shaping per operation. A projection never invents a field upstream
|
|
91
|
+
* did not send: Test IT tolerates version skew by adding properties, so a
|
|
92
|
+
* missing key is dropped rather than defaulted into a claim.
|
|
93
|
+
*/
|
|
94
|
+
export declare const TESTIT_PROJECTIONS: Readonly<Record<string, TestitProjection>>;
|
|
95
|
+
//# sourceMappingURL=operations.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ToolDefinition } from "@deepseek-ai/dsh-tools";
|
|
2
|
+
import type { IntegrationBroker } from "../../broker.js";
|
|
3
|
+
import type { IntegrationPrincipal } from "../../types.js";
|
|
4
|
+
export declare const TESTIT_TOOL_NAMES: readonly ["testit_connection_get", "testit_projects", "testit_project_get", "testit_sections", "testit_work_items", "testit_work_item_get", "testit_work_item_history", "testit_work_item_comments", "testit_work_item_test_results", "testit_test_plans", "testit_test_plan_get", "testit_test_plan_summary", "testit_test_runs", "testit_test_run_get", "testit_test_run_results", "testit_test_result_get", "testit_test_result_attachments", "testit_attachment_metadata", "testit_attachment_text", "testit_auto_tests", "testit_auto_test_get", "testit_configurations"];
|
|
5
|
+
/**
|
|
6
|
+
* Every tool reads what the *connected* Test IT token may read, never a
|
|
7
|
+
* caller-supplied identity: the connection comes from the stored integration of
|
|
8
|
+
* the QA user who owns the DSH session, and no tool schema carries a user,
|
|
9
|
+
* credential, token or installation selector.
|
|
10
|
+
*/
|
|
11
|
+
export declare function createTestitTools(options: {
|
|
12
|
+
readonly broker: IntegrationBroker;
|
|
13
|
+
readonly principalForSession: (sessionId: string) => IntegrationPrincipal | undefined;
|
|
14
|
+
}): readonly ToolDefinition[];
|
|
15
|
+
//# sourceMappingURL=tools.d.ts.map
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { ResolvedQaIntegrationsConfig } from "../../config.js";
|
|
2
|
+
import { type BoundedText } from "../shared/http.js";
|
|
3
|
+
import { type TestitFlags, type TestitInstance } from "./config.js";
|
|
4
|
+
/**
|
|
5
|
+
* Encrypted credential payload of one Test IT connection: which configured
|
|
6
|
+
* installation the API token belongs to, and the token itself. The base URL is
|
|
7
|
+
* not stored — it is re-resolved from operator config on every call, so
|
|
8
|
+
* removing or repointing an instance takes effect at once instead of at the
|
|
9
|
+
* next connect.
|
|
10
|
+
*/
|
|
11
|
+
export interface TestitCredential {
|
|
12
|
+
readonly instanceId: string;
|
|
13
|
+
readonly token: string;
|
|
14
|
+
}
|
|
15
|
+
export declare function credentialFromPlaintext(plaintext: string): TestitCredential;
|
|
16
|
+
/**
|
|
17
|
+
* The configured installation a credential belongs to. A token minted for an
|
|
18
|
+
* instance the operator has since removed fails closed: it never falls back to
|
|
19
|
+
* another instance, however permissive that one is.
|
|
20
|
+
*/
|
|
21
|
+
export declare function credentialInstance(flags: TestitFlags, credential: TestitCredential): TestitInstance;
|
|
22
|
+
export interface TestitQuery {
|
|
23
|
+
readonly [key: string]: string | number | boolean | undefined;
|
|
24
|
+
}
|
|
25
|
+
/** What Test IT reports about the page it just answered with. */
|
|
26
|
+
export interface TestitPage {
|
|
27
|
+
readonly skip?: number | undefined;
|
|
28
|
+
readonly take?: number | undefined;
|
|
29
|
+
readonly total?: number | undefined;
|
|
30
|
+
readonly pages?: number | undefined;
|
|
31
|
+
}
|
|
32
|
+
export interface TestitJsonResponse<T> {
|
|
33
|
+
readonly data: T;
|
|
34
|
+
readonly page?: TestitPage | undefined;
|
|
35
|
+
}
|
|
36
|
+
export type TestitTextResponse = BoundedText;
|
|
37
|
+
/**
|
|
38
|
+
* HTTP boundary of the provider: one documented Test IT API call, bounded in
|
|
39
|
+
* time and size, with upstream failures folded into safe domain errors and
|
|
40
|
+
* bounded retries for the transient ones.
|
|
41
|
+
*
|
|
42
|
+
* The API token reaches Test IT as the `PrivateToken` authorization header and
|
|
43
|
+
* nowhere else: no query parameter, URL segment or body this provider builds
|
|
44
|
+
* ever carries it.
|
|
45
|
+
*/
|
|
46
|
+
export declare class TestitTransport {
|
|
47
|
+
private readonly config;
|
|
48
|
+
private readonly flags;
|
|
49
|
+
private readonly fetcher;
|
|
50
|
+
constructor(config: ResolvedQaIntegrationsConfig, flags: TestitFlags, fetcher?: typeof fetch);
|
|
51
|
+
getJson<T>(instance: TestitInstance, token: string, path: string, query?: TestitQuery): Promise<TestitJsonResponse<T>>;
|
|
52
|
+
/**
|
|
53
|
+
* A bounded byte read: the one attachment download, which is not JSON and
|
|
54
|
+
* whose budget is the caller's, capped by the deployment.
|
|
55
|
+
*/
|
|
56
|
+
getText(instance: TestitInstance, token: string, path: string, maxBytes: number, query?: TestitQuery): Promise<TestitTextResponse>;
|
|
57
|
+
private url;
|
|
58
|
+
private request;
|
|
59
|
+
/**
|
|
60
|
+
* The provider error model. Test IT answers a missing or hidden resource with
|
|
61
|
+
* 404 and a refused permission with 403; both stay distinct so the model can
|
|
62
|
+
* tell "you may not" from "it is not there", and neither ever carries an
|
|
63
|
+
* upstream body, which can name internal hosts or echo the request.
|
|
64
|
+
*/
|
|
65
|
+
private failure;
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=transport.d.ts.map
|