@yadsh/dsh-qa-integrations 0.5.0 → 0.6.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 (191) hide show
  1. package/README.md +431 -18
  2. package/compatibility.json +1 -1
  3. package/lib/broker.js +456 -9
  4. package/lib/broker.js.map +1 -1
  5. package/lib/client/bitrix24.js +2 -1
  6. package/lib/client/bitrix24.js.map +1 -1
  7. package/lib/client/card.js +8 -1
  8. package/lib/client/card.js.map +1 -1
  9. package/lib/client/confluence.js +3 -2
  10. package/lib/client/confluence.js.map +1 -1
  11. package/lib/client/gitlab.js +40 -4
  12. package/lib/client/gitlab.js.map +1 -1
  13. package/lib/client/index.js +13 -11
  14. package/lib/client/index.js.map +1 -1
  15. package/lib/client/integrations.js +39 -2
  16. package/lib/client/integrations.js.map +1 -1
  17. package/lib/client/jira.js +3 -2
  18. package/lib/client/jira.js.map +1 -1
  19. package/lib/client/provider-card.js +138 -4
  20. package/lib/client/provider-card.js.map +1 -1
  21. package/lib/client/styles.js +8 -5
  22. package/lib/client/styles.js.map +1 -1
  23. package/lib/client/teamcity.js +31 -4
  24. package/lib/client/teamcity.js.map +1 -1
  25. package/lib/client/testit.js +65 -0
  26. package/lib/client/testit.js.map +1 -0
  27. package/lib/client/weblate.js +70 -0
  28. package/lib/client/weblate.js.map +1 -0
  29. package/lib/client.js +2600 -480
  30. package/lib/client.js.map +1 -1
  31. package/lib/coerce.js +16 -7
  32. package/lib/coerce.js.map +1 -1
  33. package/lib/config.js +12 -0
  34. package/lib/config.js.map +1 -1
  35. package/lib/errors.js.map +1 -1
  36. package/lib/index.js +274 -28
  37. package/lib/index.js.map +1 -1
  38. package/lib/providers/bitrix24/catalog.js +13 -0
  39. package/lib/providers/bitrix24/catalog.js.map +1 -1
  40. package/lib/providers/bitrix24/config.js +3 -0
  41. package/lib/providers/bitrix24/config.js.map +1 -1
  42. package/lib/providers/bitrix24/credential-help.js +24 -0
  43. package/lib/providers/bitrix24/credential-help.js.map +1 -0
  44. package/lib/providers/bitrix24/index.js +9 -0
  45. package/lib/providers/bitrix24/index.js.map +1 -1
  46. package/lib/providers/bitrix24/operations.js +60 -1
  47. package/lib/providers/bitrix24/operations.js.map +1 -1
  48. package/lib/providers/bitrix24/tools.js +95 -3
  49. package/lib/providers/bitrix24/tools.js.map +1 -1
  50. package/lib/providers/confluence/credential-help.js +29 -0
  51. package/lib/providers/confluence/credential-help.js.map +1 -0
  52. package/lib/providers/confluence/index.js +9 -0
  53. package/lib/providers/confluence/index.js.map +1 -1
  54. package/lib/providers/gitlab/catalog.js +108 -15
  55. package/lib/providers/gitlab/catalog.js.map +1 -1
  56. package/lib/providers/gitlab/config.js +11 -3
  57. package/lib/providers/gitlab/config.js.map +1 -1
  58. package/lib/providers/gitlab/credential-help.js +33 -0
  59. package/lib/providers/gitlab/credential-help.js.map +1 -0
  60. package/lib/providers/gitlab/index.js +337 -6
  61. package/lib/providers/gitlab/index.js.map +1 -1
  62. package/lib/providers/jira/credential-help.js +31 -0
  63. package/lib/providers/jira/credential-help.js.map +1 -0
  64. package/lib/providers/jira/index.js +9 -0
  65. package/lib/providers/jira/index.js.map +1 -1
  66. package/lib/providers/registry.js +4 -0
  67. package/lib/providers/registry.js.map +1 -1
  68. package/lib/providers/shared/credential-help.js +29 -0
  69. package/lib/providers/shared/credential-help.js.map +1 -0
  70. package/lib/providers/shared/service-boundary.js +44 -0
  71. package/lib/providers/shared/service-boundary.js.map +1 -0
  72. package/lib/providers/teamcity/catalog.js +56 -2
  73. package/lib/providers/teamcity/catalog.js.map +1 -1
  74. package/lib/providers/teamcity/credential-help.js +25 -0
  75. package/lib/providers/teamcity/credential-help.js.map +1 -0
  76. package/lib/providers/teamcity/index.js +254 -2
  77. package/lib/providers/teamcity/index.js.map +1 -1
  78. package/lib/providers/testit/attachments.js +131 -0
  79. package/lib/providers/testit/attachments.js.map +1 -0
  80. package/lib/providers/testit/catalog.js +225 -0
  81. package/lib/providers/testit/catalog.js.map +1 -0
  82. package/lib/providers/testit/config.js +175 -0
  83. package/lib/providers/testit/config.js.map +1 -0
  84. package/lib/providers/testit/credential-help.js +29 -0
  85. package/lib/providers/testit/credential-help.js.map +1 -0
  86. package/lib/providers/testit/index.js +184 -0
  87. package/lib/providers/testit/index.js.map +1 -0
  88. package/lib/providers/testit/operations.js +1070 -0
  89. package/lib/providers/testit/operations.js.map +1 -0
  90. package/lib/providers/testit/tools.js +717 -0
  91. package/lib/providers/testit/tools.js.map +1 -0
  92. package/lib/providers/testit/transport.js +158 -0
  93. package/lib/providers/testit/transport.js.map +1 -0
  94. package/lib/providers/weblate/catalog.js +185 -0
  95. package/lib/providers/weblate/catalog.js.map +1 -0
  96. package/lib/providers/weblate/config.js +147 -0
  97. package/lib/providers/weblate/config.js.map +1 -0
  98. package/lib/providers/weblate/credential-help.js +26 -0
  99. package/lib/providers/weblate/credential-help.js.map +1 -0
  100. package/lib/providers/weblate/index.js +181 -0
  101. package/lib/providers/weblate/index.js.map +1 -0
  102. package/lib/providers/weblate/operations.js +703 -0
  103. package/lib/providers/weblate/operations.js.map +1 -0
  104. package/lib/providers/weblate/query.js +80 -0
  105. package/lib/providers/weblate/query.js.map +1 -0
  106. package/lib/providers/weblate/tools.js +408 -0
  107. package/lib/providers/weblate/tools.js.map +1 -0
  108. package/lib/providers/weblate/transport.js +179 -0
  109. package/lib/providers/weblate/transport.js.map +1 -0
  110. package/lib/repository.js +197 -13
  111. package/lib/repository.js.map +1 -1
  112. package/lib/service-credentials/config.js +179 -0
  113. package/lib/service-credentials/config.js.map +1 -0
  114. package/lib/service-credentials/policy.js +92 -0
  115. package/lib/service-credentials/policy.js.map +1 -0
  116. package/lib/service-credentials/registry.js +142 -0
  117. package/lib/service-credentials/registry.js.map +1 -0
  118. package/lib/service-credentials/state.js +30 -0
  119. package/lib/service-credentials/state.js.map +1 -0
  120. package/lib/service-credentials/types.js +20 -0
  121. package/lib/service-credentials/types.js.map +1 -0
  122. package/lib/tools.js +27 -2
  123. package/lib/tools.js.map +1 -1
  124. package/lib/typert.host.js +1187 -39
  125. package/lib/typert.remote-client.d.ts +37 -5
  126. package/lib/typert.remote-client.js +1057 -33
  127. package/lib/types/broker.d.ts +70 -4
  128. package/lib/types/client/bitrix24.d.ts +1 -1
  129. package/lib/types/client/card.d.ts +3 -1
  130. package/lib/types/client/confluence.d.ts +2 -2
  131. package/lib/types/client/gitlab.d.ts +15 -2
  132. package/lib/types/client/index.d.ts +3 -2
  133. package/lib/types/client/integrations.d.ts +11 -2
  134. package/lib/types/client/jira.d.ts +2 -2
  135. package/lib/types/client/provider-card.d.ts +50 -8
  136. package/lib/types/client/styles.d.ts +4 -3
  137. package/lib/types/client/teamcity.d.ts +15 -2
  138. package/lib/types/client/testit.d.ts +15 -0
  139. package/lib/types/client/weblate.d.ts +15 -0
  140. package/lib/types/coerce.d.ts +2 -2
  141. package/lib/types/config.d.ts +21 -0
  142. package/lib/types/errors.d.ts +9 -1
  143. package/lib/types/index.d.ts +108 -11
  144. package/lib/types/providers/bitrix24/catalog.d.ts +1 -1
  145. package/lib/types/providers/bitrix24/config.d.ts +11 -1
  146. package/lib/types/providers/bitrix24/credential-help.d.ts +8 -0
  147. package/lib/types/providers/bitrix24/index.d.ts +5 -0
  148. package/lib/types/providers/bitrix24/tools.d.ts +4 -0
  149. package/lib/types/providers/confluence/credential-help.d.ts +9 -0
  150. package/lib/types/providers/confluence/index.d.ts +5 -0
  151. package/lib/types/providers/contract.d.ts +62 -1
  152. package/lib/types/providers/gitlab/catalog.d.ts +20 -5
  153. package/lib/types/providers/gitlab/config.d.ts +14 -3
  154. package/lib/types/providers/gitlab/credential-help.d.ts +9 -0
  155. package/lib/types/providers/gitlab/index.d.ts +51 -1
  156. package/lib/types/providers/jira/credential-help.d.ts +8 -0
  157. package/lib/types/providers/jira/index.d.ts +5 -0
  158. package/lib/types/providers/registry.d.ts +2 -0
  159. package/lib/types/providers/shared/credential-help.d.ts +17 -0
  160. package/lib/types/providers/shared/service-boundary.d.ts +25 -0
  161. package/lib/types/providers/teamcity/catalog.d.ts +18 -2
  162. package/lib/types/providers/teamcity/credential-help.d.ts +8 -0
  163. package/lib/types/providers/teamcity/index.d.ts +53 -2
  164. package/lib/types/providers/testit/attachments.d.ts +20 -0
  165. package/lib/types/providers/testit/catalog.d.ts +75 -0
  166. package/lib/types/providers/testit/config.d.ts +61 -0
  167. package/lib/types/providers/testit/credential-help.d.ts +8 -0
  168. package/lib/types/providers/testit/index.d.ts +60 -0
  169. package/lib/types/providers/testit/operations.d.ts +95 -0
  170. package/lib/types/providers/testit/tools.d.ts +15 -0
  171. package/lib/types/providers/testit/transport.d.ts +67 -0
  172. package/lib/types/providers/weblate/catalog.d.ts +43 -0
  173. package/lib/types/providers/weblate/config.d.ts +57 -0
  174. package/lib/types/providers/weblate/credential-help.d.ts +9 -0
  175. package/lib/types/providers/weblate/index.d.ts +50 -0
  176. package/lib/types/providers/weblate/operations.d.ts +77 -0
  177. package/lib/types/providers/weblate/query.d.ts +37 -0
  178. package/lib/types/providers/weblate/tools.d.ts +15 -0
  179. package/lib/types/providers/weblate/transport.d.ts +60 -0
  180. package/lib/types/repository.d.ts +38 -3
  181. package/lib/types/service-credentials/config.d.ts +73 -0
  182. package/lib/types/service-credentials/policy.d.ts +44 -0
  183. package/lib/types/service-credentials/registry.d.ts +43 -0
  184. package/lib/types/service-credentials/state.d.ts +14 -0
  185. package/lib/types/service-credentials/types.d.ts +97 -0
  186. package/lib/types/tools.d.ts +10 -1
  187. package/lib/types/types.d.ts +114 -10
  188. package/package.json +7 -7
  189. package/lib/shared/settings.js +0 -19
  190. package/lib/shared/settings.js.map +0 -1
  191. package/lib/types/shared/settings.d.ts +0 -19
