@yadsh/dsh-qa-integrations 0.7.0 → 0.8.1

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 (141) hide show
  1. package/README.md +33 -16
  2. package/lib/client/confluence.js +37 -16
  3. package/lib/client/confluence.js.map +1 -1
  4. package/lib/client/jira.js +32 -11
  5. package/lib/client/jira.js.map +1 -1
  6. package/lib/client.js +128 -73
  7. package/lib/client.js.map +1 -1
  8. package/lib/coerce.js +17 -1
  9. package/lib/coerce.js.map +1 -1
  10. package/lib/config.js.map +1 -1
  11. package/lib/errors.js +22 -0
  12. package/lib/errors.js.map +1 -1
  13. package/lib/index.js +20 -2
  14. package/lib/index.js.map +1 -1
  15. package/lib/providers/bitrix24/config.js +2 -3
  16. package/lib/providers/bitrix24/config.js.map +1 -1
  17. package/lib/providers/bitrix24/index.js +1 -14
  18. package/lib/providers/bitrix24/index.js.map +1 -1
  19. package/lib/providers/bitrix24/operations.js +5 -9
  20. package/lib/providers/bitrix24/operations.js.map +1 -1
  21. package/lib/providers/bitrix24/transport.js +11 -31
  22. package/lib/providers/bitrix24/transport.js.map +1 -1
  23. package/lib/providers/confluence/adf.js +28 -23
  24. package/lib/providers/confluence/adf.js.map +1 -1
  25. package/lib/providers/confluence/catalog.js +40 -4
  26. package/lib/providers/confluence/catalog.js.map +1 -1
  27. package/lib/providers/confluence/config.js +27 -2
  28. package/lib/providers/confluence/config.js.map +1 -1
  29. package/lib/providers/confluence/credential-help.js +14 -8
  30. package/lib/providers/confluence/credential-help.js.map +1 -1
  31. package/lib/providers/confluence/dialect.js +215 -0
  32. package/lib/providers/confluence/dialect.js.map +1 -0
  33. package/lib/providers/confluence/index.js +137 -81
  34. package/lib/providers/confluence/index.js.map +1 -1
  35. package/lib/providers/confluence/operations.js +207 -152
  36. package/lib/providers/confluence/operations.js.map +1 -1
  37. package/lib/providers/confluence/storage.js +690 -0
  38. package/lib/providers/confluence/storage.js.map +1 -0
  39. package/lib/providers/confluence/transport.js +26 -89
  40. package/lib/providers/confluence/transport.js.map +1 -1
  41. package/lib/providers/gitlab/config.js +2 -3
  42. package/lib/providers/gitlab/config.js.map +1 -1
  43. package/lib/providers/gitlab/index.js +2 -20
  44. package/lib/providers/gitlab/index.js.map +1 -1
  45. package/lib/providers/gitlab/operations.js +7 -45
  46. package/lib/providers/gitlab/operations.js.map +1 -1
  47. package/lib/providers/gitlab/transport.js +2 -18
  48. package/lib/providers/gitlab/transport.js.map +1 -1
  49. package/lib/providers/jira/adf.js +19 -14
  50. package/lib/providers/jira/adf.js.map +1 -1
  51. package/lib/providers/jira/catalog.js +52 -1
  52. package/lib/providers/jira/catalog.js.map +1 -1
  53. package/lib/providers/jira/config.js +27 -2
  54. package/lib/providers/jira/config.js.map +1 -1
  55. package/lib/providers/jira/credential-help.js +16 -7
  56. package/lib/providers/jira/credential-help.js.map +1 -1
  57. package/lib/providers/jira/dialect.js +94 -0
  58. package/lib/providers/jira/dialect.js.map +1 -0
  59. package/lib/providers/jira/index.js +101 -95
  60. package/lib/providers/jira/index.js.map +1 -1
  61. package/lib/providers/jira/jql.js +54 -21
  62. package/lib/providers/jira/jql.js.map +1 -1
  63. package/lib/providers/jira/operations.js +77 -55
  64. package/lib/providers/jira/operations.js.map +1 -1
  65. package/lib/providers/jira/tools.js +1 -1
  66. package/lib/providers/jira/tools.js.map +1 -1
  67. package/lib/providers/jira/transport.js +12 -83
  68. package/lib/providers/jira/transport.js.map +1 -1
  69. package/lib/providers/shared/health.js +31 -0
  70. package/lib/providers/shared/health.js.map +1 -0
  71. package/lib/providers/shared/http.js +20 -0
  72. package/lib/providers/shared/http.js.map +1 -1
  73. package/lib/providers/shared/paths.js +14 -0
  74. package/lib/providers/shared/paths.js.map +1 -0
  75. package/lib/providers/shared/payload.js +46 -0
  76. package/lib/providers/shared/payload.js.map +1 -0
  77. package/lib/providers/teamcity/artifacts.js +0 -8
  78. package/lib/providers/teamcity/artifacts.js.map +1 -1
  79. package/lib/providers/teamcity/config.js +2 -3
  80. package/lib/providers/teamcity/config.js.map +1 -1
  81. package/lib/providers/teamcity/index.js +2 -20
  82. package/lib/providers/teamcity/index.js.map +1 -1
  83. package/lib/providers/teamcity/operations.js +5 -39
  84. package/lib/providers/teamcity/operations.js.map +1 -1
  85. package/lib/providers/teamcity/transport.js +2 -11
  86. package/lib/providers/teamcity/transport.js.map +1 -1
  87. package/lib/providers/testit/config.js +2 -3
  88. package/lib/providers/testit/config.js.map +1 -1
  89. package/lib/providers/testit/index.js +2 -20
  90. package/lib/providers/testit/index.js.map +1 -1
  91. package/lib/providers/testit/operations.js +34 -63
  92. package/lib/providers/testit/operations.js.map +1 -1
  93. package/lib/providers/testit/transport.js +2 -18
  94. package/lib/providers/testit/transport.js.map +1 -1
  95. package/lib/providers/weblate/config.js +2 -3
  96. package/lib/providers/weblate/config.js.map +1 -1
  97. package/lib/providers/weblate/index.js +2 -19
  98. package/lib/providers/weblate/index.js.map +1 -1
  99. package/lib/providers/weblate/operations.js +3 -33
  100. package/lib/providers/weblate/operations.js.map +1 -1
  101. package/lib/providers/weblate/query.js +3 -6
  102. package/lib/providers/weblate/query.js.map +1 -1
  103. package/lib/providers/weblate/transport.js +2 -12
  104. package/lib/providers/weblate/transport.js.map +1 -1
  105. package/lib/service-credentials/config.js +2 -3
  106. package/lib/service-credentials/config.js.map +1 -1
  107. package/lib/typert.host.js +62 -55
  108. package/lib/typert.remote-client.d.ts +4 -4
  109. package/lib/typert.remote-client.js +58 -51
  110. package/lib/types/client/confluence.d.ts +5 -1
  111. package/lib/types/client/jira.d.ts +5 -1
  112. package/lib/types/coerce.d.ts +14 -0
  113. package/lib/types/config.d.ts +4 -4
  114. package/lib/types/errors.d.ts +16 -0
  115. package/lib/types/index.d.ts +10 -2
  116. package/lib/types/providers/bitrix24/index.d.ts +1 -0
  117. package/lib/types/providers/confluence/catalog.d.ts +33 -5
  118. package/lib/types/providers/confluence/config.d.ts +39 -7
  119. package/lib/types/providers/confluence/credential-help.d.ts +9 -4
  120. package/lib/types/providers/confluence/dialect.d.ts +113 -0
  121. package/lib/types/providers/confluence/index.d.ts +24 -4
  122. package/lib/types/providers/confluence/operations.d.ts +12 -4
  123. package/lib/types/providers/confluence/storage.d.ts +28 -0
  124. package/lib/types/providers/confluence/transport.d.ts +10 -21
  125. package/lib/types/providers/jira/catalog.d.ts +36 -2
  126. package/lib/types/providers/jira/config.d.ts +37 -6
  127. package/lib/types/providers/jira/credential-help.d.ts +11 -3
  128. package/lib/types/providers/jira/dialect.d.ts +79 -0
  129. package/lib/types/providers/jira/index.d.ts +32 -22
  130. package/lib/types/providers/jira/jql.d.ts +14 -4
  131. package/lib/types/providers/jira/operations.d.ts +3 -0
  132. package/lib/types/providers/jira/transport.d.ts +6 -13
  133. package/lib/types/providers/shared/health.d.ts +18 -0
  134. package/lib/types/providers/shared/http.d.ts +9 -0
  135. package/lib/types/providers/shared/paths.d.ts +10 -0
  136. package/lib/types/providers/shared/payload.d.ts +26 -0
  137. package/lib/types/providers/teamcity/artifacts.d.ts +0 -2
  138. package/lib/types/providers/teamcity/index.d.ts +2 -0
  139. package/lib/types/providers/testit/index.d.ts +2 -0
  140. package/lib/types/types.d.ts +8 -0
  141. package/package.json +5 -5
