@yadsh/dsh-qa-integrations 0.6.0 → 0.8.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.
Files changed (183) hide show
  1. package/README.md +341 -303
  2. package/lib/broker.js +12 -0
  3. package/lib/broker.js.map +1 -1
  4. package/lib/client/bitrix24.js +66 -5
  5. package/lib/client/bitrix24.js.map +1 -1
  6. package/lib/client/confluence.js +117 -128
  7. package/lib/client/confluence.js.map +1 -1
  8. package/lib/client/gitlab.js +1 -1
  9. package/lib/client/gitlab.js.map +1 -1
  10. package/lib/client/index.js +25 -5
  11. package/lib/client/index.js.map +1 -1
  12. package/lib/client/integrations.js +1 -1
  13. package/lib/client/integrations.js.map +1 -1
  14. package/lib/client/jira.js +115 -126
  15. package/lib/client/jira.js.map +1 -1
  16. package/lib/client/operator-card.js +537 -0
  17. package/lib/client/operator-card.js.map +1 -0
  18. package/lib/client/operator-controls.js +232 -0
  19. package/lib/client/operator-controls.js.map +1 -0
  20. package/lib/client/styles.js +60 -0
  21. package/lib/client/styles.js.map +1 -1
  22. package/lib/client/testit.js +39 -3
  23. package/lib/client/testit.js.map +1 -1
  24. package/lib/client/weblate.js +38 -3
  25. package/lib/client/weblate.js.map +1 -1
  26. package/lib/client.js +2966 -871
  27. package/lib/client.js.map +1 -1
  28. package/lib/coerce.js +17 -1
  29. package/lib/coerce.js.map +1 -1
  30. package/lib/config.js.map +1 -1
  31. package/lib/errors.js +22 -0
  32. package/lib/errors.js.map +1 -1
  33. package/lib/index.js +211 -52
  34. package/lib/index.js.map +1 -1
  35. package/lib/providers/bitrix24/catalog.js +138 -8
  36. package/lib/providers/bitrix24/catalog.js.map +1 -1
  37. package/lib/providers/bitrix24/config.js +84 -14
  38. package/lib/providers/bitrix24/config.js.map +1 -1
  39. package/lib/providers/bitrix24/index.js +100 -0
  40. package/lib/providers/bitrix24/index.js.map +1 -1
  41. package/lib/providers/bitrix24/operations.js +5 -9
  42. package/lib/providers/bitrix24/operations.js.map +1 -1
  43. package/lib/providers/bitrix24/transport.js +11 -31
  44. package/lib/providers/bitrix24/transport.js.map +1 -1
  45. package/lib/providers/confluence/adf.js +28 -23
  46. package/lib/providers/confluence/adf.js.map +1 -1
  47. package/lib/providers/confluence/catalog.js +91 -7
  48. package/lib/providers/confluence/catalog.js.map +1 -1
  49. package/lib/providers/confluence/config.js +27 -2
  50. package/lib/providers/confluence/config.js.map +1 -1
  51. package/lib/providers/confluence/credential-help.js +14 -8
  52. package/lib/providers/confluence/credential-help.js.map +1 -1
  53. package/lib/providers/confluence/dialect.js +215 -0
  54. package/lib/providers/confluence/dialect.js.map +1 -0
  55. package/lib/providers/confluence/index.js +393 -79
  56. package/lib/providers/confluence/index.js.map +1 -1
  57. package/lib/providers/confluence/operations.js +208 -153
  58. package/lib/providers/confluence/operations.js.map +1 -1
  59. package/lib/providers/confluence/storage.js +690 -0
  60. package/lib/providers/confluence/storage.js.map +1 -0
  61. package/lib/providers/confluence/transport.js +26 -89
  62. package/lib/providers/confluence/transport.js.map +1 -1
  63. package/lib/providers/gitlab/config.js +2 -3
  64. package/lib/providers/gitlab/config.js.map +1 -1
  65. package/lib/providers/gitlab/index.js +2 -20
  66. package/lib/providers/gitlab/index.js.map +1 -1
  67. package/lib/providers/gitlab/operations.js +7 -45
  68. package/lib/providers/gitlab/operations.js.map +1 -1
  69. package/lib/providers/gitlab/transport.js +2 -18
  70. package/lib/providers/gitlab/transport.js.map +1 -1
  71. package/lib/providers/jira/adf.js +19 -14
  72. package/lib/providers/jira/adf.js.map +1 -1
  73. package/lib/providers/jira/catalog.js +125 -4
  74. package/lib/providers/jira/catalog.js.map +1 -1
  75. package/lib/providers/jira/config.js +27 -2
  76. package/lib/providers/jira/config.js.map +1 -1
  77. package/lib/providers/jira/credential-help.js +16 -7
  78. package/lib/providers/jira/credential-help.js.map +1 -1
  79. package/lib/providers/jira/dialect.js +94 -0
  80. package/lib/providers/jira/dialect.js.map +1 -0
  81. package/lib/providers/jira/index.js +327 -67
  82. package/lib/providers/jira/index.js.map +1 -1
  83. package/lib/providers/jira/jql.js +54 -21
  84. package/lib/providers/jira/jql.js.map +1 -1
  85. package/lib/providers/jira/operations.js +77 -55
  86. package/lib/providers/jira/operations.js.map +1 -1
  87. package/lib/providers/jira/tools.js +1 -1
  88. package/lib/providers/jira/tools.js.map +1 -1
  89. package/lib/providers/jira/transport.js +12 -83
  90. package/lib/providers/jira/transport.js.map +1 -1
  91. package/lib/providers/shared/health.js +31 -0
  92. package/lib/providers/shared/health.js.map +1 -0
  93. package/lib/providers/shared/http.js +20 -0
  94. package/lib/providers/shared/http.js.map +1 -1
  95. package/lib/providers/shared/paths.js +14 -0
  96. package/lib/providers/shared/paths.js.map +1 -0
  97. package/lib/providers/shared/payload.js +46 -0
  98. package/lib/providers/shared/payload.js.map +1 -0
  99. package/lib/providers/teamcity/artifacts.js +0 -8
  100. package/lib/providers/teamcity/artifacts.js.map +1 -1
  101. package/lib/providers/teamcity/config.js +2 -3
  102. package/lib/providers/teamcity/config.js.map +1 -1
  103. package/lib/providers/teamcity/index.js +2 -20
  104. package/lib/providers/teamcity/index.js.map +1 -1
  105. package/lib/providers/teamcity/operations.js +5 -39
  106. package/lib/providers/teamcity/operations.js.map +1 -1
  107. package/lib/providers/teamcity/transport.js +2 -11
  108. package/lib/providers/teamcity/transport.js.map +1 -1
  109. package/lib/providers/testit/catalog.js +77 -0
  110. package/lib/providers/testit/catalog.js.map +1 -1
  111. package/lib/providers/testit/config.js +2 -3
  112. package/lib/providers/testit/config.js.map +1 -1
  113. package/lib/providers/testit/index.js +260 -4
  114. package/lib/providers/testit/index.js.map +1 -1
  115. package/lib/providers/testit/operations.js +34 -63
  116. package/lib/providers/testit/operations.js.map +1 -1
  117. package/lib/providers/testit/transport.js +2 -18
  118. package/lib/providers/testit/transport.js.map +1 -1
  119. package/lib/providers/weblate/catalog.js +103 -9
  120. package/lib/providers/weblate/catalog.js.map +1 -1
  121. package/lib/providers/weblate/config.js +2 -3
  122. package/lib/providers/weblate/config.js.map +1 -1
  123. package/lib/providers/weblate/index.js +227 -6
  124. package/lib/providers/weblate/index.js.map +1 -1
  125. package/lib/providers/weblate/operations.js +3 -33
  126. package/lib/providers/weblate/operations.js.map +1 -1
  127. package/lib/providers/weblate/query.js +3 -6
  128. package/lib/providers/weblate/query.js.map +1 -1
  129. package/lib/providers/weblate/transport.js +2 -12
  130. package/lib/providers/weblate/transport.js.map +1 -1
  131. package/lib/service-credentials/config.js +2 -3
  132. package/lib/service-credentials/config.js.map +1 -1
  133. package/lib/shared/settings.js +14 -0
  134. package/lib/shared/settings.js.map +1 -0
  135. package/lib/typert.host.js +159 -60
  136. package/lib/typert.remote-client.d.ts +13 -11
  137. package/lib/typert.remote-client.js +98 -52
  138. package/lib/types/broker.d.ts +11 -3
  139. package/lib/types/client/bitrix24.d.ts +24 -2
  140. package/lib/types/client/confluence.d.ts +24 -4
  141. package/lib/types/client/index.d.ts +7 -6
  142. package/lib/types/client/integrations.d.ts +2 -2
  143. package/lib/types/client/jira.d.ts +25 -4
  144. package/lib/types/client/operator-card.d.ts +22 -0
  145. package/lib/types/client/operator-controls.d.ts +135 -0
  146. package/lib/types/client/testit.d.ts +14 -1
  147. package/lib/types/client/weblate.d.ts +14 -1
  148. package/lib/types/coerce.d.ts +14 -0
  149. package/lib/types/config.d.ts +4 -4
  150. package/lib/types/errors.d.ts +16 -0
  151. package/lib/types/index.d.ts +91 -15
  152. package/lib/types/providers/bitrix24/catalog.d.ts +8 -0
  153. package/lib/types/providers/bitrix24/config.d.ts +14 -23
  154. package/lib/types/providers/bitrix24/index.d.ts +37 -1
  155. package/lib/types/providers/confluence/catalog.d.ts +44 -8
  156. package/lib/types/providers/confluence/config.d.ts +39 -7
  157. package/lib/types/providers/confluence/credential-help.d.ts +9 -4
  158. package/lib/types/providers/confluence/dialect.d.ts +113 -0
  159. package/lib/types/providers/confluence/index.d.ts +82 -8
  160. package/lib/types/providers/confluence/operations.d.ts +14 -4
  161. package/lib/types/providers/confluence/storage.d.ts +28 -0
  162. package/lib/types/providers/confluence/transport.d.ts +10 -21
  163. package/lib/types/providers/jira/catalog.d.ts +49 -2
  164. package/lib/types/providers/jira/config.d.ts +37 -6
  165. package/lib/types/providers/jira/credential-help.d.ts +11 -3
  166. package/lib/types/providers/jira/dialect.d.ts +79 -0
  167. package/lib/types/providers/jira/index.d.ts +76 -19
  168. package/lib/types/providers/jira/jql.d.ts +14 -4
  169. package/lib/types/providers/jira/operations.d.ts +3 -0
  170. package/lib/types/providers/jira/transport.d.ts +6 -13
  171. package/lib/types/providers/shared/health.d.ts +18 -0
  172. package/lib/types/providers/shared/http.d.ts +9 -0
  173. package/lib/types/providers/shared/paths.d.ts +10 -0
  174. package/lib/types/providers/shared/payload.d.ts +26 -0
  175. package/lib/types/providers/teamcity/artifacts.d.ts +0 -2
  176. package/lib/types/providers/teamcity/index.d.ts +2 -0
  177. package/lib/types/providers/testit/catalog.d.ts +12 -0
  178. package/lib/types/providers/testit/index.d.ts +63 -2
  179. package/lib/types/providers/weblate/catalog.d.ts +19 -2
  180. package/lib/types/providers/weblate/index.d.ts +43 -1
  181. package/lib/types/shared/settings.d.ts +14 -0
  182. package/lib/types/types.d.ts +8 -0
  183. package/package.json +3 -3
