@yadsh/dsh-qa-integrations 0.5.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (206) hide show
  1. package/README.md +636 -202
  2. package/compatibility.json +1 -1
  3. package/lib/broker.js +468 -9
  4. package/lib/broker.js.map +1 -1
  5. package/lib/client/bitrix24.js +67 -5
  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 +98 -129
  10. package/lib/client/confluence.js.map +1 -1
  11. package/lib/client/gitlab.js +41 -5
  12. package/lib/client/gitlab.js.map +1 -1
  13. package/lib/client/index.js +33 -11
  14. package/lib/client/index.js.map +1 -1
  15. package/lib/client/integrations.js +40 -3
  16. package/lib/client/integrations.js.map +1 -1
  17. package/lib/client/jira.js +96 -127
  18. package/lib/client/jira.js.map +1 -1
  19. package/lib/client/operator-card.js +537 -0
  20. package/lib/client/operator-card.js.map +1 -0
  21. package/lib/client/operator-controls.js +232 -0
  22. package/lib/client/operator-controls.js.map +1 -0
  23. package/lib/client/provider-card.js +138 -4
  24. package/lib/client/provider-card.js.map +1 -1
  25. package/lib/client/styles.js +68 -5
  26. package/lib/client/styles.js.map +1 -1
  27. package/lib/client/teamcity.js +31 -4
  28. package/lib/client/teamcity.js.map +1 -1
  29. package/lib/client/testit.js +101 -0
  30. package/lib/client/testit.js.map +1 -0
  31. package/lib/client/weblate.js +105 -0
  32. package/lib/client/weblate.js.map +1 -0
  33. package/lib/client.js +5214 -1054
  34. package/lib/client.js.map +1 -1
  35. package/lib/coerce.js +16 -7
  36. package/lib/coerce.js.map +1 -1
  37. package/lib/config.js +12 -0
  38. package/lib/config.js.map +1 -1
  39. package/lib/errors.js.map +1 -1
  40. package/lib/index.js +444 -57
  41. package/lib/index.js.map +1 -1
  42. package/lib/providers/bitrix24/catalog.js +151 -8
  43. package/lib/providers/bitrix24/catalog.js.map +1 -1
  44. package/lib/providers/bitrix24/config.js +87 -13
  45. package/lib/providers/bitrix24/config.js.map +1 -1
  46. package/lib/providers/bitrix24/credential-help.js +24 -0
  47. package/lib/providers/bitrix24/credential-help.js.map +1 -0
  48. package/lib/providers/bitrix24/index.js +122 -0
  49. package/lib/providers/bitrix24/index.js.map +1 -1
  50. package/lib/providers/bitrix24/operations.js +60 -1
  51. package/lib/providers/bitrix24/operations.js.map +1 -1
  52. package/lib/providers/bitrix24/tools.js +95 -3
  53. package/lib/providers/bitrix24/tools.js.map +1 -1
  54. package/lib/providers/confluence/catalog.js +51 -3
  55. package/lib/providers/confluence/catalog.js.map +1 -1
  56. package/lib/providers/confluence/credential-help.js +29 -0
  57. package/lib/providers/confluence/credential-help.js.map +1 -0
  58. package/lib/providers/confluence/index.js +302 -35
  59. package/lib/providers/confluence/index.js.map +1 -1
  60. package/lib/providers/confluence/operations.js +1 -1
  61. package/lib/providers/confluence/operations.js.map +1 -1
  62. package/lib/providers/gitlab/catalog.js +108 -15
  63. package/lib/providers/gitlab/catalog.js.map +1 -1
  64. package/lib/providers/gitlab/config.js +11 -3
  65. package/lib/providers/gitlab/config.js.map +1 -1
  66. package/lib/providers/gitlab/credential-help.js +33 -0
  67. package/lib/providers/gitlab/credential-help.js.map +1 -0
  68. package/lib/providers/gitlab/index.js +337 -6
  69. package/lib/providers/gitlab/index.js.map +1 -1
  70. package/lib/providers/jira/catalog.js +73 -3
  71. package/lib/providers/jira/catalog.js.map +1 -1
  72. package/lib/providers/jira/credential-help.js +31 -0
  73. package/lib/providers/jira/credential-help.js.map +1 -0
  74. package/lib/providers/jira/index.js +275 -12
  75. package/lib/providers/jira/index.js.map +1 -1
  76. package/lib/providers/registry.js +4 -0
  77. package/lib/providers/registry.js.map +1 -1
  78. package/lib/providers/shared/credential-help.js +29 -0
  79. package/lib/providers/shared/credential-help.js.map +1 -0
  80. package/lib/providers/shared/service-boundary.js +44 -0
  81. package/lib/providers/shared/service-boundary.js.map +1 -0
  82. package/lib/providers/teamcity/catalog.js +56 -2
  83. package/lib/providers/teamcity/catalog.js.map +1 -1
  84. package/lib/providers/teamcity/credential-help.js +25 -0
  85. package/lib/providers/teamcity/credential-help.js.map +1 -0
  86. package/lib/providers/teamcity/index.js +254 -2
  87. package/lib/providers/teamcity/index.js.map +1 -1
  88. package/lib/providers/testit/attachments.js +131 -0
  89. package/lib/providers/testit/attachments.js.map +1 -0
  90. package/lib/providers/testit/catalog.js +302 -0
  91. package/lib/providers/testit/catalog.js.map +1 -0
  92. package/lib/providers/testit/config.js +175 -0
  93. package/lib/providers/testit/config.js.map +1 -0
  94. package/lib/providers/testit/credential-help.js +29 -0
  95. package/lib/providers/testit/credential-help.js.map +1 -0
  96. package/lib/providers/testit/index.js +458 -0
  97. package/lib/providers/testit/index.js.map +1 -0
  98. package/lib/providers/testit/operations.js +1070 -0
  99. package/lib/providers/testit/operations.js.map +1 -0
  100. package/lib/providers/testit/tools.js +717 -0
  101. package/lib/providers/testit/tools.js.map +1 -0
  102. package/lib/providers/testit/transport.js +158 -0
  103. package/lib/providers/testit/transport.js.map +1 -0
  104. package/lib/providers/weblate/catalog.js +279 -0
  105. package/lib/providers/weblate/catalog.js.map +1 -0
  106. package/lib/providers/weblate/config.js +147 -0
  107. package/lib/providers/weblate/config.js.map +1 -0
  108. package/lib/providers/weblate/credential-help.js +26 -0
  109. package/lib/providers/weblate/credential-help.js.map +1 -0
  110. package/lib/providers/weblate/index.js +419 -0
  111. package/lib/providers/weblate/index.js.map +1 -0
  112. package/lib/providers/weblate/operations.js +703 -0
  113. package/lib/providers/weblate/operations.js.map +1 -0
  114. package/lib/providers/weblate/query.js +80 -0
  115. package/lib/providers/weblate/query.js.map +1 -0
  116. package/lib/providers/weblate/tools.js +408 -0
  117. package/lib/providers/weblate/tools.js.map +1 -0
  118. package/lib/providers/weblate/transport.js +179 -0
  119. package/lib/providers/weblate/transport.js.map +1 -0
  120. package/lib/repository.js +197 -13
  121. package/lib/repository.js.map +1 -1
  122. package/lib/service-credentials/config.js +179 -0
  123. package/lib/service-credentials/config.js.map +1 -0
  124. package/lib/service-credentials/policy.js +92 -0
  125. package/lib/service-credentials/policy.js.map +1 -0
  126. package/lib/service-credentials/registry.js +142 -0
  127. package/lib/service-credentials/registry.js.map +1 -0
  128. package/lib/service-credentials/state.js +30 -0
  129. package/lib/service-credentials/state.js.map +1 -0
  130. package/lib/service-credentials/types.js +20 -0
  131. package/lib/service-credentials/types.js.map +1 -0
  132. package/lib/shared/settings.js +8 -13
  133. package/lib/shared/settings.js.map +1 -1
  134. package/lib/tools.js +27 -2
  135. package/lib/tools.js.map +1 -1
  136. package/lib/typert.host.js +1340 -100
  137. package/lib/typert.remote-client.d.ts +45 -11
  138. package/lib/typert.remote-client.js +1101 -38
  139. package/lib/types/broker.d.ts +79 -5
  140. package/lib/types/client/bitrix24.d.ts +24 -2
  141. package/lib/types/client/card.d.ts +3 -1
  142. package/lib/types/client/confluence.d.ts +19 -3
  143. package/lib/types/client/gitlab.d.ts +15 -2
  144. package/lib/types/client/index.d.ts +7 -5
  145. package/lib/types/client/integrations.d.ts +12 -3
  146. package/lib/types/client/jira.d.ts +20 -3
  147. package/lib/types/client/operator-card.d.ts +22 -0
  148. package/lib/types/client/operator-controls.d.ts +135 -0
  149. package/lib/types/client/provider-card.d.ts +50 -8
  150. package/lib/types/client/styles.d.ts +4 -3
  151. package/lib/types/client/teamcity.d.ts +15 -2
  152. package/lib/types/client/testit.d.ts +28 -0
  153. package/lib/types/client/weblate.d.ts +28 -0
  154. package/lib/types/coerce.d.ts +2 -2
  155. package/lib/types/config.d.ts +21 -0
  156. package/lib/types/errors.d.ts +9 -1
  157. package/lib/types/index.d.ts +183 -18
  158. package/lib/types/providers/bitrix24/catalog.d.ts +9 -1
  159. package/lib/types/providers/bitrix24/config.d.ts +23 -22
  160. package/lib/types/providers/bitrix24/credential-help.d.ts +8 -0
  161. package/lib/types/providers/bitrix24/index.d.ts +41 -1
  162. package/lib/types/providers/bitrix24/tools.d.ts +4 -0
  163. package/lib/types/providers/confluence/catalog.d.ts +11 -3
  164. package/lib/types/providers/confluence/credential-help.d.ts +9 -0
  165. package/lib/types/providers/confluence/index.d.ts +66 -7
  166. package/lib/types/providers/confluence/operations.d.ts +2 -0
  167. package/lib/types/providers/contract.d.ts +62 -1
  168. package/lib/types/providers/gitlab/catalog.d.ts +20 -5
  169. package/lib/types/providers/gitlab/config.d.ts +14 -3
  170. package/lib/types/providers/gitlab/credential-help.d.ts +9 -0
  171. package/lib/types/providers/gitlab/index.d.ts +51 -1
  172. package/lib/types/providers/jira/catalog.d.ts +13 -0
  173. package/lib/types/providers/jira/credential-help.d.ts +8 -0
  174. package/lib/types/providers/jira/index.d.ts +53 -1
  175. package/lib/types/providers/registry.d.ts +2 -0
  176. package/lib/types/providers/shared/credential-help.d.ts +17 -0
  177. package/lib/types/providers/shared/service-boundary.d.ts +25 -0
  178. package/lib/types/providers/teamcity/catalog.d.ts +18 -2
  179. package/lib/types/providers/teamcity/credential-help.d.ts +8 -0
  180. package/lib/types/providers/teamcity/index.d.ts +53 -2
  181. package/lib/types/providers/testit/attachments.d.ts +20 -0
  182. package/lib/types/providers/testit/catalog.d.ts +87 -0
  183. package/lib/types/providers/testit/config.d.ts +61 -0
  184. package/lib/types/providers/testit/credential-help.d.ts +8 -0
  185. package/lib/types/providers/testit/index.d.ts +119 -0
  186. package/lib/types/providers/testit/operations.d.ts +95 -0
  187. package/lib/types/providers/testit/tools.d.ts +15 -0
  188. package/lib/types/providers/testit/transport.d.ts +67 -0
  189. package/lib/types/providers/weblate/catalog.d.ts +60 -0
  190. package/lib/types/providers/weblate/config.d.ts +57 -0
  191. package/lib/types/providers/weblate/credential-help.d.ts +9 -0
  192. package/lib/types/providers/weblate/index.d.ts +92 -0
  193. package/lib/types/providers/weblate/operations.d.ts +77 -0
  194. package/lib/types/providers/weblate/query.d.ts +37 -0
  195. package/lib/types/providers/weblate/tools.d.ts +15 -0
  196. package/lib/types/providers/weblate/transport.d.ts +60 -0
  197. package/lib/types/repository.d.ts +38 -3
  198. package/lib/types/service-credentials/config.d.ts +73 -0
  199. package/lib/types/service-credentials/policy.d.ts +44 -0
  200. package/lib/types/service-credentials/registry.d.ts +43 -0
  201. package/lib/types/service-credentials/state.d.ts +14 -0
  202. package/lib/types/service-credentials/types.d.ts +97 -0
  203. package/lib/types/shared/settings.d.ts +8 -13
  204. package/lib/types/tools.d.ts +10 -1
  205. package/lib/types/types.d.ts +114 -10
  206. package/package.json +7 -7
