@yadsh/dsh-qa-integrations 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (191) hide show
  1. package/README.md +431 -18
  2. package/compatibility.json +1 -1
  3. package/lib/broker.js +456 -9
  4. package/lib/broker.js.map +1 -1
  5. package/lib/client/bitrix24.js +2 -1
  6. package/lib/client/bitrix24.js.map +1 -1
  7. package/lib/client/card.js +8 -1
  8. package/lib/client/card.js.map +1 -1
  9. package/lib/client/confluence.js +3 -2
  10. package/lib/client/confluence.js.map +1 -1
  11. package/lib/client/gitlab.js +40 -4
  12. package/lib/client/gitlab.js.map +1 -1
  13. package/lib/client/index.js +13 -11
  14. package/lib/client/index.js.map +1 -1
  15. package/lib/client/integrations.js +39 -2
  16. package/lib/client/integrations.js.map +1 -1
  17. package/lib/client/jira.js +3 -2
  18. package/lib/client/jira.js.map +1 -1
  19. package/lib/client/provider-card.js +138 -4
  20. package/lib/client/provider-card.js.map +1 -1
  21. package/lib/client/styles.js +8 -5
  22. package/lib/client/styles.js.map +1 -1
  23. package/lib/client/teamcity.js +31 -4
  24. package/lib/client/teamcity.js.map +1 -1
  25. package/lib/client/testit.js +65 -0
  26. package/lib/client/testit.js.map +1 -0
  27. package/lib/client/weblate.js +70 -0
  28. package/lib/client/weblate.js.map +1 -0
  29. package/lib/client.js +2600 -480
  30. package/lib/client.js.map +1 -1
  31. package/lib/coerce.js +16 -7
  32. package/lib/coerce.js.map +1 -1
  33. package/lib/config.js +12 -0
  34. package/lib/config.js.map +1 -1
  35. package/lib/errors.js.map +1 -1
  36. package/lib/index.js +274 -28
  37. package/lib/index.js.map +1 -1
  38. package/lib/providers/bitrix24/catalog.js +13 -0
  39. package/lib/providers/bitrix24/catalog.js.map +1 -1
  40. package/lib/providers/bitrix24/config.js +3 -0
  41. package/lib/providers/bitrix24/config.js.map +1 -1
  42. package/lib/providers/bitrix24/credential-help.js +24 -0
  43. package/lib/providers/bitrix24/credential-help.js.map +1 -0
  44. package/lib/providers/bitrix24/index.js +9 -0
  45. package/lib/providers/bitrix24/index.js.map +1 -1
  46. package/lib/providers/bitrix24/operations.js +60 -1
  47. package/lib/providers/bitrix24/operations.js.map +1 -1
  48. package/lib/providers/bitrix24/tools.js +95 -3
  49. package/lib/providers/bitrix24/tools.js.map +1 -1
  50. package/lib/providers/confluence/credential-help.js +29 -0
  51. package/lib/providers/confluence/credential-help.js.map +1 -0
  52. package/lib/providers/confluence/index.js +9 -0
  53. package/lib/providers/confluence/index.js.map +1 -1
  54. package/lib/providers/gitlab/catalog.js +108 -15
  55. package/lib/providers/gitlab/catalog.js.map +1 -1
  56. package/lib/providers/gitlab/config.js +11 -3
  57. package/lib/providers/gitlab/config.js.map +1 -1
  58. package/lib/providers/gitlab/credential-help.js +33 -0
  59. package/lib/providers/gitlab/credential-help.js.map +1 -0
  60. package/lib/providers/gitlab/index.js +337 -6
  61. package/lib/providers/gitlab/index.js.map +1 -1
  62. package/lib/providers/jira/credential-help.js +31 -0
  63. package/lib/providers/jira/credential-help.js.map +1 -0
  64. package/lib/providers/jira/index.js +9 -0
  65. package/lib/providers/jira/index.js.map +1 -1
  66. package/lib/providers/registry.js +4 -0
  67. package/lib/providers/registry.js.map +1 -1
  68. package/lib/providers/shared/credential-help.js +29 -0
  69. package/lib/providers/shared/credential-help.js.map +1 -0
  70. package/lib/providers/shared/service-boundary.js +44 -0
  71. package/lib/providers/shared/service-boundary.js.map +1 -0
  72. package/lib/providers/teamcity/catalog.js +56 -2
  73. package/lib/providers/teamcity/catalog.js.map +1 -1
  74. package/lib/providers/teamcity/credential-help.js +25 -0
  75. package/lib/providers/teamcity/credential-help.js.map +1 -0
  76. package/lib/providers/teamcity/index.js +254 -2
  77. package/lib/providers/teamcity/index.js.map +1 -1
  78. package/lib/providers/testit/attachments.js +131 -0
  79. package/lib/providers/testit/attachments.js.map +1 -0
  80. package/lib/providers/testit/catalog.js +225 -0
  81. package/lib/providers/testit/catalog.js.map +1 -0
  82. package/lib/providers/testit/config.js +175 -0
  83. package/lib/providers/testit/config.js.map +1 -0
  84. package/lib/providers/testit/credential-help.js +29 -0
  85. package/lib/providers/testit/credential-help.js.map +1 -0
  86. package/lib/providers/testit/index.js +184 -0
  87. package/lib/providers/testit/index.js.map +1 -0
  88. package/lib/providers/testit/operations.js +1070 -0
  89. package/lib/providers/testit/operations.js.map +1 -0
  90. package/lib/providers/testit/tools.js +717 -0
  91. package/lib/providers/testit/tools.js.map +1 -0
  92. package/lib/providers/testit/transport.js +158 -0
  93. package/lib/providers/testit/transport.js.map +1 -0
  94. package/lib/providers/weblate/catalog.js +185 -0
  95. package/lib/providers/weblate/catalog.js.map +1 -0
  96. package/lib/providers/weblate/config.js +147 -0
  97. package/lib/providers/weblate/config.js.map +1 -0
  98. package/lib/providers/weblate/credential-help.js +26 -0
  99. package/lib/providers/weblate/credential-help.js.map +1 -0
  100. package/lib/providers/weblate/index.js +181 -0
  101. package/lib/providers/weblate/index.js.map +1 -0
  102. package/lib/providers/weblate/operations.js +703 -0
  103. package/lib/providers/weblate/operations.js.map +1 -0
  104. package/lib/providers/weblate/query.js +80 -0
  105. package/lib/providers/weblate/query.js.map +1 -0
  106. package/lib/providers/weblate/tools.js +408 -0
  107. package/lib/providers/weblate/tools.js.map +1 -0
  108. package/lib/providers/weblate/transport.js +179 -0
  109. package/lib/providers/weblate/transport.js.map +1 -0
  110. package/lib/repository.js +197 -13
  111. package/lib/repository.js.map +1 -1
  112. package/lib/service-credentials/config.js +179 -0
  113. package/lib/service-credentials/config.js.map +1 -0
  114. package/lib/service-credentials/policy.js +92 -0
  115. package/lib/service-credentials/policy.js.map +1 -0
  116. package/lib/service-credentials/registry.js +142 -0
  117. package/lib/service-credentials/registry.js.map +1 -0
  118. package/lib/service-credentials/state.js +30 -0
  119. package/lib/service-credentials/state.js.map +1 -0
  120. package/lib/service-credentials/types.js +20 -0
  121. package/lib/service-credentials/types.js.map +1 -0
  122. package/lib/tools.js +27 -2
  123. package/lib/tools.js.map +1 -1
  124. package/lib/typert.host.js +1187 -39
  125. package/lib/typert.remote-client.d.ts +37 -5
  126. package/lib/typert.remote-client.js +1057 -33
  127. package/lib/types/broker.d.ts +70 -4
  128. package/lib/types/client/bitrix24.d.ts +1 -1
  129. package/lib/types/client/card.d.ts +3 -1
  130. package/lib/types/client/confluence.d.ts +2 -2
  131. package/lib/types/client/gitlab.d.ts +15 -2
  132. package/lib/types/client/index.d.ts +3 -2
  133. package/lib/types/client/integrations.d.ts +11 -2
  134. package/lib/types/client/jira.d.ts +2 -2
  135. package/lib/types/client/provider-card.d.ts +50 -8
  136. package/lib/types/client/styles.d.ts +4 -3
  137. package/lib/types/client/teamcity.d.ts +15 -2
  138. package/lib/types/client/testit.d.ts +15 -0
  139. package/lib/types/client/weblate.d.ts +15 -0
  140. package/lib/types/coerce.d.ts +2 -2
  141. package/lib/types/config.d.ts +21 -0
  142. package/lib/types/errors.d.ts +9 -1
  143. package/lib/types/index.d.ts +108 -11
  144. package/lib/types/providers/bitrix24/catalog.d.ts +1 -1
  145. package/lib/types/providers/bitrix24/config.d.ts +11 -1
  146. package/lib/types/providers/bitrix24/credential-help.d.ts +8 -0
  147. package/lib/types/providers/bitrix24/index.d.ts +5 -0
  148. package/lib/types/providers/bitrix24/tools.d.ts +4 -0
  149. package/lib/types/providers/confluence/credential-help.d.ts +9 -0
  150. package/lib/types/providers/confluence/index.d.ts +5 -0
  151. package/lib/types/providers/contract.d.ts +62 -1
  152. package/lib/types/providers/gitlab/catalog.d.ts +20 -5
  153. package/lib/types/providers/gitlab/config.d.ts +14 -3
  154. package/lib/types/providers/gitlab/credential-help.d.ts +9 -0
  155. package/lib/types/providers/gitlab/index.d.ts +51 -1
  156. package/lib/types/providers/jira/credential-help.d.ts +8 -0
  157. package/lib/types/providers/jira/index.d.ts +5 -0
  158. package/lib/types/providers/registry.d.ts +2 -0
  159. package/lib/types/providers/shared/credential-help.d.ts +17 -0
  160. package/lib/types/providers/shared/service-boundary.d.ts +25 -0
  161. package/lib/types/providers/teamcity/catalog.d.ts +18 -2
  162. package/lib/types/providers/teamcity/credential-help.d.ts +8 -0
  163. package/lib/types/providers/teamcity/index.d.ts +53 -2
  164. package/lib/types/providers/testit/attachments.d.ts +20 -0
  165. package/lib/types/providers/testit/catalog.d.ts +75 -0
  166. package/lib/types/providers/testit/config.d.ts +61 -0
  167. package/lib/types/providers/testit/credential-help.d.ts +8 -0
  168. package/lib/types/providers/testit/index.d.ts +60 -0
  169. package/lib/types/providers/testit/operations.d.ts +95 -0
  170. package/lib/types/providers/testit/tools.d.ts +15 -0
  171. package/lib/types/providers/testit/transport.d.ts +67 -0
  172. package/lib/types/providers/weblate/catalog.d.ts +43 -0
  173. package/lib/types/providers/weblate/config.d.ts +57 -0
  174. package/lib/types/providers/weblate/credential-help.d.ts +9 -0
  175. package/lib/types/providers/weblate/index.d.ts +50 -0
  176. package/lib/types/providers/weblate/operations.d.ts +77 -0
  177. package/lib/types/providers/weblate/query.d.ts +37 -0
  178. package/lib/types/providers/weblate/tools.d.ts +15 -0
  179. package/lib/types/providers/weblate/transport.d.ts +60 -0
  180. package/lib/types/repository.d.ts +38 -3
  181. package/lib/types/service-credentials/config.d.ts +73 -0
  182. package/lib/types/service-credentials/policy.d.ts +44 -0
  183. package/lib/types/service-credentials/registry.d.ts +43 -0
  184. package/lib/types/service-credentials/state.d.ts +14 -0
  185. package/lib/types/service-credentials/types.d.ts +97 -0
  186. package/lib/types/tools.d.ts +10 -1
  187. package/lib/types/types.d.ts +114 -10
  188. package/package.json +7 -7
  189. package/lib/shared/settings.js +0 -19
  190. package/lib/shared/settings.js.map +0 -1
  191. package/lib/types/shared/settings.d.ts +0 -19