@@ -0,0 +1,79 @@
1
+ import type { JiraDeployment, JiraSite } from "./config.js";
2
+ /**
3
+ * Everything that differs between Atlassian Cloud and a self-hosted Server /
4
+ * Data Center instance, in one place. The provider is one read-only product
5
+ * surface over two products: keeping the differences here means an operation
6
+ * asks the dialect where to read and how to authenticate, instead of every
7
+ * call site deciding for itself which Jira it is talking to.
8
+ *
9
+ * Nothing here is inferred at run time. The deployment type comes from the
10
+ * operator's site list, and a site that answers a different product than it
11
+ * declared is refused — the specification forbids treating Data Center as
12
+ * silently compatible with Cloud.
13
+ */
14
+ export interface JiraDialect {
15
+ readonly deployment: JiraDeployment;
16
+ /** Root every REST path of this product hangs under. */
17
+ readonly apiRoot: "/rest/api/3" | "/rest/api/2";
18
+ /** What the connect form calls the secret this product accepts. */
19
+ readonly credentialLabel: string;
20
+ /** Shape of one pasteable token, before anything is sent upstream. */
21
+ readonly tokenShape: RegExp;
22
+ /**
23
+ * Whether an e-mail must travel with the token. Cloud pairs an API token with
24
+ * the account it was minted for; a Server / Data Center personal access token
25
+ * authenticates on its own.
26
+ */
27
+ readonly requiresEmail: boolean;
28
+ /** The user directory parameter a free-text person is searched by. */
29
+ readonly userSearchParam: "query" | "username";
30
+ /** Fields a person is identified by in an answer, in order of preference. */
31
+ readonly identityFields: readonly string[];
32
+ /** `deploymentType` values `serverInfo` answers for this product. */
33
+ readonly deploymentTypes: readonly string[];
34
+ /** How the name of this product reads in a message. */
35
+ readonly productName: string;
36
+ }
37
+ export declare const JIRA_DIALECTS: Readonly<Record<JiraDeployment, JiraDialect>>;
38
+ /** The dialect of one configured site. */
39
+ export declare function dialectOf(site: JiraSite): JiraDialect;
40
+ /**
41
+ * The identifier of one person as an answer reports it. Cloud names an account
42
+ * id, a Server / Data Center instance the user name its JQL filters on; reading
43
+ * them in the dialect's own order is what keeps the identity of a connection
44
+ * the same value the model has to pass back in a filter.
45
+ */
46
+ export declare function identityOf(dialect: JiraDialect, person: Readonly<Record<string, unknown>>): string | undefined;
47
+ /**
48
+ * Jira Cloud authenticates an API token with HTTP Basic over `email:token`.
49
+ * The e-mail is not a secret, but it is what makes the token usable, so the two
50
+ * travel as one pair and never as two arguments.
51
+ */
52
+ export declare function basicAuthorization(credential: {
53
+ readonly email: string;
54
+ readonly token: string;
55
+ }): string;
56
+ /**
57
+ * The `Authorization` header of one stored credential. Cloud spends an
58
+ * Atlassian API token as HTTP Basic over `email:token`; a Server / Data Center
59
+ * personal access token is a bearer token, and the account it belongs to is the
60
+ * token's own — no e-mail travels with it.
61
+ *
62
+ * The credential carries what the operator's site declared, so a site whose
63
+ * deployment type no longer matches the credential is refused here, before the
64
+ * secret is spent: a token minted for one product must not be offered to the
65
+ * other.
66
+ */
67
+ export declare function authorizationFor(dialect: JiraDialect, credential: {
68
+ readonly email: string;
69
+ readonly token: string;
70
+ }): string;
71
+ /**
72
+ * Whether a `serverInfo` answer proves the site is the product it declared. An
73
+ * answer that names no type at all proves nothing either way and is left to the
74
+ * identity call that already succeeded; an answer that names the other product
75
+ * is a configuration mistake the operator has to fix, and the message says
76
+ * which one.
77
+ */
78
+ export declare function assertDeployment(dialect: JiraDialect, deploymentType: string | undefined): void;
79
+ //# sourceMappingURL=dialect.d.ts.map
@@ -5,11 +5,15 @@ import type { CapabilityServiceState, IntegrationCapability, IntegrationCapabili
5
5
  import type { IntegrationProvider, ProviderContext } from "../contract.js";
6
6
  export { credentialFromPlaintext, credentialSite, type JiraCredential, } from "./transport.js";
7
7
  /**
8
- * 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).
9
10
  *
10
11
  * The token is spent against the site the credential names, and that site is
11
12
  * re-resolved from operator config on every call, so a site the deployment
12
- * 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.
13
17
  */
14
18
  export declare class JiraProvider implements IntegrationProvider {
15
19
  private readonly config;
@@ -31,10 +35,12 @@ export declare class JiraProvider implements IntegrationProvider {
31
35
  * host the caller names.
32
36
  *
33
37
  * The same method turns a deployment-managed secret into this credential
34
- * shape. That secret is the whole Basic pair (`email:token`), because Jira
35
- * cannot spend the token without the account and the pair must not be split
36
- * across two records; the form path instead supplies the e-mail separately,
37
- * and keeps refusing a pasted pair.
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.
38
44
  */
39
45
  parseCredential(raw: string, options?: Readonly<Record<string, string>>): {
40
46
  readonly credential: string;
@@ -59,6 +65,8 @@ export declare class JiraProvider implements IntegrationProvider {
59
65
  */
60
66
  validateServiceCredential(context: ProviderContext): Promise<ServiceCredentialHealth>;
61
67
  validate(context: ProviderContext): Promise<ProviderValidation>;
68
+ /** The identity read of this site's product: the one connect proves itself with. */
69
+ private identityPath;
62
70
  execute(context: ProviderContext, operation: string, input: Readonly<Record<string, unknown>>): Promise<unknown>;
63
71
  /**
64
72
  * Hold one call inside the deployment's boundary. A single-resource read
@@ -88,18 +96,18 @@ export declare class JiraProvider implements IntegrationProvider {
88
96
  */
89
97
  private applyFieldAliases;
90
98
  /**
91
- * Replace a person's name with the account id Jira filters on, for the two
92
- * filters that can carry one. `me` and an account id are already what Jira
93
- * 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.
94
102
  *
95
103
  * The directory is a read of the site's own user list, bounded to ten hits,
96
- * and its answer is never handed to the model: it only decides the id the
97
- * query is built from. A name nobody matches, or a name several people share,
98
- * is refused with what to do next — an account id from an issue — because the
99
- * 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".
100
108
  */
101
109
  private resolvePeople;
102
- private accountIdFor;
110
+ private identityFor;
103
111
  /**
104
112
  * The site's field schema, read only when an issue read was asked to name
105
113
  * custom fields. It is not cached: the same site answers a different list to
@@ -108,15 +116,16 @@ export declare class JiraProvider implements IntegrationProvider {
108
116
  */
109
117
  private fieldNames;
110
118
  /**
111
- * The provider speaks the Cloud-only `/rest/api/3` surface. A Data Center
112
- * instance answers a different API, and the specification forbids treating it
113
- * as silently compatible, so the deployment type is checked once, at connect:
114
- * a site that names a type other than Cloud is refused. A site that does not
115
- * serve the endpoint at all — an older tenant, a proxy that hides it — is left
116
- * to the identity call that already succeeded instead of failing on a probe
117
- * 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.
118
127
  */
119
- private requireCloud;
128
+ private requireDeployment;
120
129
  private resolveSite;
121
130
  }
122
131
  /**
@@ -127,5 +136,6 @@ export declare class JiraProvider implements IntegrationProvider {
127
136
  * listed never widens into its issues: `PROJ` does not cover `PROJX`.
128
137
  */
129
138
  export declare function projectAllowed(boundary: ServiceResourceBoundary, ref: string): boolean;
139
+ /** Map an upstream failure of the probe onto a health status. */
130
140
  export default JiraProvider;
131
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
@@ -115,5 +115,7 @@ export declare class TestitProvider implements IntegrationProvider {
115
115
  private readAttachment;
116
116
  private resolveInstance;
117
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. */
118
120
  export default TestitProvider;
119
121
  //# sourceMappingURL=index.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.7.0",
3
+ "version": "0.8.1",
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.10.0"
91
+ "@yadsh/dsh-qa-surface": "^0.11.1",
92
+ "@yadsh/dsh-plugin-kit": "^0.3.0"
93
93
  },
94
94
  "peerDependencies": {
95
95
  "@deepseek-ai/cordis": "^4.0.2",
@@ -123,8 +123,8 @@
123
123
  "typescript": "^7.0.2",
124
124
  "vitest": "^4.1.11",
125
125
  "@yadsh/dsh-config": "^0.0.0",
126
- "@yadsh/dsh-test-kit": "^0.1.0",
127
- "@yadsh/dsh-plugin-scripts": "^0.0.0"
126
+ "@yadsh/dsh-plugin-scripts": "^0.0.0",
127
+ "@yadsh/dsh-test-kit": "^0.1.0"
128
128
  },
129
129
  "publishConfig": {
130
130
  "access": "public",