@yadsh/dsh-qa-integrations 0.6.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (183) hide show
  1. package/README.md +341 -303
  2. package/lib/broker.js +12 -0
  3. package/lib/broker.js.map +1 -1
  4. package/lib/client/bitrix24.js +66 -5
  5. package/lib/client/bitrix24.js.map +1 -1
  6. package/lib/client/confluence.js +117 -128
  7. package/lib/client/confluence.js.map +1 -1
  8. package/lib/client/gitlab.js +1 -1
  9. package/lib/client/gitlab.js.map +1 -1
  10. package/lib/client/index.js +25 -5
  11. package/lib/client/index.js.map +1 -1
  12. package/lib/client/integrations.js +1 -1
  13. package/lib/client/integrations.js.map +1 -1
  14. package/lib/client/jira.js +115 -126
  15. package/lib/client/jira.js.map +1 -1
  16. package/lib/client/operator-card.js +537 -0
  17. package/lib/client/operator-card.js.map +1 -0
  18. package/lib/client/operator-controls.js +232 -0
  19. package/lib/client/operator-controls.js.map +1 -0
  20. package/lib/client/styles.js +60 -0
  21. package/lib/client/styles.js.map +1 -1
  22. package/lib/client/testit.js +39 -3
  23. package/lib/client/testit.js.map +1 -1
  24. package/lib/client/weblate.js +38 -3
  25. package/lib/client/weblate.js.map +1 -1
  26. package/lib/client.js +2966 -871
  27. package/lib/client.js.map +1 -1
  28. package/lib/coerce.js +17 -1
  29. package/lib/coerce.js.map +1 -1
  30. package/lib/config.js.map +1 -1
  31. package/lib/errors.js +22 -0
  32. package/lib/errors.js.map +1 -1
  33. package/lib/index.js +211 -52
  34. package/lib/index.js.map +1 -1
  35. package/lib/providers/bitrix24/catalog.js +138 -8
  36. package/lib/providers/bitrix24/catalog.js.map +1 -1
  37. package/lib/providers/bitrix24/config.js +84 -14
  38. package/lib/providers/bitrix24/config.js.map +1 -1
  39. package/lib/providers/bitrix24/index.js +100 -0
  40. package/lib/providers/bitrix24/index.js.map +1 -1
  41. package/lib/providers/bitrix24/operations.js +5 -9
  42. package/lib/providers/bitrix24/operations.js.map +1 -1
  43. package/lib/providers/bitrix24/transport.js +11 -31
  44. package/lib/providers/bitrix24/transport.js.map +1 -1
  45. package/lib/providers/confluence/adf.js +28 -23
  46. package/lib/providers/confluence/adf.js.map +1 -1
  47. package/lib/providers/confluence/catalog.js +91 -7
  48. package/lib/providers/confluence/catalog.js.map +1 -1
  49. package/lib/providers/confluence/config.js +27 -2
  50. package/lib/providers/confluence/config.js.map +1 -1
  51. package/lib/providers/confluence/credential-help.js +14 -8
  52. package/lib/providers/confluence/credential-help.js.map +1 -1
  53. package/lib/providers/confluence/dialect.js +215 -0
  54. package/lib/providers/confluence/dialect.js.map +1 -0
  55. package/lib/providers/confluence/index.js +393 -79
  56. package/lib/providers/confluence/index.js.map +1 -1
  57. package/lib/providers/confluence/operations.js +208 -153
  58. package/lib/providers/confluence/operations.js.map +1 -1
  59. package/lib/providers/confluence/storage.js +690 -0
  60. package/lib/providers/confluence/storage.js.map +1 -0
  61. package/lib/providers/confluence/transport.js +26 -89
  62. package/lib/providers/confluence/transport.js.map +1 -1
  63. package/lib/providers/gitlab/config.js +2 -3
  64. package/lib/providers/gitlab/config.js.map +1 -1
  65. package/lib/providers/gitlab/index.js +2 -20
  66. package/lib/providers/gitlab/index.js.map +1 -1
  67. package/lib/providers/gitlab/operations.js +7 -45
  68. package/lib/providers/gitlab/operations.js.map +1 -1
  69. package/lib/providers/gitlab/transport.js +2 -18
  70. package/lib/providers/gitlab/transport.js.map +1 -1
  71. package/lib/providers/jira/adf.js +19 -14
  72. package/lib/providers/jira/adf.js.map +1 -1
  73. package/lib/providers/jira/catalog.js +125 -4
  74. package/lib/providers/jira/catalog.js.map +1 -1
  75. package/lib/providers/jira/config.js +27 -2
  76. package/lib/providers/jira/config.js.map +1 -1
  77. package/lib/providers/jira/credential-help.js +16 -7
  78. package/lib/providers/jira/credential-help.js.map +1 -1
  79. package/lib/providers/jira/dialect.js +94 -0
  80. package/lib/providers/jira/dialect.js.map +1 -0
  81. package/lib/providers/jira/index.js +327 -67
  82. package/lib/providers/jira/index.js.map +1 -1
  83. package/lib/providers/jira/jql.js +54 -21
  84. package/lib/providers/jira/jql.js.map +1 -1
  85. package/lib/providers/jira/operations.js +77 -55
  86. package/lib/providers/jira/operations.js.map +1 -1
  87. package/lib/providers/jira/tools.js +1 -1
  88. package/lib/providers/jira/tools.js.map +1 -1
  89. package/lib/providers/jira/transport.js +12 -83
  90. package/lib/providers/jira/transport.js.map +1 -1
  91. package/lib/providers/shared/health.js +31 -0
  92. package/lib/providers/shared/health.js.map +1 -0
  93. package/lib/providers/shared/http.js +20 -0
  94. package/lib/providers/shared/http.js.map +1 -1
  95. package/lib/providers/shared/paths.js +14 -0
  96. package/lib/providers/shared/paths.js.map +1 -0
  97. package/lib/providers/shared/payload.js +46 -0
  98. package/lib/providers/shared/payload.js.map +1 -0
  99. package/lib/providers/teamcity/artifacts.js +0 -8
  100. package/lib/providers/teamcity/artifacts.js.map +1 -1
  101. package/lib/providers/teamcity/config.js +2 -3
  102. package/lib/providers/teamcity/config.js.map +1 -1
  103. package/lib/providers/teamcity/index.js +2 -20
  104. package/lib/providers/teamcity/index.js.map +1 -1
  105. package/lib/providers/teamcity/operations.js +5 -39
  106. package/lib/providers/teamcity/operations.js.map +1 -1
  107. package/lib/providers/teamcity/transport.js +2 -11
  108. package/lib/providers/teamcity/transport.js.map +1 -1
  109. package/lib/providers/testit/catalog.js +77 -0
  110. package/lib/providers/testit/catalog.js.map +1 -1
  111. package/lib/providers/testit/config.js +2 -3
  112. package/lib/providers/testit/config.js.map +1 -1
  113. package/lib/providers/testit/index.js +260 -4
  114. package/lib/providers/testit/index.js.map +1 -1
  115. package/lib/providers/testit/operations.js +34 -63
  116. package/lib/providers/testit/operations.js.map +1 -1
  117. package/lib/providers/testit/transport.js +2 -18
  118. package/lib/providers/testit/transport.js.map +1 -1
  119. package/lib/providers/weblate/catalog.js +103 -9
  120. package/lib/providers/weblate/catalog.js.map +1 -1
  121. package/lib/providers/weblate/config.js +2 -3
  122. package/lib/providers/weblate/config.js.map +1 -1
  123. package/lib/providers/weblate/index.js +227 -6
  124. package/lib/providers/weblate/index.js.map +1 -1
  125. package/lib/providers/weblate/operations.js +3 -33
  126. package/lib/providers/weblate/operations.js.map +1 -1
  127. package/lib/providers/weblate/query.js +3 -6
  128. package/lib/providers/weblate/query.js.map +1 -1
  129. package/lib/providers/weblate/transport.js +2 -12
  130. package/lib/providers/weblate/transport.js.map +1 -1
  131. package/lib/service-credentials/config.js +2 -3
  132. package/lib/service-credentials/config.js.map +1 -1
  133. package/lib/shared/settings.js +14 -0
  134. package/lib/shared/settings.js.map +1 -0
  135. package/lib/typert.host.js +159 -60
  136. package/lib/typert.remote-client.d.ts +13 -11
  137. package/lib/typert.remote-client.js +98 -52
  138. package/lib/types/broker.d.ts +11 -3
  139. package/lib/types/client/bitrix24.d.ts +24 -2
  140. package/lib/types/client/confluence.d.ts +24 -4
  141. package/lib/types/client/index.d.ts +7 -6
  142. package/lib/types/client/integrations.d.ts +2 -2
  143. package/lib/types/client/jira.d.ts +25 -4
  144. package/lib/types/client/operator-card.d.ts +22 -0
  145. package/lib/types/client/operator-controls.d.ts +135 -0
  146. package/lib/types/client/testit.d.ts +14 -1
  147. package/lib/types/client/weblate.d.ts +14 -1
  148. package/lib/types/coerce.d.ts +14 -0
  149. package/lib/types/config.d.ts +4 -4
  150. package/lib/types/errors.d.ts +16 -0
  151. package/lib/types/index.d.ts +91 -15
  152. package/lib/types/providers/bitrix24/catalog.d.ts +8 -0
  153. package/lib/types/providers/bitrix24/config.d.ts +14 -23
  154. package/lib/types/providers/bitrix24/index.d.ts +37 -1
  155. package/lib/types/providers/confluence/catalog.d.ts +44 -8
  156. package/lib/types/providers/confluence/config.d.ts +39 -7
  157. package/lib/types/providers/confluence/credential-help.d.ts +9 -4
  158. package/lib/types/providers/confluence/dialect.d.ts +113 -0
  159. package/lib/types/providers/confluence/index.d.ts +82 -8
  160. package/lib/types/providers/confluence/operations.d.ts +14 -4
  161. package/lib/types/providers/confluence/storage.d.ts +28 -0
  162. package/lib/types/providers/confluence/transport.d.ts +10 -21
  163. package/lib/types/providers/jira/catalog.d.ts +49 -2
  164. package/lib/types/providers/jira/config.d.ts +37 -6
  165. package/lib/types/providers/jira/credential-help.d.ts +11 -3
  166. package/lib/types/providers/jira/dialect.d.ts +79 -0
  167. package/lib/types/providers/jira/index.d.ts +76 -19
  168. package/lib/types/providers/jira/jql.d.ts +14 -4
  169. package/lib/types/providers/jira/operations.d.ts +3 -0
  170. package/lib/types/providers/jira/transport.d.ts +6 -13
  171. package/lib/types/providers/shared/health.d.ts +18 -0
  172. package/lib/types/providers/shared/http.d.ts +9 -0
  173. package/lib/types/providers/shared/paths.d.ts +10 -0
  174. package/lib/types/providers/shared/payload.d.ts +26 -0
  175. package/lib/types/providers/teamcity/artifacts.d.ts +0 -2
  176. package/lib/types/providers/teamcity/index.d.ts +2 -0
  177. package/lib/types/providers/testit/catalog.d.ts +12 -0
  178. package/lib/types/providers/testit/index.d.ts +63 -2
  179. package/lib/types/providers/weblate/catalog.d.ts +19 -2
  180. package/lib/types/providers/weblate/index.d.ts +43 -1
  181. package/lib/types/shared/settings.d.ts +14 -0
  182. package/lib/types/types.d.ts +8 -0
  183. package/package.json +3 -3