@@ -0,0 +1,184 @@
1
+ import { resolveCredentialHelp, } from "@yadsh/dsh-plugin-kit";
2
+ import { IntegrationError } from "../../errors.js";
3
+ import { redactSecrets } from "../../redaction.js";
4
+ import { objectOf } from "../shared/account.js";
5
+ import { assertReadableSize, attachmentBinaryProblem, attachmentByteLimit, attachmentName, } from "./attachments.js";
6
+ import { TESTIT_CAPABILITY_INFO, TESTIT_OPERATIONS, enabledCapabilities, testitOperationCapability, } from "./catalog.js";
7
+ import { TESTIT_HANDLERS, TESTIT_PROJECTIONS, contentBlock, } from "./operations.js";
8
+ import { TESTIT_CREDENTIAL_HELP } from "./credential-help.js";
9
+ import { TestitTransport, credentialFromPlaintext, credentialInstance, } from "./transport.js";
10
+ export { credentialFromPlaintext, credentialInstance, } from "./transport.js";
11
+ /**
12
+ * Test IT API tokens are opaque: the platform documents no shape, so the only
13
+ * checks worth making are the ones that catch a paste mistake — a URL instead
14
+ * of a token, or whitespace a copy carried along.
15
+ */
16
+ const TOKEN_SHAPE = /^\S{16,4096}$/u;
17
+ const URL_LIKE = /^https?:\/\//iu;
18
+ /**
19
+ * Test IT provider: one Test IT installation per QA user, connected with that
20
+ * user's own API token.
21
+ *
22
+ * The installation is operator configuration — the connect form only picks from
23
+ * the configured list — so the broker cannot be pointed at a host of the
24
+ * caller's choosing, and the address is re-resolved from config on every call,
25
+ * which makes removing or repointing an instance take effect at once.
26
+ */
27
+ export class TestitProvider {
28
+ config;
29
+ id = "testit";
30
+ displayName = "Test IT";
31
+ /** What this deployment is willing to expose; Test IT's own rights still apply. */
32
+ capabilities;
33
+ capabilityInfo = TESTIT_CAPABILITY_INFO;
34
+ /** Where the settings card says this provider's credential comes from. */
35
+ credentialHelp;
36
+ /** Overrides the deployment got wrong; reported once at startup, never fatal. */
37
+ credentialHelpProblems;
38
+ transport;
39
+ constructor(config, fetcher = fetch) {
40
+ this.config = config;
41
+ this.transport = new TestitTransport(config, config.testit, fetcher);
42
+ this.capabilities = Object.freeze(enabledCapabilities(config.testit));
43
+ const help = resolveCredentialHelp(TESTIT_CREDENTIAL_HELP, config.credentialHelp["testit"]);
44
+ this.credentialHelp = help.help;
45
+ this.credentialHelpProblems = help.problems;
46
+ }
47
+ /**
48
+ * Keep only the token, tagged with the installation it was minted for. The
49
+ * instance comes from the connect form and from operator config, never from a
50
+ * tool argument, which is what keeps the broker from dialling any host the
51
+ * caller names.
52
+ */
53
+ parseCredential(raw, options) {
54
+ const token = raw.trim();
55
+ if (!TOKEN_SHAPE.test(token) || URL_LIKE.test(token)) {
56
+ throw new IntegrationError("InvalidCredential", "Use a Test IT API token");
57
+ }
58
+ const instance = this.resolveInstance(options?.["instanceId"]);
59
+ return {
60
+ credential: JSON.stringify({
61
+ instanceId: instance.id,
62
+ token,
63
+ }),
64
+ portal: instance.baseUrl,
65
+ };
66
+ }
67
+ operationCapability(operation) {
68
+ return testitOperationCapability(operation);
69
+ }
70
+ /**
71
+ * The documented first validation call is the project list: an authorized
72
+ * answer proves the address and the token at once, and an empty project list
73
+ * is a valid authorization result rather than a failure. Test IT API v2 has no
74
+ * endpoint that names the token owner, so no identity is stored — the answer
75
+ * reports what the probe proved and nothing more.
76
+ */
77
+ async validate(context) {
78
+ const credential = credentialFromPlaintext(context.credential);
79
+ const instance = credentialInstance(this.config.testit, credential);
80
+ const connection = TESTIT_HANDLERS["connection.get"];
81
+ if (connection === undefined) {
82
+ throw new IntegrationError("ProviderUnavailable", "Test IT connection probe is unavailable");
83
+ }
84
+ const probeRequest = connection({}, { flags: this.config.testit });
85
+ const probe = await this.transport.getJson(instance, credential.token, probeRequest.path, probeRequest.query);
86
+ const visible = probe.page?.total ?? (Array.isArray(probe.data) ? probe.data.length : 0);
87
+ return {
88
+ tenantId: instance.baseUrl,
89
+ externalUserId: "",
90
+ displayName: `${instance.label} · Test IT API v2, проектов видно: ${visible}`,
91
+ /**
92
+ * Test IT does not report the permissions of the token it was given, so
93
+ * there is nothing to narrow here: the deployment switches bound what this
94
+ * connection may attempt, and Test IT itself refuses the rest.
95
+ */
96
+ capabilities: this.capabilities,
97
+ };
98
+ }
99
+ async execute(context, operation, input) {
100
+ const credential = credentialFromPlaintext(context.credential);
101
+ const instance = credentialInstance(this.config.testit, credential);
102
+ const definition = TESTIT_OPERATIONS[operation];
103
+ const handler = TESTIT_HANDLERS[operation];
104
+ if (definition === undefined || handler === undefined) {
105
+ throw new IntegrationError("InvalidRequest", "Unsupported Test IT operation");
106
+ }
107
+ const flags = this.config.testit;
108
+ const request = handler(input, { flags });
109
+ if (definition.stream === true) {
110
+ return this.readAttachment(instance, credential, input, request, flags);
111
+ }
112
+ const response = await this.transport.getJson(instance, credential.token, request.path, request.query);
113
+ const projection = TESTIT_PROJECTIONS[operation];
114
+ if (projection === undefined)
115
+ return objectOf(response.data);
116
+ const projected = projection(response.data, {
117
+ flags,
118
+ input,
119
+ page: response.page,
120
+ instanceLabel: instance.label,
121
+ baseUrl: instance.baseUrl,
122
+ });
123
+ // A list projection already answered with its envelope; a single-resource
124
+ // answer is wrapped so every tool result has the same object shape.
125
+ return definition.list === undefined ? objectOf(projected) : projected;
126
+ }
127
+ /**
128
+ * One attachment, read as text. Test IT describes the file — its name and its
129
+ * size — before a byte is requested, and this provider trusts that description
130
+ * over anything the caller said: an archive, a screenshot, a document or a key
131
+ * is refused by name, a file bigger than the budget is refused by size, and
132
+ * the body that does come back is bounded, redacted and marked as external
133
+ * content.
134
+ */
135
+ async readAttachment(instance, credential, input, request, flags) {
136
+ const metadata = await this.transport.getJson(instance, credential.token, `${request.path}/metadata`, {});
137
+ const described = objectOf(metadata.data);
138
+ const attachmentId = String(input["attachmentId"] ?? "");
139
+ const name = attachmentName(described["name"]) || `${attachmentId}`;
140
+ const problem = attachmentBinaryProblem(name);
141
+ if (problem !== undefined) {
142
+ throw new IntegrationError("InvalidRequest", problem);
143
+ }
144
+ const declared = described["size"];
145
+ const declaredBytes = typeof declared === "number" && Number.isFinite(declared)
146
+ ? declared
147
+ : undefined;
148
+ const limit = attachmentByteLimit(input["maxBytes"], flags);
149
+ assertReadableSize(declaredBytes, limit);
150
+ const body = await this.transport.getText(instance, credential.token, request.path, limit);
151
+ const text = body.binary ? "" : String(redactSecrets(body.text) ?? "");
152
+ return {
153
+ attachmentId,
154
+ name,
155
+ type: typeof described["type"] === "string" ? described["type"] : null,
156
+ declaredBytes: declaredBytes ?? null,
157
+ downloadedBytes: body.bytes,
158
+ binary: body.binary,
159
+ truncated: body.truncated,
160
+ ...(body.binary ? {} : { untrustedContent: contentBlock(text, limit) }),
161
+ };
162
+ }
163
+ resolveInstance(requested) {
164
+ const flags = this.config.testit;
165
+ const id = requested?.trim();
166
+ if (id !== undefined && id !== "") {
167
+ const instance = flags.instances.find((item) => item.id === id);
168
+ if (instance === undefined) {
169
+ throw new IntegrationError("InvalidCredential", "Unknown Test IT instance");
170
+ }
171
+ return instance;
172
+ }
173
+ const [only] = flags.instances;
174
+ if (only === undefined) {
175
+ throw new IntegrationError("InvalidCredential", "No Test IT instance is configured");
176
+ }
177
+ if (flags.instances.length > 1) {
178
+ throw new IntegrationError("InvalidCredential", "Choose a Test IT instance");
179
+ }
180
+ return only;
181
+ }
182
+ }
183
+ export default TestitProvider;
184
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/providers/testit/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,GAEtB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAOnD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EACL,kBAAkB,EAClB,uBAAuB,EACvB,mBAAmB,EACnB,cAAc,GACf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,sBAAsB,EACtB,iBAAiB,EACjB,mBAAmB,EACnB,yBAAyB,GAC1B,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,YAAY,GAEb,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EACL,eAAe,EACf,uBAAuB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