@camunda/ccma-api 3.1.0 → 5.0.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 (56) hide show
  1. package/dist/index.d.ts +12 -8
  2. package/dist/index.js +4 -0
  3. package/dist/index.js.map +2 -2
  4. package/dist/services/accounts/approvals.m2m.service.d.ts +212 -0
  5. package/dist/services/accounts/approvals.m2m.service.js +330 -0
  6. package/dist/services/accounts/approvals.m2m.service.js.map +2 -2
  7. package/dist/services/accounts/early-access-features.service.d.ts +4 -0
  8. package/dist/services/accounts/early-access-features.service.js.map +2 -2
  9. package/dist/services/accounts/hdp.service.d.ts +16 -3
  10. package/dist/services/accounts/hdp.service.js +45 -2
  11. package/dist/services/accounts/hdp.service.js.map +2 -2
  12. package/dist/services/accounts/orgs.service.d.ts +5 -0
  13. package/dist/services/accounts/orgs.service.js.map +2 -2
  14. package/dist/services/console/console.approvals.m2m.service.d.ts +95 -1
  15. package/dist/services/console/console.approvals.m2m.service.js +142 -0
  16. package/dist/services/console/console.approvals.m2m.service.js.map +2 -2
  17. package/dist/services/console/console.cluster-parameters.service.d.ts +6 -0
  18. package/dist/services/console/console.cluster-parameters.service.js.map +2 -2
  19. package/dist/services/console/console.cluster.service.d.ts +2 -0
  20. package/dist/services/console/console.cluster.service.js.map +2 -2
  21. package/dist/services/console/generation.service.d.ts +17 -1
  22. package/dist/services/console/generation.service.js +52 -1
  23. package/dist/services/console/generation.service.js.map +2 -2
  24. package/dist/services/control/control.approvals.service.d.ts +421 -0
  25. package/dist/services/control/control.approvals.service.js +209 -1
  26. package/dist/services/control/control.approvals.service.js.map +2 -2
  27. package/dist/services/control/control.approvals.service.spec.d.ts +1 -0
  28. package/dist/services/control/control.dashboards.service.d.ts +76 -0
  29. package/dist/services/control/control.dashboards.service.js +180 -0
  30. package/dist/services/control/control.dashboards.service.js.map +7 -0
  31. package/dist/services/control/control.dashboards.service.spec.d.ts +1 -0
  32. package/dist/services/control/control.feature-flags.service.d.ts +53 -0
  33. package/dist/services/control/control.feature-flags.service.js +123 -0
  34. package/dist/services/control/control.feature-flags.service.js.map +7 -0
  35. package/dist/services/control/control.feature-flags.service.spec.d.ts +1 -0
  36. package/dist/services/control/control.platform.service.d.ts +14 -0
  37. package/dist/services/control/control.platform.service.js +27 -0
  38. package/dist/services/control/control.platform.service.js.map +2 -2
  39. package/dist/services/control/control.platform.service.spec.d.ts +1 -0
  40. package/dist/services/external/external.accounts.service.d.ts +2 -2
  41. package/dist/services/external/external.accounts.service.js.map +2 -2
  42. package/dist/services/github/github.service.d.ts +20 -0
  43. package/dist/services/github/github.service.js +50 -1
  44. package/dist/services/github/github.service.js.map +2 -2
  45. package/dist/services/openrouter/openrouter.service.d.ts +35 -0
  46. package/dist/services/openrouter/openrouter.service.js +45 -0
  47. package/dist/services/openrouter/openrouter.service.js.map +2 -2
  48. package/dist/services/slack/slack-blockkit.service.d.ts +7 -0
  49. package/dist/services/slack/slack-blockkit.service.js +1 -0
  50. package/dist/services/slack/slack-blockkit.service.js.map +2 -2
  51. package/dist/utils/environments.js +3 -4
  52. package/dist/utils/environments.js.map +2 -2
  53. package/dist/utils/sse.d.ts +1 -0
  54. package/dist/utils/sse.js +7 -0
  55. package/dist/utils/sse.js.map +2 -2
  56. package/package.json +2 -2
@@ -57,6 +57,336 @@ class AccountsApprovalsM2MService {
57
57
  );
58
58
  }
59
59
  }
