@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
@@ -100,6 +100,52 @@ export interface SendToExpiredTrialPayloadDto {
100
100
  orgId: string;
101
101
  orgName?: string;
102
102
  }
103
+ export interface CreatePersonalOrganisationPayloadDto {
104
+ /** 3 to 100 characters, after the spaces at both ends are cut. */
105
+ name: string;
106
+ }
107
+ /**
108
+ * The create call of `create-personal-organisation`.
109
+ *
110
+ * It has no `requiredAcks`: the request needs no approval, and the route
111
+ * answers 400 to a body that names the field.
112
+ */
113
+ export interface CreatePersonalOrganisationRequest extends RequestBaseParams {
114
+ params: {
115
+ payload: CreatePersonalOrganisationPayloadDto;
116
+ reason?: string;
117
+ };
118
+ }
119
+ export interface CreateCustomerHardwareSizingPayloadDto {
120
+ /** The organization that gets the plan. The requester must own it. */
121
+ orgId: string;
122
+ /** 3 to 100 characters, after the spaces at both ends are cut. */
123
+ name: string;
124
+ /** The cluster plan, in the same format as the plan route of the admin tool. */
125
+ plan: Record<string, unknown>;
126
+ }
127
+ /**
128
+ * `unlink` removes the plan from one organization that the requester owns.
129
+ * `delete` removes it from every organization of the requester, and deletes it.
130
+ */
131
+ export type RemoveCustomerHardwareSizingPayloadDto = {
132
+ mode: 'unlink';
133
+ clusterPlanId: string;
134
+ orgId: string;
135
+ } | {
136
+ mode: 'delete';
137
+ clusterPlanId: string;
138
+ };
139
+ /**
140
+ * The create call of a customer hardware sizing use case. Like
141
+ * `CreatePersonalOrganisationRequest`, it has no `requiredAcks`.
142
+ */
143
+ export interface CustomerHardwareSizingRequest<TPayload> extends RequestBaseParams {
144
+ params: {
145
+ payload: TPayload;
146
+ reason?: string;
147
+ };
148
+ }
103
149
  export interface ExtendTrialPayloadDto {
104
150
  orgId: string;
105
151
  orgName?: string;
@@ -121,6 +167,232 @@ export interface MoveClusterOrgPayloadDto {
121
167
  /** A copy, for the same reason as `clusterName`. */
122
168
  targetOrgName?: string;
123
169
  }
170
+ export interface ChangePlatformRolesPayloadDto {
171
+ userId: string;
172
+ /** A copy, so a list shows a person and not an Auth0 id. Nothing reads it. */
173
+ userEmail?: string;
174
+ /**
175
+ * A CHANGE, and never the whole set. Accounts applies it over the roles that
176
+ * the user holds when the action RUNS, so a role change that somebody else
177
+ * made while the request waited stays.
178
+ */
179
+ rolesToAdd: string[];
180
+ rolesToRemove: string[];
181
+ }
182
+ export interface ChangeOrgLimitsPayloadDto {
183
+ orgId: string;
184
+ /** A copy, so a list shows a name that a person knows. Nothing reads it. */
185
+ orgName?: string;
186
+ /** One key of `allSalesPlanLimits()`. One limit for each request. */
187
+ limitKey: string;
188
+ /**
189
+ * The override that the person who asked READ. Absent for "not set".
190
+ *
191
+ * Accounts compares it with the override that it holds when the action
192
+ * runs, and writes nothing when the two differ. See `staleApprovalKeys`.
193
+ */
194
+ expected?: string | number | boolean;
195
+ /** The new override. `null` clears it, and the default of the plan applies. */
196
+ value: string | number | boolean | null;
197
+ }
198
+ export interface ChangeClusterPlanTypePayloadDto {
199
+ clusterId: string;
200
+ /** A copy, so a list shows a name that a person knows. Nothing reads it. */
201
+ clusterName?: string;
202
+ /** The organization that owns the cluster. Console refuses another one. */
203
+ orgId: string;
204
+ /** A copy, for the same reason as `clusterName`. */
205
+ orgName?: string;
206
+ toPlanTypeUuid: string;
207
+ /** A copy of the name of the new plan type, for the approver to read. */
208
+ toPlanTypeName?: string;
209
+ /**
210
+ * The hardware packages of the cluster after the change, 1 at least.
211
+ *
212
+ * Always sent, also for a plan type with no availability class, where it is
213
+ * 1. Console checks the reservations of the organization only when the
214
+ * packages are in the call, and the check is the point of this use case.
215
+ */
216
+ numberOfAllocatedHwPackages: number;
217
+ /**
218
+ * The plan type that the person who asked READ.
219
+ *
220
+ * Console compares it with the plan type of the cluster when the action
221
+ * runs, and changes nothing when the two differ.
222
+ */
223
+ expectedPlanTypeUuid: string;
224
+ /** A copy of the name of the current plan type, for the approver to read. */
225
+ expectedPlanTypeName?: string;
226
+ /**
227
+ * The hardware packages that the person who asked READ, 1 for a cluster
228
+ * that holds none. The same stale guard as `expectedPlanTypeUuid`.
229
+ */
230
+ expectedNumberOfAllocatedHwPackages: number;
231
+ /**
232
+ * The cluster plan that the person who asked READ. Console decides the
233
+ * plan move from it, so it is part of the stale guard too, and Console
234
+ * refuses a cluster that runs none, so a request needs one.
235
+ */
236
+ expectedClusterPlanUuid: string;
237
+ /** A copy of the name of that plan, for the approver to read. */
238
+ expectedClusterPlanName?: string;
239
+ /**
240
+ * The active modification config that the person who asked READ, absent
241
+ * when the cluster has none. The change removes it, and an approver must
242
+ * read which one goes.
243
+ */
244
+ expectedActiveModificationConfigUuid?: string;
245
+ /**
246
+ * The active plan of the NEW plan type that the person who asked READ. The
247
+ * cluster moves to it, so a plan that a Camundi changed on the type while
248
+ * the request waited fails the guard, and Console refuses a type that has
249
+ * none, so a request needs one.
250
+ */
251
+ expectedTargetPlanUuid: string;
252
+ /** A copy of the name of that plan, for the approver to read. */
253
+ expectedTargetPlanName?: string;
254
+ /**
255
+ * Whether the cluster plan moves to the active plan of the new type, as
256
+ * the dialog read it. The list of migratable plans can change while the
257
+ * request waits, and a verdict that moved changes whether the cluster
258
+ * restarts, so Console refuses a request whose verdict moved.
259
+ */
260
+ expectedClusterPlanUpdate: boolean;
261
+ }
262
+ export interface ChangeSalesPlanPayloadDto {
263
+ orgId: string;
264
+ /** A copy, so a list shows a name that a person knows. Nothing reads it. */
265
+ orgName?: string;
266
+ salesPlanId: string;
267
+ /** A copy of the name of the new plan, for the approver to read. */
268
+ salesPlanName?: string;
269
+ /**
270
+ * The plan that the person who asked READ. Absent for "no plan".
271
+ *
272
+ * Accounts compares it with the plan that it holds when the action runs,
273
+ * and switches nothing when the two differ.
274
+ */
275
+ expectedSalesPlanId?: string;
276
+ /** A copy of the name of the current plan, for the approver to read. */
277
+ expectedSalesPlanName?: string;
278
+ /** Skips the validation of the switch. The approver sees it. */
279
+ force: boolean;
280
+ }
281
+ /** Every value of a flag row that a person can change. */
282
+ export interface FeatureFlagValuesDto {
283
+ description: string;
284
+ enabled: boolean;
285
+ orgIds: string[];
286
+ emailDomains: string[];
287
+ /** The team that owns the flag. A create needs it. An older row has none. */
288
+ owner?: string;
289
+ /** `YYYY-MM-DD`, the day after which the flag is late. */
290
+ expiresAt?: string;
291
+ /**
292
+ * The issue that tracks the flag. A create and an edit need it. An older
293
+ * row has none.
294
+ */
295
+ issueUrl?: string;
296
+ }
297
+ /**
298
+ * One change of the feature flag table: the action, and the whole row that it
299
+ * asks for.
300
+ *
301
+ * An edit and a delete carry the row that the person who asked READ, as
302
+ * `expected`. The action writes nothing when the row changed in the meantime.
303
+ * `key` of an edit and a delete is a copy for the approver, and the action
304
+ * compares it too.
305
+ */
306
+ export type ChangeFeatureFlagPayloadDto = {
307
+ action: 'create';
308
+ key: string;
309
+ value: FeatureFlagValuesDto & {
310
+ owner: string;
311
+ issueUrl: string;
312
+ };
313
+ } | {
314
+ action: 'update';
315
+ id: string;
316
+ key: string;
317
+ expected: FeatureFlagValuesDto;
318
+ value: FeatureFlagValuesDto & {
319
+ issueUrl: string;
320
+ };
321
+ } | {
322
+ action: 'delete';
323
+ id: string;
324
+ key: string;
325
+ expected: FeatureFlagValuesDto;
326
+ };
327
+ export interface DeleteSsoConnectionPayloadDto {
328
+ strategy: 'waad' | 'samlp';
329
+ connectionId: string;
330
+ /** A copy, so a list shows a name that a person knows. Nothing reads it. */
331
+ connectionName?: string;
332
+ /**
333
+ * The organizations that the connection serves, as copies for the approver.
334
+ * The request is findable on the page of each one.
335
+ */
336
+ orgIds?: string[];
337
+ }
338
+ export interface DeleteOrganizationPayloadDto {
339
+ orgId: string;
340
+ /**
341
+ * The name that the approvers read. Accounts refuses the deletion when the
342
+ * organization has another name when the action runs.
343
+ */
344
+ orgName: string;
345
+ }
346
+ export interface DeleteUserPayloadDto {
347
+ userId: string;
348
+ /**
349
+ * The address that the approvers read. Accounts refuses the deletion when
350
+ * the user has another address when the action runs.
351
+ */
352
+ userEmail: string;
353
+ }
354
+ export interface ChangeUserEmailPayloadDto {
355
+ userId: string;
356
+ /**
357
+ * The address that the person who asked READ. Accounts compares it with
358
+ * the address that the user has when the action runs, and changes nothing
359
+ * when the two differ.
360
+ */
361
+ expectedEmail: string;
362
+ newEmail: string;
363
+ }
364
+ export interface PurgeUsersPayloadDto {
365
+ /**
366
+ * The users to delete, at most `PURGE_USERS_MAX_USERS`. The address is a
367
+ * copy for the approver, and accounts refuses a user whose address is not
368
+ * that copy. A list that came from a file of ids carries none.
369
+ */
370
+ users: {
371
+ userId: string;
372
+ email?: string;
373
+ }[];
374
+ }
375
+ export interface UpdateUserMetadataPayloadDto {
376
+ userId: string;
377
+ /** A copy, so a list shows a person and not an Auth0 id. Nothing reads it. */
378
+ userEmail?: string;
379
+ /** `app` writes `app_metadata`, `user` writes `user_metadata`. */
380
+ kind: 'app' | 'user';
381
+ /**
382
+ * The metadata that the person who asked READ. Absent for "not set".
383
+ * Accounts writes nothing when it holds another value when the action runs.
384
+ */
385
+ expected?: Record<string, unknown>;
386
+ metadata: Record<string, unknown>;
387
+ }
388
+ export interface DeleteInternalBackupPayloadDto {
389
+ clusterId: string;
390
+ /** A copy, so a list shows a name that a person knows. Nothing reads it. */
391
+ clusterName?: string;
392
+ backupName: string;
393
+ /** A copy of the Slack link of the incident, for the approver to read. */
394
+ incidentLink?: string;
395
+ }
124
396
  export declare class ControlApprovalsService {
125
397
  /**
126
398
  * The registered privileged actions, with the rules that guard each one.
@@ -170,6 +442,140 @@ export declare class ControlApprovalsService {
170
442
  approval: ApprovalJobDto;
171
443
  created: boolean;
172
444
  }>;
445
+ /**
446
+ * Opens a change-platform-roles request.
447
+ *
448
+ * Opening one needs `accounts:admin:changeRole`, the same permission that
449
+ * approving needs, and the reason is necessary. A 200 means that a request
450
+ * for the same user is already open.
451
+ */
452
+ static createChangePlatformRoles(params: CreateApprovalRequest<ChangePlatformRolesPayloadDto>): Promise<{
453
+ approval: ApprovalJobDto;
454
+ created: boolean;
455
+ }>;
456
+ /**
457
+ * Opens a delete-internal-backup request.
458
+ *
459
+ * Opening one needs `console:clusters:canCreateInternalBackup`, the same
460
+ * permission that approving needs. A 200 means that a request for the same
461
+ * backup is already open.
462
+ */
463
+ static createDeleteInternalBackup(params: CreateApprovalRequest<DeleteInternalBackupPayloadDto>): Promise<{
464
+ approval: ApprovalJobDto;
465
+ created: boolean;
466
+ }>;
467
+ /**
468
+ * Opens a change-org-limits request.
469
+ *
470
+ * Opening one needs `accounts:admin:mayChangeOrgLimits`, the same
471
+ * permission that approving needs. A 200 means that a request for the same
472
+ * limit of the same organization is already open.
473
+ */
474
+ static createChangeOrgLimits(params: CreateApprovalRequest<ChangeOrgLimitsPayloadDto>): Promise<{
475
+ approval: ApprovalJobDto;
476
+ created: boolean;
477
+ }>;
478
+ /**
479
+ * Opens a delete-sso-connection request.
480
+ *
481
+ * Opening one needs `AccountsPermissions.ADMIN_AUTH0_CONNECTIONS_DELETE`, the same
482
+ * permission that approving needs. A 200 means that a request for the same
483
+ * connection is already open.
484
+ */
485
+ static createDeleteSsoConnection(params: CreateApprovalRequest<DeleteSsoConnectionPayloadDto>): Promise<{
486
+ approval: ApprovalJobDto;
487
+ created: boolean;
488
+ }>;
489
+ /**
490
+ * Opens a change-sales-plan request.
491
+ *
492
+ * Opening one needs `AccountsPermissions.SALES_PLAN_SWITCH`, the same
493
+ * permission that approving needs. A 200 means that a request for the same
494
+ * organization is already open.
495
+ */
496
+ static createChangeSalesPlan(params: CreateApprovalRequest<ChangeSalesPlanPayloadDto>): Promise<{
497
+ approval: ApprovalJobDto;
498
+ created: boolean;
499
+ }>;
500
+ /**
501
+ * Opens a change-cluster-plan-type request.
502
+ *
503
+ * Opening one needs `ConsolePermissions.CLUSTERS_CAN_UPDATE_CLUSTERPLANTYPE`,
504
+ * the same permission that approving needs. A 200 means that a request for
505
+ * the same cluster is already open. The route answers 404 while
506
+ * `control.changeClusterPlanType` is off.
507
+ */
508
+ static createChangeClusterPlanType(params: CreateApprovalRequest<ChangeClusterPlanTypePayloadDto>): Promise<{
509
+ approval: ApprovalJobDto;
510
+ created: boolean;
511
+ }>;
512
+ /**
513
+ * Opens a delete-organization request.
514
+ *
515
+ * Opening one needs `AccountsPermissions.DELETE_ORG`, the same permission
516
+ * that approving needs. A 200 means that a request for the same
517
+ * organization is already open.
518
+ */
519
+ static createDeleteOrganization(params: CreateApprovalRequest<DeleteOrganizationPayloadDto>): Promise<{
520
+ approval: ApprovalJobDto;
521
+ created: boolean;
522
+ }>;
523
+ /**
524
+ * Opens a delete-user request.
525
+ *
526
+ * Opening one needs `AccountsPermissions.DELETE_USER`, the same permission
527
+ * that approving needs. A 200 means that a request for the same user is
528
+ * already open.
529
+ */
530
+ static createDeleteUser(params: CreateApprovalRequest<DeleteUserPayloadDto>): Promise<{
531
+ approval: ApprovalJobDto;
532
+ created: boolean;
533
+ }>;
534
+ /**
535
+ * Opens a change-user-email request.
536
+ *
537
+ * Opening one needs `AccountsPermissions.ADMIN_CHANGE_EMAIL`, the same
538
+ * permission that approving needs. A 200 means that a request for the same
539
+ * user is already open.
540
+ */
541
+ static createChangeUserEmail(params: CreateApprovalRequest<ChangeUserEmailPayloadDto>): Promise<{
542
+ approval: ApprovalJobDto;
543
+ created: boolean;
544
+ }>;
545
+ /**
546
+ * Opens a purge-users request.
547
+ *
548
+ * Opening one needs `AccountsPermissions.GOD_PURGE_USERS` and
549
+ * `AccountsPermissions.DELETE_USER`, the same permissions that approving
550
+ * needs. A 200 means that a request for the same set of users is already
551
+ * open.
552
+ */
553
+ static createPurgeUsers(params: CreateApprovalRequest<PurgeUsersPayloadDto>): Promise<{
554
+ approval: ApprovalJobDto;
555
+ created: boolean;
556
+ }>;
557
+ /**
558
+ * Opens an update-user-metadata request.
559
+ *
560
+ * Opening one needs `AccountsPermissions.GOD_UPDATE_USER_METADATA`, the
561
+ * same permission that approving needs. A 200 means that a request for the
562
+ * same user and the same kind of metadata is already open.
563
+ */
564
+ static createUpdateUserMetadata(params: CreateApprovalRequest<UpdateUserMetadataPayloadDto>): Promise<{
565
+ approval: ApprovalJobDto;
566
+ created: boolean;
567
+ }>;
568
+ /**
569
+ * Opens a change-feature-flag request.
570
+ *
571
+ * Opening one needs `aafw`, the same permission that approving needs. A 200
572
+ * means that a request for the same flag is already open. On int this is
573
+ * the only way to change a flag.
574
+ */
575
+ static createChangeFeatureFlag(params: CreateApprovalRequest<ChangeFeatureFlagPayloadDto>): Promise<{
576
+ approval: ApprovalJobDto;
577
+ created: boolean;
578
+ }>;
173
579
  /** Adds the approval of the caller. The last one can run the action. */
174
580
  static acknowledge(params: ApprovalIdRequest): Promise<ApprovalJobDto>;
175
581
  /** Closes a request without running the action. The reason is necessary. */
@@ -199,6 +605,21 @@ export declare class ControlApprovalsService {
199
605
  * approving needs, and the reason is necessary.
200
606
  */
201
607
  static createExtendTrial(params: CreateApprovalRequest<ExtendTrialPayloadDto>): Promise<ApprovalJobDto>;
608
+ /**
609
+ * Opens a create-personal-organisation request. Any signed-in Camundi can.
610
+ *
611
+ * The request needs no approval, so the answer already holds the outcome,
612
+ * and the route answers 404 while `control.personalOrganisation` is off.
613
+ */
614
+ static createPersonalOrganisation(params: CreatePersonalOrganisationRequest): Promise<ApprovalJobDto>;
615
+ /**
616
+ * Opens a create-customer-hardware-sizing request. Any signed-in Camundi
617
+ * can. It runs on dev only, needs no approval, and the route answers 404
618
+ * while `control.customerHardwareSizing` is off.
619
+ */
620
+ static createCustomerHardwareSizing(params: CustomerHardwareSizingRequest<CreateCustomerHardwareSizingPayloadDto>): Promise<ApprovalJobDto>;
621
+ /** Opens a remove-customer-hardware-sizing request. See the one above. */
622
+ static removeCustomerHardwareSizing(params: CustomerHardwareSizingRequest<RemoveCustomerHardwareSizingPayloadDto>): Promise<ApprovalJobDto>;
202
623
  /**
203
624
  * The shared half of every call that answers one request.
204
625
  *
@@ -158,6 +158,176 @@ class ControlApprovalsService {
158
158
  `api/approvals/${useCase}`
159
159
  );
160
160
  }
161
+ /**
162
+ * Opens a change-platform-roles request.
163
+ *
164
+ * Opening one needs `accounts:admin:changeRole`, the same permission that
165
+ * approving needs, and the reason is necessary. A 200 means that a request
166
+ * for the same user is already open.
167
+ */
168
+ static async createChangePlatformRoles(params) {
169
+ return ControlApprovalsService.create(
170
+ params,
171
+ "createChangePlatformRoles",
172
+ "api/approvals/change-platform-roles"
173
+ );
174
+ }
175
+ /**
176
+ * Opens a delete-internal-backup request.
177
+ *
178
+ * Opening one needs `console:clusters:canCreateInternalBackup`, the same
179
+ * permission that approving needs. A 200 means that a request for the same
180
+ * backup is already open.
181
+ */
182
+ static async createDeleteInternalBackup(params) {
183
+ return ControlApprovalsService.create(
184
+ params,
185
+ "createDeleteInternalBackup",
186
+ "api/approvals/delete-internal-backup"
187
+ );
188
+ }
189
+ /**
190
+ * Opens a change-org-limits request.
191
+ *
192
+ * Opening one needs `accounts:admin:mayChangeOrgLimits`, the same
193
+ * permission that approving needs. A 200 means that a request for the same
194
+ * limit of the same organization is already open.
195
+ */
196
+ static async createChangeOrgLimits(params) {
197
+ return ControlApprovalsService.create(
198
+ params,
199
+ "createChangeOrgLimits",
200
+ "api/approvals/change-org-limits"
201
+ );
202
+ }
203
+ /**
204
+ * Opens a delete-sso-connection request.
205
+ *
206
+ * Opening one needs `AccountsPermissions.ADMIN_AUTH0_CONNECTIONS_DELETE`, the same
207
+ * permission that approving needs. A 200 means that a request for the same
208
+ * connection is already open.
209
+ */
210
+ static async createDeleteSsoConnection(params) {
211
+ return ControlApprovalsService.create(
212
+ params,
213
+ "createDeleteSsoConnection",
214
+ "api/approvals/delete-sso-connection"
215
+ );
216
+ }
217
+ /**
218
+ * Opens a change-sales-plan request.
219
+ *
220
+ * Opening one needs `AccountsPermissions.SALES_PLAN_SWITCH`, the same
221
+ * permission that approving needs. A 200 means that a request for the same
222
+ * organization is already open.
223
+ */
224
+ static async createChangeSalesPlan(params) {
225
+ return ControlApprovalsService.create(
226
+ params,
227
+ "createChangeSalesPlan",
228
+ "api/approvals/change-sales-plan"
229
+ );
230
+ }
231
+ /**
232
+ * Opens a change-cluster-plan-type request.
233
+ *
234
+ * Opening one needs `ConsolePermissions.CLUSTERS_CAN_UPDATE_CLUSTERPLANTYPE`,
235
+ * the same permission that approving needs. A 200 means that a request for
236
+ * the same cluster is already open. The route answers 404 while
237
+ * `control.changeClusterPlanType` is off.
238
+ */
239
+ static async createChangeClusterPlanType(params) {
240
+ return ControlApprovalsService.create(
241
+ params,
242
+ "createChangeClusterPlanType",
243
+ "api/approvals/change-cluster-plan-type"
244
+ );
245
+ }
246
+ /**
247
+ * Opens a delete-organization request.
248
+ *
249
+ * Opening one needs `AccountsPermissions.DELETE_ORG`, the same permission
250
+ * that approving needs. A 200 means that a request for the same
251
+ * organization is already open.
252
+ */
253
+ static async createDeleteOrganization(params) {
254
+ return ControlApprovalsService.create(
255
+ params,
256
+ "createDeleteOrganization",
257
+ "api/approvals/delete-organization"
258
+ );
259
+ }
260
+ /**
261
+ * Opens a delete-user request.
262
+ *
263
+ * Opening one needs `AccountsPermissions.DELETE_USER`, the same permission
264
+ * that approving needs. A 200 means that a request for the same user is
265
+ * already open.
266
+ */
267
+ static async createDeleteUser(params) {
268
+ return ControlApprovalsService.create(
269
+ params,
270
+ "createDeleteUser",
271
+ "api/approvals/delete-user"
272
+ );
273
+ }
274
+ /**
275
+ * Opens a change-user-email request.
276
+ *
277
+ * Opening one needs `AccountsPermissions.ADMIN_CHANGE_EMAIL`, the same
278
+ * permission that approving needs. A 200 means that a request for the same
279
+ * user is already open.
280
+ */
281
+ static async createChangeUserEmail(params) {
282
+ return ControlApprovalsService.create(
283
+ params,
284
+ "createChangeUserEmail",
285
+ "api/approvals/change-user-email"
286
+ );
287
+ }
288
+ /**
289
+ * Opens a purge-users request.
290
+ *
291
+ * Opening one needs `AccountsPermissions.GOD_PURGE_USERS` and
292
+ * `AccountsPermissions.DELETE_USER`, the same permissions that approving
293
+ * needs. A 200 means that a request for the same set of users is already
294
+ * open.
295
+ */
296
+ static async createPurgeUsers(params) {
297
+ return ControlApprovalsService.create(
298
+ params,
299
+ "createPurgeUsers",
300
+ "api/approvals/purge-users"
301
+ );
302
+ }
303
+ /**
304
+ * Opens an update-user-metadata request.
305
+ *
306
+ * Opening one needs `AccountsPermissions.GOD_UPDATE_USER_METADATA`, the
307
+ * same permission that approving needs. A 200 means that a request for the
308
+ * same user and the same kind of metadata is already open.
309
+ */
310
+ static async createUpdateUserMetadata(params) {
311
+ return ControlApprovalsService.create(
312
+ params,
313
+ "createUpdateUserMetadata",
314
+ "api/approvals/update-user-metadata"
315
+ );
316
+ }
317
+ /**
318
+ * Opens a change-feature-flag request.
319
+ *
320
+ * Opening one needs `aafw`, the same permission that approving needs. A 200
321
+ * means that a request for the same flag is already open. On int this is
322
+ * the only way to change a flag.
323
+ */
324
+ static async createChangeFeatureFlag(params) {
325
+ return ControlApprovalsService.create(
326
+ params,
327
+ "createChangeFeatureFlag",
328
+ "api/approvals/change-feature-flag"
329
+ );
330
+ }
161
331
  /** Adds the approval of the caller. The last one can run the action. */
162
332
  static async acknowledge(params) {
163
333
  return ControlApprovalsService.readOne(
@@ -235,6 +405,43 @@ class ControlApprovalsService {
235
405
  );
236
406
  return approval;
237
407
  }
408
+ /**
409
+ * Opens a create-personal-organisation request. Any signed-in Camundi can.
410
+ *
411
+ * The request needs no approval, so the answer already holds the outcome,
412
+ * and the route answers 404 while `control.personalOrganisation` is off.
413
+ */
414
+ static async createPersonalOrganisation(params) {
415
+ const { approval } = await ControlApprovalsService.create(
416
+ params,
417
+ "createPersonalOrganisation",
418
+ "api/approvals/create-personal-organisation",
419
+ { retryRateLimit: false }
420
+ );
421
+ return approval;
422
+ }
423
+ /**
424
+ * Opens a create-customer-hardware-sizing request. Any signed-in Camundi
425
+ * can. It runs on dev only, needs no approval, and the route answers 404
426
+ * while `control.customerHardwareSizing` is off.
427
+ */
428
+ static async createCustomerHardwareSizing(params) {
429
+ const { approval } = await ControlApprovalsService.create(
430
+ params,
431
+ "createCustomerHardwareSizing",
432
+ "api/approvals/create-customer-hardware-sizing"
433
+ );
434
+ return approval;
435
+ }
436
+ /** Opens a remove-customer-hardware-sizing request. See the one above. */
437
+ static async removeCustomerHardwareSizing(params) {
438
+ const { approval } = await ControlApprovalsService.create(
439
+ params,
440
+ "removeCustomerHardwareSizing",
441
+ "api/approvals/remove-customer-hardware-sizing"
442
+ );
443
+ return approval;
444
+ }
238
445
  /**
239
446
  * The shared half of every call that answers one request.
240
447
  *
@@ -275,7 +482,7 @@ class ControlApprovalsService {
275
482
  * difference. `createSendToExpiredTrial` and `createExtendTrial` do not
276
483
  * need it, so they read `approval` alone off this result.
277
484
  */
278
- static async create(params, name, url) {
485
+ static async create(params, name, url, options = {}) {
279
486
  const serviceContext = contextFor(
280
487
  name,
281
488
  url,
@@ -289,6 +496,7 @@ class ControlApprovalsService {
289
496
  url,
290
497
  method: "post",
291
498
  metricsDetails: serviceContext,
499
+ ...options.retryRateLimit === false ? { retry: { attempts: 1, remaining: 0 } } : {},
292
500
  body: {
293
501
  payload: params.params.payload,
294
502
  reason: params.params.reason,