package/lib/index.js CHANGED
@@ -33,33 +33,30 @@ var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn,
33
33
  done = true;
34
34
  };
35
35
  import { Remote, TypertRemoteService } from "@deepseek-ai/dsh-typert-protocol";
36
- import z from "@deepseek-ai/schemastery";
37
36
  import { createHostLoggerSink, getPluginLogger, } from "@yadsh/dsh-plugin-log";
38
37
  import { IntegrationBroker } from "./broker.js";
39
38
  import { ConfigSchema, resolveConfig, } from "./config.js";
39
+ import { QA_INTEGRATIONS_SETTINGS_NAMESPACE } from "./shared/settings.js";
40
40
  import { IntegrationError, publicIntegrationError } from "./errors.js";
41
41
  import Bitrix24Provider from "./providers/bitrix24/index.js";
42
42
  import ConfluenceProvider from "./providers/confluence/index.js";
43
+ import { GITLAB_CI_SPLIT_CAPABILITIES, GITLAB_LEGACY_CI_CAPABILITY, } from "./providers/gitlab/catalog.js";
43
44
  import GitlabProvider from "./providers/gitlab/index.js";
44
45
  import JiraProvider from "./providers/jira/index.js";
45
46
  import { IntegrationProviderRegistry } from "./providers/registry.js";
46
47
  import TeamcityProvider from "./providers/teamcity/index.js";
47
48
  import { networkAllowsNothing } from "./providers/teamcity/config.js";
49
+ import { TEAMCITY_INSTANCE_ID } from "./providers/teamcity/catalog.js";
50
+ import TestitProvider from "./providers/testit/index.js";
51
+ import WeblateProvider from "./providers/weblate/index.js";
48
52
  import { IntegrationRepository } from "./repository.js";
49
53
  import { DockerSecretKeyProvider } from "./secrets/key-provider.js";
50
54
  import { SecretStore } from "./secrets/secret-store.js";
51
- import { QA_INTEGRATIONS_SETTINGS_NAMESPACE } from "./shared/settings.js";
52
- import { createIntegrationTools, INTEGRATION_TOOL_NAMES } from "./tools.js";
55
+ import { ServiceCredentialRegistry } from "./service-credentials/registry.js";
56
+ import { createIntegrationTools, integrationToolNames } from "./tools.js";
53
57
  export const name = "dsh-qa-integrations";
54
58
  export const inject = ["qaSurface", "tools"];
55
59
  export const Config = ConfigSchema;