60
+ static async changePlatformRoles(params) {
61
+ const serviceContext = {
62
+ method: {
63
+ name: "AccountsApprovalsM2MService.changePlatformRoles",
64
+ url: `api/admin/approvals/users/${encodeURIComponent(params.params.userId)}/roles`,
65
+ normalizedUrl: "api/admin/approvals/users/:userId/roles",
66
+ type: "post"
67
+ },
68
+ source: params.config.metrics?.source || "unset",
69
+ target: { name: "accounts", type: "internal" }
70
+ };
71
+ const response = await request({
72
+ config: params.config,
73
+ base: { id: "accounts" },
74
+ url: serviceContext.method.url,
75
+ method: serviceContext.method.type,
76
+ metricsDetails: serviceContext,
77
+ body: params.body
78
+ });
79
+ if (!response.ok) {
80
+ throw new HttpError(
81
+ `${serviceContext.method.name}: ${response.status} ${response.statusText}`,
82
+ response.status,
83
+ response.statusText
84
+ );
85
+ }
86
+ return response.body;
87
+ }
88
+ static async changeOrgLimit(params) {
89
+ const { orgId, limitKey } = params.params;
90
+ const serviceContext = {
91
+ method: {
92
+ name: "AccountsApprovalsM2MService.changeOrgLimit",
93
+ url: `api/admin/approvals/organizations/${orgId}/limits/${encodeURIComponent(limitKey)}`,
94
+ normalizedUrl: "api/admin/approvals/organizations/:orgId/limits/:limitKey",
95
+ type: "post"
96
+ },
97
+ source: params.config.metrics?.source || "unset",
98
+ target: { name: "accounts", type: "internal" }
99
+ };
100
+ const response = await request({
101
+ config: params.config,
102
+ base: { id: "accounts" },
103
+ url: serviceContext.method.url,
104
+ method: serviceContext.method.type,
105
+ metricsDetails: serviceContext,
106
+ body: params.body,
107
+ responseType: "none"
108
+ });
109
+ if (!response.ok) {
110
+ throw new HttpError(
111
+ `${serviceContext.method.name}: ${response.status} ${response.statusText}`,
112
+ response.status,
113
+ response.statusText
114
+ );
115
+ }
116
+ }
117
+ static async deleteSsoConnection(params) {
118
+ const { strategy, connectionId } = params.params;
119
+ const serviceContext = {
120
+ method: {
121
+ name: "AccountsApprovalsM2MService.deleteSsoConnection",
122
+ url: `api/admin/approvals/connections/${strategy}/${encodeURIComponent(connectionId)}`,
123
+ normalizedUrl: "api/admin/approvals/connections/:strategy/:connectionId",
124
+ type: "delete"
125
+ },
126
+ source: params.config.metrics?.source || "unset",
127
+ target: { name: "accounts", type: "internal" }
128
+ };
129
+ const response = await request({
130
+ config: params.config,
131
+ base: { id: "accounts" },
132
+ url: serviceContext.method.url,
133
+ method: serviceContext.method.type,
134
+ metricsDetails: serviceContext,
135
+ body: params.body
136
+ });
137
+ if (!response.ok) {
138
+ throw new HttpError(
139
+ `${serviceContext.method.name}: ${response.status} ${response.statusText}`,
140
+ response.status,
141
+ response.statusText
142
+ );
143
+ }
144
+ return response.body;
145
+ }
146
+ static async changeSalesPlan(params) {
147
+ const serviceContext = {
148
+ method: {
149
+ name: "AccountsApprovalsM2MService.changeSalesPlan",
150
+ url: `api/admin/approvals/organizations/${params.params.orgId}/sales-plan`,
151
+ normalizedUrl: "api/admin/approvals/organizations/:orgId/sales-plan",
152
+ type: "post"
153
+ },
154
+ source: params.config.metrics?.source || "unset",
155
+ target: { name: "accounts", type: "internal" }
156
+ };
157
+ const response = await request({
158
+ config: params.config,
159
+ base: { id: "accounts" },
160
+ url: serviceContext.method.url,
161
+ method: serviceContext.method.type,
162
+ metricsDetails: serviceContext,
163
+ body: params.body,
164
+ responseType: "none"
165
+ });
166
+ if (!response.ok) {
167
+ throw new HttpError(
168
+ `${serviceContext.method.name}: ${response.status} ${response.statusText}`,
169
+ response.status,
170
+ response.statusText
171
+ );
172
+ }
173
+ }
174
+ static async deleteOrganization(params) {
175
+ const serviceContext = {
176
+ method: {
177
+ name: "AccountsApprovalsM2MService.deleteOrganization",
178
+ url: `api/admin/approvals/organizations/${params.params.orgId}`,
179
+ normalizedUrl: "api/admin/approvals/organizations/:orgId",
180
+ type: "delete"
181
+ },
182
+ source: params.config.metrics?.source || "unset",
183
+ target: { name: "accounts", type: "internal" }
184
+ };
185
+ const response = await request({
186
+ config: params.config,
187
+ base: { id: "accounts" },
188
+ url: serviceContext.method.url,
189
+ method: serviceContext.method.type,
190
+ metricsDetails: serviceContext,
191
+ body: params.body
192
+ });
193
+ if (!response.ok) {
194
+ throw new HttpError(
195
+ `${serviceContext.method.name}: ${response.status} ${response.statusText}`,
196
+ response.status,
197
+ response.statusText
198
+ );
199
+ }
200
+ return response.body;
201
+ }
202
+ static async createPersonalOrganization(params) {
203
+ const serviceContext = {
204
+ method: {
205
+ name: "AccountsApprovalsM2MService.createPersonalOrganization",
206
+ url: "api/admin/approvals/organizations/personal",
207
+ normalizedUrl: "api/admin/approvals/organizations/personal",
208
+ type: "post"
209
+ },
210
+ source: params.config.metrics?.source || "unset",
211
+ target: { name: "accounts", type: "internal" }
212
+ };
213
+ const response = await request({
214
+ config: params.config,
215
+ base: { id: "accounts" },
216
+ url: serviceContext.method.url,
217
+ method: serviceContext.method.type,
218
+ metricsDetails: serviceContext,
219
+ body: params.body
220
+ });
221
+ if (!response.ok) {
222
+ throw new HttpError(
223
+ `${serviceContext.method.name}: ${response.status} ${response.statusText}`,
224
+ response.status,
225
+ response.statusText
226
+ );
227
+ }
228
+ return response.body;
229
+ }
230
+ /**
231
+ * Adds a cluster plan to the `clusterPlanWhiteList` of an organization that
232
+ * the requester owns. Safe to run again.
233
+ */
234
+ static async linkClusterPlan(params) {
235
+ return AccountsApprovalsM2MService.changeClusterPlanLink(params, "put");
236
+ }
237
+ /**
238
+ * Removes a cluster plan from the `clusterPlanWhiteList` of an organization
239
+ * that the requester owns.
240
+ */
241
+ static async unlinkClusterPlan(params) {
242
+ return AccountsApprovalsM2MService.changeClusterPlanLink(params, "delete");
243
+ }
244
+ static async changeClusterPlanLink(params, type) {
245
+ const { orgId, clusterPlanId } = params.params;
246
+ const serviceContext = {
247
+ method: {
248
+ name: type === "put" ? "AccountsApprovalsM2MService.linkClusterPlan" : "AccountsApprovalsM2MService.unlinkClusterPlan",
249
+ url: `api/admin/approvals/organizations/${orgId}/cluster-plans/${clusterPlanId}`,
250
+ normalizedUrl: "api/admin/approvals/organizations/:orgId/cluster-plans/:clusterPlanId",
251
+ type
252
+ },
253
+ source: params.config.metrics?.source || "unset",
254
+ target: { name: "accounts", type: "internal" }
255
+ };
256
+ const response = await request({
257
+ config: params.config,
258
+ base: { id: "accounts" },
259
+ url: serviceContext.method.url,
260
+ method: serviceContext.method.type,
261
+ metricsDetails: serviceContext,
262
+ body: params.body
263
+ });
264
+ if (!response.ok) {
265
+ throw new HttpError(
266
+ `${serviceContext.method.name}: ${response.status} ${response.statusText}`,
267
+ response.status,
268
+ response.statusText
269
+ );
270
+ }
271
+ return response.body;
272
+ }
273
+ /**
274
+ * Removes a cluster plan from the `clusterPlanWhiteList` of every
275
+ * organization that the requester is a member of.
276
+ */
277
+ static async unlinkClusterPlanFromMemberOrganizations(params) {
278
+ const { clusterPlanId } = params.params;
279
+ const serviceContext = {
280
+ method: {
281
+ name: "AccountsApprovalsM2MService.unlinkClusterPlanFromMemberOrganizations",
282
+ url: `api/admin/approvals/cluster-plans/${clusterPlanId}/unlink-from-member-organizations`,
283
+ normalizedUrl: "api/admin/approvals/cluster-plans/:clusterPlanId/unlink-from-member-organizations",
284
+ type: "post"
285
+ },
286
+ source: params.config.metrics?.source || "unset",
287
+ target: { name: "accounts", type: "internal" }
288
+ };
289
+ const response = await request({
290
+ config: params.config,
291
+ base: { id: "accounts" },
292
+ url: serviceContext.method.url,
293
+ method: serviceContext.method.type,
294
+ metricsDetails: serviceContext,
295
+ body: params.body
296
+ });
297
+ if (!response.ok) {
298
+ throw new HttpError(
299
+ `${serviceContext.method.name}: ${response.status} ${response.statusText}`,
300
+ response.status,
301
+ response.statusText
302
+ );
303
+ }
304
+ return response.body;
305
+ }
306
+ static async deleteUser(params) {
307
+ const serviceContext = {
308
+ method: {
309
+ name: "AccountsApprovalsM2MService.deleteUser",
310
+ url: `api/admin/approvals/users/${encodeURIComponent(params.params.userId)}`,
311
+ normalizedUrl: "api/admin/approvals/users/:userId",
312
+ type: "delete"
313
+ },
314
+ source: params.config.metrics?.source || "unset",
315
+ target: { name: "accounts", type: "internal" }
316
+ };
317
+ const response = await request({
318
+ config: params.config,
319
+ base: { id: "accounts" },
320
+ url: serviceContext.method.url,
321
+ method: serviceContext.method.type,
322
+ metricsDetails: serviceContext,
323
+ body: params.body
324
+ });
325
+ if (!response.ok) {
326
+ throw new HttpError(
327
+ `${serviceContext.method.name}: ${response.status} ${response.statusText}`,
328
+ response.status,
329
+ response.statusText
330
+ );
331
+ }
332
+ return response.body;
333
+ }
334
+ static async changeUserEmail(params) {
335
+ const serviceContext = {
336
+ method: {
337
+ name: "AccountsApprovalsM2MService.changeUserEmail",
338
+ url: `api/admin/approvals/users/${encodeURIComponent(params.params.userId)}/email`,
339
+ normalizedUrl: "api/admin/approvals/users/:userId/email",
340
+ type: "post"
341
+ },
342
+ source: params.config.metrics?.source || "unset",
343
+ target: { name: "accounts", type: "internal" }
344
+ };
345
+ const response = await request({
346
+ config: params.config,
347
+ base: { id: "accounts" },
348
+ url: serviceContext.method.url,
349
+ method: serviceContext.method.type,
350
+ metricsDetails: serviceContext,
351
+ body: params.body,
352
+ responseType: "none"
353
+ });
354
+ if (!response.ok) {
355
+ throw new HttpError(
356
+ `${serviceContext.method.name}: ${response.status} ${response.statusText}`,
357
+ response.status,
358
+ response.statusText
359
+ );
360
+ }
361
+ }
362
+ static async updateUserMetadata(params) {
363
+ const serviceContext = {
364
+ method: {
365
+ name: "AccountsApprovalsM2MService.updateUserMetadata",
366
+ url: `api/admin/approvals/users/${encodeURIComponent(params.params.userId)}/metadata/${params.params.kind}`,
367
+ normalizedUrl: "api/admin/approvals/users/:userId/metadata/:kind",
368
+ type: "put"
369
+ },
370
+ source: params.config.metrics?.source || "unset",
371
+ target: { name: "accounts", type: "internal" }
372
+ };
373
+ const response = await request({
374
+ config: params.config,
375
+ base: { id: "accounts" },
376
+ url: serviceContext.method.url,
377
+ method: serviceContext.method.type,
378
+ metricsDetails: serviceContext,
379
+ body: params.body,
380
+ responseType: "none"
381
+ });
382
+ if (!response.ok) {
383
+ throw new HttpError(
384
+ `${serviceContext.method.name}: ${response.status} ${response.statusText}`,
385
+ response.status,
386
+ response.statusText
387
+ );
388
+ }
389
+ }
60
390
  }