@@ -2,20 +2,58 @@ import type { PluginLogger } from "@yadsh/dsh-plugin-log";
2
2
  import type { IntegrationProviderRegistry } from "./providers/registry.js";
3
3
  import type { IntegrationRepository } from "./repository.js";
4
4
  import type { SecretStore } from "./secrets/secret-store.js";
5
- import type { CredentialInput, IntegrationPrincipal, IntegrationProviderId, IntegrationProviderSummary, IntegrationSummary, IntegrationToolResult, PolicyPatch } from "./types.js";
5
+ import type { ServiceCredentialRegistry } from "./service-credentials/registry.js";
6
+ import { type ServiceCredentialHealth, type ServiceResourceBoundary } from "./service-credentials/types.js";
7
+ import type { CredentialInput, CredentialSource, IntegrationPrincipal, IntegrationProviderId, IntegrationProviderSummary, IntegrationSummary, IntegrationToolResult, PolicyPatch } from "./types.js";
8
+ export interface BrokerOptions {
9
+ /** Absent in deployments that configure no managed credential at all. */
10
+ readonly serviceCredentials?: ServiceCredentialRegistry | undefined;
11
+ /** Whether a new connection starts in service mode when a profile exists. */
12
+ readonly defaultForNewConnections?: boolean | undefined;
13
+ }
6
14
  /** In-process broker boundary; no caller outside it receives decrypted secrets. */