56
- /**
57
- * Schema of the mount-only settings section. The Plugins tab dispatches a card
58
- * by the namespace its Host serves, so serving it is what puts the Integrations
59
- * card in "Plugin configuration"; the section itself holds nothing an operator
60
- * could edit, for the reason spelled out in `shared/settings.ts`.
61
- */
62
- const MOUNT_SECTION_SCHEMA = z.object({});
63
60
  /** What the settings client needs to render a provider it has never seen. */
64
61
  function providerSummary(provider) {
65
62
  return {
@@ -68,6 +65,7 @@ function providerSummary(provider) {
68
65
  enabled: true,
69
66
  authModes: ["token"],
70
67
  capabilities: provider.capabilities,
68
+ credentialHelp: provider.credentialHelp,
71
69
  };
72
70
  }
73
71
  /** The `.json` sibling of a `.db` path: what a deployment upgraded from. */
@@ -85,6 +83,7 @@ let QaIntegrations = (() => {
85
83
  let _list_decorators;
86
84
  let _getBitrix24_decorators;
87
85
  let _putBitrix24Credential_decorators;
86
+ let _bitrix24Instances_decorators;
88
87
  let _testBitrix24_decorators;
89
88
  let _patchBitrix24Policy_decorators;
90
89
  let _disconnectBitrix24_decorators;
@@ -112,6 +111,22 @@ let QaIntegrations = (() => {
112
111
  let _testJira_decorators;
113
112
  let _patchJiraPolicy_decorators;
114
113
  let _disconnectJira_decorators;
114
+ let _testitInstances_decorators;
115
+ let _getTestit_decorators;
116
+ let _putTestitCredential_decorators;
117
+ let _testTestit_decorators;
118
+ let _patchTestitPolicy_decorators;
119
+ let _disconnectTestit_decorators;
120
+ let _weblateInstances_decorators;
121
+ let _getWeblate_decorators;
122
+ let _putWeblateCredential_decorators;
123
+ let _testWeblate_decorators;
124
+ let _patchWeblatePolicy_decorators;
125
+ let _disconnectWeblate_decorators;
126
+ let _managedServiceCredentials_decorators;
127
+ let _credentialSource_decorators;
128
+ let _serviceBoundary_decorators;
129
+ let _serviceHealth_decorators;
115
130
  return class QaIntegrations extends _classSuper {
116
131
  static {
117
132
  const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
@@ -120,6 +135,7 @@ let QaIntegrations = (() => {
120
135
  _list_decorators = [Remote("list")];
121
136
  _getBitrix24_decorators = [Remote("getBitrix24")];
122
137
  _putBitrix24Credential_decorators = [Remote("putBitrix24Credential")];
138
+ _bitrix24Instances_decorators = [Remote("bitrix24Instances")];
123
139
  _testBitrix24_decorators = [Remote("testBitrix24")];
124
140
  _patchBitrix24Policy_decorators = [Remote("patchBitrix24Policy")];
125
141
  _disconnectBitrix24_decorators = [Remote("disconnectBitrix24")];
@@ -147,11 +163,28 @@ let QaIntegrations = (() => {
147
163
  _testJira_decorators = [Remote("testJira")];
148
164
  _patchJiraPolicy_decorators = [Remote("patchJiraPolicy")];
149
165
  _disconnectJira_decorators = [Remote("disconnectJira")];
166
+ _testitInstances_decorators = [Remote("testitInstances")];
167
+ _getTestit_decorators = [Remote("getTestit")];
168
+ _putTestitCredential_decorators = [Remote("putTestitCredential")];
169
+ _testTestit_decorators = [Remote("testTestit")];
170
+ _patchTestitPolicy_decorators = [Remote("patchTestitPolicy")];
171
+ _disconnectTestit_decorators = [Remote("disconnectTestit")];
172
+ _weblateInstances_decorators = [Remote("weblateInstances")];
173
+ _getWeblate_decorators = [Remote("getWeblate")];
174
+ _putWeblateCredential_decorators = [Remote("putWeblateCredential")];
175
+ _testWeblate_decorators = [Remote("testWeblate")];
176
+ _patchWeblatePolicy_decorators = [Remote("patchWeblatePolicy")];
177
+ _disconnectWeblate_decorators = [Remote("disconnectWeblate")];
178
+ _managedServiceCredentials_decorators = [Remote("managedServiceCredentials")];
179
+ _credentialSource_decorators = [Remote("credentialSource")];
180
+ _serviceBoundary_decorators = [Remote("serviceBoundary")];
181
+ _serviceHealth_decorators = [Remote("serviceHealth")];
150
182
  __esDecorate(this, null, _describe_decorators, { kind: "method", name: "describe", static: false, private: false, access: { has: obj => "describe" in obj, get: obj => obj.describe }, metadata: _metadata }, null, _instanceExtraInitializers);
151
183
  __esDecorate(this, null, _providers_decorators, { kind: "method", name: "providers", static: false, private: false, access: { has: obj => "providers" in obj, get: obj => obj.providers }, metadata: _metadata }, null, _instanceExtraInitializers);
152
184
  __esDecorate(this, null, _list_decorators, { kind: "method", name: "list", static: false, private: false, access: { has: obj => "list" in obj, get: obj => obj.list }, metadata: _metadata }, null, _instanceExtraInitializers);
153
185
  __esDecorate(this, null, _getBitrix24_decorators, { kind: "method", name: "getBitrix24", static: false, private: false, access: { has: obj => "getBitrix24" in obj, get: obj => obj.getBitrix24 }, metadata: _metadata }, null, _instanceExtraInitializers);
154
186
  __esDecorate(this, null, _putBitrix24Credential_decorators, { kind: "method", name: "putBitrix24Credential", static: false, private: false, access: { has: obj => "putBitrix24Credential" in obj, get: obj => obj.putBitrix24Credential }, metadata: _metadata }, null, _instanceExtraInitializers);
187
+ __esDecorate(this, null, _bitrix24Instances_decorators, { kind: "method", name: "bitrix24Instances", static: false, private: false, access: { has: obj => "bitrix24Instances" in obj, get: obj => obj.bitrix24Instances }, metadata: _metadata }, null, _instanceExtraInitializers);
155
188
  __esDecorate(this, null, _testBitrix24_decorators, { kind: "method", name: "testBitrix24", static: false, private: false, access: { has: obj => "testBitrix24" in obj, get: obj => obj.testBitrix24 }, metadata: _metadata }, null, _instanceExtraInitializers);
156
189
  __esDecorate(this, null, _patchBitrix24Policy_decorators, { kind: "method", name: "patchBitrix24Policy", static: false, private: false, access: { has: obj => "patchBitrix24Policy" in obj, get: obj => obj.patchBitrix24Policy }, metadata: _metadata }, null, _instanceExtraInitializers);
157
190
  __esDecorate(this, null, _disconnectBitrix24_decorators, { kind: "method", name: "disconnectBitrix24", static: false, private: false, access: { has: obj => "disconnectBitrix24" in obj, get: obj => obj.disconnectBitrix24 }, metadata: _metadata }, null, _instanceExtraInitializers);
@@ -179,36 +212,125 @@ let QaIntegrations = (() => {
179
212
  __esDecorate(this, null, _testJira_decorators, { kind: "method", name: "testJira", static: false, private: false, access: { has: obj => "testJira" in obj, get: obj => obj.testJira }, metadata: _metadata }, null, _instanceExtraInitializers);
180
213
  __esDecorate(this, null, _patchJiraPolicy_decorators, { kind: "method", name: "patchJiraPolicy", static: false, private: false, access: { has: obj => "patchJiraPolicy" in obj, get: obj => obj.patchJiraPolicy }, metadata: _metadata }, null, _instanceExtraInitializers);
181
214
  __esDecorate(this, null, _disconnectJira_decorators, { kind: "method", name: "disconnectJira", static: false, private: false, access: { has: obj => "disconnectJira" in obj, get: obj => obj.disconnectJira }, metadata: _metadata }, null, _instanceExtraInitializers);
215
+ __esDecorate(this, null, _testitInstances_decorators, { kind: "method", name: "testitInstances", static: false, private: false, access: { has: obj => "testitInstances" in obj, get: obj => obj.testitInstances }, metadata: _metadata }, null, _instanceExtraInitializers);
216
+ __esDecorate(this, null, _getTestit_decorators, { kind: "method", name: "getTestit", static: false, private: false, access: { has: obj => "getTestit" in obj, get: obj => obj.getTestit }, metadata: _metadata }, null, _instanceExtraInitializers);
217
+ __esDecorate(this, null, _putTestitCredential_decorators, { kind: "method", name: "putTestitCredential", static: false, private: false, access: { has: obj => "putTestitCredential" in obj, get: obj => obj.putTestitCredential }, metadata: _metadata }, null, _instanceExtraInitializers);
218
+ __esDecorate(this, null, _testTestit_decorators, { kind: "method", name: "testTestit", static: false, private: false, access: { has: obj => "testTestit" in obj, get: obj => obj.testTestit }, metadata: _metadata }, null, _instanceExtraInitializers);
219
+ __esDecorate(this, null, _patchTestitPolicy_decorators, { kind: "method", name: "patchTestitPolicy", static: false, private: false, access: { has: obj => "patchTestitPolicy" in obj, get: obj => obj.patchTestitPolicy }, metadata: _metadata }, null, _instanceExtraInitializers);
220
+ __esDecorate(this, null, _disconnectTestit_decorators, { kind: "method", name: "disconnectTestit", static: false, private: false, access: { has: obj => "disconnectTestit" in obj, get: obj => obj.disconnectTestit }, metadata: _metadata }, null, _instanceExtraInitializers);
221
+ __esDecorate(this, null, _weblateInstances_decorators, { kind: "method", name: "weblateInstances", static: false, private: false, access: { has: obj => "weblateInstances" in obj, get: obj => obj.weblateInstances }, metadata: _metadata }, null, _instanceExtraInitializers);
222
+ __esDecorate(this, null, _getWeblate_decorators, { kind: "method", name: "getWeblate", static: false, private: false, access: { has: obj => "getWeblate" in obj, get: obj => obj.getWeblate }, metadata: _metadata }, null, _instanceExtraInitializers);
223
+ __esDecorate(this, null, _putWeblateCredential_decorators, { kind: "method", name: "putWeblateCredential", static: false, private: false, access: { has: obj => "putWeblateCredential" in obj, get: obj => obj.putWeblateCredential }, metadata: _metadata }, null, _instanceExtraInitializers);
224
+ __esDecorate(this, null, _testWeblate_decorators, { kind: "method", name: "testWeblate", static: false, private: false, access: { has: obj => "testWeblate" in obj, get: obj => obj.testWeblate }, metadata: _metadata }, null, _instanceExtraInitializers);
225
+ __esDecorate(this, null, _patchWeblatePolicy_decorators, { kind: "method", name: "patchWeblatePolicy", static: false, private: false, access: { has: obj => "patchWeblatePolicy" in obj, get: obj => obj.patchWeblatePolicy }, metadata: _metadata }, null, _instanceExtraInitializers);
226
+ __esDecorate(this, null, _disconnectWeblate_decorators, { kind: "method", name: "disconnectWeblate", static: false, private: false, access: { has: obj => "disconnectWeblate" in obj, get: obj => obj.disconnectWeblate }, metadata: _metadata }, null, _instanceExtraInitializers);
227
+ __esDecorate(this, null, _managedServiceCredentials_decorators, { kind: "method", name: "managedServiceCredentials", static: false, private: false, access: { has: obj => "managedServiceCredentials" in obj, get: obj => obj.managedServiceCredentials }, metadata: _metadata }, null, _instanceExtraInitializers);
228
+ __esDecorate(this, null, _credentialSource_decorators, { kind: "method", name: "credentialSource", static: false, private: false, access: { has: obj => "credentialSource" in obj, get: obj => obj.credentialSource }, metadata: _metadata }, null, _instanceExtraInitializers);
229
+ __esDecorate(this, null, _serviceBoundary_decorators, { kind: "method", name: "serviceBoundary", static: false, private: false, access: { has: obj => "serviceBoundary" in obj, get: obj => obj.serviceBoundary }, metadata: _metadata }, null, _instanceExtraInitializers);
230
+ __esDecorate(this, null, _serviceHealth_decorators, { kind: "method", name: "serviceHealth", static: false, private: false, access: { has: obj => "serviceHealth" in obj, get: obj => obj.serviceHealth }, metadata: _metadata }, null, _instanceExtraInitializers);
182
231
  if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
183
232
  }
184
233
  static inject = inject;
185
234
  static Config = ConfigSchema;
186
235
  broker = __runInitializers(this, _instanceExtraInitializers);
187
236
  logger;
188
- enabled;
189
- providerSummaries;
190
- configuredInstances;
237
+ owner;
238
+ enabled = false;
239
+ /** Providers by id; the service-credential registry resolves through them. */
240
+ providerRegistry = new IntegrationProviderRegistry();
241
+ /** Absent unless the deployment configured managed service credentials. */
242
+ serviceCredentials;
243
+ defaultForNewConnections = true;
244
+ providerSummaries = [];
245
+ configuredInstances = [];
191
246
  /** The Confluence sites this deployment dials, for the connect form. */
192
- configuredConfluenceSites;
247
+ configuredConfluenceSites = [];
193
248
  /** The Jira Cloud sites this deployment allows, in config order. */
194
- configuredJiraSites;
249
+ configuredJiraSites = [];
195
250
  /** The TeamCity server this deployment dials, or null when it mounts none. */
196
- configuredServer;
251
+ configuredServer = null;
252
+ /** The Test IT installations this deployment allows, in config order. */
253
+ configuredTestitInstances = [];
254
+ /** The Weblate instances this deployment allows, in config order. */
255
+ configuredWeblateInstances = [];
256
+ /** The Bitrix24 portals this deployment allows, in config order. */
257
+ configuredBitrix24Portals = [];
258
+ /**
259
+ * The composition row the Host resolved at load. It stays the base of the
260
+ * settings section, and the configuration source until the namespace takes
261
+ * over, so a deployment without a settings provider keeps booting on it.
262
+ */
263
+ entryConfig;
264
+ /** Where the live configuration is read from; the settings namespace swaps this. */
265
+ configSource;
266
+ /**
267
+ * The connection store and its key live for the whole process: connections
268
+ * and wrapped secrets belong to the boot path, and only derivations of the
269
+ * configuration re-apply while running.
270
+ */
271
+ repository;
272
+ secrets;
273
+ bootDataPath;
274
+ bootMasterKeyPath;
275
+ bootMasterKeyVersion;
276
+ /** Removers of the currently mounted admission and tool registrations. */
277
+ toolRemovers = [];
278
+ /** The mounted tool-name list; an unchanged signature never re-registers. */
279
+ toolsKey = "";
197
280
  constructor(ctx, rawConfig = {}) {
198
281
  super(ctx, "qaIntegrations", { namespace: "qaIntegrations" });
199
- const config = resolveConfig(rawConfig);
200
- this.enabled = config.enabled;
282
+ this.owner = ctx;
201
283
  this.logger = getPluginLogger({
202
284
  pluginId: "dsh-qa-integrations",
203
285
  consoleSink: createHostLoggerSink(ctx.logger),
204
286
  });
205
- const repository = new IntegrationRepository(config.dataPath, {
206
- auditRetentionDays: config.auditRetentionDays,
287
+ this.entryConfig = structuredClone(rawConfig);
288
+ this.configSource = () => this.entryConfig;
289
+ const boot = resolveConfig(rawConfig);
290
+ const repository = new IntegrationRepository(boot.dataPath, {
291
+ auditRetentionDays: boot.auditRetentionDays,
207
292
  });
208
293
  // A deployment upgrading from the JSON store keeps its connections: the
209
294
  // file is imported, verified and renamed aside before the broker serves.
210
- repository.importLegacyFile(legacySiblingOf(config.dataPath));
211
- const secrets = new SecretStore(new DockerSecretKeyProvider(config.masterKeyPath, config.masterKeyVersion));
295
+ repository.importLegacyFile(legacySiblingOf(boot.dataPath));
296
+ // A provider that split one capability into two names the pair here; the
297
+ // store stays provider-agnostic and the composition root is where the
298
+ // knowledge of a provider belongs.
299
+ repository.expandCapabilities({
300
+ [GITLAB_LEGACY_CI_CAPABILITY]: GITLAB_CI_SPLIT_CAPABILITIES,
301
+ });
302
+ this.repository = repository;
303
+ this.secrets = new SecretStore(new DockerSecretKeyProvider(boot.masterKeyPath, boot.masterKeyVersion));
304
+ this.bootDataPath = boot.dataPath;
305
+ this.bootMasterKeyPath = boot.masterKeyPath;
306
+ this.bootMasterKeyVersion = boot.masterKeyVersion;
307
+ this.broker = new IntegrationBroker(repository, this.secrets, new IntegrationProviderRegistry(), this.logger, {});
308
+ this.applyConfig(boot);
309
+ this.installSettings();
310
+ ctx.effect(() => () => {
311
+ for (const remove of this.toolRemovers)
312
+ remove();
313
+ this.toolRemovers = [];
314
+ }, "dsh-qa-integrations.tools");
315
+ ctx.effect(() => async () => this.logger.close(), "dsh-qa-integrations.logger");
316
+ }
317
+ /**
318
+ * Rebuild every configuration-derived surface: the provider registry, the
319
+ * deployment instance lists, the service-credential registry and the tool
320
+ * mount. The store and its key do not travel here — connections and wrapped
321
+ * secrets belong to the boot path, and a card edit that re-points them is
322
+ * answered with a warning instead of a live reopen.
323
+ */
324
+ applyConfig(config) {
325
+ this.enabled = config.enabled;
326
+ if (config.dataPath !== this.bootDataPath ||
327
+ config.masterKeyPath !== this.bootMasterKeyPath ||
328
+ config.masterKeyVersion !== this.bootMasterKeyVersion) {
329
+ this.logger.warn("config.store-path-needs-restart", {
330
+ dataPath: config.dataPath,
331
+ masterKeyPath: config.masterKeyPath,
332
+ });
333
+ }
212
334
  const providers = new IntegrationProviderRegistry();
213
335
  if (config.bitrix24.enabled) {
214
336
  providers.register(new Bitrix24Provider(config));
@@ -225,6 +347,32 @@ let QaIntegrations = (() => {
225
347
  if (config.jira.enabled) {
226
348
  providers.register(new JiraProvider(config));
227
349
  }
350
+ if (config.testit.enabled) {
351
+ providers.register(new TestitProvider(config));
352
+ }
353
+ if (config.weblate.enabled) {
354
+ providers.register(new WeblateProvider(config));
355
+ }
356
+ this.providerRegistry = providers;
357
+ this.defaultForNewConnections =
358
+ config.managedServiceCredentials.defaultForNewConnections;
359
+ // Profiles are resolved to a portal here, at apply time: deployment
360
+ // configuration that names a provider instance nobody configured fails
361
+ // loudly instead of leaving users with a checkbox that cannot work.
362
+ this.serviceCredentials = config.managedServiceCredentials.enabled
363
+ ? new ServiceCredentialRegistry(config.managedServiceCredentials, (providerId, instanceId) => {
364
+ const provider = providers.find(providerId);
365
+ if (provider === undefined) {
366
+ throw new Error(`qa-integrations managed service credentials: a profile names provider "${providerId}", which this deployment does not enable`);
367
+ }
368
+ try {
369
+ return provider.instancePortal?.(instanceId);
370
+ }
371
+ catch {
372
+ return undefined;
373
+ }
374
+ })
375
+ : undefined;
228
376
  this.providerSummaries = this.enabled
229
377
  ? providers.list().map(providerSummary)
230
378
  : [];
@@ -233,6 +381,7 @@ let QaIntegrations = (() => {
233
381
  id: instance.id,
234
382
  label: instance.label,
235
383
  baseUrl: instance.baseUrl,
384
+ service: this.serviceBinding("confluence", instance.id),
236
385
  }))
237
386
  : [];
238
387
  this.configuredInstances = config.gitlab.enabled
@@ -240,6 +389,7 @@ let QaIntegrations = (() => {
240
389
  id: instance.id,
241
390
  label: instance.label,
242
391
  baseUrl: instance.baseUrl,
392
+ service: this.serviceBinding("gitlab", instance.id),
243
393
  }))
244
394
  : [];
245
395
  this.configuredJiraSites = config.jira.enabled
@@ -247,38 +397,49 @@ let QaIntegrations = (() => {
247
397
  id: site.id,
248
398
  label: site.label,
249
399
  baseUrl: site.baseUrl,
400
+ service: this.serviceBinding("jira", site.id),
401
+ }))
402
+ : [];
403
+ this.configuredTestitInstances = config.testit.enabled
404
+ ? config.testit.instances.map((instance) => ({
405
+ id: instance.id,
406
+ label: instance.label,
407
+ baseUrl: instance.baseUrl,
408
+ service: this.serviceBinding("testit", instance.id),
409
+ }))
410
+ : [];
411
+ // The portal a Bitrix24 connection answers on is a hostname, not a URL —
412
+ // the same shape a webhook URL reports, so profile and connection match.
413
+ this.configuredBitrix24Portals = config.bitrix24.enabled
414
+ ? config.bitrix24.instances.map((instance) => ({
415
+ id: instance.id,
416
+ label: instance.label,
417
+ baseUrl: instance.portal,
418
+ service: this.serviceBinding("bitrix24", instance.id),
250
419
  }))
251
420
  : [];
252
421
  this.configuredServer =
253
422
  config.teamcity.enabled && config.teamcity.serverUrl !== ""
254
423
  ? {
255
- id: "teamcity",
424
+ id: TEAMCITY_INSTANCE_ID,
256
425
  label: new URL(config.teamcity.serverUrl).host,
257
426
  baseUrl: config.teamcity.serverUrl,
427
+ service: this.serviceBinding("teamcity", TEAMCITY_INSTANCE_ID),
258
428
  }
259
429
  : null;
260
- this.broker = new IntegrationBroker(repository, secrets, providers, this.logger);
261
- // Serving the namespace is what lets the browser half mount its card; the
262
- // section carries no editable value and therefore no live source.
263
- ctx.inject(["settings"], (settingsCtx) => {
264
- settingsCtx.settings.installSection(ctx, QA_INTEGRATIONS_SETTINGS_NAMESPACE, MOUNT_SECTION_SCHEMA, {}, { setSource: () => undefined, onChange: () => undefined });
265
- });
266
- if (config.enabled) {
267
- const removeAdmission = ctx.qaSurface.registerPrincipalScopedTools(INTEGRATION_TOOL_NAMES);
268
- const removers = createIntegrationTools({
269
- broker: this.broker,
270
- principalForSession: (sessionId) => ctx.qaSurface.principalForSession(sessionId),
271
- }).map((definition) => ctx.tools.register(definition));
272
- ctx.effect(() => () => {
273
- for (const remove of removers.reverse())
274
- remove();
275
- removeAdmission();
276
- }, "dsh-qa-integrations.tools");
277
- }
278
- ctx.effect(() => async () => this.logger.close(), "dsh-qa-integrations.logger");
279
- this.logger.info(config.enabled ? "plugin.ready" : "plugin.disabled", {
280
- tools: config.enabled ? [...INTEGRATION_TOOL_NAMES] : [],
281
- });
430
+ this.configuredWeblateInstances = config.weblate.enabled
431
+ ? config.weblate.instances.map((instance) => ({
432
+ id: instance.id,
433
+ label: instance.label,
434
+ baseUrl: instance.baseUrl,
435
+ service: this.serviceBinding("weblate", instance.id),
436
+ }))
437
+ : [];
438
+ // The broker is one object for the service's lifetime — the mounted tools
439
+ // close over it — so a fresh configuration is swapped in rather than
440
+ // mounted beside the old one.
441
+ this.broker.swap(providers, this.serviceCredentials, this.defaultForNewConnections);
442
+ this.syncTools(config);
282
443
  if (config.teamcity.enabled &&
283
444
  networkAllowsNothing(config.teamcity.network)) {
284
445
  // A TeamCity deployment whose address policy is empty refuses every
@@ -287,6 +448,99 @@ let QaIntegrations = (() => {
287
448
  hint: "set teamcity.network.allowedHosts or network.allowedCidrs",
288
449
  });
289
450
  }
451
+ for (const provider of providers.list()) {
452
+ for (const problem of provider.credentialHelpProblems ?? []) {
453
+ // A help address the deployment got wrong hides its own link and is
454
+ // reported here: the credential field keeps working, which is why this
455
+ // is a warning and not a load failure.
456
+ this.logger.warn("credential-help.override", {
457
+ provider: provider.id,
458
+ problem,
459
+ });
460
+ }
461
+ }
462
+ }
463
+ /**
464
+ * Mount the tools the configuration asks for. The mounted set changes only
465
+ * when the plugin or its one write capability flips, so an unrelated card
466
+ * edit never churns the Host tool registry.
467
+ */
468
+ syncTools(config) {
469
+ const toolOptions = {
470
+ bitrix24CrmCommentWrite: config.bitrix24.crmCommentWrite,
471
+ };
472
+ const names = config.enabled ? integrationToolNames(toolOptions) : [];
473
+ const signature = names.join(",");
474
+ if (signature === this.toolsKey)
475
+ return;
476
+ for (const remove of this.toolRemovers)
477
+ remove();
478
+ this.toolRemovers = [];
479
+ this.toolsKey = signature;
480
+ if (names.length === 0) {
481
+ this.logger.info("plugin.disabled", { tools: [] });
482
+ return;
483
+ }
484
+ const removeAdmission = this.owner.qaSurface.registerPrincipalScopedTools(names);
485
+ const removers = createIntegrationTools({
486
+ broker: this.broker,
487
+ principalForSession: (sessionId) => this.owner.qaSurface.principalForSession(sessionId),
488
+ ...toolOptions,
489
+ }).map((definition) => this.owner.tools.register(definition));
490
+ this.toolRemovers = [removeAdmission, ...removers];
491
+ this.logger.info("plugin.ready", { tools: [...names] });
492
+ }
493
+ /**
494
+ * Attach the settings namespace. The installed section becomes the plugin's
495
+ * configuration source, so an operator card edit re-applies the running
496
+ * service instead of waiting for a restart; without a settings provider the
497
+ * composition entry stays authoritative. The read is structural and optional:
498
+ * a Host without a mounted settings provider keeps this plugin fully working.
499
+ */
500
+ installSettings() {
501
+ this.owner.inject(["settings"], (settingsCtx) => {
502
+ const settings = settingsCtx.settings;
503
+ if (settings === undefined)
504
+ return;
505
+ settings.installSection(this.owner, QA_INTEGRATIONS_SETTINGS_NAMESPACE, ConfigSchema, this.entryConfig, {
506
+ setSource: (current) => {
507
+ this.configSource = current;
508
+ },
509
+ onChange: () => {
510
+ this.reapply();
511
+ },
512
+ // Constraints the schema alone cannot carry (a TeamCity host pattern
513
+ // that matches nothing, an instance list with a duplicate id) are
514
+ // refused at write time, so the card reports them instead of storing
515
+ // a configuration the resolvers would throw away at the next boot.
516
+ validate: (value) => {
517
+ resolveConfig(value);
518
+ },
519
+ });
520
+ });
521
+ }
522
+ /**
523
+ * Re-resolve the source after a committed settings change and rebuild what
524
+ * derives from it. A source the resolvers refuse keeps the running state:
525
+ * the settings provider validates on write, so this only covers a value
526
+ * that arrived through another path.
527
+ */
528
+ reapply() {
529
+ let next;
530
+ try {
531
+ next = resolveConfig(this.configSource());
532
+ }
533
+ catch (error) {
534
+ this.logger.warn("config.rejected", {
535
+ message: String(error.message),
536
+ });
537
+ return;
538
+ }
539
+ this.applyConfig(next);
540
+ this.logger.info("config.reloaded", {
541
+ enabled: next.enabled,
542
+ providers: this.providerSummaries.map((provider) => provider.id),
543
+ });
290
544
  }
291
545
  describe() {
292
546
  return {
@@ -304,7 +558,13 @@ let QaIntegrations = (() => {
304
558
  return this.run(token, (principal) => this.broker.summary(principal, "bitrix24"));
305
559
  }
306
560
  async putBitrix24Credential(token, input) {
307
- return this.runAsync(token, (principal) => this.broker.connect(principal, "bitrix24", input));
561
+ return this.runAsync(token, (principal) => this.broker.connect(principal, "bitrix24", {
562
+ token: input.token,
563
+ options: { instanceId: input.instanceId },
564
+ }, { useServiceCredential: input.useServiceCredential }));
565
+ }
566
+ bitrix24Instances(token) {
567
+ return this.run(token, () => this.configuredBitrix24Portals);
308
568
  }
309
569
  async testBitrix24(token) {
310
570
  return this.runAsync(token, (principal) => this.broker.validate(principal, "bitrix24"));
@@ -330,7 +590,7 @@ let QaIntegrations = (() => {
330
590
  return this.runAsync(token, (principal) => this.broker.connect(principal, "gitlab", {
331
591
  token: input.token,
332
592
  options: { instanceId: input.instanceId },
333
- }));
593
+ }, { useServiceCredential: input.useServiceCredential }));
334
594
  }
335
595
  async testGitlab(token) {
336
596
  return this.runAsync(token, (principal) => this.broker.validate(principal, "gitlab"));
@@ -361,7 +621,7 @@ let QaIntegrations = (() => {
361
621
  return this.runAsync(token, (principal) => this.broker.connect(principal, "confluence", {
362
622
  token: input.token,
363
623
  options: { instanceId: input.instanceId, email: input.email },
364
- }));
624
+ }, { useServiceCredential: input.useServiceCredential }));
365
625
  }
366
626
  async testConfluence(token) {
367
627
  return this.runAsync(token, (principal) => this.broker.validate(principal, "confluence"));
@@ -382,7 +642,7 @@ let QaIntegrations = (() => {
382
642
  * every call.
383
643
  */
384
644
  async putTeamcityCredential(token, input) {
385
- return this.runAsync(token, (principal) => this.broker.connect(principal, "teamcity", { token: input.token }));
645
+ return this.runAsync(token, (principal) => this.broker.connect(principal, "teamcity", { token: input.token }, { useServiceCredential: input.useServiceCredential }));
386
646
  }
387
647
  /**
388
648
  * The address the connect form shows next to the token field, or null when
@@ -417,8 +677,10 @@ let QaIntegrations = (() => {
417
677
  async putJiraCredential(token, input) {
418
678
  return this.runAsync(token, (principal) => this.broker.connect(principal, "jira", {
419
679
  token: input.token,
420
- options: { siteId: input.siteId, email: input.email },
421
- }));
680
+ // The broker resolves the profile by `instanceId`; Jira names its
681
+ // instances `siteId` on the wire.
682
+ options: { instanceId: input.siteId, email: input.email },
683
+ }, { useServiceCredential: input.useServiceCredential }));
422
684
  }
423
685
  async testJira(token) {
424
686
  return this.runAsync(token, (principal) => this.broker.validate(principal, "jira"));
@@ -429,6 +691,111 @@ let QaIntegrations = (() => {
429
691
  disconnectJira(token) {
430
692
  return this.run(token, (principal) => this.broker.disconnect(principal, "jira"));
431
693
  }
694
+ /**
695
+ * Installations this deployment allows. Like the GitLab instance list, the
696
+ * connect form picks from it and never takes a hostname: the Test IT address a
697
+ * token is spent against is operator configuration.
698
+ */
699
+ testitInstances(token) {
700
+ return this.run(token, () => this.configuredTestitInstances);
701
+ }
702
+ getTestit(token) {
703
+ return this.run(token, (principal) => this.broker.summary(principal, "testit"));
704
+ }
705
+ async putTestitCredential(token, input) {
706
+ return this.runAsync(token, (principal) => this.broker.connect(principal, "testit", {
707
+ token: input.token,
708
+ options: { instanceId: input.instanceId },
709
+ }, { useServiceCredential: input.useServiceCredential }));
710
+ }
711
+ async testTestit(token) {
712
+ return this.runAsync(token, (principal) => this.broker.validate(principal, "testit"));
713
+ }
714
+ patchTestitPolicy(token, patch) {
715
+ return this.run(token, (principal) => this.broker.patchPolicy(principal, "testit", patch));
716
+ }
717
+ disconnectTestit(token) {
718
+ return this.run(token, (principal) => this.broker.disconnect(principal, "testit"));
719
+ }
720
+ /**
721
+ * Instances this deployment allows. The connect form picks from this list and
722
+ * never takes a hostname, which is what keeps the broker from being pointed at
723
+ * an origin the operator did not configure.
724
+ */
725
+ weblateInstances(token) {
726
+ return this.run(token, () => this.configuredWeblateInstances);
727
+ }
728
+ getWeblate(token) {
729
+ return this.run(token, (principal) => this.broker.summary(principal, "weblate"));
730
+ }
731
+ async putWeblateCredential(token, input) {
732
+ return this.runAsync(token, (principal) => this.broker.connect(principal, "weblate", {
733
+ token: input.token,
734
+ options: { instanceId: input.instanceId },
735
+ }, { useServiceCredential: input.useServiceCredential }));
736
+ }
737
+ async testWeblate(token) {
738
+ return this.runAsync(token, (principal) => this.broker.validate(principal, "weblate"));
739
+ }
740
+ patchWeblatePolicy(token, patch) {
741
+ return this.run(token, (principal) => this.broker.patchPolicy(principal, "weblate", patch));
742
+ }
743
+ disconnectWeblate(token) {
744
+ return this.run(token, (principal) => this.broker.disconnect(principal, "weblate"));
745
+ }
746
+ /**
747
+ * Whether this deployment offers managed service credentials at all, and
748
+ * whether a new connection starts on one. Token-gated like every other card
749
+ * call: the answer describes the deployment, not the caller.
750
+ */
751
+ managedServiceCredentials(token) {
752
+ return this.run(token, () => ({
753
+ enabled: this.serviceCredentials !== undefined,
754
+ defaultForNewConnections: this.defaultForNewConnections,
755
+ }));
756
+ }
757
+ /**
758
+ * Switch one provider of the calling principal between their own credential
759
+ * and the deployment's. The provider id is validated against the registry, and
760
+ * the profile is resolved server-side, so no caller can name a credential.
761
+ */
762
+ async credentialSource(token, input) {
763
+ return this.runAsync(token, (principal) => this.broker.setCredentialSource(principal, input.provider, input.source));
764
+ }
765
+ /**
766
+ * Narrow what this connection may read inside the profile's allowlist. A
767
+ * selection outside that allowlist is dropped rather than stored, so this can
768
+ * only ever remove.
769
+ */
770
+ serviceBoundary(token, input) {
771
+ return this.run(token, (principal) => this.broker.setServiceSelection(principal, input.provider, input.selection));
772
+ }
773
+ /**
774
+ * Probe the managed credential of one provider instance. Answers a health
775
+ * status, never the secret and never the upstream identity it carries.
776
+ */
777
+ serviceHealth(token, input) {
778
+ return this.runAsync(token, () => this.broker.serviceCredentialHealth(input.provider, input.instanceId));
779
+ }
780
+ /** The safe alias of the managed credential bound to one instance, if any. */
781
+ serviceBinding(providerId, instanceId) {
782
+ const registry = this.serviceCredentials;
783
+ if (registry === undefined)
784
+ return null;
785
+ let portal;
786
+ try {
787
+ portal = this.providerRegistry
788
+ .find(providerId)
789
+ ?.instancePortal?.(instanceId);
790
+ }
791
+ catch {
792
+ return null;
793
+ }
794
+ if (portal === undefined || portal === "")
795
+ return null;
796
+ const profile = registry.find(providerId, portal);
797
+ return profile?.enabled === true ? { label: profile.label } : null;
798
+ }
432
799
  requirePrincipal(token) {
433
800
  if (!this.enabled) {
434
801
  throw new IntegrationError("ProviderUnavailable", "QA integrations are disabled");
@@ -460,14 +827,20 @@ let QaIntegrations = (() => {
460
827
  export { QaIntegrations };
461
828
  export { IntegrationBroker } from "./broker.js";
462
829
  export { ConfigSchema, resolveConfig, } from "./config.js";
830
+ export { MANAGED_SERVICE_CREDENTIALS_DEFAULTS, managedServiceCredentialsSchema, resolveManagedServiceCredentials, } from "./service-credentials/config.js";
831
+ export { evaluateServiceOperation, narrowBoundary, SERVICE_CEILING, } from "./service-credentials/policy.js";
832
+ export { ServiceCredentialRegistry } from "./service-credentials/registry.js";
833
+ export { operationCapabilityServiceState } from "./service-credentials/state.js";
834
+ export { profilePolicyRevision } from "./service-credentials/config.js";
835
+ export { CREDENTIAL_SOURCES, isCredentialSource, UNCLASSIFIED_OPERATION, } from "./service-credentials/types.js";
463
836
  export { IntegrationError } from "./errors.js";
464
837
  export { BITRIX_CAPABILITIES, BITRIX_OPERATIONS, BITRIX24_CAPABILITY_INFO, bitrix24OperationCapability, enabledCapabilities, } from "./providers/bitrix24/catalog.js";
465
838
  export { BITRIX24_DEFAULTS, bitrix24ConfigSchema, resolveBitrix24Config, } from "./providers/bitrix24/config.js";
466
839
  export { Bitrix24Provider, parseBitrixWebhook, } from "./providers/bitrix24/index.js";
467
840
  export { BITRIX_HANDLERS, BITRIX_PROJECTIONS, } from "./providers/bitrix24/operations.js";
468
841
  export { createBitrix24Tools, BITRIX24_TOOL_NAMES, } from "./providers/bitrix24/tools.js";
469
- export { GitlabProvider } from "./providers/gitlab/index.js";
470
- export { GITLAB_CAPABILITIES, GITLAB_CAPABILITY_INFO, GITLAB_OPERATIONS, capabilitiesForScopes, gitlabOperationCapability, } from "./providers/gitlab/catalog.js";
842
+ export { GitlabProvider, groupAllowed as gitlabGroupAllowed, projectAllowed as gitlabProjectAllowed, } from "./providers/gitlab/index.js";
843
+ export { GITLAB_CAPABILITIES, GITLAB_CAPABILITY_INFO, GITLAB_CI_SPLIT_CAPABILITIES, GITLAB_LEGACY_CI_CAPABILITY, GITLAB_OPERATIONS, GITLAB_RESOURCE_KIND, capabilitiesForScopes, gitlabOperationCapability, gitlabOperationMetadata, } from "./providers/gitlab/catalog.js";
471
844
  export { GITLAB_DEFAULTS, gitlabConfigSchema, resolveGitlabConfig, } from "./providers/gitlab/config.js";
472
845
  export { createGitlabTools, GITLAB_TOOL_NAMES, } from "./providers/gitlab/tools.js";
473
846
  export { GitlabTransport, credentialFromPlaintext as gitlabCredentialFromPlaintext, credentialInstance, } from "./providers/gitlab/transport.js";
@@ -480,8 +853,8 @@ export { buildCql, cqlLiteral, CONTENT_TYPES, ORDER_BY, } from "./providers/conf
480
853
  export { COMMENT_KINDS, CONFLUENCE_HANDLERS, CONFLUENCE_PROJECTIONS, DEFAULT_LIMIT, bodyLimit, commentChildrenPath, commentCollections, commentKind, commentPath, commentReplies, isNumericSpace, modifiedAfterDate, numericId, offsetCursor, pageLimit, plainExcerpt, spaceRef, upstreamCursor, } from "./providers/confluence/operations.js";
481
854
  export { createConfluenceTools, CONFLUENCE_TOOL_NAMES, } from "./providers/confluence/tools.js";
482
855
  export { ConfluenceTransport, credentialFromPlaintext as confluenceCredentialFromPlaintext, credentialInstance as confluenceCredentialInstance, } from "./providers/confluence/transport.js";
483
- export { TeamcityProvider } from "./providers/teamcity/index.js";
484
- export { TEAMCITY_CAPABILITIES, TEAMCITY_CAPABILITY_INFO, TEAMCITY_OPERATIONS, TEAMCITY_STREAM_OPERATIONS, enabledCapabilities as enabledTeamcityCapabilities, teamcityOperationCapability, } from "./providers/teamcity/catalog.js";
856
+ export { TeamcityProvider, buildTypeAllowed as teamcityBuildTypeAllowed, projectAllowed as teamcityProjectAllowed, } from "./providers/teamcity/index.js";
857
+ export { TEAMCITY_CAPABILITIES, TEAMCITY_CAPABILITY_INFO, TEAMCITY_INSTANCE_ID, TEAMCITY_OPERATIONS, TEAMCITY_RESOURCE_KIND, TEAMCITY_STREAM_OPERATIONS, enabledCapabilities as enabledTeamcityCapabilities, teamcityOperationCapability, teamcityOperationMetadata, } from "./providers/teamcity/catalog.js";
485
858
  export { TEAMCITY_DEFAULTS, DEFAULT_LOG_LINES, resolveTeamCityConfig, teamcityConfigSchema, } from "./providers/teamcity/config.js";
486
859
  export { artifactBinaryProblem, artifactByteLimit, artifactPath, textArtifact, } from "./providers/teamcity/artifacts.js";
487
860
  export { LOG_MODES, logLines, logMode, sanitizeLog, selectLogWindow, trimToBytes, } from "./providers/teamcity/logs.js";
@@ -498,13 +871,27 @@ export { buildJql, commentLimit, commentStart, issueKey as jiraIssueKey, jqlDate
498
871
  export { ISSUE_INCLUDES, JIRA_HANDLERS, JIRA_PROJECTIONS, SEARCH_FIELDS as JIRA_SEARCH_FIELDS, customFieldValue, issueFields, issueUrl, requestedIncludes, wantsFieldNames, } from "./providers/jira/operations.js";
499
872
  export { JiraTransport, basicAuthorization, credentialFromPlaintext as jiraCredentialFromPlaintext, credentialSite, } from "./providers/jira/transport.js";
500
873
  export { createJiraTools, JIRA_TOOL_NAMES } from "./providers/jira/tools.js";
874
+ export { TestitProvider } from "./providers/testit/index.js";
875
+ export { TESTIT_CAPABILITIES, TESTIT_CAPABILITY_INFO, TESTIT_OPERATIONS, enabledCapabilities as enabledTestitCapabilities, testitOperationCapability, } from "./providers/testit/catalog.js";
876
+ export { TESTIT_DEFAULTS, resolveTestitConfig, testitConfigSchema, testitInstance, } from "./providers/testit/config.js";
877
+ export { assertReadableSize, attachmentBinaryProblem, attachmentByteLimit, attachmentExtension, attachmentName, } from "./providers/testit/attachments.js";
878
+ export { RESULT_OUTCOMES, TESTIT_HANDLERS, TESTIT_LIMITS, TESTIT_PROJECTIONS, TEST_RUN_STATES, WORK_ITEM_ENTITY_TYPES, WORK_ITEM_PRIORITIES, WORK_ITEM_STATES, bounded as testitBounded, capped, contentBlock as testitContentBlock, listLimit as testitListLimit, listOffset as testitListOffset, paged, } from "./providers/testit/operations.js";
879
+ export { TestitTransport, credentialFromPlaintext as testitCredentialFromPlaintext, credentialInstance as testitCredentialInstance, } from "./providers/testit/transport.js";
880
+ export { createTestitTools, TESTIT_TOOL_NAMES, } from "./providers/testit/tools.js";
881
+ export { WeblateProvider } from "./providers/weblate/index.js";
882
+ export { WEBLATE_CAPABILITIES, WEBLATE_CAPABILITY_INFO, WEBLATE_OPERATIONS, enabledCapabilities as weblateEnabledCapabilities, weblateOperationCapability, } from "./providers/weblate/catalog.js";
883
+ export { WEBLATE_DEFAULTS, resolveWeblateConfig, weblateConfigSchema, weblateInstance, } from "./providers/weblate/config.js";
884
+ export { WEBLATE_HANDLERS, WEBLATE_PROJECTIONS, WEBLATE_UNTRUSTED_OPERATIONS, accountFromUsers, componentRef, projectRef as weblateProjectRef, sameOriginUrl, translationRef as weblateTranslationRef, unitState as weblateUnitState, } from "./providers/weblate/operations.js";
885
+ export { FAILING_CHECK_CLAUSE, UNIT_STATE_FILTERS, UNIT_TEXT_FIELDS, buildUnitQuery, exactClause as weblateExactClause, quoteQueryValue, stateClause as weblateStateClause, textClause as weblateTextClause, } from "./providers/weblate/query.js";
886
+ export { WeblateTransport, credentialFromPlaintext as weblateCredentialFromPlaintext, credentialInstance as weblateCredentialInstance, resultsOf, } from "./providers/weblate/transport.js";
887
+ export { createWeblateTools, WEBLATE_TOOL_NAMES, } from "./providers/weblate/tools.js";
501
888
  export { IntegrationProviderRegistry } from "./providers/registry.js";
889
+ export { serviceBoundaryOf, serviceResourceDenied, } from "./providers/shared/service-boundary.js";
502
890
  export { IntegrationRepository } from "./repository.js";
503
891
  export { DockerSecretKeyProvider, MemoryKeyProvider, } from "./secrets/key-provider.js";
504
892
  export { SecretStore } from "./secrets/secret-store.js";
505
- export { QA_INTEGRATIONS_SETTINGS_NAMESPACE } from "./shared/settings.js";
506
893
  export { createToolKit } from "./tool-kit.js";
507
- export { createIntegrationTools, INTEGRATION_TOOL_NAMES } from "./tools.js";
894
+ export { createIntegrationTools, INTEGRATION_TOOL_NAMES, integrationToolNames, } from "./tools.js";
508
895
  export { BitrixTransport, credentialFromPlaintext, } from "./providers/bitrix24/transport.js";
509
896
  export default QaIntegrations;
510
897
  //# sourceMappingURL=index.js.map