@@ -1,14 +1,19 @@
1
1
  import { type CredentialHelp } from "@yadsh/dsh-plugin-kit";
2
2
  import type { ResolvedQaIntegrationsConfig } from "../../config.js";
3
- import type { IntegrationCapability, IntegrationCapabilityInfo, ProviderValidation } from "../../types.js";
3
+ import type { OperationSecurityMetadata, ServiceCredentialHealth, ServiceResourceBoundary } from "../../service-credentials/types.js";
4
+ import type { CapabilityServiceState, IntegrationCapability, IntegrationCapabilityInfo, ProviderValidation } from "../../types.js";
4
5
  import type { IntegrationProvider, ProviderContext } from "../contract.js";
5
6
  export { credentialFromPlaintext, credentialSite, type JiraCredential, } from "./transport.js";
6
7
  /**
7
- * Jira Cloud provider: operator-configured sites over an Atlassian API token.
8
+ * Jira provider: operator-configured sites over an Atlassian API token (Cloud)
9
+ * or a personal access token (Server / Data Center).
8
10
  *
9
11
  * The token is spent against the site the credential names, and that site is
10
12
  * re-resolved from operator config on every call, so a site the deployment
11
- * removed or repointed closes the connection instead of redirecting it.
13
+ * removed or repointed closes the connection instead of redirecting it. Which
14
+ * product answers there — and so which API root, which authentication scheme
15
+ * and which shape of answer this provider speaks — is the site's own declared
16
+ * deployment type, never a guess made at connect or at run time.
12
17
  */