@@ -3,7 +3,7 @@ import { TypertRemoteService } from "@deepseek-ai/dsh-typert-protocol";
3
3
  import type { QaSurface } from "@yadsh/dsh-qa-surface";
4
4
  import { IntegrationBroker } from "./broker.js";
5
5
  import { type QaIntegrationsConfig } from "./config.js";
6
- import type { CredentialInput, CredentialSource, IntegrationInstanceSummary, ServiceCredentialHealth, IntegrationProviderId, IntegrationProviderSummary, IntegrationServiceBoundary, IntegrationSummary, PolicyPatch } from "./types.js";
6
+ import type { CredentialSource, IntegrationInstanceSummary, ServiceCredentialHealth, IntegrationProviderId, IntegrationProviderSummary, IntegrationServiceBoundary, IntegrationSummary, PolicyPatch } from "./types.js";
7
7
  export declare const name = "dsh-qa-integrations";
8
8
  export declare const inject: readonly ["qaSurface", "tools"];
9
9
  export declare const Config: import("@deepseek-ai/schemastery").default<QaIntegrationsConfig>;
@@ -21,25 +21,79 @@ export declare class QaIntegrations extends TypertRemoteService {
21
21
  static Config: import("@deepseek-ai/schemastery").default<QaIntegrationsConfig>;
22
22
  readonly broker: IntegrationBroker;
23
23
  private readonly logger;
24
- private readonly enabled;
24
+ private readonly owner;
25
+ private enabled;
25
26
  /** Providers by id; the service-credential registry resolves through them. */
26
- private readonly providerRegistry;
27
+ private providerRegistry;
27
28
  /** Absent unless the deployment configured managed service credentials. */
28
- private readonly serviceCredentials;
29
- private readonly defaultForNewConnections;
30
- private readonly providerSummaries;
31
- private readonly configuredInstances;
29
+ private serviceCredentials;
30
+ private defaultForNewConnections;
31
+ private providerSummaries;
32
+ private configuredInstances;
32
33
  /** The Confluence sites this deployment dials, for the connect form. */
33
- private readonly configuredConfluenceSites;
34
+ private configuredConfluenceSites;
34
35
  /** The Jira Cloud sites this deployment allows, in config order. */
35
- private readonly configuredJiraSites;
36
+ private configuredJiraSites;
36
37
  /** The TeamCity server this deployment dials, or null when it mounts none. */
37
- private readonly configuredServer;
38
+ private configuredServer;
38
39
  /** The Test IT installations this deployment allows, in config order. */
39
- private readonly configuredTestitInstances;
40
+ private configuredTestitInstances;
40
41
  /** The Weblate instances this deployment allows, in config order. */
41
- private readonly configuredWeblateInstances;
42
+ private configuredWeblateInstances;
43
+ /** The Bitrix24 portals this deployment allows, in config order. */
44
+ private configuredBitrix24Portals;
45
+ /**
46
+ * The composition row the Host resolved at load. It stays the base of the
47
+ * settings section, and the configuration source until the namespace takes
48
+ * over, so a deployment without a settings provider keeps booting on it.
49
+ */
50
+ private readonly entryConfig;
51
+ /** Where the live configuration is read from; the settings namespace swaps this. */
52
+ private configSource;
53
+ /**
54
+ * The connection store and its key live for the whole process: connections
55
+ * and wrapped secrets belong to the boot path, and only derivations of the
56
+ * configuration re-apply while running.
57
+ */
58
+ private readonly repository;
59
+ private readonly secrets;
60
+ private readonly bootDataPath;
61
+ private readonly bootMasterKeyPath;
62
+ private readonly bootMasterKeyVersion;
63
+ /** Removers of the currently mounted admission and tool registrations. */
64
+ private toolRemovers;
65
+ /** The mounted tool-name list; an unchanged signature never re-registers. */
66
+ private toolsKey;
42
67
  constructor(ctx: IntegrationsContext, rawConfig?: QaIntegrationsConfig);
68
+ /**
69
+ * Rebuild every configuration-derived surface: the provider registry, the
70
+ * deployment instance lists, the service-credential registry and the tool
71
+ * mount. The store and its key do not travel here — connections and wrapped
72
+ * secrets belong to the boot path, and a card edit that re-points them is
73
+ * answered with a warning instead of a live reopen.
74
+ */
75
+ private applyConfig;
76
+ /**
77
+ * Mount the tools the configuration asks for. The mounted set changes only
78
+ * when the plugin or its one write capability flips, so an unrelated card
79
+ * edit never churns the Host tool registry.
80
+ */
81
+ private syncTools;
82
+ /**
83
+ * Attach the settings namespace. The installed section becomes the plugin's
84
+ * configuration source, so an operator card edit re-applies the running
85
+ * service instead of waiting for a restart; without a settings provider the
86
+ * composition entry stays authoritative. The read is structural and optional:
87
+ * a Host without a mounted settings provider keeps this plugin fully working.
88
+ */
89
+ private installSettings;
90
+ /**
91
+ * Re-resolve the source after a committed settings change and rebuild what
92
+ * derives from it. A source the resolvers refuse keeps the running state:
93
+ * the settings provider validates on write, so this only covers a value
94
+ * that arrived through another path.
95
+ */
96
+ private reapply;
43
97
  describe(): {
44
98
  readonly enabled: boolean;
45
99
  readonly providers: readonly IntegrationProviderId[];
@@ -47,7 +101,13 @@ export declare class QaIntegrations extends TypertRemoteService {
47
101
  providers(token: string): readonly IntegrationProviderSummary[];
48
102
  list(token: string): readonly IntegrationSummary[];
49
103
  getBitrix24(token: string): IntegrationSummary;
50
- putBitrix24Credential(token: string, input: CredentialInput): Promise<IntegrationSummary>;
104
+ putBitrix24Credential(token: string, input: {
105
+ readonly instanceId: string;
106
+ readonly token: string;
107
+ /** Whether the connect form asked for the managed credential instead. */
108
+ readonly useServiceCredential?: boolean | undefined;
109
+ }): Promise<IntegrationSummary>;
110
+ bitrix24Instances(token: string): readonly IntegrationInstanceSummary[];
51
111
  testBitrix24(token: string): Promise<IntegrationSummary>;
52
112
  patchBitrix24Policy(token: string, patch: PolicyPatch): IntegrationSummary;
53
113
  disconnectBitrix24(token: string): boolean;
@@ -78,11 +138,17 @@ export declare class QaIntegrations extends TypertRemoteService {
78
138
  * The account e-mail is not a secret, but it is half of the Basic pair, so it
79
139
  * travels with the secret instead of being a separate field: both halves land
80
140
  * in one encrypted record, and a token can never be spent as another account.
141
+ * A Server / Data Center instance authenticates with a personal access token
142
+ * alone, so its connect sends no e-mail and the instance's declared
143
+ * deployment type is what makes that shape acceptable.
81
144
  */
82
145
  putConfluenceCredential(token: string, input: {
83
146
  readonly instanceId: string;
84
- readonly email: string;
147
+ /** Absent on a Server / Data Center connect, which needs no account. */
148
+ readonly email?: string | undefined;
85
149
  readonly token: string;
150
+ /** Whether the connect form asked for the managed credential instead. */
151
+ readonly useServiceCredential?: boolean | undefined;
86
152
  }): Promise<IntegrationSummary>;
87
153
  testConfluence(token: string): Promise<IntegrationSummary>;
88
154
  patchConfluencePolicy(token: string, patch: PolicyPatch): IntegrationSummary;
@@ -119,8 +185,14 @@ export declare class QaIntegrations extends TypertRemoteService {
119
185
  getJira(token: string): IntegrationSummary;
120
186
  putJiraCredential(token: string, input: {
121
187
  readonly siteId: string;
122
- readonly email: string;
188
+ /**
189
+ * Absent on a Server / Data Center connect: a personal access token
190
+ * authenticates as its own bearer and needs no account.
191
+ */
192
+ readonly email?: string | undefined;
123
193
  readonly token: string;
194
+ /** Whether the connect form asked for the managed credential instead. */
195
+ readonly useServiceCredential?: boolean | undefined;
124
196
  }): Promise<IntegrationSummary>;
125
197
  testJira(token: string): Promise<IntegrationSummary>;
126
198
  patchJiraPolicy(token: string, patch: PolicyPatch): IntegrationSummary;
@@ -135,6 +207,8 @@ export declare class QaIntegrations extends TypertRemoteService {
135
207
  putTestitCredential(token: string, input: {
136
208
  readonly instanceId: string;
137
209
  readonly token: string;
210
+ /** Whether the connect form asked for the managed credential instead. */
211
+ readonly useServiceCredential?: boolean | undefined;
138
212
  }): Promise<IntegrationSummary>;
139
213
  testTestit(token: string): Promise<IntegrationSummary>;
140
214
  patchTestitPolicy(token: string, patch: PolicyPatch): IntegrationSummary;
@@ -149,6 +223,8 @@ export declare class QaIntegrations extends TypertRemoteService {
149
223
  putWeblateCredential(token: string, input: {
150
224
  readonly instanceId: string;
151
225
  readonly token: string;
226
+ /** Whether the connect form asked for the managed credential instead. */
227
+ readonly useServiceCredential?: boolean | undefined;
152
228
  }): Promise<IntegrationSummary>;
153
229
  testWeblate(token: string): Promise<IntegrationSummary>;
154
230
  patchWeblatePolicy(token: string, patch: PolicyPatch): IntegrationSummary;
@@ -1,4 +1,5 @@
1
1
  import type { IntegrationCapability, IntegrationCapabilityInfo } from "../../types.js";
2
+ import type { OperationSecurityMetadata } from "../../service-credentials/types.js";
2
3
  import type { Bitrix24Flags } from "./config.js";
3
4
  /**
4
5
  * Capabilities this provider can offer, one per Bitrix24 webhook scope. `scopes`
@@ -32,6 +33,13 @@ export interface BitrixOperationDefinition {
32
33
  /** REST method as called over the webhook, without the `.json` suffix. */
33
34
  readonly method: string;
34
35
  readonly list?: BitrixListShape;
36
+ /**
37
+ * Security classification for the managed service credential. Bitrix24 has
38
+ * no project tree, so the resource a service call has to stay inside is the
39
+ * portal itself: every boundary-required operation names the `"portals"`
40
+ * kind, and the profile's `resources.portals` has to name the portal host.
41
+ */
42
+ readonly security: OperationSecurityMetadata;
35
43
  }
36
44
  /**
37
45
  * Every model-reachable operation. The provider refuses any operation that is
@@ -1,4 +1,16 @@
1
1
  import z from "@deepseek-ai/schemastery";
2
+ /**
3
+ * One operator-declared Bitrix24 portal. A personal connection names its
4
+ * portal implicitly, through the webhook URL; a managed service credential
5
+ * needs the portal named by the deployment, because the profile binds to it —
6
+ * the registry matches a profile to a connection by this host.
7
+ */
8
+ export interface Bitrix24Instance {
9
+ readonly id: string;
10
+ readonly label: string;
11
+ /** Portal hostname (lowercase, no scheme, no path), e.g. company.bitrix24.ru. */
12
+ readonly portal: string;
13
+ }
2
14
  /**
3
15
  * Deployment switches for the Bitrix24 provider. Every read scope is on by
4
16
  * default: a capability is offered to the agent only when the connected webhook
@@ -23,31 +35,10 @@ export interface Bitrix24Flags {
23
35
  readonly tasksRead: boolean;
24
36
  readonly calendarRead: boolean;
25
37
  readonly diskRead: boolean;
38
+ readonly instances: readonly Bitrix24Instance[];
26
39
  }
27
40
  export declare const BITRIX24_DEFAULTS: Bitrix24Flags;
28
41
  /** Config slice of this provider, as it appears under `bitrix24:` in YAML. */
29
- export declare const bitrix24ConfigSchema: z<Schemastery.ObjectS<{
30
- enabled: z<boolean, boolean>;
31
- crmRead: z<boolean, boolean>;
32
- crmCommentWrite: z<boolean, boolean>;
33
- chatRead: z<boolean, boolean>;
34
- openlinesRead: z<boolean, boolean>;
35
- userRead: z<boolean, boolean>;
36
- departmentRead: z<boolean, boolean>;
37
- tasksRead: z<boolean, boolean>;
38
- calendarRead: z<boolean, boolean>;
39
- diskRead: z<boolean, boolean>;
40
- }>, Schemastery.ObjectT<{
41
- enabled: z<boolean, boolean>;
42
- crmRead: z<boolean, boolean>;
43
- crmCommentWrite: z<boolean, boolean>;
44
- chatRead: z<boolean, boolean>;
45
- openlinesRead: z<boolean, boolean>;
46
- userRead: z<boolean, boolean>;
47
- departmentRead: z<boolean, boolean>;
48
- tasksRead: z<boolean, boolean>;
49
- calendarRead: z<boolean, boolean>;
50
- diskRead: z<boolean, boolean>;
51
- }>>;
42
+ export declare const bitrix24ConfigSchema: z<Partial<Bitrix24Flags>>;
52
43
  export declare function resolveBitrix24Config(input?: Partial<Bitrix24Flags>): Bitrix24Flags;
53
44
  //# sourceMappingURL=config.d.ts.map
@@ -1,6 +1,7 @@
1
1
  import { type CredentialHelp } from "@yadsh/dsh-plugin-kit";
2
2
  import type { ResolvedQaIntegrationsConfig } from "../../config.js";
3
- import type { IntegrationCapability, IntegrationCapabilityInfo, ProviderValidation } from "../../types.js";
3
+ import type { CapabilityServiceState, IntegrationCapability, IntegrationCapabilityInfo, ProviderValidation, ServiceCredentialHealth } from "../../types.js";
4
+ import type { OperationSecurityMetadata } from "../../service-credentials/types.js";
4
5
  import type { IntegrationProvider, ProviderContext } from "../contract.js";
5
6
  export { credentialFromPlaintext, parseBitrixWebhook, type BitrixCredential, } from "./transport.js";
6
7
  /** Bitrix24 provider: incoming-webhook credentials over the Bitrix24 REST API. */
@@ -23,7 +24,41 @@ export declare class Bitrix24Provider implements IntegrationProvider {
23
24
  readonly portal: string;
24
25
  };
25
26
  operationCapability(operation: string): IntegrationCapability | undefined;
27
+ /**
28
+ * Security classification of one operation, straight from the catalog: an
29
+ * operation the catalog does not list is unclassified and unreachable
30
+ * through the managed credential.
31
+ */
32
+ operationMetadata(operation: string): OperationSecurityMetadata | undefined;
33
+ /**
34
+ * How one capability behaves under the managed credential. A capability that
35
+ * mixes portal reads with personal-only reads (CRM: the call transcript and
36
+ * the duplicate lookup stay personal) reports `sensitive`, so the card says
37
+ * what the connection loses in service mode.
38
+ */
39
+ capabilityServiceState(capability: IntegrationCapability): CapabilityServiceState | undefined;
40
+ /**
41
+ * Bitrix24 scopes by portal, not by project, so `"portals"` is the one
42
+ * boundary kind: the profile names the portal hosts a service account may
43
+ * work inside, and every boundary-required call checks against them.
44
+ */
45
+ resourceBoundaryKind(operation: string): string | undefined;
46
+ /**
47
+ * Portal host of one configured instance, so deployment configuration can
48
+ * name an instance the same way the connect form does and a typo fails at
49
+ * load. The host — not the URL — is the form a stored portal carries.
50
+ */
51
+ instancePortal(instanceId: string): string | undefined;
26
52
  validate(context: ProviderContext): Promise<ProviderValidation>;
53
+ /**
54
+ * Health of a deployment-managed webhook. The probe reads only the identity
55
+ * and scope self-inspection methods, so it never changes upstream state.
56
+ * Bitrix24 webhook scopes are coarse — the `crm` scope reads and writes with
57
+ * one bit — so the probe cannot certify read-only the way GitLab scopes can;
58
+ * the answer says so, and the local service ceiling is what bounds the
59
+ * credential either way.
60
+ */
61
+ validateServiceCredential(context: ProviderContext): Promise<ServiceCredentialHealth>;
27
62
  execute(context: ProviderContext, operation: string, input: Readonly<Record<string, unknown>>): Promise<unknown>;
28
63
  /**
29
64
  * The scopes the connected webhook was actually granted. A portal that
@@ -32,5 +67,6 @@ export declare class Bitrix24Provider implements IntegrationProvider {
32
67
  */
33
68
  private grantedScopes;
34
69
  }
70
+ /** Map an upstream failure of the probe onto a health status. */
35
71
  export default Bitrix24Provider;
36
72
  //# sourceMappingURL=index.d.ts.map
@@ -1,5 +1,6 @@
1
+ import type { OperationSecurityMetadata } from "../../service-credentials/types.js";
1
2
  import type { IntegrationCapability, IntegrationCapabilityInfo } from "../../types.js";
2
- import type { ConfluenceFlags } from "./config.js";
3
+ import type { ConfluenceDeployment, ConfluenceFlags } from "./config.js";
3
4
  /**
4
5
  * Capabilities this provider offers. They are narrower than Confluence's own
5
6
  * scopes on purpose: one switch per kind of data, so the operator decides what
@@ -29,6 +30,14 @@ export interface ConfluenceOperationDefinition {
29
30
  * endpoint of its own.
30
31
  */
31
32
  readonly path: string;
33
+ /**
34
+ * The path of this operation on a Server / Data Center installation. The two
35
+ * products genuinely differ here — Cloud answers the v2 API under `/wiki`
36
+ * (`/wiki/api/v2/pages/:pageId`), a self-hosted installation its own v1 API
37
+ * (`/rest/api/content/:pageId`) — so nearly every read names both rather than
38
+ * deriving one from the other.
39
+ */
40
+ readonly serverPath: string;
32
41
  /** Set when the operation answers with one page of a collection. */
33
42
  readonly list?: boolean;
34
43
  /**
@@ -37,23 +46,50 @@ export interface ConfluenceOperationDefinition {
37
46
  * the two a `nextCursor` belongs to.
38
47
  */
39
48
  readonly cursor?: "offset" | "upstream";
49
+ /** What this operation does, how sensitive it is, who may reach it. */
50
+ readonly security: OperationSecurityMetadata;
40
51
  }
52
+ /** The resource kind every space-scoped operation of this provider is bounded by. */
53
+ export declare const CONFLUENCE_RESOURCE_KIND = "spaces";
41
54
  /**
42
55
  * Every model-reachable operation. The provider refuses any operation that is
43
- * not listed here, so this table — together with `capability` — is the
44
- * permission surface. Only GET: the catalog carries no operation that could
45
- * change Confluence state, and the confirmation framework does not exist yet.
56
+ * not listed here, so this table — together with `capability` and `security`
57
+ * — is the permission surface. Only GET: the catalog carries no operation that
58
+ * could change Confluence state, and the confirmation framework does not exist
59
+ * yet.
46
60
  *
47
- * The mix of REST versions is deliberate. Confluence Cloud v2 covers pages,
48
- * comments, attachments, versions and spaces, and that is where the reads go;
49
- * the CQL search and the "who am I" call exist only in v1. Tools never see the
50
- * difference — an operation answers a normalized object either way.
61
+ * The mix of REST versions is deliberate. On Cloud the v2 API covers pages,
62
+ * comments, attachments, versions and spaces, and that is where those reads go,
63
+ * while the CQL search and the "who am I" call exist only in v1; on a Server /
64
+ * Data Center installation the whole surface is that v1 API. Each operation
65
+ * declares the endpoint of both products, and the dialect builds the request
66
+ * from the one the instance declared. Tools never see the difference — an
67
+ * operation answers a normalized object either way.
51
68
  */
52
69
  export declare const CONFLUENCE_OPERATIONS: Readonly<Record<string, ConfluenceOperationDefinition>>;
70
+ /**
71
+ * The inline comment collection of a Cloud page. The catalog declares the
72
+ * footer one as the operation's endpoint; the inline kind is the same collection
73
+ * under its own name, and it is declared here rather than derived, so both paths
74
+ * a request may reach are lines somebody added on purpose.
75
+ */
76
+ export declare const CONFLUENCE_INLINE_COMMENTS_PATH = "/wiki/api/v2/pages/:pageId/inline-comments";
77
+ /**
78
+ * The reads this provider performs that are not operations of the catalog: the
79
+ * replies of one comment, which Cloud keeps in a collection per comment kind
80
+ * and a Server / Data Center installation in the comment's own children.
81
+ */
82
+ export declare const CONFLUENCE_COMPANION_PATHS: readonly string[];
83
+ /** The same read on a Server / Data Center installation, which has one kind. */
84
+ export declare const CONFLUENCE_SERVER_COMPANION_PATHS: readonly string[];
85
+ /** The path of one operation on the instance's product. */
86
+ export declare function confluenceOperationPath(operation: string, deployment: ConfluenceDeployment): string | undefined;
53
87
  /** Capabilities this deployment allows, in catalog order. */
54
88
  export declare function enabledCapabilities(flags: ConfluenceFlags): readonly ConfluenceCapability[];
55
89
  /** Label and hint per capability, for clients that render what we declare. */
56
90
  export declare const CONFLUENCE_CAPABILITY_INFO: Readonly<Record<ConfluenceCapability, IntegrationCapabilityInfo>>;
57
91
  /** Capability an operation needs, or undefined when the catalog has none. */
58
92
  export declare function confluenceOperationCapability(operation: string): IntegrationCapability | undefined;
93
+ /** Security classification of an operation, or undefined when it is unknown. */
94
+ export declare function confluenceOperationMetadata(operation: string): OperationSecurityMetadata | undefined;
59
95
  //# sourceMappingURL=catalog.d.ts.map
@@ -1,20 +1,52 @@
1
1
  import z from "@deepseek-ai/schemastery";
2
+ /**
3
+ * Which Confluence this instance is: Atlassian Cloud, or a self-hosted Server /
4
+ * Data Center installation. The two are different products behind one name —
5
+ * Cloud answers the v2 API under `/wiki` with page bodies as Atlassian Document
6
+ * Format, while a Server / Data Center installation answers its own v1 API
7
+ * under `/rest/api` with page bodies as storage format — so the deployment type
8
+ * is a property of the instance the operator declares, never a guess this
9
+ * provider makes at run time.
10
+ *
11
+ * Server and Data Center are one value on purpose: Data Center is Server with
12
+ * clustering, and the REST surface they answer is the same one.
13
+ */
14
+ export type ConfluenceDeployment = "cloud" | "server";
2
15
  /**
3
16
  * One Confluence site the operator allows. A user never types a host: the
4
17
  * connect form only picks from this list, so the broker cannot be pointed at an
5
18
  * arbitrary origin.
6
19
  *
7
- * The address is the site origin a Confluence Cloud deployment answers on
8
- * (`https://company.atlassian.net`). Deployments that reach Confluence through
9
- * the Atlassian gateway for scoped API tokens configure that base instead
10
- * (`https://api.atlassian.com/ex/confluence/<cloudId>`); both spell the same
11
- * relative `/wiki/...` paths, so the provider needs no mode switch.
20
+ * The address is the base every relative path of the product hangs under. Cloud
21
+ * answers on the site origin (`https://company.atlassian.net`, with `/wiki` as
22
+ * part of the path) or, for scoped API tokens, on the gateway
23
+ * (`https://api.atlassian.com/ex/confluence/<cloudId>`). A Server / Data Center
24
+ * installation is named by its own address, and an installation behind a context
25
+ * path spells that path here (`https://wiki.example.corp/confluence`).
12
26
  */
13
27
  export interface ConfluenceInstance {
14
28
  readonly id: string;
15
29
  readonly label: string;
16
30
  /** Canonical `<origin><path>`, without a trailing slash. */
17
31
  readonly baseUrl: string;
32
+ /** Which product answers at `baseUrl`; see {@link ConfluenceDeployment}. */
33
+ readonly deploymentType: ConfluenceDeployment;
34
+ }
35
+ /**
36
+ * One instance as the operator writes it. `deploymentType` is spelled as a
37
+ * plain string here and resolved below, so a config written before the field
38
+ * existed keeps loading as the Cloud site it always was, and a typo is refused
39
+ * with the accepted values instead of quietly becoming a default.
40
+ */
41
+ export interface ConfluenceInstanceInput {
42
+ readonly id: string;
43
+ readonly label?: string;
44
+ readonly baseUrl: string;
45
+ readonly deploymentType?: string;
46
+ }
47
+ /** Config slice as YAML writes it: every member is optional there. */
48
+ export interface ConfluenceConfigInput extends Partial<Omit<ConfluenceFlags, "instances">> {
49
+ readonly instances?: readonly ConfluenceInstanceInput[] | undefined;
18
50
  }
19
51
  /**
20
52
  * Deployment switches for the Confluence provider. Read capabilities are on by
@@ -59,8 +91,8 @@ export declare const CONFLUENCE_DEFAULTS: ConfluenceFlags;
59
91
  * instance list is validated and canonicalized by `resolveConfluenceConfig`,
60
92
  * which is where a deployment typo fails loudly.
61
93
  */
62
- export declare const confluenceConfigSchema: z<Partial<ConfluenceFlags>>;
63
- export declare function resolveConfluenceConfig(input?: Partial<ConfluenceFlags>): ConfluenceFlags;
94
+ export declare const confluenceConfigSchema: z<ConfluenceConfigInput>;
95
+ export declare function resolveConfluenceConfig(input?: ConfluenceConfigInput): ConfluenceFlags;
64
96
  /** The configured site a stored credential names, or a fail-closed error. */
65
97
  export declare function confluenceInstance(flags: ConfluenceFlags, instanceId: string): ConfluenceInstance | undefined;
66
98
  /** Whether a space key passes the operator allowlist; an empty list allows all. */
@@ -1,9 +1,14 @@
1
1
  import type { CredentialHelp } from "@yadsh/dsh-plugin-kit";
2
2
  /**
3
- * Confluence authenticates with an Atlassian API token next to the account
4
- * e-mail, and the token is account-wide: the same one opens Jira and the other
5
- * Atlassian Cloud products, so the scopes are about the account rather than
6
- * about Confluence alone.
3
+ * Confluence authenticates in one of two ways, depending on where it runs.
4
+ * Atlassian Cloud takes an API token next to the account e-mail, and that token
5
+ * is account-wide: the same one opens Jira and the other Atlassian Cloud
6
+ * products, so the scopes are about the account rather than about Confluence
7
+ * alone. A self-hosted Server / Data Center instance takes a personal access
8
+ * token and no account, because the token belongs to the account that minted
9
+ * it. Which one the connect form asks for follows the instance the operator
10
+ * configured, and the instructions name both so the page is not wrong for
11
+ * either product.
7
12
  */
8
13
  export declare const CONFLUENCE_CREDENTIAL_HELP: CredentialHelp;
9
14
  //# sourceMappingURL=credential-help.d.ts.map
@@ -0,0 +1,113 @@
1
+ import type { ConfluenceDeployment, ConfluenceInstance } from "./config.js";
2
+ /**
3
+ * Where one Confluence read lives, and how it pages. Cloud and Server / Data
4
+ * Center are two products behind one name: Cloud answers the v2 API relative to
5
+ * `/wiki` and pages its listings with an opaque cursor, while a self-hosted
6
+ * installation answers its own v1 API relative to `/rest/api` and pages by row
7
+ * offset. Everything that differs is a member of this interface, so an
8
+ * operation asks the dialect where to read instead of deciding for itself which
9
+ * Confluence it is talking to.
10
+ *
11
+ * Nothing here is inferred at run time: the deployment type comes from the
12
+ * operator's instance list, and a connection whose stored credential does not
13
+ * match it is refused.
14
+ */
15
+ export interface ConfluenceDialect {
16
+ readonly deployment: ConfluenceDeployment;
17
+ /** What the connect form calls the secret this product accepts. */
18
+ readonly credentialLabel: string;
19
+ /** Shape of one pasteable token, before anything is sent upstream. */
20
+ readonly tokenShape: RegExp;
21
+ /**
22
+ * Whether an account e-mail must travel with the token. Cloud spends an
23
+ * Atlassian API token as HTTP Basic over `email:token`; a Server / Data
24
+ * Center personal access token is a bearer token and needs no account.
25
+ */
26
+ readonly requiresEmail: boolean;
27
+ /** How the name of this product reads in a message. */
28
+ readonly productName: string;
29
+ /**
30
+ * Which page-addressed collection path one comment kind has, or none when the
31
+ * product keeps both kinds in one collection and marks them per comment.
32
+ */
33
+ readonly commentKinds: "path" | "marker";
34
+ /** The identity read a connect proves itself with. */
35
+ readonly currentUserPath: string;
36
+ /** The CQL search. */
37
+ searchPath(input: SearchInput): ConfluenceRead;
38
+ /** One space, by the key or id the model named. */
39
+ spacePath(ref: string): ConfluenceRead;
40
+ /** The space listing, filtered by keys when the caller named any. */
41
+ spaceList(input: SpaceListInput): ConfluenceRead;
42
+ /** The space a page belongs to, for the deployment's own space policy. */
43
+ pageSpacePath(pageId: string): ConfluenceRead;
44
+ /** One page with the body and metadata an answer carries. */
45
+ pagePath(pageId: string): ConfluenceRead;
46
+ /** The comments of one page; `kind` selects the collection where it can. */
47
+ commentPath(input: CommentInput): ConfluenceRead;
48
+ /** The replies of one comment. */
49
+ commentChildrenPath(input: CommentChildrenInput): ConfluenceRead;
50
+ /** The attachments of one page, metadata only. */
51
+ attachmentPath(input: PageInput): ConfluenceRead;
52
+ /** The versions of one page. */
53
+ versionPath(input: PageInput): ConfluenceRead;
54
+ }
55
+ /** One read: a path relative to the instance base, with its own parameters. */
56
+ export interface ConfluenceRead {
57
+ readonly path: string;
58
+ readonly query: ConfluenceQuery;
59
+ }
60
+ export interface PagedInput {
61
+ /** A continuation token this provider already shape-checked. */
62
+ readonly cursor: string | undefined;
63
+ readonly limit: number;
64
+ }
65
+ export interface SearchInput {
66
+ readonly cql: string;
67
+ /** Rows before this page; both products page a CQL search by offset. */
68
+ readonly start: number;
69
+ readonly limit: number;
70
+ /** Archived spaces are a Cloud concept; the field is ignored elsewhere. */
71
+ readonly includeArchived: boolean | undefined;
72
+ }
73
+ export interface SpaceListInput extends PagedInput {
74
+ readonly keys: readonly string[];
75
+ readonly type: string | undefined;
76
+ }
77
+ export interface CommentInput extends PagedInput {
78
+ readonly pageId: string;
79
+ readonly kind: "footer" | "inline";
80
+ }
81
+ export interface PageInput extends PagedInput {
82
+ readonly pageId: string;
83
+ }
84
+ export interface CommentChildrenInput extends PagedInput {
85
+ readonly commentId: string;
86
+ readonly kind: "footer" | "inline";
87
+ }
88
+ /**
89
+ * Query parameters of one read. Every value is a constant, a number, or a
90
+ * string this provider validated first — never caller input as-is.
91
+ */
92
+ export interface ConfluenceQuery {
93
+ readonly [key: string]: string | number | boolean | undefined;
94
+ }
95
+ export declare const CONFLUENCE_DIALECTS: Readonly<Record<ConfluenceDeployment, ConfluenceDialect>>;
96
+ /** The dialect of one configured instance. */
97
+ export declare function dialectOf(instance: ConfluenceInstance): ConfluenceDialect;
98
+ /**
99
+ * The `Authorization` header of one stored credential. Cloud spends an
100
+ * Atlassian API token as HTTP Basic over `email:token`; a Server / Data Center
101
+ * personal access token is a bearer token whose account is the token's own, so
102
+ * no e-mail travels with it.
103
+ *
104
+ * The credential carries what the operator's instance declared, so an instance
105
+ * whose deployment type no longer matches the stored credential is refused
106
+ * here, before the secret is spent: a token minted for one product must not be
107
+ * offered to the other.
108
+ */
109
+ export declare function authorizationFor(dialect: ConfluenceDialect, credential: {
110
+ readonly email: string;
111
+ readonly token: string;
112
+ }): string;
113
+ //# sourceMappingURL=dialect.d.ts.map