61
391
  export {
62
392
  AccountsApprovalsM2MService
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/services/accounts/approvals.m2m.service.ts"],
4
- "sourcesContent": ["/*\n * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH\n * under one or more contributor license agreements. Licensed under a commercial license.\n * You may not use this file except in compliance with the commercial license.\n */\n\nimport type { ApprovalM2mActor } from '@camunda/ccma-shared-types'\nimport type {\n RequestBaseParams,\n RequestBaseServiceContext,\n} from '../../types/general.types.js'\nimport { request } from '../../utils/api.js'\nimport { HttpError } from '../../utils/errors.js'\n\n/**\n * The routes of `api/admin/approvals` in accounts-backend.\n *\n * control-backend calls these when a four-eyes request holds the approvals\n * that it needs. They are separate from `OrgsService`, because they are a\n * separate surface: each one carries its own m2m permission, and each one\n * takes the actor envelope that names the Camundis. The routes that a browser\n * calls today go away, and this service does not go with them.\n */\n\nexport interface ExtendTrialThroughApprovalRequest extends RequestBaseParams {\n params: { orgId: string }\n body: {\n actor: ApprovalM2mActor\n /** An ISO timestamp, between 14 and 62 days from when the call ARRIVES. */\n newExpireDate: string\n }\n}\n\nexport interface SendToExpiredTrialThroughApprovalRequest\n extends RequestBaseParams {\n params: { orgId: string }\n body: { actor: ApprovalM2mActor }\n}\n\nexport class AccountsApprovalsM2MService {\n public static async extendTrial(\n params: ExtendTrialThroughApprovalRequest,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'AccountsApprovalsM2MService.extendTrial',\n url: `api/admin/approvals/organizations/${params.params.orgId}/extend-trial`,\n normalizedUrl: 'api/admin/approvals/organizations/:orgId/extend-trial',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'accounts', type: 'internal' },\n }\n\n const response = await request<void>({\n config: params.config,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: params.body,\n responseType: 'none',\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n }\n\n public static async sendToExpiredTrial(\n params: SendToExpiredTrialThroughApprovalRequest,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'AccountsApprovalsM2MService.sendToExpiredTrial',\n url: `api/admin/approvals/organizations/${params.params.orgId}/expire-trial`,\n normalizedUrl: 'api/admin/approvals/organizations/:orgId/expire-trial',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'accounts', type: 'internal' },\n }\n\n const response = await request<void>({\n config: params.config,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: params.body,\n responseType: 'none',\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n }\n}\n"],
5
- "mappings": "AAWA,SAAS,eAAe;AACxB,SAAS,iBAAiB;AA2BnB,MAAM,4BAA4B;AAAA,EACvC,aAAoB,YAClB,QACe;AACf,UAAM,iBAA4C;AAAA,MAChD,QAAQ;AAAA,QACN,MAAM;AAAA,QACN,KAAK,qCAAqC,OAAO,OAAO,KAAK;AAAA,QAC7D,eAAe;AAAA,QACf,MAAM;AAAA,MACR;AAAA,MACA,QAAQ,OAAO,OAAO,SAAS,UAAU;AAAA,MACzC,QAAQ,EAAE,MAAM,YAAY,MAAM,WAAW;AAAA,IAC/C;AAEA,UAAM,WAAW,MAAM,QAAc;AAAA,MACnC,QAAQ,OAAO;AAAA,MACf,MAAM,EAAE,IAAI,WAAW;AAAA,MACvB,KAAK,eAAe,OAAO;AAAA,MAC3B,QAAQ,eAAe,OAAO;AAAA,MAC9B,gBAAgB;AAAA,MAChB,MAAM,OAAO;AAAA,MACb,cAAc;AAAA,IAChB,CAAC;AAED,QAAI,CAAC,SAAS,IAAI;AAChB,YAAM,IAAI;AAAA,QACR,GAAG,eAAe,OAAO,IAAI,KAAK,SAAS,MAAM,IAAI,SAAS,UAAU;AAAA,QACxE,SAAS;AAAA,QACT,SAAS;AAAA,MACX;AAAA,IACF;AAAA,EACF;AAAA,EAEA,aAAoB,mBAClB,QACe;AACf,UAAM,iBAA4C;AAAA,MAChD,QAAQ;AAAA,QACN,MAAM;AAAA,QACN,KAAK,qCAAqC,OAAO,OAAO,KAAK;AAAA,QAC7D,eAAe;AAAA,QACf,MAAM;AAAA,MACR;AAAA,MACA,QAAQ,OAAO,OAAO,SAAS,UAAU;AAAA,MACzC,QAAQ,EAAE,MAAM,YAAY,MAAM,WAAW;AAAA,IAC/C;AAEA,UAAM,WAAW,MAAM,QAAc;AAAA,MACnC,QAAQ,OAAO;AAAA,MACf,MAAM,EAAE,IAAI,WAAW;AAAA,MACvB,KAAK,eAAe,OAAO;AAAA,MAC3B,QAAQ,eAAe,OAAO;AAAA,MAC9B,gBAAgB;AAAA,MAChB,MAAM,OAAO;AAAA,MACb,cAAc;AAAA,IAChB,CAAC;AAED,QAAI,CAAC,SAAS,IAAI;AAChB,YAAM,IAAI;AAAA,QACR,GAAG,eAAe,OAAO,IAAI,KAAK,SAAS,MAAM,IAAI,SAAS,UAAU;AAAA,QACxE,SAAS;AAAA,QACT,SAAS;AAAA,MACX;AAAA,IACF;AAAA,EACF;AACF;",
4
+ "sourcesContent": ["/*\n * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH\n * under one or more contributor license agreements. Licensed under a commercial license.\n * You may not use this file except in compliance with the commercial license.\n */\n\nimport type { ApprovalM2mActor } from '@camunda/ccma-shared-types'\nimport type {\n RequestBaseParams,\n RequestBaseServiceContext,\n} from '../../types/general.types.js'\nimport { request } from '../../utils/api.js'\nimport { HttpError } from '../../utils/errors.js'\n\n/**\n * The routes of `api/admin/approvals` in accounts-backend.\n *\n * control-backend calls these when a four-eyes request holds the approvals\n * that it needs. They are separate from `OrgsService`, because they are a\n * separate surface: each one carries its own m2m permission, and each one\n * takes the actor envelope that names the Camundis. The routes that a browser\n * calls today go away, and this service does not go with them.\n */\n\nexport interface ExtendTrialThroughApprovalRequest extends RequestBaseParams {\n params: { orgId: string }\n body: {\n actor: ApprovalM2mActor\n /** An ISO timestamp, between 14 and 62 days from when the call ARRIVES. */\n newExpireDate: string\n }\n}\n\nexport interface SendToExpiredTrialThroughApprovalRequest\n extends RequestBaseParams {\n params: { orgId: string }\n body: { actor: ApprovalM2mActor }\n}\n\nexport interface ChangePlatformRolesThroughApprovalRequest\n extends RequestBaseParams {\n params: { userId: string }\n body: {\n actor: ApprovalM2mActor\n /** A CHANGE over the roles that the user holds when the call arrives. */\n rolesToAdd: string[]\n rolesToRemove: string[]\n }\n}\n\n/** What accounts answers for a role change: the roles after it. */\nexport interface ChangePlatformRolesThroughApprovalResult {\n userId: string\n roles: string[]\n rolesAdded: string[]\n rolesRemoved: string[]\n}\n\n/** A value of an org limit. `null` clears the override. */\nexport type OrgLimitValue = string | number | boolean | null\n\nexport interface ChangeOrgLimitThroughApprovalRequest\n extends RequestBaseParams {\n params: { orgId: string; limitKey: string }\n body: {\n actor: ApprovalM2mActor\n /**\n * The override that the person who asked read. Absent for \"not set\".\n * Accounts answers 409 and writes nothing when the override moved since.\n */\n expected?: OrgLimitValue\n value: OrgLimitValue\n }\n}\n\nexport interface DeleteSsoConnectionThroughApprovalRequest\n extends RequestBaseParams {\n params: { strategy: 'waad' | 'samlp'; connectionId: string }\n body: {\n actor: ApprovalM2mActor\n /**\n * The name of the connection that the approvers read. Accounts refuses\n * the deletion when the connection has another name.\n */\n connectionName?: string\n }\n}\n\n/** What accounts answers for a deleted connection. */\nexport interface DeleteSsoConnectionThroughApprovalResult {\n connectionId: string\n connectionName: string\n /** The users who signed in with the connection. Accounts deleted them too. */\n deletedUsers: number\n}\n\nexport interface ChangeSalesPlanThroughApprovalRequest\n extends RequestBaseParams {\n params: { orgId: string }\n body: {\n actor: ApprovalM2mActor\n salesPlanId: string\n /**\n * The plan that the person who asked read. Absent for \"no plan\". Accounts\n * answers 409 and switches nothing when the plan moved since.\n */\n expectedSalesPlanId?: string\n /**\n * The names of the two plans that the approvers read. Accounts refuses\n * the switch when a plan has another name.\n */\n salesPlanName?: string\n expectedSalesPlanName?: string\n force: boolean\n }\n}\n\nexport interface DeleteOrganizationThroughApprovalRequest\n extends RequestBaseParams {\n params: { orgId: string }\n body: {\n actor: ApprovalM2mActor\n /**\n * The name that the approvers read. Accounts refuses the deletion when\n * the organization has another name.\n */\n orgName: string\n }\n}\n\n/** What accounts answers for a deleted organization. */\nexport interface DeleteOrganizationThroughApprovalResult {\n orgId: string\n /** The members that accounts removed before it deleted the organization. */\n removedMembers: number\n}\n\nexport interface CreatePersonalOrganizationThroughApprovalRequest\n extends RequestBaseParams {\n body: {\n actor: ApprovalM2mActor\n name: string\n }\n}\n\n/** What accounts answers for a new personal organization. */\nexport interface CreatePersonalOrganizationThroughApprovalResult {\n orgId: string\n}\n\nexport interface ChangeClusterPlanLinkThroughApprovalRequest\n extends RequestBaseParams {\n params: { orgId: string; clusterPlanId: string }\n body: { actor: ApprovalM2mActor }\n}\n\n/** What accounts answers for a link or an unlink of one organization. */\nexport interface ChangeClusterPlanLinkThroughApprovalResult {\n orgId: string\n clusterPlanId: string\n /** `false` when the list of the organization already was as wanted. */\n changed: boolean\n}\n\nexport interface UnlinkClusterPlanFromMemberOrganizationsRequest\n extends RequestBaseParams {\n params: { clusterPlanId: string }\n body: { actor: ApprovalM2mActor }\n}\n\nexport interface UnlinkClusterPlanFromMemberOrganizationsResult {\n /** The organizations whose list held the plan before the call. */\n unlinkedOrgIds: string[]\n}\n\nexport interface DeleteUserThroughApprovalRequest extends RequestBaseParams {\n params: { userId: string }\n body: {\n actor: ApprovalM2mActor\n /**\n * The address that the approvers read. When given, accounts refuses the\n * deletion of a user with another address.\n */\n expectedEmail?: string\n /**\n * Accounts answers `deleted: false` for a user that Auth0 does not have,\n * and not 404. A purge sets it.\n */\n skipMissing?: boolean\n }\n}\n\n/** What accounts answers for a user deletion. */\nexport interface DeleteUserThroughApprovalResult {\n userId: string\n /** `false` when Auth0 had no such user, which only `skipMissing` answers. */\n deleted: boolean\n}\n\nexport interface ChangeUserEmailThroughApprovalRequest\n extends RequestBaseParams {\n params: { userId: string }\n body: {\n actor: ApprovalM2mActor\n /**\n * The address that the person who asked read. Accounts answers 409 and\n * changes nothing when the address moved since.\n */\n expectedEmail: string\n newEmail: string\n }\n}\n\nexport interface UpdateUserMetadataThroughApprovalRequest\n extends RequestBaseParams {\n params: { userId: string; kind: 'app' | 'user' }\n body: {\n actor: ApprovalM2mActor\n /**\n * The metadata that the person who asked read. Absent for \"not set\".\n * Accounts answers 409 and writes nothing when it moved since.\n */\n expected?: Record<string, unknown>\n metadata: Record<string, unknown>\n }\n}\n\nexport class AccountsApprovalsM2MService {\n public static async extendTrial(\n params: ExtendTrialThroughApprovalRequest,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'AccountsApprovalsM2MService.extendTrial',\n url: `api/admin/approvals/organizations/${params.params.orgId}/extend-trial`,\n normalizedUrl: 'api/admin/approvals/organizations/:orgId/extend-trial',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'accounts', type: 'internal' },\n }\n\n const response = await request<void>({\n config: params.config,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: params.body,\n responseType: 'none',\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n }\n\n public static async sendToExpiredTrial(\n params: SendToExpiredTrialThroughApprovalRequest,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'AccountsApprovalsM2MService.sendToExpiredTrial',\n url: `api/admin/approvals/organizations/${params.params.orgId}/expire-trial`,\n normalizedUrl: 'api/admin/approvals/organizations/:orgId/expire-trial',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'accounts', type: 'internal' },\n }\n\n const response = await request<void>({\n config: params.config,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: params.body,\n responseType: 'none',\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n }\n\n public static async changePlatformRoles(\n params: ChangePlatformRolesThroughApprovalRequest,\n ): Promise<ChangePlatformRolesThroughApprovalResult> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'AccountsApprovalsM2MService.changePlatformRoles',\n url: `api/admin/approvals/users/${encodeURIComponent(params.params.userId)}/roles`,\n normalizedUrl: 'api/admin/approvals/users/:userId/roles',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'accounts', type: 'internal' },\n }\n\n const response = await request<ChangePlatformRolesThroughApprovalResult>({\n config: params.config,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: params.body,\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n return response.body!\n }\n\n public static async changeOrgLimit(\n params: ChangeOrgLimitThroughApprovalRequest,\n ): Promise<void> {\n const { orgId, limitKey } = params.params\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'AccountsApprovalsM2MService.changeOrgLimit',\n url: `api/admin/approvals/organizations/${orgId}/limits/${encodeURIComponent(limitKey)}`,\n normalizedUrl:\n 'api/admin/approvals/organizations/:orgId/limits/:limitKey',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'accounts', type: 'internal' },\n }\n\n const response = await request<void>({\n config: params.config,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: params.body,\n responseType: 'none',\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n }\n\n public static async deleteSsoConnection(\n params: DeleteSsoConnectionThroughApprovalRequest,\n ): Promise<DeleteSsoConnectionThroughApprovalResult> {\n const { strategy, connectionId } = params.params\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'AccountsApprovalsM2MService.deleteSsoConnection',\n url: `api/admin/approvals/connections/${strategy}/${encodeURIComponent(connectionId)}`,\n normalizedUrl:\n 'api/admin/approvals/connections/:strategy/:connectionId',\n type: 'delete',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'accounts', type: 'internal' },\n }\n\n const response = await request<DeleteSsoConnectionThroughApprovalResult>({\n config: params.config,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: params.body,\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n return response.body!\n }\n\n public static async changeSalesPlan(\n params: ChangeSalesPlanThroughApprovalRequest,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'AccountsApprovalsM2MService.changeSalesPlan',\n url: `api/admin/approvals/organizations/${params.params.orgId}/sales-plan`,\n normalizedUrl: 'api/admin/approvals/organizations/:orgId/sales-plan',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'accounts', type: 'internal' },\n }\n\n const response = await request<void>({\n config: params.config,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: params.body,\n responseType: 'none',\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n }\n\n public static async deleteOrganization(\n params: DeleteOrganizationThroughApprovalRequest,\n ): Promise<DeleteOrganizationThroughApprovalResult> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'AccountsApprovalsM2MService.deleteOrganization',\n url: `api/admin/approvals/organizations/${params.params.orgId}`,\n normalizedUrl: 'api/admin/approvals/organizations/:orgId',\n type: 'delete',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'accounts', type: 'internal' },\n }\n\n const response = await request<DeleteOrganizationThroughApprovalResult>({\n config: params.config,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: params.body,\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n return response.body!\n }\n\n public static async createPersonalOrganization(\n params: CreatePersonalOrganizationThroughApprovalRequest,\n ): Promise<CreatePersonalOrganizationThroughApprovalResult> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'AccountsApprovalsM2MService.createPersonalOrganization',\n url: 'api/admin/approvals/organizations/personal',\n normalizedUrl: 'api/admin/approvals/organizations/personal',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'accounts', type: 'internal' },\n }\n\n const response =\n await request<CreatePersonalOrganizationThroughApprovalResult>({\n config: params.config,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: params.body,\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n return response.body!\n }\n\n /**\n * Adds a cluster plan to the `clusterPlanWhiteList` of an organization that\n * the requester owns. Safe to run again.\n */\n public static async linkClusterPlan(\n params: ChangeClusterPlanLinkThroughApprovalRequest,\n ): Promise<ChangeClusterPlanLinkThroughApprovalResult> {\n return AccountsApprovalsM2MService.changeClusterPlanLink(params, 'put')\n }\n\n /**\n * Removes a cluster plan from the `clusterPlanWhiteList` of an organization\n * that the requester owns.\n */\n public static async unlinkClusterPlan(\n params: ChangeClusterPlanLinkThroughApprovalRequest,\n ): Promise<ChangeClusterPlanLinkThroughApprovalResult> {\n return AccountsApprovalsM2MService.changeClusterPlanLink(params, 'delete')\n }\n\n private static async changeClusterPlanLink(\n params: ChangeClusterPlanLinkThroughApprovalRequest,\n type: 'put' | 'delete',\n ): Promise<ChangeClusterPlanLinkThroughApprovalResult> {\n const { orgId, clusterPlanId } = params.params\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name:\n type === 'put'\n ? 'AccountsApprovalsM2MService.linkClusterPlan'\n : 'AccountsApprovalsM2MService.unlinkClusterPlan',\n url: `api/admin/approvals/organizations/${orgId}/cluster-plans/${clusterPlanId}`,\n normalizedUrl:\n 'api/admin/approvals/organizations/:orgId/cluster-plans/:clusterPlanId',\n type,\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'accounts', type: 'internal' },\n }\n\n const response = await request<ChangeClusterPlanLinkThroughApprovalResult>({\n config: params.config,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: params.body,\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n return response.body!\n }\n\n /**\n * Removes a cluster plan from the `clusterPlanWhiteList` of every\n * organization that the requester is a member of.\n */\n public static async unlinkClusterPlanFromMemberOrganizations(\n params: UnlinkClusterPlanFromMemberOrganizationsRequest,\n ): Promise<UnlinkClusterPlanFromMemberOrganizationsResult> {\n const { clusterPlanId } = params.params\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'AccountsApprovalsM2MService.unlinkClusterPlanFromMemberOrganizations',\n url: `api/admin/approvals/cluster-plans/${clusterPlanId}/unlink-from-member-organizations`,\n normalizedUrl:\n 'api/admin/approvals/cluster-plans/:clusterPlanId/unlink-from-member-organizations',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'accounts', type: 'internal' },\n }\n\n const response =\n await request<UnlinkClusterPlanFromMemberOrganizationsResult>({\n config: params.config,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: params.body,\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n return response.body!\n }\n\n public static async deleteUser(\n params: DeleteUserThroughApprovalRequest,\n ): Promise<DeleteUserThroughApprovalResult> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'AccountsApprovalsM2MService.deleteUser',\n url: `api/admin/approvals/users/${encodeURIComponent(params.params.userId)}`,\n normalizedUrl: 'api/admin/approvals/users/:userId',\n type: 'delete',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'accounts', type: 'internal' },\n }\n\n const response = await request<DeleteUserThroughApprovalResult>({\n config: params.config,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: params.body,\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n return response.body!\n }\n\n public static async changeUserEmail(\n params: ChangeUserEmailThroughApprovalRequest,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'AccountsApprovalsM2MService.changeUserEmail',\n url: `api/admin/approvals/users/${encodeURIComponent(params.params.userId)}/email`,\n normalizedUrl: 'api/admin/approvals/users/:userId/email',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'accounts', type: 'internal' },\n }\n\n const response = await request<void>({\n config: params.config,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: params.body,\n responseType: 'none',\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n }\n\n public static async updateUserMetadata(\n params: UpdateUserMetadataThroughApprovalRequest,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'AccountsApprovalsM2MService.updateUserMetadata',\n url: `api/admin/approvals/users/${encodeURIComponent(params.params.userId)}/metadata/${params.params.kind}`,\n normalizedUrl: 'api/admin/approvals/users/:userId/metadata/:kind',\n type: 'put',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'accounts', type: 'internal' },\n }\n\n const response = await request<void>({\n config: params.config,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: params.body,\n responseType: 'none',\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n }\n}\n"],
5
+ "mappings": "AAWA,SAAS,eAAe;AACxB,SAAS,iBAAiB;AAuNnB,MAAM,4BAA4B;AAAA,EACvC,aAAoB,YAClB,QACe;AACf,UAAM,iBAA4C;AAAA,MAChD,QAAQ;AAAA,QACN,MAAM;AAAA,QACN,KAAK,qCAAqC,OAAO,OAAO,KAAK;AAAA,QAC7D,eAAe;AAAA,QACf,MAAM;AAAA,MACR;AAAA,MACA,QAAQ,OAAO,OAAO,SAAS,UAAU;AAAA,MACzC,QAAQ,EAAE,MAAM,YAAY,MAAM,WAAW;AAAA,IAC/C;AAEA,UAAM,WAAW,MAAM,QAAc;AAAA,MACnC,QAAQ,OAAO;AAAA,MACf,MAAM,EAAE,IAAI,WAAW;AAAA,MACvB,KAAK,eAAe,OAAO;AAAA,MAC3B,QAAQ,eAAe,OAAO;AAAA,MAC9B,gBAAgB;AAAA,MAChB,MAAM,OAAO;AAAA,MACb,cAAc;AAAA,IAChB,CAAC;AAED,QAAI,CAAC,SAAS,IAAI;AAChB,YAAM,IAAI;AAAA,QACR,GAAG,eAAe,OAAO,IAAI,KAAK,SAAS,MAAM,IAAI,SAAS,UAAU;AAAA,QACxE,SAAS;AAAA,QACT,SAAS;AAAA,MACX;AAAA,IACF;AAAA,EACF;AAAA,EAEA,aAAoB,mBAClB,QACe;AACf,UAAM,iBAA4C;AAAA,MAChD,QAAQ;AAAA,QACN,MAAM;AAAA,QACN,KAAK,qCAAqC,OAAO,OAAO,KAAK;AAAA,QAC7D,eAAe;AAAA,QACf,MAAM;AAAA,MACR;AAAA,MACA,QAAQ,OAAO,OAAO,SAAS,UAAU;AAAA,MACzC,QAAQ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AAAA,QACxE,SAAS;AAAA,QACT,SAAS;AAAA,MACX;AAAA,IACF;AAAA,EACF;AACF;",
6
6
  "names": []
7
7
  }