13
18
  export declare class JiraProvider implements IntegrationProvider {
14
19
  private readonly config;
@@ -28,14 +33,56 @@ export declare class JiraProvider implements IntegrationProvider {
28
33
  * Both non-secret choices come from the connect form and from operator config,
29
34
  * never from a tool argument, which is what keeps the broker from dialling any
30
35
  * host the caller names.
36
+ *
37
+ * The same method turns a deployment-managed secret into this credential
38
+ * shape. On Cloud that secret is the whole Basic pair (`email:token`), because
39
+ * Jira cannot spend the token without the account and the pair must not be
40
+ * split across two records; the form path instead supplies the e-mail
41
+ * separately, and keeps refusing a pasted pair. A Server / Data Center
42
+ * personal access token needs no account at all, so its connection stores an
43
+ * empty e-mail and authenticates as the token's own bearer.
31
44
  */
32
45
  parseCredential(raw: string, options?: Readonly<Record<string, string>>): {
33
46
  readonly credential: string;
34
47
  readonly portal: string;
35
48
  };
36
49
  operationCapability(operation: string): IntegrationCapability | undefined;
50
+ operationMetadata(operation: string): OperationSecurityMetadata | undefined;
51
+ /** Every project-scoped read names its project through a key or an issue key. */
52
+ resourceBoundaryKind(operation: string): string | undefined;
53
+ /**
54
+ * Portal of a configured site. An empty id means "the only site", the same
55
+ * rule `parseCredential` applies, so deployment configuration and the connect
56
+ * form name sites alike.
57
+ */
58
+ instancePortal(instanceId: string): string | undefined;
59
+ capabilityServiceState(capability: IntegrationCapability): CapabilityServiceState | undefined;
60
+ /**
61
+ * Health of a deployment-managed token. The probe reads only the identity
62
+ * endpoint the personal validation reads, so it never changes upstream state;
63
+ * Jira reports no granted scopes for an API token, so the answer is healthy
64
+ * with a warning — the local service ceiling stays the whole local boundary.
65
+ */
66
+ validateServiceCredential(context: ProviderContext): Promise<ServiceCredentialHealth>;
37
67
  validate(context: ProviderContext): Promise<ProviderValidation>;
68
+ /** The identity read of this site's product: the one connect proves itself with. */
69
+ private identityPath;
38
70
  execute(context: ProviderContext, operation: string, input: Readonly<Record<string, unknown>>): Promise<unknown>;
71
+ /**
72
+ * Hold one call inside the deployment's boundary. A single-resource read
73
+ * names its project — a project key, or the key an issue key embeds — and
74
+ * must stay inside it, or nothing is read. A search names none by default, so
75
+ * it is not refused here but answered with the hits filtered to the boundary
76
+ * instead.
77
+ */
78
+ private assertInsideBoundary;
79
+ /**
80
+ * Fail closed on an issue an issue-security level closes off. The service
81
+ * identity may be allowed to see it upstream, so the check is made here,
82
+ * before anything about it is returned, and it answers the same not-found a
83
+ * personal caller would see for an issue they cannot.
84
+ */
85
+ private assertIssueNotRestricted;
39
86
  /**
40
87
  * Replace a custom field's alias with the instance id the operator mapped it
41
88
  * to. The mapping lives in the deployment's config on purpose: which of an
@@ -49,18 +96,18 @@ export declare class JiraProvider implements IntegrationProvider {
49
96
  */
50
97
  private applyFieldAliases;
51
98
  /**
52
- * Replace a person's name with the account id Jira filters on, for the two
53
- * filters that can carry one. `me` and an account id are already what Jira
54
- * wants and cost no call.
99
+ * Replace a person's name with the identifier this product filters on, for
100
+ * the two filters that can carry one. `me` and an identifier already in the
101
+ * product's own shape are what Jira wants and cost no call.
55
102
  *
56
103
  * The directory is a read of the site's own user list, bounded to ten hits,
57
- * and its answer is never handed to the model: it only decides the id the
58
- * query is built from. A name nobody matches, or a name several people share,
59
- * is refused with what to do next — an account id from an issue — because the
60
- * alternative is a query that quietly answers "no such issues".
104
+ * and its answer is never handed to the model: it only decides the identifier
105
+ * the query is built from. A name nobody matches, or a name several people
106
+ * share, is refused with what to do next — the identifier an issue reported —
107
+ * because the alternative is a query that quietly answers "no such issues".
61
108
  */
62
109
  private resolvePeople;
63
- private accountIdFor;
110
+ private identityFor;
64
111
  /**
65
112
  * The site's field schema, read only when an issue read was asked to name
66
113
  * custom fields. It is not cached: the same site answers a different list to
@@ -69,16 +116,26 @@ export declare class JiraProvider implements IntegrationProvider {
69
116
  */
70
117
  private fieldNames;
71
118
  /**
72
- * The provider speaks the Cloud-only `/rest/api/3` surface. A Data Center
73
- * instance answers a different API, and the specification forbids treating it
74
- * as silently compatible, so the deployment type is checked once, at connect:
75
- * a site that names a type other than Cloud is refused. A site that does not
76
- * serve the endpoint at all — an older tenant, a proxy that hides it — is left
77
- * to the identity call that already succeeded instead of failing on a probe
78
- * that proves nothing either way.
119
+ * The provider speaks the deployment type the operator declared, and a site
120
+ * that answers the other product is refused instead of being read as if it
121
+ * were compatible. The two Jiras are different APIs — different roots,
122
+ * different authentication, different answers for the same read — so a probe
123
+ * happens once, at connect, and the message tells the operator which value to
124
+ * set. A site that does not serve the endpoint at all — an older tenant, a
125
+ * proxy that hides it — is left to the identity call that already succeeded
126
+ * instead of failing on a probe that proves nothing either way.
79
127
  */
80
- private requireCloud;
128
+ private requireDeployment;
81
129
  private resolveSite;
82
130
  }
131
+ /**
132
+ * Whether one caller-named project stays inside the deployment's boundary. The
133
+ * boundary lists project keys, and a Jira project key compares case-insensitively
134
+ * upstream while an operator may type it in any case, so the match normalizes
135
+ * the case; a listed numeric id matches exactly. A project key that is not
136
+ * listed never widens into its issues: `PROJ` does not cover `PROJX`.
137
+ */
138
+ export declare function projectAllowed(boundary: ServiceResourceBoundary, ref: string): boolean;
139
+ /** Map an upstream failure of the probe onto a health status. */
83
140
  export default JiraProvider;
84
141
  //# sourceMappingURL=index.d.ts.map
@@ -1,4 +1,4 @@
1
- import { type JiraFlags } from "./config.js";
1
+ import { type JiraDeployment, type JiraFlags } from "./config.js";
2
2
  /** One JQL string literal: quoted, with the quote and the backslash escaped. */
3
3
  export declare function jqlLiteral(value: string, field: string): string;
4
4
  /**
@@ -10,11 +10,13 @@ export declare function jqlLiteral(value: string, field: string): string;
10
10
  export declare function jqlDateValue(value: unknown, field: string): string;
11
11
  export declare function projectKey(value: unknown, field?: string): string;
12
12
  export declare function issueKey(value: unknown, field?: string): string;
13
+ /** What this product calls the identifier a person filter takes. */
14
+ export declare function identifierName(deployment: JiraDeployment): string;
13
15
  /**
14
16
  * Whether a person filter needs the directory before it becomes JQL: `me` and
15
- * an account id are already unambiguous, a free-text name is not.
17
+ * an already-shaped identifier are unambiguous, a free-text name is not.
16
18
  */
17
- export declare function needsUserLookup(value: unknown): boolean;
19
+ export declare function needsUserLookup(value: unknown, deployment: JiraDeployment): boolean;
18
20
  /** One free-text fragment: every word searched, or the exact phrase. */
19
21
  export declare function textClauses(value: unknown, match: "all" | "phrase" | undefined): string[];
20
22
  /**
@@ -36,7 +38,7 @@ export declare function textMatch(value: unknown): "all" | "phrase";
36
38
  * "OR project = SECRET" is a text fragment to search for rather than a clause
37
39
  * that widens the search.
38
40
  */
39
- export declare function buildJql(input: Readonly<Record<string, unknown>>): string;
41
+ export declare function buildJql(input: Readonly<Record<string, unknown>>, deployment?: JiraDeployment): string;
40
42
  /**
41
43
  * Rows of one search page: the model may lower the deployment's default but
42
44
  * never raise its ceiling.
@@ -48,4 +50,12 @@ export declare function commentLimit(requested: unknown, flags: JiraFlags): numb
48
50
  export declare function commentStart(value: unknown): number;
49
51
  /** An opaque continuation token from a previous search answer. */
50
52
  export declare function pageToken(value: unknown): string | undefined;
53
+ /**
54
+ * The row offset a Server / Data Center search continues from. Its cursor is
55
+ * the position the previous answer ended at — the product pages a search by
56
+ * offset, and reports the size of the answer rather than minting a token — so
57
+ * the cursor is a decimal number and a bounded one, because search pagination
58
+ * is not a crawl API.
59
+ */
60
+ export declare function pageOffset(value: unknown): number;
51
61
  //# sourceMappingURL=jql.d.ts.map
@@ -1,4 +1,5 @@
1
1
  import type { JiraFlags, JiraSite } from "./config.js";
2
+ import type { JiraDialect } from "./dialect.js";
2
3
  import type { JiraQuery } from "./transport.js";
3
4
  /** What a search answer carries about every issue it returns. */
4
5
  export declare const SEARCH_FIELDS: readonly string[];
@@ -12,6 +13,8 @@ export interface OperationContext {
12
13
  */
13
14
  readonly externalUserId?: string | undefined;
14
15
  readonly flags: JiraFlags;
16
+ /** The product this site is, which decides paths and search paging. */
17
+ readonly dialect: JiraDialect;
15
18
  }
16
19
  export interface JiraRequest {
17
20
  readonly path: string;
@@ -1,5 +1,6 @@
1
1
  import type { ResolvedQaIntegrationsConfig } from "../../config.js";
2
2
  import { type JiraFlags, type JiraSite } from "./config.js";
3
+ export { basicAuthorization } from "./dialect.js";
3
4
  /**
4
5
  * Encrypted payload of one Jira connection: which configured site the token
5
6
  * belongs to, the Atlassian account it authenticates as, and the API token
@@ -7,10 +8,13 @@ import { type JiraFlags, type JiraSite } from "./config.js";
7
8
  *
8
9
  * The site's address is not stored — it is re-resolved from operator config on
9
10
  * every call, so removing or repointing a site takes effect at once instead of
10
- * at the next connect. The e-mail is not a secret, but it is what makes the
11
+ * at the next connect. The e-mail is not a secret, but it is what makes a Cloud
11
12
  * token usable (Jira Cloud authenticates an API token with HTTP Basic over
12
13
  * `email:token`), so it travels in the same encrypted blob rather than in a
13
- * second record that could go missing.
14
+ * second record that could go missing. A Server / Data Center connection
15
+ * authenticates on the token alone and keeps the field empty: the site's
16
+ * declared deployment type decides whether it is spent, which is why a
17
+ * credential is never paired with the other product's scheme.
14
18
  */
15
19
  export interface JiraCredential {
16
20
  readonly siteId: string;
@@ -25,8 +29,6 @@ export declare function credentialFromPlaintext(plaintext: string): JiraCredenti
25
29
  */
26
30
  export declare function credentialSite(flags: JiraFlags, credential: JiraCredential): JiraSite;
27
31
  export type JiraQuery = Readonly<Record<string, string | number | boolean | undefined>>;
28
- /** Jira Cloud authenticates an API token with HTTP Basic over `email:token`. */
29
- export declare function basicAuthorization(credential: JiraCredential): string;
30
32
  /**
31
33
  * HTTP boundary of the provider: one documented Jira Cloud REST call, bounded in
32
34
  * time and size, with upstream failures folded into safe domain errors and
@@ -44,9 +46,6 @@ export declare class JiraTransport {
44
46
  getJson<T>(site: JiraSite, credential: JiraCredential, path: string, query?: JiraQuery): Promise<T>;
45
47
  private url;
46
48
  private request;
47
- /** Jira asks for a pause through `retry-after`; honour it, but bounded. */
48
- private backoff;
49
- private retryDelay;
50
49
  /**
51
50
  * The provider error model. Jira answers a refused permission with 403 — a
52
51
  * permission scheme the connected user is not in, an issue security level, or
@@ -55,11 +54,5 @@ export declare class JiraTransport {
55
54
  * there". Neither answer ever carries the upstream body.
56
55
  */
57
56
  private failure;
58
- /**
59
- * Read a body without letting upstream decide how much memory the broker
60
- * spends. A body over the cap is reported as truncated instead of surfacing a
61
- * raw `content-length` nobody can verify.
62
- */
63
- private readText;
64
57
  }
65
58
  //# sourceMappingURL=transport.d.ts.map
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Credential health, projected from a provider failure.
3
+ *
4
+ * Every provider answers its integration card's "is this credential still
5
+ * usable?" question by classifying the safe error code it raised, and the
6
+ * classification is the same for every upstream: an expired secret, a revoked
7
+ * or denied one, and everything else, which is reported as unreachable instead
8
+ * of guessed. Keeping one implementation here is what stops the three answers
9
+ * from drifting apart between providers — the operator reads the same meaning
10
+ * whichever upstream sits behind the failing provider.
11
+ *
12
+ * The projection reads only `IntegrationError` codes; a raw throw (a bug
13
+ * outside the provider's folding) is unreachable, never a credential verdict.
14
+ */
15
+ import type { ServiceCredentialHealth } from "../../service-credentials/types.js";
16
+ /** Classify a provider failure into the health its settings card shows. */
17
+ export declare function healthFromFailure(error: unknown): ServiceCredentialHealth;
18
+ //# sourceMappingURL=health.d.ts.map
@@ -26,6 +26,15 @@ export declare function retryDelay(attempt: number): number;
26
26
  * raw `content-length` nobody can verify.
27
27
  */
28
28
  export declare function readBoundedText(response: Response, maxBytes: number): Promise<BoundedText>;
29
+ /**
30
+ * Read one JSON body under the deployment cap, folding what a capped or
31
+ * unreadable body means into a domain error. The cap, the prefix-keeping
32
+ * truncation and the binary classification are the shared policy; a transport
33
+ * only supplies the label it answers with, so the same limit cannot mean
34
+ * "narrow the request" in one provider and "try again later" in another, and
35
+ * no transport can quietly skip the cap.
36
+ */
37
+ export declare function readBoundedJson<T>(response: Response, maxBytes: number, label: string): Promise<T>;
29
38
  /**
30
39
  * How a provider folds transport outcomes into its own safe domain errors:
31
40
  * each transport keeps the wording, the shared loop keeps the mechanics.
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Path safety for values that end up inside an upstream REST path. Each
3
+ * provider keeps its own segment grammar — what a project path or a component
4
+ * slug may contain — and the predicate here answers the question every grammar
5
+ * shares: whether a `.` or `..` segment could walk out of the path the provider
6
+ * meant to compose. Providers refuse such a value as an invalid argument.
7
+ */
8
+ /** Whether any `/`-separated segment of the value is `.` or `..`. */
9
+ export declare function hasTraversal(value: string): boolean;
10
+ //# sourceMappingURL=paths.d.ts.map
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Readers for fields of an upstream payload, shared by every provider
3
+ * projection. An answer from the upstream is untrusted input: a field may be
4
+ * missing, null, or of a shape the API changed without telling anyone. None of
5
+ * these readers throws — each answers `undefined` or an empty value, and the
6
+ * projection decides what a missing field means for that endpoint.
7
+ *
8
+ * The emptiness policy is one decision and lives here: a string field that
9
+ * arrived empty counts as absent, like every other unusable value. A provider
10
+ * that kept `""` as a value answered a caller with something no request can use
11
+ * — an empty continuation cursor, for instance — so the caller had to guess
12
+ * whether a token existed at all.
13
+ */
14
+ /** An object field as a record; scalars, arrays and null become `{}`. */
15
+ export declare function recordOf(value: unknown): Record<string, unknown>;
16
+ /** A non-empty string field: the text, or `undefined` when there is none. */
17
+ export declare function stringOf(source: Record<string, unknown>, key: string): string | undefined;
18
+ /** A finite number field. Numeric strings stay strings, as the API sent them. */
19
+ export declare function numberOf(source: Record<string, unknown>, key: string): number | undefined;
20
+ /** A boolean field, only when the upstream sent a boolean. */
21
+ export declare function booleanOf(source: Record<string, unknown>, key: string): boolean | undefined;
22
+ /** An array field; anything that is not an array counts as no items. */
23
+ export declare function arrayOf(source: Record<string, unknown>, key: string): unknown[];
24
+ /** Drop unset keys so a projection never answers with `undefined` holes. */
25
+ export declare function compact(source: Record<string, unknown>): Record<string, unknown>;
26
+ //# sourceMappingURL=payload.d.ts.map
@@ -22,8 +22,6 @@ export declare function artifactExtension(path: string): string;
22
22
  export declare function artifactByteLimit(requested: unknown, flags: TeamCityFlags): number;
23
23
  /** Why this artifact may not be read as text at all. */
24
24
  export declare function artifactBinaryProblem(path: string): string | undefined;
25
- /** A NUL byte in the head of a body is the classic text/binary split. */
26
- export declare function looksBinary(bytes: Uint8Array): boolean;
27
25
  export interface TextArtifactAnswer {
28
26
  readonly path: string;
29
27
  /** Bytes of the body that was downloaded, not the artifact's full size. */
@@ -109,5 +109,7 @@ export declare class TeamcityProvider implements IntegrationProvider {
109
109
  private read;
110
110
  private project;
111
111
  }
112
+ /** A missing or forbidden project inside a boundary is reported, not fatal. */
113
+ /** Map an upstream failure of the probe onto a health status. */
112
114
  export default TeamcityProvider;
113
115
  //# sourceMappingURL=index.d.ts.map
@@ -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 { TestitFlags } from "./config.js";
3
4
  /**
@@ -47,7 +48,11 @@ export interface TestitOperationDefinition {
47
48
  * the provider reads it through its bounded text path instead.
48
49
  */
49
50
  readonly stream?: boolean;
51
+ /** What this operation does, how sensitive it is, who may reach it. */
52
+ readonly security: OperationSecurityMetadata;
50
53
  }
54
+ /** The resource kind every project-scoped operation of this provider is bounded by. */
55
+ export declare const TESTIT_RESOURCE_KIND = "projects";
51
56
  /**
52
57
  * Every model-reachable operation. The provider refuses any operation that is
53
58
  * not listed here, so this table — together with `capability` — is the
@@ -64,6 +69,11 @@ export interface TestitOperationDefinition {
64
69
  * endpoints Test IT marks deprecated: they are kept because they are the only
65
70
  * GET reads of those collections, and a version that drops them answers
66
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`.
67
77
  */
68
78
  export declare const TESTIT_OPERATIONS: Readonly<Record<string, TestitOperationDefinition>>;
69
79
  /** Capabilities this deployment allows, in catalog order. */
@@ -72,4 +82,6 @@ export declare function enabledCapabilities(flags: TestitFlags): readonly Testit
72
82
  export declare const TESTIT_CAPABILITY_INFO: Readonly<Record<TestitCapability, IntegrationCapabilityInfo>>;
73
83
  /** Capability an operation needs, or undefined when the catalog has none. */
74
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;
75
87
  //# sourceMappingURL=catalog.d.ts.map
@@ -1,11 +1,19 @@
1
1
  import { type CredentialHelp } from "@yadsh/dsh-plugin-kit";
2
2
  import type { ResolvedQaIntegrationsConfig } from "../../config.js";
3
- import type { IntegrationCapability, IntegrationCapabilityInfo, ProviderValidation } from "../../types.js";
3
+ import type { OperationSecurityMetadata, ServiceCredentialHealth, ServiceResourceBoundary } from "../../service-credentials/types.js";
4
+ import type { CapabilityServiceState, IntegrationCapability, IntegrationCapabilityInfo, ProviderValidation } from "../../types.js";
4
5
  import type { IntegrationProvider, ProviderContext } from "../contract.js";
5
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;
6
13
  /**
7
14
  * Test IT provider: one Test IT installation per QA user, connected with that
8
- * user's own API token.
15
+ * user's own API token, or with the deployment's managed read-only credential
16
+ * when the user's binding asks for it.
9
17
  *
10
18
  * The installation is operator configuration — the connect form only picks from
11
19
  * the configured list — so the broker cannot be pointed at a host of the
@@ -36,6 +44,16 @@ export declare class TestitProvider implements IntegrationProvider {
36
44
  readonly portal: string;
37
45
  };
38
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;
39
57
  /**
40
58
  * The documented first validation call is the project list: an authorized
41
59
  * answer proves the address and the token at once, and an empty project list
@@ -44,7 +62,48 @@ export declare class TestitProvider implements IntegrationProvider {
44
62
  * reports what the probe proved and nothing more.
45
63
  */
46
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>;
47
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;
48
107
  /**
49
108
  * One attachment, read as text. Test IT describes the file — its name and its
50
109
  * size — before a byte is requested, and this provider trusts that description
@@ -56,5 +115,7 @@ export declare class TestitProvider implements IntegrationProvider {
56
115
  private readAttachment;
57
116
  private resolveInstance;
58
117
  }
118
+ /** A missing or forbidden project inside a boundary is reported, not fatal. */
119
+ /** Map an upstream failure of the probe onto a health status. */
59
120
  export default TestitProvider;
60
121
  //# sourceMappingURL=index.d.ts.map
@@ -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 { WeblateFlags } from "./config.js";
3
4
  /**
@@ -25,13 +26,27 @@ export interface WeblateOperationDefinition {
25
26
  readonly path: string;
26
27
  /** Set when the operation answers with one page of a collection. */
27
28
  readonly list?: boolean;
29
+ /** What this operation does, how sensitive it is, who may reach it. */
30
+ readonly security: OperationSecurityMetadata;
28
31
  }
32
+ /**
33
+ * The resource kind every project-scoped operation of this provider is bounded
34
+ * by. A boundary entry is a project slug exactly as the operations address one,
35
+ * so a boundary entry and a tool argument are compared as strings.
36
+ */
37
+ export declare const WEBLATE_RESOURCE_KIND = "projects";
29
38
  /**
30
39
  * Every model-reachable operation. The provider refuses any operation that is
31
- * not listed here, so this table — together with `capability` — is the
32
- * permission surface. Only GET: localization writes (suggestions, comments,
40
+ * not listed here, so this table — together with `capability` and `security` —
41
+ * is the permission surface. Only GET: localization writes (suggestions, comments,
33
42
  * translations, approvals) and the repository, file and autotranslate
34
43
  * operations stay out until the confirmation framework exists.
44
+ *
45
+ * No operation of this catalog carries a secret or another person's raw output —
46
+ * there is no repository status or commit text here, and the localization text
47
+ * every read returns is bounded by the deployment's character cap and marked as
48
+ * untrusted content — so none of them is classified sensitive; a shared
49
+ * read-only account answers every one of them inside a project boundary.
35
50
  */
36
51
  export declare const WEBLATE_OPERATIONS: Readonly<Record<string, WeblateOperationDefinition>>;
37
52
  /** Capabilities this deployment allows, in catalog order. */
@@ -40,4 +55,6 @@ export declare function enabledCapabilities(flags: WeblateFlags): readonly Webla
40
55
  export declare const WEBLATE_CAPABILITY_INFO: Readonly<Record<WeblateCapability, IntegrationCapabilityInfo>>;
41
56
  /** Capability an operation needs, or undefined when the catalog has none. */
42
57
  export declare function weblateOperationCapability(operation: string): IntegrationCapability | undefined;
58
+ /** Security classification of an operation, or undefined when it is unknown. */
59
+ export declare function weblateOperationMetadata(operation: string): OperationSecurityMetadata | undefined;
43
60
  //# sourceMappingURL=catalog.d.ts.map
@@ -1,6 +1,7 @@
1
1
  import { type CredentialHelp } from "@yadsh/dsh-plugin-kit";
2
2
  import type { ResolvedQaIntegrationsConfig } from "../../config.js";
3
- import type { IntegrationCapability, IntegrationCapabilityInfo, ProviderValidation } from "../../types.js";
3
+ import type { OperationSecurityMetadata, ServiceCredentialHealth } from "../../service-credentials/types.js";
4
+ import type { CapabilityServiceState, IntegrationCapability, IntegrationCapabilityInfo, ProviderValidation } from "../../types.js";
4
5
  import type { IntegrationProvider, ProviderContext } from "../contract.js";
5
6
  export { credentialFromPlaintext, credentialInstance, resultsOf, type WeblateCredential, } from "./transport.js";
6
7
  export type WeblateTokenKind = "personal" | "project" | "unknown";
@@ -42,8 +43,49 @@ export declare class WeblateProvider implements IntegrationProvider {
42
43
  readonly portal: string;
43
44
  };
44
45
  operationCapability(operation: string): IntegrationCapability | undefined;
46
+ operationMetadata(operation: string): OperationSecurityMetadata | undefined;
47
+ /** Every project-scoped read is held inside the profile's project boundary. */
48
+ resourceBoundaryKind(operation: string): string | undefined;
49
+ /**
50
+ * Portal of a configured instance. An empty id means "the only instance", the
51
+ * same rule `parseCredential` applies, so deployment configuration and the
52
+ * connect form name instances alike.
53
+ */
54
+ instancePortal(instanceId: string): string | undefined;
55
+ capabilityServiceState(capability: IntegrationCapability): CapabilityServiceState | undefined;
45
56
  validate(context: ProviderContext): Promise<ProviderValidation>;
57
+ /**
58
+ * Health of a deployment-managed token. The probe is the one read personal
59
+ * validation makes, so it cannot change upstream state; Weblate exposes no
60
+ * token-scope introspection, so there is nothing wider than read-only to
61
+ * detect here — the local service ceiling stays the only bound on what the
62
+ * credential may do, and the warning says so.
63
+ */
64
+ validateServiceCredential(context: ProviderContext): Promise<ServiceCredentialHealth>;
46
65
  execute(context: ProviderContext, operation: string, input: Readonly<Record<string, unknown>>): Promise<unknown>;
66
+ /**
67
+ * Hold one call inside the deployment's boundary. A service-safe operation
68
+ * either names its project in the arguments — a missing slug is refused, which
69
+ * is what keeps the global unit searches from answering with the shared
70
+ * account's whole view — or is addressed by the id of a string or a
71
+ * screenshot, which is resolved to its project upstream first.
72
+ */
73
+ private assertInsideBoundary;
74
+ /**
75
+ * Resolve one id-addressed read to the project it answers for. The probe is
76
+ * the same read the operation itself makes — Weblate has no cheaper "which
77
+ * project is this id" endpoint — and the probed answer is discarded unless
78
+ * the project is inside the boundary, so a foreign id reveals nothing.
79
+ */
80
+ private projectOfAddressedResource;
81
+ /**
82
+ * The bounded project listing. A service profile names the projects it covers,
83
+ * so the answer is built from that list instead of from whatever the shared
84
+ * account can reach; a project the service token cannot see is reported as
85
+ * unavailable rather than silently dropped. The whole allowlist is the answer
86
+ * — its size is bounded by the administrator, not by a cursor.
87
+ */
88
+ private listBoundedProjects;
47
89
  private resolveInstance;
48
90
  }
49
91
  export default WeblateProvider;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Identity shared by the Host plugin and its operator card.
3
+ *
4
+ * This module must stay dependency-free: the card bundle inlines it, and a
5
+ * browser build must not pull the Host config surface (schemastery) into the
6
+ * page just to learn the namespace name.
7
+ */
8
+ /**
9
+ * Settings namespace the plugin owns and its operator card binds to. The
10
+ * namespace carries the deployment configuration the card edits; the profile
11
+ * composition row stays the base layer an override reverts to.
12
+ */
13
+ export declare const QA_INTEGRATIONS_SETTINGS_NAMESPACE = "qa-integrations";
14
+ //# sourceMappingURL=settings.d.ts.map
@@ -99,6 +99,14 @@ export interface IntegrationInstanceSummary {
99
99
  readonly id: string;
100
100
  readonly label: string;
101
101
  readonly baseUrl: string;
102
+ /**
103
+ * Which product answers at `baseUrl`, on the providers that distinguish the
104
+ * vendor's hosted deployment from a self-hosted one. Absent for a provider
105
+ * without that distinction, and an absent value means the resolver's own
106
+ * default — the hosted product — so a client reads `=== "server"` rather
107
+ * than enumerating both.
108
+ */
109
+ readonly deploymentType?: "cloud" | "server" | undefined;
102
110
  /** Safe alias of the managed credential bound to this instance, if any. */
103
111
  readonly service: {
104
112
  readonly label: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yadsh/dsh-qa-integrations",
3
- "version": "0.6.0",
3
+ "version": "0.8.0",
4
4
  "description": "Principal-scoped, encrypted user integrations for DSH QA Surface",
5
5
  "repository": {
6
6
  "type": "git",
@@ -87,9 +87,9 @@
87
87
  },
88
88
  "dependencies": {
89
89
  "zod": "^4.4.3",
90
- "@yadsh/dsh-plugin-kit": "^0.3.0",
91
90
  "@yadsh/dsh-plugin-log": "^0.4.0",
92
- "@yadsh/dsh-qa-surface": "^0.9.0"
91
+ "@yadsh/dsh-plugin-kit": "^0.3.0",
92
+ "@yadsh/dsh-qa-surface": "^0.11.0"
93
93
  },
94
94
  "peerDependencies": {
95
95
  "@deepseek-ai/cordis": "^4.0.2",