7
15
  export declare class IntegrationBroker {
8
16
  private readonly repository;
9
17
  private readonly secrets;
10
18
  private readonly providers;
11
19
  private readonly logger;
12
- constructor(repository: IntegrationRepository, secrets: SecretStore, providers: IntegrationProviderRegistry, logger: PluginLogger);
20
+ private readonly serviceCredentials;
21
+ private readonly defaultForNewConnections;
22
+ constructor(repository: IntegrationRepository, secrets: SecretStore, providers: IntegrationProviderRegistry, logger: PluginLogger, options?: BrokerOptions);
13
23
  listProviders(): readonly IntegrationProviderSummary[];
14
24
  list(principal: IntegrationPrincipal): readonly IntegrationSummary[];
15
25
  summary(principal: IntegrationPrincipal, providerId: IntegrationProviderId): IntegrationSummary;
16
- /** Connect one provider for one principal; the provider owns its credential shape. */
17
- connect(principal: IntegrationPrincipal, providerId: IntegrationProviderId, input: CredentialInput): Promise<IntegrationSummary>;
26
+ /**
27
+ * Connect one provider for one principal. The credential source is decided
28
+ * here, server-side: the client may ask for service mode, and gets it only
29
+ * when this deployment really manages a credential for that provider
30
+ * instance. A new connection defaults to service mode when the deployment
31
+ * says so and a profile exists — an existing connection never moves on its
32
+ * own, because its source is already stored.
33
+ */
34
+ connect(principal: IntegrationPrincipal, providerId: IntegrationProviderId, input: CredentialInput, options?: {
35
+ readonly useServiceCredential?: boolean | undefined;
36
+ }): Promise<IntegrationSummary>;
18
37
  validate(principal: IntegrationPrincipal, providerId: IntegrationProviderId): Promise<IntegrationSummary>;
38
+ /**
39
+ * Probe the deployment's managed credential for one instance and report what
40
+ * state it is in. The probe never changes upstream state, and the answer is a
41
+ * health status plus operator warnings — never the secret, and never the
42
+ * upstream identity the credential carries.
43
+ */
44
+ serviceCredentialHealth(providerId: IntegrationProviderId, instanceId: string): Promise<ServiceCredentialHealth | null>;
45
+ /**
46
+ * Move one binding between credential sources. Both directions invalidate
47
+ * everything derived from the previous identity by bumping the binding
48
+ * revision, and neither direction ever falls back on its own.
49
+ */
50
+ setCredentialSource(principal: IntegrationPrincipal, providerId: IntegrationProviderId, source: CredentialSource): Promise<IntegrationSummary>;
51
+ /**
52
+ * Narrow what this binding may read inside the profile's allowlist. A user may
53
+ * only remove entries: anything outside the administrator's list is dropped
54
+ * rather than stored, so a forged request cannot widen the boundary.
55
+ */
56
+ setServiceSelection(principal: IntegrationPrincipal, providerId: IntegrationProviderId, selection: ServiceResourceBoundary | null): IntegrationSummary;
19
57
  patchPolicy(principal: IntegrationPrincipal, providerId: IntegrationProviderId, patch: PolicyPatch): IntegrationSummary;
20
58
  disconnect(principal: IntegrationPrincipal, providerId: IntegrationProviderId): boolean;
21
59
  call(principal: IntegrationPrincipal, request: {
@@ -24,6 +62,34 @@ export declare class IntegrationBroker {
24
62
  readonly input: Readonly<Record<string, unknown>>;
25
63
  readonly sourceSessionId: string;
26
64
  }): Promise<IntegrationToolResult>;
65
+ /**
66
+ * Decide one operation against the service ceiling. Every refusal is audited
67
+ * with the real principal: upstream will only ever show the service account,
68
+ * so this row is what answers who asked.
69
+ */
70
+ private assertServiceOperation;
71
+ /**
72
+ * The profile a binding resolves to. It is chosen by the deployment — provider
73
+ * and portal — and never by an argument the model or the user supplies, which
74
+ * is why a caller cannot point a session at somebody else's credential.
75
+ */
76
+ private profileFor;
77
+ private resolveService;
78
+ /**
79
+ * Turn the deployment's secret into the credential shape of this provider.
80
+ * The provider owns that shape, so a service secret can never be spent against
81
+ * an instance other than the profile's.
82
+ */
83
+ private buildServiceCredential;
84
+ private probeService;
85
+ /** Capabilities the managed credential can reach through this provider. */
86
+ private serviceCapabilities;
87
+ /**
88
+ * Managed-credential state of one provider, as a client renders it. Null for a
89
+ * provider that supports no managed credential at all, so nothing about the
90
+ * feature appears where it does not apply.
91
+ */
92
+ private serviceSummary;
27
93
  private requireConnected;
28
94
  private decrypt;
29
95
  }
@@ -14,5 +14,5 @@ export interface IntegrationsRemote {
14
14
  patchBitrix24Policy(token: string, patch: PolicyPatch): Promise<RemoteResult<IntegrationSummary>>;
15
15
  disconnectBitrix24(token: string): Promise<RemoteResult<boolean>>;
16
16
  }
17
- export declare function createBitrix24Card(remote: IntegrationsRemote): ({ token }: import("@yadsh/dsh-qa-surface/client/settings").QaUserSettingsSectionProps) => import("react/jsx-runtime").JSX.Element;
17
+ export declare function createBitrix24Card(remote: IntegrationsRemote): ({ token, help }: import("./provider-card.js").ProviderCardProps) => import("react/jsx-runtime").JSX.Element;
18
18
  //# sourceMappingURL=bitrix24.d.ts.map
@@ -2,7 +2,7 @@ import type { QaUserSession } from "@yadsh/dsh-qa-surface/client/settings";
2
2
  import { type ReactElement } from "react";
3
3
  import { type IntegrationsClientRemote } from "./integrations.js";
4
4
  /**
5
- * The Integrations card of the host's "Plugin configuration" tab.
5
+ * The Integrations card shown inside the plugin-owned host settings tab.
6
6
  *
7
7
  * A connection belongs to a QA account, and the token of that account is the
8
8
  * only credential the principal-scoped remotes accept, so the card renders the
@@ -10,4 +10,6 @@ import { type IntegrationsClientRemote } from "./integrations.js";
10
10
  * and says so instead of showing forms that could only fail.
11
11
  */
12
12
  export declare function createIntegrationsCard(remote: IntegrationsClientRemote, providers: readonly string[], session: QaUserSession): () => ReactElement;
13
+ /** Host tab wrapper that preserves the card shell's direct ul > li contract. */
14
+ export declare function createIntegrationsHostTab(remote: IntegrationsClientRemote, providers: readonly string[], session: QaUserSession): () => ReactElement;
13
15
  //# sourceMappingURL=card.d.ts.map
@@ -1,6 +1,6 @@
1
1
  import type { RemoteResult } from "@deepseek-ai/dsh-typert-protocol";
2
- import type { QaUserSettingsSectionProps } from "@yadsh/dsh-qa-surface/client/settings";
3
2
  import type { IntegrationInstanceSummary, IntegrationSummary, PolicyPatch } from "../types.js";
3
+ import type { ProviderCardProps } from "./provider-card.js";
4
4
  export interface ConfluenceRemote {
5
5
  confluenceSites(token: string): Promise<RemoteResult<readonly IntegrationInstanceSummary[]>>;
6
6
  getConfluence(token: string): Promise<RemoteResult<IntegrationSummary>>;
@@ -13,5 +13,5 @@ export interface ConfluenceRemote {
13
13
  patchConfluencePolicy(token: string, patch: PolicyPatch): Promise<RemoteResult<IntegrationSummary>>;
14
14
  disconnectConfluence(token: string): Promise<RemoteResult<boolean>>;
15
15
  }
16
- export declare function createConfluenceCard(remote: ConfluenceRemote): ({ token }: QaUserSettingsSectionProps) => import("react/jsx-runtime").JSX.Element;
16
+ export declare function createConfluenceCard(remote: ConfluenceRemote): ({ token, help }: ProviderCardProps) => import("react/jsx-runtime").JSX.Element;
17
17
  //# sourceMappingURL=confluence.d.ts.map
@@ -1,15 +1,28 @@
1
1
  import type { RemoteResult } from "@deepseek-ai/dsh-typert-protocol";
2
- import type { IntegrationInstanceSummary, IntegrationSummary, PolicyPatch } from "../types.js";
2
+ import type { CredentialSource, IntegrationInstanceSummary, IntegrationServiceBoundary, IntegrationSummary, PolicyPatch } from "../types.js";
3
3
  export interface GitlabRemote {
4
4
  gitlabInstances(token: string): Promise<RemoteResult<readonly IntegrationInstanceSummary[]>>;
5
5
  getGitlab(token: string): Promise<RemoteResult<IntegrationSummary>>;
6
6
  putGitlabCredential(token: string, input: {
7
7
  readonly instanceId: string;
8
8
  readonly token: string;
9
+ readonly useServiceCredential?: boolean;
9
10
  }): Promise<RemoteResult<IntegrationSummary>>;
10
11
  testGitlab(token: string): Promise<RemoteResult<IntegrationSummary>>;
11
12
  patchGitlabPolicy(token: string, patch: PolicyPatch): Promise<RemoteResult<IntegrationSummary>>;
12
13
  disconnectGitlab(token: string): Promise<RemoteResult<boolean>>;
14
+ managedServiceCredentials(token: string): Promise<RemoteResult<{
15
+ readonly enabled: boolean;
16
+ readonly defaultForNewConnections: boolean;
17
+ }>>;
18
+ credentialSource(token: string, input: {
19
+ readonly provider: string;
20
+ readonly source: CredentialSource;
21
+ }): Promise<RemoteResult<IntegrationSummary>>;
22
+ serviceBoundary(token: string, input: {
23
+ readonly provider: string;
24
+ readonly selection: IntegrationServiceBoundary | null;
25
+ }): Promise<RemoteResult<IntegrationSummary>>;
13
26
  }
14
- export declare function createGitlabCard(remote: GitlabRemote): ({ token }: import("@yadsh/dsh-qa-surface/client/settings").QaUserSettingsSectionProps) => import("react/jsx-runtime").JSX.Element;
27
+ export declare function createGitlabCard(remote: GitlabRemote): ({ token, help }: import("./provider-card.js").ProviderCardProps) => import("react/jsx-runtime").JSX.Element;
15
28
  //# sourceMappingURL=gitlab.d.ts.map
@@ -5,8 +5,9 @@ export declare const inject: readonly ["remote", "qaUserSettingsSections", "qaUs
5
5
  /**
6
6
  * Both mounts of the provider cards come from this one bundle: the page of the
7
7
  * signed-in user's QA settings dialog, where the account gate lives, and the
8
- * card of the host's "Plugin configuration" tab, which reaches the same account
9
- * through the `qaUserSession` service.
8
+ * feature-owned tab in the host's Plugins settings, which reaches the same
9
+ * account through the `qaUserSession` service without depending on the Host
10
+ * settings directory.
10
11
  */
11
12
  export declare function apply(ctx: Context): Promise<() => Promise<void>>;
12
13
  export type { IntegrationSummary, PolicyPatch, RemoteResult };
@@ -1,10 +1,18 @@
1
+ import type { RemoteResult } from "@deepseek-ai/dsh-typert-protocol";
1
2
  import type { QaUserSettingsSectionProps } from "@yadsh/dsh-qa-surface/client/settings";
3
+ import type { IntegrationProviderSummary } from "../types.js";
2
4
  import { type IntegrationsRemote } from "./bitrix24.js";
3
5
  import { type ConfluenceRemote } from "./confluence.js";
4
6
  import { type GitlabRemote } from "./gitlab.js";
5
7
  import { type JiraRemote } from "./jira.js";
6
8
  import { type TeamcityRemote } from "./teamcity.js";
7
- export type IntegrationsClientRemote = IntegrationsRemote & ConfluenceRemote & GitlabRemote & TeamcityRemote & JiraRemote;
9
+ import { type TestitRemote } from "./testit.js";
10
+ import { type WeblateRemote } from "./weblate.js";
11
+ /** The provider list arrives with each provider's credential help on it. */
12
+ export interface CredentialHelpRemote {
13
+ providers(token: string): Promise<RemoteResult<readonly IntegrationProviderSummary[]>>;
14
+ }
15
+ export type IntegrationsClientRemote = CredentialHelpRemote & IntegrationsRemote & ConfluenceRemote & GitlabRemote & TeamcityRemote & JiraRemote & TestitRemote & WeblateRemote;
8
16
  /** What every mount of the provider cards needs. */
9
17
  export interface ProviderCardsProps {
10
18
  /** Current QA account token; transport authentication for the remotes. */
@@ -17,7 +25,8 @@ export declare const INTEGRATIONS_DISCLOSURE = "\u0414\u0430\u043D\u043D\u044B\u
17
25
  /**
18
26
  * One card per provider the deployment mounted. The list comes from the host
19
27
  * (`describe`), so a provider the operator switched off simply never renders and
20
- * the client carries no knowledge of which exist.
28
+ * the client carries no knowledge of which exist. The credential help each card
29
+ * shows comes from the same host, per provider.
21
30
  *
22
31
  * Both mounts share this component: the page of the QA settings dialog, where
23
32
  * the account gate lives, and the host's plugin-configuration card.
@@ -1,6 +1,6 @@
1
1
  import type { RemoteResult } from "@deepseek-ai/dsh-typert-protocol";
2
- import type { QaUserSettingsSectionProps } from "@yadsh/dsh-qa-surface/client/settings";
3
2
  import type { IntegrationInstanceSummary, IntegrationSummary, PolicyPatch } from "../types.js";
3
+ import type { ProviderCardProps } from "./provider-card.js";
4
4
  export interface JiraRemote {
5
5
  jiraSites(token: string): Promise<RemoteResult<readonly IntegrationInstanceSummary[]>>;
6
6
  getJira(token: string): Promise<RemoteResult<IntegrationSummary>>;
@@ -13,5 +13,5 @@ export interface JiraRemote {
13
13
  patchJiraPolicy(token: string, patch: PolicyPatch): Promise<RemoteResult<IntegrationSummary>>;
14
14
  disconnectJira(token: string): Promise<RemoteResult<boolean>>;
15
15
  }
16
- export declare function createJiraCard(remote: JiraRemote): ({ token }: QaUserSettingsSectionProps) => import("react/jsx-runtime").JSX.Element;
16
+ export declare function createJiraCard(remote: JiraRemote): ({ token, help }: ProviderCardProps) => import("react/jsx-runtime").JSX.Element;
17
17
  //# sourceMappingURL=jira.d.ts.map
@@ -1,12 +1,23 @@
1
1
  import type { RemoteResult } from "@deepseek-ai/dsh-typert-protocol";
2
+ import type { CredentialHelp } from "@yadsh/dsh-plugin-kit";
2
3
  import type { QaUserSettingsSectionProps } from "@yadsh/dsh-qa-surface/client/settings";
3
4
  import type { ReactNode } from "react";
4
- import type { IntegrationCapability, IntegrationSummary, PolicyPatch } from "../types.js";
5
+ import type { CredentialSource, IntegrationCapability, IntegrationServiceBoundary, IntegrationSummary, PolicyPatch } from "../types.js";
5
6
  /**
6
- * The skeleton the three provider cards share: the failure banner, the status
7
- * head, the connected summary, the save/test/patch/disconnect flows, the
8
- * capability switches and the replace/disconnect confirmations. A provider
9
- * only supplies its copy, its load sequence and its credential form.
7
+ * What every provider card receives: the account token, plus the credential help
8
+ * this deployment declared for the provider. The help is metadata — a card
9
+ * renders it or renders nothing, and the credential field behaves the same
10
+ * either way.
11
+ */
12
+ export interface ProviderCardProps extends QaUserSettingsSectionProps {
13
+ readonly help?: CredentialHelp | null;
14
+ }
15
+ /**
16
+ * The skeleton the provider cards share: the failure banner, the status head,
17
+ * the connected summary, the save/test/patch/disconnect flows, the managed
18
+ * credential block, the capability switches and the replace/disconnect
19
+ * confirmations. A provider supplies its copy, its load sequence, its credential
20
+ * form and how its instances map to a deployment credential.
10
21
  */
11
22
  export interface ProviderCardState<Extra> {
12
23
  readonly token: string;
@@ -16,12 +27,23 @@ export interface ProviderCardState<Extra> {
16
27
  readonly showCredential: boolean;
17
28
  readonly credential: string;
18
29
  readonly extra: Extra;
30
+ /** Managed credential offered by the selected instance, or null. */
31
+ readonly service: {
32
+ readonly label: string;
33
+ } | null;
34
+ /** Whether the connect form asks for that credential instead of a token. */
35
+ readonly useService: boolean;
36
+ setUseService(value: boolean): void;
19
37
  setCredential(value: string): void;
20
38
  /** Clear the form and leave replace mode. */
21
39
  cancelCredential(): void;
22
40
  save(): void;
23
41
  test(): void;
24
42
  patch(capability: IntegrationCapability, allowed: boolean): void;
43
+ /** Move the connected binding onto the other credential source. */
44
+ switchSource(source: CredentialSource): void;
45
+ /** Store what this binding narrows the profile's allowlist to. */
46
+ saveBoundary(selection: IntegrationServiceBoundary | null): void;
25
47
  setConfirmDisconnect(value: boolean): void;
26
48
  disconnect(): void;
27
49
  fail(cause: unknown): void;
@@ -36,10 +58,15 @@ export interface ProviderCardLoad<Extra> {
36
58
  }
37
59
  /** The remote calls every provider card makes on the shared skeleton. */
38
60
  export interface ProviderCardCalls<Extra> {
39
- save(token: string, credential: string, extra: Extra): Promise<RemoteResult<IntegrationSummary>>;
61
+ save(token: string, credential: string, extra: Extra, options: {
62
+ readonly useServiceCredential: boolean;
63
+ }): Promise<RemoteResult<IntegrationSummary>>;
40
64
  test(token: string): Promise<RemoteResult<IntegrationSummary>>;
41
65
  patch(token: string, patch: PolicyPatch): Promise<RemoteResult<IntegrationSummary>>;
42
66
  disconnect(token: string): Promise<RemoteResult<boolean>>;
67
+ /** Present on the providers a deployment may manage a credential for. */
68
+ setSource?(token: string, source: CredentialSource): Promise<RemoteResult<IntegrationSummary>>;
69
+ setBoundary?(token: string, selection: IntegrationServiceBoundary | null): Promise<RemoteResult<IntegrationSummary>>;
43
70
  }
44
71
  export interface ProviderCardSpec<Extra> {
45
72
  readonly title: string;
@@ -55,9 +82,24 @@ export interface ProviderCardSpec<Extra> {
55
82
  useExtra(): Extra;
56
83
  load(load: ProviderCardLoad<Extra>): Promise<void>;
57
84
  readonly calls: ProviderCardCalls<Extra>;
58
- credentialSection(state: ProviderCardState<Extra>): ReactNode;
85
+ credentialSection(state: ProviderCardState<Extra>, help: CredentialHelp | null): ReactNode;
59
86
  /** Muted note under the head, or null when this provider shows none. */
60
87
  readonly notConfiguredHint?: (state: ProviderCardState<Extra>) => ReactNode | null;
88
+ /** Managed credential of the instance the form currently selects. */
89
+ readonly serviceBinding?: (extra: Extra) => {
90
+ readonly label: string;
91
+ } | null;
92
+ /**
93
+ * Whether a new connection starts on the managed credential. Read from the
94
+ * deployment, so the default the form shows is the one the host will apply.
95
+ */
96
+ readonly serviceDefault?: (token: string) => Promise<boolean>;
61
97
  }
62
- export declare function createProviderCard<Extra>(spec: ProviderCardSpec<Extra>): ({ token }: QaUserSettingsSectionProps) => import("react/jsx-runtime").JSX.Element;
98
+ /**
99
+ * The managed-credential block of a connect form: one checkbox, plus what the
100
+ * mode does and does not give. Rendered by the providers a deployment may
101
+ * manage a credential for, using the instance the form selected.
102
+ */
103
+ export declare function serviceConnectOption<Extra>(state: ProviderCardState<Extra>): ReactNode;
104
+ export declare function createProviderCard<Extra>(spec: ProviderCardSpec<Extra>): ({ token, help }: ProviderCardProps) => import("react/jsx-runtime").JSX.Element;
63
105
  //# sourceMappingURL=provider-card.d.ts.map
@@ -1,7 +1,8 @@
1
1
  /**
2
- * The canonical settings-card shell comes from the kit (AGENTS.md pins it), and
3
- * only what lives inside the card body is this plugin's own: the provider cards
4
- * the dialog page and the plugin card both mount.
2
+ * The canonical settings-card shell and the shared credential-help note come
3
+ * from the kit (AGENTS.md pins the shell), and only the tab list and what lives
4
+ * inside the card body are this plugin's own: the provider cards the dialog page
5
+ * and the host tab both mount.
5
6
  */
6
7
  export declare const styles: string;
7
8
  //# sourceMappingURL=styles.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import type { RemoteResult } from "@deepseek-ai/dsh-typert-protocol";
2
- import type { IntegrationInstanceSummary, IntegrationSummary, PolicyPatch } from "../types.js";
2
+ import type { CredentialSource, IntegrationInstanceSummary, IntegrationServiceBoundary, IntegrationSummary, PolicyPatch } from "../types.js";
3
3
  export interface TeamcityRemote {
4
4
  getTeamcity(token: string): Promise<RemoteResult<IntegrationSummary>>;
5
5
  /**
@@ -10,10 +10,23 @@ export interface TeamcityRemote {
10
10
  teamcityServer(token: string): Promise<RemoteResult<IntegrationInstanceSummary | null>>;
11
11
  putTeamcityCredential(token: string, input: {
12
12
  readonly token: string;
13
+ readonly useServiceCredential?: boolean;
13
14
  }): Promise<RemoteResult<IntegrationSummary>>;
14
15
  testTeamcity(token: string): Promise<RemoteResult<IntegrationSummary>>;
15
16
  patchTeamcityPolicy(token: string, patch: PolicyPatch): Promise<RemoteResult<IntegrationSummary>>;
16
17
  disconnectTeamcity(token: string): Promise<RemoteResult<boolean>>;
18
+ managedServiceCredentials(token: string): Promise<RemoteResult<{
19
+ readonly enabled: boolean;
20
+ readonly defaultForNewConnections: boolean;
21
+ }>>;
22
+ credentialSource(token: string, input: {
23
+ readonly provider: string;
24
+ readonly source: CredentialSource;
25
+ }): Promise<RemoteResult<IntegrationSummary>>;
26
+ serviceBoundary(token: string, input: {
27
+ readonly provider: string;
28
+ readonly selection: IntegrationServiceBoundary | null;
29
+ }): Promise<RemoteResult<IntegrationSummary>>;
17
30
  }
18
- export declare function createTeamcityCard(remote: TeamcityRemote): ({ token }: import("@yadsh/dsh-qa-surface/client/settings").QaUserSettingsSectionProps) => import("react/jsx-runtime").JSX.Element;
31
+ export declare function createTeamcityCard(remote: TeamcityRemote): ({ token, help }: import("./provider-card.js").ProviderCardProps) => import("react/jsx-runtime").JSX.Element;
19
32
  //# sourceMappingURL=teamcity.d.ts.map
@@ -0,0 +1,15 @@
1
+ import type { RemoteResult } from "@deepseek-ai/dsh-typert-protocol";
2
+ import type { IntegrationInstanceSummary, IntegrationSummary, PolicyPatch } from "../types.js";
3
+ export interface TestitRemote {
4
+ testitInstances(token: string): Promise<RemoteResult<readonly IntegrationInstanceSummary[]>>;
5
+ getTestit(token: string): Promise<RemoteResult<IntegrationSummary>>;
6
+ putTestitCredential(token: string, input: {
7
+ readonly instanceId: string;
8
+ readonly token: string;
9
+ }): Promise<RemoteResult<IntegrationSummary>>;
10
+ testTestit(token: string): Promise<RemoteResult<IntegrationSummary>>;
11
+ patchTestitPolicy(token: string, patch: PolicyPatch): Promise<RemoteResult<IntegrationSummary>>;
12
+ disconnectTestit(token: string): Promise<RemoteResult<boolean>>;
13
+ }
14
+ export declare function createTestitCard(remote: TestitRemote): ({ token, help }: import("./provider-card.js").ProviderCardProps) => import("react/jsx-runtime").JSX.Element;
15
+ //# sourceMappingURL=testit.d.ts.map
@@ -0,0 +1,15 @@
1
+ import type { RemoteResult } from "@deepseek-ai/dsh-typert-protocol";
2
+ import type { IntegrationInstanceSummary, IntegrationSummary, PolicyPatch } from "../types.js";
3
+ export interface WeblateRemote {
4
+ weblateInstances(token: string): Promise<RemoteResult<readonly IntegrationInstanceSummary[]>>;
5
+ getWeblate(token: string): Promise<RemoteResult<IntegrationSummary>>;
6
+ putWeblateCredential(token: string, input: {
7
+ readonly instanceId: string;
8
+ readonly token: string;
9
+ }): Promise<RemoteResult<IntegrationSummary>>;
10
+ testWeblate(token: string): Promise<RemoteResult<IntegrationSummary>>;
11
+ patchWeblatePolicy(token: string, patch: PolicyPatch): Promise<RemoteResult<IntegrationSummary>>;
12
+ disconnectWeblate(token: string): Promise<RemoteResult<boolean>>;
13
+ }
14
+ export declare function createWeblateCard(remote: WeblateRemote): ({ token, help }: import("./provider-card.js").ProviderCardProps) => import("react/jsx-runtime").JSX.Element;
15
+ //# sourceMappingURL=weblate.d.ts.map
@@ -1,8 +1,8 @@
1
1
  /** Model-supplied identifiers are positive integers or the argument is refused. */
2
2
  export declare function requiredInteger(value: unknown, field: string, min?: number, max?: number): number;
3
3
  export declare function optionalInteger(value: unknown, field: string, min?: number, max?: number): number | undefined;
4
- export declare function requiredText(value: unknown, field: string, min: number, max: number): string;
5
- export declare function optionalText(value: unknown, field: string, min: number, max: number): string | undefined;
4
+ export declare function requiredText(value: unknown, field: string, min: number, max: number, explain?: string): string;
5
+ export declare function optionalText(value: unknown, field: string, min: number, max: number, explain?: string): string | undefined;
6
6
  export declare function optionalBoolean(value: unknown, field: string): boolean | undefined;
7
7
  /** Date-only fields, as most REST APIs declare them. */
8
8
  export declare function requiredDate(value: unknown, field: string): string;
@@ -1,9 +1,13 @@
1
1
  import z from "@deepseek-ai/schemastery";
2
+ import type { CredentialHelpOverride } from "@yadsh/dsh-plugin-kit";
2
3
  import { type Bitrix24Flags } from "./providers/bitrix24/config.js";
3
4
  import { type ConfluenceFlags } from "./providers/confluence/config.js";
4
5
  import { type GitlabFlags } from "./providers/gitlab/config.js";
5
6
  import { type JiraFlags } from "./providers/jira/config.js";
6
7
  import { type TeamCityConfigInput, type TeamCityFlags } from "./providers/teamcity/config.js";
8
+ import { type TestitFlags } from "./providers/testit/config.js";
9
+ import { type WeblateFlags } from "./providers/weblate/config.js";
10
+ import { type ManagedServiceCredentialsConfig, type ManagedServiceCredentialsInput } from "./service-credentials/config.js";
7
11
  /**
8
12
  * Composition root of the plugin config: the shared knobs plus one slice per
9
13
  * provider. Adding a provider means adding its slice here and nothing else.
@@ -22,11 +26,24 @@ export interface QaIntegrationsConfig {
22
26
  readonly maxResponseBytes?: number;
23
27
  /** Host allowlist for providers that dial an operator-approved domain. */
24
28
  readonly allowedPortalSuffixes?: string[];
29
+ /**
30
+ * Deployment replacements for the credential help each provider declares:
31
+ * corporate token pages, self-hosted instances, internal documentation. A
32
+ * provider without an entry keeps the help it ships.
33
+ */
34
+ readonly credentialHelp?: Readonly<Record<string, CredentialHelpOverride>>;
25
35
  readonly bitrix24?: Partial<Bitrix24Flags>;
26
36
  readonly confluence?: Partial<ConfluenceFlags>;
27
37
  readonly gitlab?: Partial<GitlabFlags>;
28
38
  readonly teamcity?: TeamCityConfigInput;
29
39
  readonly jira?: Partial<JiraFlags>;
40
+ readonly testit?: Partial<TestitFlags>;
41
+ readonly weblate?: Partial<WeblateFlags>;
42
+ /**
43
+ * Deployment-managed service credentials. Absent by default: a deployment
44
+ * opts in, and nothing about the feature exists until it does.
45
+ */
46
+ readonly managedServiceCredentials?: ManagedServiceCredentialsInput;
30
47
  }
31
48
  export interface ResolvedQaIntegrationsConfig {
32
49
  readonly enabled: boolean;
@@ -37,11 +54,15 @@ export interface ResolvedQaIntegrationsConfig {
37
54
  readonly timeoutMs: number;
38
55
  readonly maxResponseBytes: number;
39
56
  readonly allowedPortalSuffixes: readonly string[];
57
+ readonly credentialHelp: Readonly<Record<string, CredentialHelpOverride | undefined>>;
40
58
  readonly bitrix24: Bitrix24Flags;
41
59
  readonly confluence: ConfluenceFlags;
42
60
  readonly gitlab: GitlabFlags;
43
61
  readonly teamcity: TeamCityFlags;
44
62
  readonly jira: JiraFlags;
63
+ readonly testit: TestitFlags;
64
+ readonly weblate: WeblateFlags;
65
+ readonly managedServiceCredentials: ManagedServiceCredentialsConfig;
45
66
  }
46
67
  export declare const ConfigSchema: z<QaIntegrationsConfig>;
47
68
  export declare function resolveConfig(input?: QaIntegrationsConfig): ResolvedQaIntegrationsConfig;
@@ -16,7 +16,15 @@ export type IntegrationErrorCode = "IntegrationNotConnected" | "CredentialExpire
16
16
  * certificate. The user cannot fix this from the connect form, so it is kept
17
17
  * apart from a plain unreachable host.
18
18
  */
19
- | "TlsFailure";
19
+ | "TlsFailure"
20
+ /**
21
+ * Managed service credentials. The first group describes the deployment's own
22
+ * credential; the second describes what one user's binding may do with it.
23
+ * The names follow the specification's `SERVICE_CREDENTIAL_*` /
24
+ * `OPERATION_NOT_ALLOWED_*` codes in this package's casing convention, and
25
+ * `publicIntegrationError` is what turns them into a client-visible reason.
26
+ */
27
+ | "ServiceCredentialUnavailable" | "ServiceCredentialDisabled" | "ServiceCredentialInvalid" | "ServiceCredentialUnsafeScope" | "ServiceResourceNotAllowed" | "OperationNotAllowedWithServiceCredential" | "SensitiveReadRequiresPersonalCredential" | "PersonalCredentialRequired";
20
28
  /** Safe domain error: message and code never include upstream bodies or secrets. */
21
29
  export declare class IntegrationError extends Error {
22
30
  readonly code: IntegrationErrorCode;