@@ -14,6 +14,7 @@ export interface EarlyAccessFeatureDto {
14
14
  clickwrapId?: string;
15
15
  actionUrl?: string;
16
16
  actionLabel?: string;
17
+ featureFlagKey?: string;
17
18
  salesPlanTypeVisibilities?: EarlyAccessFeatureSalesPlanConfigDto[];
18
19
  }
19
20
  export interface EarlyAccessFeatureActivationDto {
@@ -43,6 +44,7 @@ export interface CreateEarlyAccessFeatureParams extends RequestBaseParams {
43
44
  description: string;
44
45
  actionLabel?: string;
45
46
  actionUrl?: string;
47
+ featureFlagKey?: string;
46
48
  salesPlanTypeVisibilities?: EarlyAccessFeatureSalesPlanConfigDto[];
47
49
  };
48
50
  }
@@ -59,6 +61,8 @@ export interface UpdateEarlyAccessFeatureParams extends RequestBaseParams {
59
61
  actionLabel?: string;
60
62
  actionUrl?: string;
61
63
  clickwrapId?: string;
64
+ /** An empty string removes the gate. When absent, the gate stays as it is. */
65
+ featureFlagKey?: string;
62
66
  };
63
67
  }
64
68
  export interface DeleteEarlyAccessFeatureParams extends RequestBaseParams {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/services/accounts/early-access-features.service.ts"],
4
- "sourcesContent": ["/*\n * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH\n * under one or more contributor license agreements. Licensed under a commercial license.\n * You may not use this file except in compliance with the commercial license.\n */\n\nimport type {\n RequestBaseParams,\n RequestBaseServiceContext,\n} from '../../types/general.types.js'\nimport { request } from '../../utils/api.js'\nimport { HttpError } from '../../utils/errors.js'\n\nexport interface EarlyAccessFeatureSalesPlanConfigDto {\n salesPlanType: string\n default: boolean\n requiresClickwrap: boolean\n}\n\nexport interface EarlyAccessFeatureDto {\n uuid: string\n frontendId: string\n name: string\n availableIn: string\n description: string\n documentationLink: string\n clickwrapId?: string\n actionUrl?: string\n actionLabel?: string\n salesPlanTypeVisibilities?: EarlyAccessFeatureSalesPlanConfigDto[]\n}\n\nexport interface EarlyAccessFeatureActivationDto {\n feature: EarlyAccessFeatureDto\n active: boolean\n requiresClickwrap: boolean\n hasAcceptedFeatureTerms: boolean\n}\n\nexport interface GetEarlyAccessFeaturesForOrgParams extends RequestBaseParams {\n params: {\n orgId: string\n }\n}\n\nexport interface SetEarlyAccessFeatureActivationParams\n extends RequestBaseParams {\n params: {\n orgId: string\n featureUuid: string\n activate: boolean\n }\n}\n\nexport interface CreateEarlyAccessFeatureParams extends RequestBaseParams {\n body: {\n name: string\n frontendId: string\n availableIn: string\n documentationLink: string\n description: string\n actionLabel?: string\n actionUrl?: string\n salesPlanTypeVisibilities?: EarlyAccessFeatureSalesPlanConfigDto[]\n }\n}\n\nexport interface UpdateEarlyAccessFeatureParams extends RequestBaseParams {\n params: {\n uuid: string\n }\n body: {\n name: string\n availableIn: string\n documentationLink: string\n description: string\n salesPlanTypeVisibilities: EarlyAccessFeatureSalesPlanConfigDto[]\n actionLabel?: string\n actionUrl?: string\n clickwrapId?: string\n }\n}\n\nexport interface DeleteEarlyAccessFeatureParams extends RequestBaseParams {\n params: {\n uuid: string\n }\n}\n\nexport interface GetEarlyAccessFeatureOrgsParams extends RequestBaseParams {\n params: {\n uuid: string\n }\n}\n\n/** An organization currently using an early-access feature. */\nexport interface EarlyAccessFeatureOrgDto {\n uuid: string\n name: string\n salesPlanType?: string\n}\n\nexport class EarlyAccessFeaturesService {\n public static async getAll(\n params: RequestBaseParams,\n ): Promise<EarlyAccessFeatureDto[]> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'EarlyAccessFeaturesService.getAll',\n url: 'api/earlyaccessfeatures',\n normalizedUrl: 'api/earlyaccessfeatures',\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'accounts', type: 'internal' },\n }\n\n const response = await request<EarlyAccessFeatureDto[]>({\n ...params,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n\n return response.body ?? []\n }\n\n /**\n * Organizations currently using a feature\n * (`GET api/earlyaccessfeatures/:uuid/orgs`), backing the per-feature detail\n * view (org list + CSV export).\n */\n public static async getOrgsForFeature(\n params: GetEarlyAccessFeatureOrgsParams,\n ): Promise<EarlyAccessFeatureOrgDto[]> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'EarlyAccessFeaturesService.getOrgsForFeature',\n url: `api/earlyaccessfeatures/${encodeURIComponent(params.params.uuid)}/orgs`,\n normalizedUrl: 'api/earlyaccessfeatures/:uuid/orgs',\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'accounts', type: 'internal' },\n }\n\n const response = await request<EarlyAccessFeatureOrgDto[]>({\n ...params,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n\n return response.body ?? []\n }\n\n public static async create(\n params: CreateEarlyAccessFeatureParams,\n ): Promise<EarlyAccessFeatureDto> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'EarlyAccessFeaturesService.create',\n url: 'api/earlyaccessfeatures',\n normalizedUrl: 'api/earlyaccessfeatures',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'accounts', type: 'internal' },\n }\n\n const response = await request<EarlyAccessFeatureDto>({\n config: params.config,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: params.body,\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n\n return response.body!\n }\n\n public static async update(\n params: UpdateEarlyAccessFeatureParams,\n ): Promise<EarlyAccessFeatureDto> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'EarlyAccessFeaturesService.update',\n url: `api/earlyaccessfeatures/${encodeURIComponent(params.params.uuid)}`,\n normalizedUrl: 'api/earlyaccessfeatures/:uuid',\n type: 'put',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'accounts', type: 'internal' },\n }\n\n const response = await request<EarlyAccessFeatureDto>({\n config: params.config,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: params.body,\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n\n return response.body!\n }\n\n public static async delete(\n params: DeleteEarlyAccessFeatureParams,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'EarlyAccessFeaturesService.delete',\n url: `api/earlyaccessfeatures/${encodeURIComponent(params.params.uuid)}`,\n normalizedUrl: 'api/earlyaccessfeatures/:uuid',\n type: 'delete',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'accounts', type: 'internal' },\n }\n\n const response = await request({\n config: params.config,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n responseType: 'none',\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n }\n\n public static async getForOrg(\n params: GetEarlyAccessFeaturesForOrgParams,\n ): Promise<EarlyAccessFeatureActivationDto[]> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'EarlyAccessFeaturesService.getForOrg',\n url: `api/earlyaccessfeatures/org/${encodeURIComponent(params.params.orgId)}`,\n normalizedUrl: 'api/earlyaccessfeatures/org/:orgId',\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'accounts', type: 'internal' },\n }\n\n const response = await request<EarlyAccessFeatureActivationDto[]>({\n ...params,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n\n return response.body!\n }\n\n public static async setActivation(\n params: SetEarlyAccessFeatureActivationParams,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'EarlyAccessFeaturesService.setActivation',\n url: `api/earlyaccessfeatures/org/${encodeURIComponent(\n params.params.orgId,\n )}/activate/${encodeURIComponent(params.params.featureUuid)}`,\n normalizedUrl:\n 'api/earlyaccessfeatures/org/:orgId/activate/:featureUuid',\n type: 'put',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'accounts', type: 'internal' },\n }\n\n const response = await request({\n config: params.config,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: {\n activate: params.params.activate,\n },\n responseType: 'none',\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n }\n}\n"],
5
- "mappings": "AAUA,SAAS,eAAe;AACxB,SAAS,iBAAiB;AA2FnB,MAAM,2BAA2B;AAAA,EACtC,aAAoB,OAClB,QACkC;AAClC,UAAM,iBAA4C;AAAA,MAChD,QAAQ;AAAA,QACN,MAAM;AAAA,QACN,KAAK;AAAA,QACL,eAAe;AAAA,QACf,MAAM;AAAA,MACR;AAAA,MACA,QAAQ,OAAO,OAAO,SAAS,UAAU;AAAA,MACzC,QAAQ,EAAE,MAAM,YAAY,MAAM,WAAW;AAAA,IAC/C;AAEA,UAAM,WAAW,MAAM,QAAiC;AAAA,MACtD,GAAG;AAAA,MACH,MAAM,EAAE,IAAI,WAAW;AAAA,MACvB,KAAK,eAAe,OA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,IAAI,SAAS,UAAU;AAAA,QACxE,SAAS;AAAA,QACT,SAAS;AAAA,MACX;AAAA,IACF;AAEA,WAAO,SAAS;AAAA,EAClB;AAAA,EAEA,aAAoB,cAClB,QACe;AACf,UAAM,iBAA4C;AAAA,MAChD,QAAQ;AAAA,QACN,MAAM;AAAA,QACN,KAAK,+BAA+B;AAAA,UAClC,OAAO,OAAO;AAAA,QAChB,CAAC,aAAa,mBAAmB,OAAO,OAAO,WAAW,CAAC;AAAA,QAC3D,eACE;AAAA,QACF,MAAM;AAAA,MACR;AAAA,MACA,QAAQ,OAAO,OAAO,SAAS,UAAU;AAAA,MACzC,QAAQ,EAAE,MAAM,YAAY,MAAM,WAAW;AAAA,IAC/C;AAEA,UAAM,WAAW,MAAM,QAAQ;AAAA,MAC7B,QAAQ,OAAO;AAAA,MACf,MAAM,EAAE,IAAI,WAAW;AAAA,MACvB,KAAK,eAAe,OAAO;AAAA,MAC3B,QAAQ,eAAe,OAAO;AAAA,MAC9B,gBAAgB;AAAA,MAChB,MAAM;AAAA,QACJ,UAAU,OAAO,OAAO;AAAA,MAC1B;AAAA,MACA,cAAc;AAAA,IAChB,CAAC;AAED,QAAI,CAAC,SAAS,IAAI;AAChB,YAAM,IAAI;AAAA,QACR,GAAG,eAAe,OAAO,IAAI,KAAK,SAAS,MAAM,IAAI,SAAS,UAAU;AAAA,QACxE,SAAS;AAAA,QACT,SAAS;AAAA,MACX;AAAA,IACF;AAAA,EACF;AACF;",
4
+ "sourcesContent": ["/*\n * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH\n * under one or more contributor license agreements. Licensed under a commercial license.\n * You may not use this file except in compliance with the commercial license.\n */\n\nimport type {\n RequestBaseParams,\n RequestBaseServiceContext,\n} from '../../types/general.types.js'\nimport { request } from '../../utils/api.js'\nimport { HttpError } from '../../utils/errors.js'\n\nexport interface EarlyAccessFeatureSalesPlanConfigDto {\n salesPlanType: string\n default: boolean\n requiresClickwrap: boolean\n}\n\nexport interface EarlyAccessFeatureDto {\n uuid: string\n frontendId: string\n name: string\n availableIn: string\n description: string\n documentationLink: string\n clickwrapId?: string\n actionUrl?: string\n actionLabel?: string\n featureFlagKey?: string\n salesPlanTypeVisibilities?: EarlyAccessFeatureSalesPlanConfigDto[]\n}\n\nexport interface EarlyAccessFeatureActivationDto {\n feature: EarlyAccessFeatureDto\n active: boolean\n requiresClickwrap: boolean\n hasAcceptedFeatureTerms: boolean\n}\n\nexport interface GetEarlyAccessFeaturesForOrgParams extends RequestBaseParams {\n params: {\n orgId: string\n }\n}\n\nexport interface SetEarlyAccessFeatureActivationParams\n extends RequestBaseParams {\n params: {\n orgId: string\n featureUuid: string\n activate: boolean\n }\n}\n\nexport interface CreateEarlyAccessFeatureParams extends RequestBaseParams {\n body: {\n name: string\n frontendId: string\n availableIn: string\n documentationLink: string\n description: string\n actionLabel?: string\n actionUrl?: string\n featureFlagKey?: string\n salesPlanTypeVisibilities?: EarlyAccessFeatureSalesPlanConfigDto[]\n }\n}\n\nexport interface UpdateEarlyAccessFeatureParams extends RequestBaseParams {\n params: {\n uuid: string\n }\n body: {\n name: string\n availableIn: string\n documentationLink: string\n description: string\n salesPlanTypeVisibilities: EarlyAccessFeatureSalesPlanConfigDto[]\n actionLabel?: string\n actionUrl?: string\n clickwrapId?: string\n /** An empty string removes the gate. When absent, the gate stays as it is. */\n featureFlagKey?: string\n }\n}\n\nexport interface DeleteEarlyAccessFeatureParams extends RequestBaseParams {\n params: {\n uuid: string\n }\n}\n\nexport interface GetEarlyAccessFeatureOrgsParams extends RequestBaseParams {\n params: {\n uuid: string\n }\n}\n\n/** An organization currently using an early-access feature. */\nexport interface EarlyAccessFeatureOrgDto {\n uuid: string\n name: string\n salesPlanType?: string\n}\n\nexport class EarlyAccessFeaturesService {\n public static async getAll(\n params: RequestBaseParams,\n ): Promise<EarlyAccessFeatureDto[]> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'EarlyAccessFeaturesService.getAll',\n url: 'api/earlyaccessfeatures',\n normalizedUrl: 'api/earlyaccessfeatures',\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'accounts', type: 'internal' },\n }\n\n const response = await request<EarlyAccessFeatureDto[]>({\n ...params,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n\n return response.body ?? []\n }\n\n /**\n * Organizations currently using a feature\n * (`GET api/earlyaccessfeatures/:uuid/orgs`), backing the per-feature detail\n * view (org list + CSV export).\n */\n public static async getOrgsForFeature(\n params: GetEarlyAccessFeatureOrgsParams,\n ): Promise<EarlyAccessFeatureOrgDto[]> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'EarlyAccessFeaturesService.getOrgsForFeature',\n url: `api/earlyaccessfeatures/${encodeURIComponent(params.params.uuid)}/orgs`,\n normalizedUrl: 'api/earlyaccessfeatures/:uuid/orgs',\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'accounts', type: 'internal' },\n }\n\n const response = await request<EarlyAccessFeatureOrgDto[]>({\n ...params,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n\n return response.body ?? []\n }\n\n public static async create(\n params: CreateEarlyAccessFeatureParams,\n ): Promise<EarlyAccessFeatureDto> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'EarlyAccessFeaturesService.create',\n url: 'api/earlyaccessfeatures',\n normalizedUrl: 'api/earlyaccessfeatures',\n type: 'post',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'accounts', type: 'internal' },\n }\n\n const response = await request<EarlyAccessFeatureDto>({\n config: params.config,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: params.body,\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n\n return response.body!\n }\n\n public static async update(\n params: UpdateEarlyAccessFeatureParams,\n ): Promise<EarlyAccessFeatureDto> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'EarlyAccessFeaturesService.update',\n url: `api/earlyaccessfeatures/${encodeURIComponent(params.params.uuid)}`,\n normalizedUrl: 'api/earlyaccessfeatures/:uuid',\n type: 'put',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'accounts', type: 'internal' },\n }\n\n const response = await request<EarlyAccessFeatureDto>({\n config: params.config,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: params.body,\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n\n return response.body!\n }\n\n public static async delete(\n params: DeleteEarlyAccessFeatureParams,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'EarlyAccessFeaturesService.delete',\n url: `api/earlyaccessfeatures/${encodeURIComponent(params.params.uuid)}`,\n normalizedUrl: 'api/earlyaccessfeatures/:uuid',\n type: 'delete',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'accounts', type: 'internal' },\n }\n\n const response = await request({\n config: params.config,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n responseType: 'none',\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n }\n\n public static async getForOrg(\n params: GetEarlyAccessFeaturesForOrgParams,\n ): Promise<EarlyAccessFeatureActivationDto[]> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'EarlyAccessFeaturesService.getForOrg',\n url: `api/earlyaccessfeatures/org/${encodeURIComponent(params.params.orgId)}`,\n normalizedUrl: 'api/earlyaccessfeatures/org/:orgId',\n type: 'get',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'accounts', type: 'internal' },\n }\n\n const response = await request<EarlyAccessFeatureActivationDto[]>({\n ...params,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n\n return response.body!\n }\n\n public static async setActivation(\n params: SetEarlyAccessFeatureActivationParams,\n ): Promise<void> {\n const serviceContext: RequestBaseServiceContext = {\n method: {\n name: 'EarlyAccessFeaturesService.setActivation',\n url: `api/earlyaccessfeatures/org/${encodeURIComponent(\n params.params.orgId,\n )}/activate/${encodeURIComponent(params.params.featureUuid)}`,\n normalizedUrl:\n 'api/earlyaccessfeatures/org/:orgId/activate/:featureUuid',\n type: 'put',\n },\n source: params.config.metrics?.source || 'unset',\n target: { name: 'accounts', type: 'internal' },\n }\n\n const response = await request({\n config: params.config,\n base: { id: 'accounts' },\n url: serviceContext.method.url,\n method: serviceContext.method.type,\n metricsDetails: serviceContext,\n body: {\n activate: params.params.activate,\n },\n responseType: 'none',\n })\n\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n }\n}\n"],
5
+ "mappings": "AAUA,SAAS,eAAe;AACxB,SAAS,iBAAiB;AA+FnB,MAAM,2BAA2B;AAAA,EACtC,aAAoB,OAClB,QACkC;AAClC,UAAM,iBAA4C;AAAA,MAChD,QAAQ;AAAA,QACN,MAAM;AAAA,QACN,KAAK;AAAA,QACL,eAAe;AAAA,QACf,MAAM;AAAA,MACR;AAAA,MACA,QAAQ,OAAO,OAAO,SAAS,U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,OAAO;AAAA,MAC3B,QAAQ,eAAe,OAAO;AAAA,MAC9B,gBAAgB;AAAA,IAClB,CAAC;AAED,QAAI,CAAC,SAAS,IAAI;AAChB,YAAM,IAAI;AAAA,QACR,GAAG,eAAe,OAAO,IAAI,KAAK,SAAS,MAAM,IAAI,SAAS,UAAU;AAAA,QACxE,SAAS;AAAA,QACT,SAAS;AAAA,MACX;AAAA,IACF;AAEA,WAAO,SAAS;AAAA,EAClB;AAAA,EAEA,aAAoB,cAClB,QACe;AACf,UAAM,iBAA4C;AAAA,MAChD,QAAQ;AAAA,QACN,MAAM;AAAA,QACN,KAAK,+BAA+B;AAAA,UAClC,OAAO,OAAO;AAAA,QAChB,CAAC,aAAa,mBAAmB,OAAO,OAAO,WAAW,CAAC;AAAA,QAC3D,eACE;AAAA,QACF,MAAM;AAAA,MACR;AAAA,MACA,QAAQ,OAAO,OAAO,SAAS,UAAU;AAAA,MACzC,QAAQ,EAAE,MAAM,YAAY,MAAM,WAAW;AAAA,IAC/C;AAEA,UAAM,WAAW,MAAM,QAAQ;AAAA,MAC7B,QAAQ,OAAO;AAAA,MACf,MAAM,EAAE,IAAI,WAAW;AAAA,MACvB,KAAK,eAAe,OAAO;AAAA,MAC3B,QAAQ,eAAe,OAAO;AAAA,MAC9B,gBAAgB;AAAA,MAChB,MAAM;AAAA,QACJ,UAAU,OAAO,OAAO;AAAA,MAC1B;AAAA,MACA,cAAc;AAAA,IAChB,CAAC;AAED,QAAI,CAAC,SAAS,IAAI;AAChB,YAAM,IAAI;AAAA,QACR,GAAG,eAAe,OAAO,IAAI,KAAK,SAAS,MAAM,IAAI,SAAS,UAAU;AAAA,QACxE,SAAS;AAAA,QACT,SAAS;AAAA,MACX;AAAA,IACF;AAAA,EACF;AACF;",
6
6
  "names": []
7
7
  }
@@ -1,5 +1,10 @@
1
- import type { Hdp, HdpBackendChangeEvent, HdpDisk, HdpPrometheusDataCapacityDataPoint, HdpTenantUsageBreakdown, HdpTenantUsagePoint } from '@camunda/ccma-shared-types';
1
+ import type { ChartResult, ChartSpec, Hdp, HdpBackendChangeEvent, HdpDisk, HdpPrometheusDataCapacityDataPoint, HdpTenantUsageBreakdown, HdpTenantUsagePoint } from '@camunda/ccma-shared-types';
2
2
  import type { RequestBaseParams } from '../../types/general.types.js';
3
+ export interface QueryChartRequest extends RequestBaseParams {
4
+ params: {
5
+ spec: ChartSpec;
6
+ };
7
+ }
3
8
  export interface GetClusterCapacityRequest extends RequestBaseParams {
4
9
  params: {
5
10
  orgId: string;
@@ -139,10 +144,18 @@ export declare class HdpService {
139
144
  * the answer for one hour, thus a page can call this on load. HDP keeps the
140
145
  * rows of deleted clusters, thus the caller matches `rows` against its own
141
146
  * cluster list. A cluster with no row has no cost data. That is not a cost
142
- * of 0. While `control.fleetHostingCost` is off on the stage, `rows` is
143
- * empty.
147
+ * of 0.
144
148
  */
145
149
  static getFleetHostingCost(params: RequestBaseParams): Promise<Hdp.FleetHostingCost>;
150
+ /**
151
+ * One chart of a Control dashboard: a query on one metric of HDP. Admin
152
+ * only, and only while `control.dashboardCharts` is on (404 otherwise). The
153
+ * backend checks the spec against `CHART_METRICS` and answers 400 for a spec
154
+ * it refuses, 422 when the query reads too many bytes, and 429 when the user
155
+ * runs too many queries. The message of the thrown {@link HttpError} is the
156
+ * reason that the backend gives.
157
+ */
158
+ static queryChart(params: QueryChartRequest): Promise<ChartResult>;
146
159
  static getActiveOrgs(params: GetActiveOrgsRequest): Promise<GetActiveOrgsResponse>;
147
160
  static getLlmUsage(params: GetLlmUsageRequest): Promise<LlmUsageEntry[]>;
148
161
  }
@@ -313,8 +313,7 @@ class HdpService {
313
313
  * the answer for one hour, thus a page can call this on load. HDP keeps the
314
314
  * rows of deleted clusters, thus the caller matches `rows` against its own
315
315
  * cluster list. A cluster with no row has no cost data. That is not a cost
316
- * of 0. While `control.fleetHostingCost` is off on the stage, `rows` is
317
- * empty.
316
+ * of 0.
318
317
  */
319
318
  static async getFleetHostingCost(params) {
320
319
  const serviceContext = {
@@ -348,6 +347,50 @@ class HdpService {
348
347
  }
349
348
  return response.body;
350
349
  }
350
+ /**
351
+ * One chart of a Control dashboard: a query on one metric of HDP. Admin
352
+ * only, and only while `control.dashboardCharts` is on (404 otherwise). The
353
+ * backend checks the spec against `CHART_METRICS` and answers 400 for a spec
354
+ * it refuses, 422 when the query reads too many bytes, and 429 when the user
355
+ * runs too many queries. The message of the thrown {@link HttpError} is the
356
+ * reason that the backend gives.
357
+ */
358
+ static async queryChart(params) {
359
+ const serviceContext = {
360
+ method: {
361
+ name: `HdpService.queryChart`,
362
+ url: "api/hdp/charts/query",
363
+ normalizedUrl: "api/hdp/charts/query",
364
+ type: "post"
365
+ },
366
+ source: params.config.metrics?.source || "unset",
367
+ target: {
368
+ name: "accounts",
369
+ type: "internal"
370
+ }
371
+ };
372
+ const response = await request({
373
+ ...params,
374
+ base: {
375
+ id: "accounts"
376
+ },
377
+ url: serviceContext.method.url,
378
+ method: serviceContext.method.type,
379
+ metricsDetails: serviceContext,
380
+ body: params.params.spec,
381
+ // No retry on a 429: a retry after the backoff starts a BigQuery job
382
+ // that nobody asked for. The chart shows the limit at once.
383
+ retry: { attempts: 1, remaining: 0 }
384
+ });
385
+ if (!response.ok || !response.body) {
386
+ throw new HttpError(
387
+ `${serviceContext.method.name}: ${response.status} ${response.statusText}`,
388
+ response.status,
389
+ response.statusText
390
+ );
391
+ }
392
+ return response.body;
393
+ }
351
394
  static async getActiveOrgs(params) {
352
395
  const serviceContext = {
353
396
  method: {