@camunda/ccma-shared-types 19.1.0 → 19.3.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.
@@ -160,6 +160,11 @@ export declare const APPROVAL_RULES: {
160
160
  readonly "change-generation-versions": {
161
161
  readonly prod: 2;
162
162
  };
163
+ readonly "hot-patch-generations": {
164
+ readonly prod: 5;
165
+ readonly testStages: 3;
166
+ readonly dev: 2;
167
+ };
163
168
  readonly "change-org-reservations": {
164
169
  readonly prod: 2;
165
170
  readonly testStages: 1;
@@ -63,6 +63,10 @@ const APPROVAL_RULES = {
63
63
  [T.moveClusterOrg]: { prod: 2 },
64
64
  [T.editGeneration]: { prod: 2 },
65
65
  [T.changeGenerationVersions]: { prod: 2 },
66
+ // A hot patch changes the image of generations that clusters run, and every
67
+ // awake cluster of those generations restarts on it. Ten eyes on prod, six
68
+ // on int and four on dev, the opener counted. The counts are fixed.
69
+ [T.hotPatchGenerations]: { prod: 5, testStages: 3, dev: 2 },
66
70
  // A reservation is a commercial commitment that the customer pays for, and
67
71
  // the force path skips every check of the sales plan. Four eyes on prod.
68
72
  // On the test stages a holder does it alone, as the direct route did.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/approvals/approval-rules.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 { Stage } from '../constants/misc.const.js'\nimport {\n type ApprovalUseCaseType,\n APPROVAL_USE_CASE_TYPES as T,\n} from './use-cases.const.js'\n\n/**\n * The approvals of one type of request.\n *\n * The count is the number of approvals from holders of the run permissions of\n * the request (`requiredPermissions`). The opener counts too: when the opener\n * holds every run permission, the request gets the approval of the opener\n * when it is created. The opener cannot approve the request by hand\n * (`canAcknowledge`).\n */\nexport interface ApprovalRule {\n /** The approvals on prod. */\n prod: number\n /** The approvals on int, and on dev and local unless `dev` is set. When it is not set, `prod` applies. */\n testStages?: number\n /** The approvals on dev and local. When it is not set, `testStages` applies. */\n dev?: number\n}\n\n/**\n * How many approvals each type of request needs. This table is the one source\n * of that number, for control-backend, control-frontend, and the routes of\n * accounts and console that run an approved action.\n *\n * - **0**: no approval. Only a holder, or a person whom the use case opens the\n * request to, can open it.\n * - **1**: a holder does the action alone. The request of a holder runs when\n * it is created. The request of a person who is not a holder waits for one\n * holder.\n * - **2**: four eyes. The request of a holder waits for one other holder. The\n * request of a person who is not a holder waits for two holders.\n * - **3**: six eyes on prod.\n *\n * Before #10483 a use case counted only the approvals of people other than\n * the opener. Thus an old count and a count of this table are not the same\n * unit.\n */\nexport const APPROVAL_RULES = {\n // No approval. A use case that is open to every Camundi, or that only a\n // system opens.\n [T.clusterTtlDeletion]: { prod: 0 },\n [T.createPersonalOrganisation]: { prod: 0 },\n [T.convertTrialToInternal]: { prod: 0 },\n [T.deleteOwnTestOrg]: { prod: 0 },\n [T.createCustomHardwareSizing]: { prod: 0 },\n [T.removeCustomHardwareSizing]: { prod: 0 },\n [T.createCustomGeneration]: { prod: 0 },\n [T.removeCustomGeneration]: { prod: 0 },\n [T.selfServiceClusterModification]: { prod: 0 },\n // Only the run of a grant opens it, as the system, and it runs by itself at\n // the end of the grant. Ending a grant takes power away.\n [T.revokeApprovalOverride]: { prod: 0 },\n\n // A holder does it alone. Before #10483 a holder did these actions in\n // accounts-frontend or console-frontend with no second person.\n [T.extendTrial]: { prod: 1 },\n [T.changeOrgLimits]: { prod: 1 },\n // The create and the edit of an SSO connection start with the count of the\n // direct route, so the people who use it today see no change. Raise it\n // when the approvers are in place (#11340).\n [T.createSsoConnection]: { prod: 1 },\n [T.updateSsoConnection]: { prod: 1 },\n // A holder of the create permission of alpha features does it alone, as on\n // the direct route. Anyone else needs one holder to approve.\n [T.createEarlyAccessFeature]: { prod: 1 },\n [T.llmBudgetTopUp]: { prod: 1 },\n [T.changeSalesPlan]: { prod: 1 },\n [T.requestInNegotiation]: { prod: 1 },\n [T.onboardToEnterprise]: { prod: 1 },\n [T.automatedEnterpriseOnboarding]: { prod: 1 },\n [T.changeClusterPlanType]: { prod: 1 },\n [T.deleteInternalBackup]: { prod: 1 },\n [T.releaseTrainPublish]: { prod: 1 },\n [T.releaseTrainRollback]: { prod: 1 },\n\n // Four eyes. The action removes data or access, changes a person, moves a\n // cluster to another customer, or restarts every cluster of a generation.\n [T.changePlatformRoles]: { prod: 2 },\n // A wrong pattern blocks real signups, and a removed one lets spam in.\n [T.changeSignupSpamPatterns]: { prod: 2 },\n // Any Camundi opens it. Engineering holds `pps` on both stages and unlocks\n // alone, and anyone else needs one holder to approve. Not 0: then anyone\n // could unlock their own email. A permanent rule needs more\n // (`PREPROD_UNLOCK_PERMANENT_ACKS`). The rule lets one more email into dev\n // and int.\n [T.unlockPreprodSignup]: { prod: 2, testStages: 1, dev: 1 },\n // Removes the exact rule of one email on dev and int. A wider rule or an\n // enterprise SSO signup can still let the email in.\n [T.removePreprodSignup]: { prod: 2, testStages: 1, dev: 1 },\n [T.changeUserEmail]: { prod: 2 },\n [T.deleteUser]: { prod: 2 },\n [T.removeOrgMember]: { prod: 2 },\n [T.purgeUsers]: { prod: 2 },\n [T.updateUserMetadata]: { prod: 2 },\n [T.deleteOrganization]: { prod: 2 },\n [T.sendToExpiredTrial]: { prod: 2 },\n [T.deleteSsoConnection]: { prod: 2 },\n [T.deleteApiClient]: { prod: 2 },\n [T.moveClusterOrg]: { prod: 2 },\n [T.editGeneration]: { prod: 2 },\n [T.changeGenerationVersions]: { prod: 2 },\n\n // A reservation is a commercial commitment that the customer pays for, and\n // the force path skips every check of the sales plan. Four eyes on prod.\n // On the test stages a holder does it alone, as the direct route did.\n [T.changeOrgReservations]: { prod: 2, testStages: 1 },\n\n // One decision changes many clusters. A deletion cannot be undone, so it\n // needs six eyes on prod. On the test stages, the opener runs every other\n // type alone: the console team rolls out generations there with no second\n // person.\n [T.clusterBulkGenerationUpdate]: { prod: 2, testStages: 1 },\n [T.clusterBulkPlanUpdate]: { prod: 2, testStages: 1 },\n [T.clusterBulkPlanTypeUpdate]: { prod: 2, testStages: 1 },\n [T.clusterBulkSleepWakeup]: { prod: 2, testStages: 1 },\n [T.clusterBulkSpecUpdate]: { prod: 2, testStages: 1 },\n [T.clusterBulkDeletion]: { prod: 3, testStages: 2 },\n // Many organizations in one request, and a deletion cannot be undone: six\n // eyes on prod, as the bulk deletion of clusters.\n [T.orgBulkDeletion]: { prod: 3, testStages: 2 },\n [T.deleteClusterCorpses]: { prod: 3, testStages: 2 },\n [T.forceDeleteClusterPlanType]: { prod: 3, testStages: 2 },\n // The contract of an enterprise customer sets what the customer pays for.\n // On prod the opener and one other holder. On the test stages a holder\n // changes a test contract alone.\n [T.changeEnterpriseContract]: { prod: 2, testStages: 1 },\n // A shorter retention limit deletes the old data of every cluster of the\n // plan type.\n [T.changePlanTypeRetentionLimits]: { prod: 3, testStages: 2 },\n\n // A generation upgrade of one cluster that skips the upgrade graph\n // (`--yolo`) or the upgrade gate. The gate keeps an upgrade from a cluster\n // that has not finished its last migration, so a forced upgrade on prod\n // needs the opener and one other holder. On the test stages the opener\n // runs it alone.\n [T.forceGenerationUpgrade]: { prod: 2, testStages: 1 },\n // The deletion of the managed LLM tenant removes the key and the spend\n // history, and nothing brings them back. Four eyes on prod. On the test\n // stages the opener does it alone, as the direct route did before.\n [T.deleteManagedLlmTenant]: { prod: 2, testStages: 1 },\n\n // A flag of prod turns a feature on or off for every customer.\n [T.changeFeatureFlag]: { prod: 3, testStages: 2 },\n // Turning a flag off lowers the risk, thus it needs fewer approvals than a\n // change. On prod the opener with `aafw` gives one, and one other holder\n // gives the second. On int the opener with `aafw` does it alone. On dev\n // and local no approval is needed: opening the request runs it.\n [T.disableFeatureFlag]: { prod: 2, testStages: 1, dev: 0 },\n // A kill switch stops one action in an incident, thus it is as fast as a\n // rollback: the same counts as `disableFeatureFlag`.\n [T.engageKillSwitch]: { prod: 2, testStages: 1, dev: 0 },\n\n // The licensing model sets which value metrics an enterprise customer pays\n // for. On prod the opener and one other holder. On the test stages a holder\n // changes a test organization alone.\n [T.changeLicensingModel]: { prod: 2, testStages: 1 },\n\n // A grant lets one Camundi run many requests with no second person. The\n // opener and one other holder, on every stage. The grantee approves\n // neither by hand nor when they open it, thus a grant for oneself needs\n // two other holders. The console team has three people, so a third\n // approval would block a grant for oneself.\n [T.grantApprovalOverride]: { prod: 2 },\n} as const satisfies Record<ApprovalUseCaseType, ApprovalRule>\n\n/** The types whose count on the test stages is not the count on prod. */\nexport type StageDependentApprovalType = {\n [K in ApprovalUseCaseType]: (typeof APPROVAL_RULES)[K] extends {\n testStages: number\n }\n ? K\n : (typeof APPROVAL_RULES)[K] extends { dev: number }\n ? K\n : never\n}[ApprovalUseCaseType]\n\n/**\n * The approvals of a permanent unlock of a preprod signup. A permanent rule\n * never expires, so it needs one more person than `APPROVAL_RULES` gives on\n * that stage. Prod never reads the signup rules. The prod value is 2, as for\n * the unlock. It only satisfies `ApprovalRule`.\n */\nexport const PREPROD_UNLOCK_PERMANENT_ACKS = {\n prod: 2,\n testStages: 2,\n dev: 2,\n} as const satisfies ApprovalRule\n\n/** The approvals that a request of `type` needs on `stage`. */\nexport function approvalsRequiredFor(\n type: ApprovalUseCaseType,\n stage: Stage,\n): number {\n return approvalsOfRule(APPROVAL_RULES[type], stage)\n}\n\n/** The approvals that `rule` gives on `stage`. */\nexport function approvalsOfRule(rule: ApprovalRule, stage: Stage): number {\n if (stage === 'prod') {\n return rule.prod\n }\n const testStages = rule.testStages ?? rule.prod\n return stage === 'int' ? testStages : (rule.dev ?? testStages)\n}\n"],
5
- "mappings": "AAOA;AAAA,EAEE,2BAA2B;AAAA,OACtB;AAsCA,MAAM,iBAAiB;AAAA;AAAA;AAAA,EAG5B,CAAC,EAAE,kBAAkB,GAAG,EAAE,MAAM,EAAE;AAAA,EAClC,CAAC,EAAE,0BAA0B,GAAG,EAAE,MAAM,EAAE;AAAA,EAC1C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AA,EAKvD,CAAC,EAAE,oBAAoB,GAAG,EAAE,MAAM,GAAG,YAAY,EAAE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOnD,CAAC,EAAE,qBAAqB,GAAG,EAAE,MAAM,EAAE;AACvC;AAmBO,MAAM,gCAAgC;AAAA,EAC3C,MAAM;AAAA,EACN,YAAY;AAAA,EACZ,KAAK;AACP;AAGO,SAAS,qBACd,MACA,OACQ;AACR,SAAO,gBAAgB,eAAe,IAAI,GAAG,KAAK;AACpD;AAGO,SAAS,gBAAgB,MAAoB,OAAsB;AACxE,MAAI,UAAU,QAAQ;AACpB,WAAO,KAAK;AAAA,EACd;AACA,QAAM,aAAa,KAAK,cAAc,KAAK;AAC3C,SAAO,UAAU,QAAQ,aAAc,KAAK,OAAO;AACrD;",
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 { Stage } from '../constants/misc.const.js'\nimport {\n type ApprovalUseCaseType,\n APPROVAL_USE_CASE_TYPES as T,\n} from './use-cases.const.js'\n\n/**\n * The approvals of one type of request.\n *\n * The count is the number of approvals from holders of the run permissions of\n * the request (`requiredPermissions`). The opener counts too: when the opener\n * holds every run permission, the request gets the approval of the opener\n * when it is created. The opener cannot approve the request by hand\n * (`canAcknowledge`).\n */\nexport interface ApprovalRule {\n /** The approvals on prod. */\n prod: number\n /** The approvals on int, and on dev and local unless `dev` is set. When it is not set, `prod` applies. */\n testStages?: number\n /** The approvals on dev and local. When it is not set, `testStages` applies. */\n dev?: number\n}\n\n/**\n * How many approvals each type of request needs. This table is the one source\n * of that number, for control-backend, control-frontend, and the routes of\n * accounts and console that run an approved action.\n *\n * - **0**: no approval. Only a holder, or a person whom the use case opens the\n * request to, can open it.\n * - **1**: a holder does the action alone. The request of a holder runs when\n * it is created. The request of a person who is not a holder waits for one\n * holder.\n * - **2**: four eyes. The request of a holder waits for one other holder. The\n * request of a person who is not a holder waits for two holders.\n * - **3**: six eyes on prod.\n *\n * Before #10483 a use case counted only the approvals of people other than\n * the opener. Thus an old count and a count of this table are not the same\n * unit.\n */\nexport const APPROVAL_RULES = {\n // No approval. A use case that is open to every Camundi, or that only a\n // system opens.\n [T.clusterTtlDeletion]: { prod: 0 },\n [T.createPersonalOrganisation]: { prod: 0 },\n [T.convertTrialToInternal]: { prod: 0 },\n [T.deleteOwnTestOrg]: { prod: 0 },\n [T.createCustomHardwareSizing]: { prod: 0 },\n [T.removeCustomHardwareSizing]: { prod: 0 },\n [T.createCustomGeneration]: { prod: 0 },\n [T.removeCustomGeneration]: { prod: 0 },\n [T.selfServiceClusterModification]: { prod: 0 },\n // Only the run of a grant opens it, as the system, and it runs by itself at\n // the end of the grant. Ending a grant takes power away.\n [T.revokeApprovalOverride]: { prod: 0 },\n\n // A holder does it alone. Before #10483 a holder did these actions in\n // accounts-frontend or console-frontend with no second person.\n [T.extendTrial]: { prod: 1 },\n [T.changeOrgLimits]: { prod: 1 },\n // The create and the edit of an SSO connection start with the count of the\n // direct route, so the people who use it today see no change. Raise it\n // when the approvers are in place (#11340).\n [T.createSsoConnection]: { prod: 1 },\n [T.updateSsoConnection]: { prod: 1 },\n // A holder of the create permission of alpha features does it alone, as on\n // the direct route. Anyone else needs one holder to approve.\n [T.createEarlyAccessFeature]: { prod: 1 },\n [T.llmBudgetTopUp]: { prod: 1 },\n [T.changeSalesPlan]: { prod: 1 },\n [T.requestInNegotiation]: { prod: 1 },\n [T.onboardToEnterprise]: { prod: 1 },\n [T.automatedEnterpriseOnboarding]: { prod: 1 },\n [T.changeClusterPlanType]: { prod: 1 },\n [T.deleteInternalBackup]: { prod: 1 },\n [T.releaseTrainPublish]: { prod: 1 },\n [T.releaseTrainRollback]: { prod: 1 },\n\n // Four eyes. The action removes data or access, changes a person, moves a\n // cluster to another customer, or restarts every cluster of a generation.\n [T.changePlatformRoles]: { prod: 2 },\n // A wrong pattern blocks real signups, and a removed one lets spam in.\n [T.changeSignupSpamPatterns]: { prod: 2 },\n // Any Camundi opens it. Engineering holds `pps` on both stages and unlocks\n // alone, and anyone else needs one holder to approve. Not 0: then anyone\n // could unlock their own email. A permanent rule needs more\n // (`PREPROD_UNLOCK_PERMANENT_ACKS`). The rule lets one more email into dev\n // and int.\n [T.unlockPreprodSignup]: { prod: 2, testStages: 1, dev: 1 },\n // Removes the exact rule of one email on dev and int. A wider rule or an\n // enterprise SSO signup can still let the email in.\n [T.removePreprodSignup]: { prod: 2, testStages: 1, dev: 1 },\n [T.changeUserEmail]: { prod: 2 },\n [T.deleteUser]: { prod: 2 },\n [T.removeOrgMember]: { prod: 2 },\n [T.purgeUsers]: { prod: 2 },\n [T.updateUserMetadata]: { prod: 2 },\n [T.deleteOrganization]: { prod: 2 },\n [T.sendToExpiredTrial]: { prod: 2 },\n [T.deleteSsoConnection]: { prod: 2 },\n [T.deleteApiClient]: { prod: 2 },\n [T.moveClusterOrg]: { prod: 2 },\n [T.editGeneration]: { prod: 2 },\n [T.changeGenerationVersions]: { prod: 2 },\n // A hot patch changes the image of generations that clusters run, and every\n // awake cluster of those generations restarts on it. Ten eyes on prod, six\n // on int and four on dev, the opener counted. The counts are fixed.\n [T.hotPatchGenerations]: { prod: 5, testStages: 3, dev: 2 },\n\n // A reservation is a commercial commitment that the customer pays for, and\n // the force path skips every check of the sales plan. Four eyes on prod.\n // On the test stages a holder does it alone, as the direct route did.\n [T.changeOrgReservations]: { prod: 2, testStages: 1 },\n\n // One decision changes many clusters. A deletion cannot be undone, so it\n // needs six eyes on prod. On the test stages, the opener runs every other\n // type alone: the console team rolls out generations there with no second\n // person.\n [T.clusterBulkGenerationUpdate]: { prod: 2, testStages: 1 },\n [T.clusterBulkPlanUpdate]: { prod: 2, testStages: 1 },\n [T.clusterBulkPlanTypeUpdate]: { prod: 2, testStages: 1 },\n [T.clusterBulkSleepWakeup]: { prod: 2, testStages: 1 },\n [T.clusterBulkSpecUpdate]: { prod: 2, testStages: 1 },\n [T.clusterBulkDeletion]: { prod: 3, testStages: 2 },\n // Many organizations in one request, and a deletion cannot be undone: six\n // eyes on prod, as the bulk deletion of clusters.\n [T.orgBulkDeletion]: { prod: 3, testStages: 2 },\n [T.deleteClusterCorpses]: { prod: 3, testStages: 2 },\n [T.forceDeleteClusterPlanType]: { prod: 3, testStages: 2 },\n // The contract of an enterprise customer sets what the customer pays for.\n // On prod the opener and one other holder. On the test stages a holder\n // changes a test contract alone.\n [T.changeEnterpriseContract]: { prod: 2, testStages: 1 },\n // A shorter retention limit deletes the old data of every cluster of the\n // plan type.\n [T.changePlanTypeRetentionLimits]: { prod: 3, testStages: 2 },\n\n // A generation upgrade of one cluster that skips the upgrade graph\n // (`--yolo`) or the upgrade gate. The gate keeps an upgrade from a cluster\n // that has not finished its last migration, so a forced upgrade on prod\n // needs the opener and one other holder. On the test stages the opener\n // runs it alone.\n [T.forceGenerationUpgrade]: { prod: 2, testStages: 1 },\n // The deletion of the managed LLM tenant removes the key and the spend\n // history, and nothing brings them back. Four eyes on prod. On the test\n // stages the opener does it alone, as the direct route did before.\n [T.deleteManagedLlmTenant]: { prod: 2, testStages: 1 },\n\n // A flag of prod turns a feature on or off for every customer.\n [T.changeFeatureFlag]: { prod: 3, testStages: 2 },\n // Turning a flag off lowers the risk, thus it needs fewer approvals than a\n // change. On prod the opener with `aafw` gives one, and one other holder\n // gives the second. On int the opener with `aafw` does it alone. On dev\n // and local no approval is needed: opening the request runs it.\n [T.disableFeatureFlag]: { prod: 2, testStages: 1, dev: 0 },\n // A kill switch stops one action in an incident, thus it is as fast as a\n // rollback: the same counts as `disableFeatureFlag`.\n [T.engageKillSwitch]: { prod: 2, testStages: 1, dev: 0 },\n\n // The licensing model sets which value metrics an enterprise customer pays\n // for. On prod the opener and one other holder. On the test stages a holder\n // changes a test organization alone.\n [T.changeLicensingModel]: { prod: 2, testStages: 1 },\n\n // A grant lets one Camundi run many requests with no second person. The\n // opener and one other holder, on every stage. The grantee approves\n // neither by hand nor when they open it, thus a grant for oneself needs\n // two other holders. The console team has three people, so a third\n // approval would block a grant for oneself.\n [T.grantApprovalOverride]: { prod: 2 },\n} as const satisfies Record<ApprovalUseCaseType, ApprovalRule>\n\n/** The types whose count on the test stages is not the count on prod. */\nexport type StageDependentApprovalType = {\n [K in ApprovalUseCaseType]: (typeof APPROVAL_RULES)[K] extends {\n testStages: number\n }\n ? K\n : (typeof APPROVAL_RULES)[K] extends { dev: number }\n ? K\n : never\n}[ApprovalUseCaseType]\n\n/**\n * The approvals of a permanent unlock of a preprod signup. A permanent rule\n * never expires, so it needs one more person than `APPROVAL_RULES` gives on\n * that stage. Prod never reads the signup rules. The prod value is 2, as for\n * the unlock. It only satisfies `ApprovalRule`.\n */\nexport const PREPROD_UNLOCK_PERMANENT_ACKS = {\n prod: 2,\n testStages: 2,\n dev: 2,\n} as const satisfies ApprovalRule\n\n/** The approvals that a request of `type` needs on `stage`. */\nexport function approvalsRequiredFor(\n type: ApprovalUseCaseType,\n stage: Stage,\n): number {\n return approvalsOfRule(APPROVAL_RULES[type], stage)\n}\n\n/** The approvals that `rule` gives on `stage`. */\nexport function approvalsOfRule(rule: ApprovalRule, stage: Stage): number {\n if (stage === 'prod') {\n return rule.prod\n }\n const testStages = rule.testStages ?? rule.prod\n return stage === 'int' ? testStages : (rule.dev ?? testStages)\n}\n"],
5
+ "mappings": "AAOA;AAAA,EAEE,2BAA2B;AAAA,OACtB;AAsCA,MAAM,iBAAiB;AAAA;AAAA;AAAA,EAG5B,CAAC,EAAE,kBAAkB,GAAG,EAAE,MAAM,EAAE;AAAA,EAClC,CAAC,EAAE,0BAA0B,GAAG,EAAE,MAAM,EAAE;AAAA,EAC1C,CAAC,EAAE,sBAAsB,GAAG,EAAE,MAAM,EAAE;AAAA,EACtC,CAAC,EAAE,gBAAgB,GAAG,EAAE,MAAM,EAAE;AAAA,EAChC,CAAC,EAAE,0BAA0B,GAAG,EAAE,MAAM,EAAE;AAAA,EAC1C,CA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AAA;AAAA;AAAA;AAAA;AAAA,EAOnD,CAAC,EAAE,qBAAqB,GAAG,EAAE,MAAM,EAAE;AACvC;AAmBO,MAAM,gCAAgC;AAAA,EAC3C,MAAM;AAAA,EACN,YAAY;AAAA,EACZ,KAAK;AACP;AAGO,SAAS,qBACd,MACA,OACQ;AACR,SAAO,gBAAgB,eAAe,IAAI,GAAG,KAAK;AACpD;AAGO,SAAS,gBAAgB,MAAoB,OAAsB;AACxE,MAAI,UAAU,QAAQ;AACpB,WAAO,KAAK;AAAA,EACd;AACA,QAAM,aAAa,KAAK,cAAc,KAAK;AAC3C,SAAO,UAAU,QAAQ,aAAc,KAAK,OAAO;AACrD;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,112 @@
1
+ import { type GenerationHotPatchImageKey } from '../types/C8ClusterComponentVersions.type.js';
2
+ /**
3
+ * The field of a hot patch for the unified `camunda/camunda` image of 8.9
4
+ * and later. It changes `zeebe`, `operate` and `tasklist` in one write, so
5
+ * each cluster gets the new image in one spec. A request per image field
6
+ * restarts each cluster three times, and runs two images between the runs.
7
+ */
8
+ export declare const HOT_PATCH_UNIFIED_FIELD = "unified";
9
+ /** The image fields that a hot patch of `unified` changes. */
10
+ export declare const HOT_PATCH_UNIFIED_IMAGE_KEYS: readonly ["zeebe", "operate", "tasklist"];
11
+ /** What `field` of a hot patch can be: one image field, or `unified`. */
12
+ export declare const GENERATION_HOT_PATCH_FIELDS: readonly ["zeebe", "operate", "tasklist", "optimize", "connectorBridge", "elasticSearchOss", "zeebeAnalytics", "elasticSearchCurator", "unified"];
13
+ export type GenerationHotPatchField = (typeof GENERATION_HOT_PATCH_FIELDS)[number];
14
+ /** The image fields of a generation that a hot patch of `field` changes. */
15
+ export declare function hotPatchImageKeysOf(field: GenerationHotPatchField): readonly GenerationHotPatchImageKey[];
16
+ /**
17
+ * The flag that opens the create route of hot-patch-generations. The route
18
+ * also needs `control.camundiApprovalFlow`.
19
+ */
20
+ export declare const HOT_PATCH_GENERATIONS_FLAG = "control.hotPatchGenerations";
21
+ /**
22
+ * The most generations that one request can patch.
23
+ *
24
+ * The bound and `HOT_PATCH_IMAGE_MAX_LENGTH` keep a request under the body
25
+ * limit of control-backend (1 MiB): 500 generations, each with two values of
26
+ * 500 characters, is 500 000 characters before the rest of the payload.
27
+ */
28
+ export declare const HOT_PATCH_GENERATIONS_MAX_GENERATIONS = 500;
29
+ /** The longest image reference that a hot patch reads or writes. */
30
+ export declare const HOT_PATCH_IMAGE_MAX_LENGTH = 500;
31
+ /**
32
+ * One generation of a request: the value that the person read, and the new
33
+ * one.
34
+ */
35
+ export interface HotPatchGenerationDto {
36
+ id: string;
37
+ /**
38
+ * The value of `field` that the person who asked READ. Console compares it
39
+ * with the generation when the action runs, and changes nothing when it
40
+ * differs.
41
+ */
42
+ from: string;
43
+ /** The new image reference. */
44
+ to: string;
45
+ }
46
+ /**
47
+ * The payload of a hot-patch-generations request: ONE field, and the
48
+ * generations whose value of that field changes.
49
+ *
50
+ * The field is one image field, or `unified` for the `camunda/camunda`
51
+ * image in `zeebe`, `operate` and `tasklist`.
52
+ */
53
+ export interface HotPatchGenerationsPayloadDto {
54
+ field: GenerationHotPatchField;
55
+ generations: HotPatchGenerationDto[];
56
+ }
57
+ /**
58
+ * The body of `PATCH api/admin/approvals/generations/:generationId/hot-patch`
59
+ * of console-backend, without the actor envelope.
60
+ */
61
+ export interface HotPatchGenerationRequestDto {
62
+ field: GenerationHotPatchField;
63
+ from: string;
64
+ to: string;
65
+ }
66
+ /**
67
+ * The answer of
68
+ * `PATCH api/admin/approvals/generations/:generationId/hot-patch`.
69
+ */
70
+ export interface HotPatchGenerationResultDto {
71
+ generationId: string;
72
+ name: string;
73
+ field: GenerationHotPatchField;
74
+ from: string;
75
+ to: string;
76
+ /**
77
+ * True when the generation held `to` already, because an earlier call of
78
+ * the same request wrote it. Console wrote nothing. This is how a lost
79
+ * answer is retried.
80
+ */
81
+ appliedBefore: boolean;
82
+ /**
83
+ * Every cluster on the generation when console answered, in lower case.
84
+ * control-backend gives each one the new spec.
85
+ */
86
+ clusterIds: string[];
87
+ }
88
+ /**
89
+ * The body of `POST api/admin/approvals/clusters/:clusterId/hot-patch` of
90
+ * console-backend, without the actor envelope.
91
+ */
92
+ export interface HotPatchClusterRequestDto {
93
+ /** The patched generation that the cluster was on when the run read it. */
94
+ generationId: string;
95
+ }
96
+ /**
97
+ * What a hot patch did to one cluster.
98
+ *
99
+ * - `patched`: the CR holds the new spec.
100
+ * - `deferred`: the cluster sleeps. Console wrote no spec, and recorded the
101
+ * change in `deferredSpecChange`. The next resume writes the full spec
102
+ * from the database, with the new image.
103
+ * - `skipped`: the cluster is gone, or it moved to another generation.
104
+ * - `errored`: the spec write failed, or a pause on the CR stopped it.
105
+ */
106
+ export type HotPatchClusterOutcome = 'patched' | 'deferred' | 'skipped' | 'errored';
107
+ /** The answer of `POST api/admin/approvals/clusters/:clusterId/hot-patch`. */
108
+ export interface HotPatchClusterResultDto {
109
+ result: HotPatchClusterOutcome;
110
+ /** Why a cluster was skipped or errored. */
111
+ error?: string;
112
+ }
@@ -0,0 +1,29 @@
1
+ import {
2
+ GENERATION_HOT_PATCH_IMAGE_KEYS
3
+ } from "../types/C8ClusterComponentVersions.type.js";
4
+ const HOT_PATCH_UNIFIED_FIELD = "unified";
5
+ const HOT_PATCH_UNIFIED_IMAGE_KEYS = [
6
+ "zeebe",
7
+ "operate",
8
+ "tasklist"
9
+ ];
10
+ const GENERATION_HOT_PATCH_FIELDS = [
11
+ ...GENERATION_HOT_PATCH_IMAGE_KEYS,
12
+ HOT_PATCH_UNIFIED_FIELD
13
+ ];
14
+ function hotPatchImageKeysOf(field) {
15
+ return field === HOT_PATCH_UNIFIED_FIELD ? HOT_PATCH_UNIFIED_IMAGE_KEYS : [field];
16
+ }
17
+ const HOT_PATCH_GENERATIONS_FLAG = "control.hotPatchGenerations";
18
+ const HOT_PATCH_GENERATIONS_MAX_GENERATIONS = 500;
19
+ const HOT_PATCH_IMAGE_MAX_LENGTH = 500;
20
+ export {
21
+ GENERATION_HOT_PATCH_FIELDS,
22
+ HOT_PATCH_GENERATIONS_FLAG,
23
+ HOT_PATCH_GENERATIONS_MAX_GENERATIONS,
24
+ HOT_PATCH_IMAGE_MAX_LENGTH,
25
+ HOT_PATCH_UNIFIED_FIELD,
26
+ HOT_PATCH_UNIFIED_IMAGE_KEYS,
27
+ hotPatchImageKeysOf
28
+ };
29
+ //# sourceMappingURL=hot-patch-generations.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/approvals/hot-patch-generations.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 {\n GENERATION_HOT_PATCH_IMAGE_KEYS,\n type GenerationHotPatchImageKey,\n} from '../types/C8ClusterComponentVersions.type.js'\n\n/**\n * The field of a hot patch for the unified `camunda/camunda` image of 8.9\n * and later. It changes `zeebe`, `operate` and `tasklist` in one write, so\n * each cluster gets the new image in one spec. A request per image field\n * restarts each cluster three times, and runs two images between the runs.\n */\nexport const HOT_PATCH_UNIFIED_FIELD = 'unified'\n\n/** The image fields that a hot patch of `unified` changes. */\nexport const HOT_PATCH_UNIFIED_IMAGE_KEYS = [\n 'zeebe',\n 'operate',\n 'tasklist',\n] as const satisfies readonly GenerationHotPatchImageKey[]\n\n/** What `field` of a hot patch can be: one image field, or `unified`. */\nexport const GENERATION_HOT_PATCH_FIELDS = [\n ...GENERATION_HOT_PATCH_IMAGE_KEYS,\n HOT_PATCH_UNIFIED_FIELD,\n] as const\n\nexport type GenerationHotPatchField =\n (typeof GENERATION_HOT_PATCH_FIELDS)[number]\n\n/** The image fields of a generation that a hot patch of `field` changes. */\nexport function hotPatchImageKeysOf(\n field: GenerationHotPatchField,\n): readonly GenerationHotPatchImageKey[] {\n return field === HOT_PATCH_UNIFIED_FIELD\n ? HOT_PATCH_UNIFIED_IMAGE_KEYS\n : [field]\n}\n\n/**\n * The flag that opens the create route of hot-patch-generations. The route\n * also needs `control.camundiApprovalFlow`.\n */\nexport const HOT_PATCH_GENERATIONS_FLAG = 'control.hotPatchGenerations'\n\n/**\n * The most generations that one request can patch.\n *\n * The bound and `HOT_PATCH_IMAGE_MAX_LENGTH` keep a request under the body\n * limit of control-backend (1 MiB): 500 generations, each with two values of\n * 500 characters, is 500 000 characters before the rest of the payload.\n */\nexport const HOT_PATCH_GENERATIONS_MAX_GENERATIONS = 500\n\n/** The longest image reference that a hot patch reads or writes. */\nexport const HOT_PATCH_IMAGE_MAX_LENGTH = 500\n\n/**\n * One generation of a request: the value that the person read, and the new\n * one.\n */\nexport interface HotPatchGenerationDto {\n id: string\n /**\n * The value of `field` that the person who asked READ. Console compares it\n * with the generation when the action runs, and changes nothing when it\n * differs.\n */\n from: string\n /** The new image reference. */\n to: string\n}\n\n/**\n * The payload of a hot-patch-generations request: ONE field, and the\n * generations whose value of that field changes.\n *\n * The field is one image field, or `unified` for the `camunda/camunda`\n * image in `zeebe`, `operate` and `tasklist`.\n */\nexport interface HotPatchGenerationsPayloadDto {\n field: GenerationHotPatchField\n generations: HotPatchGenerationDto[]\n}\n\n/**\n * The body of `PATCH api/admin/approvals/generations/:generationId/hot-patch`\n * of console-backend, without the actor envelope.\n */\nexport interface HotPatchGenerationRequestDto {\n field: GenerationHotPatchField\n from: string\n to: string\n}\n\n/**\n * The answer of\n * `PATCH api/admin/approvals/generations/:generationId/hot-patch`.\n */\nexport interface HotPatchGenerationResultDto {\n generationId: string\n name: string\n field: GenerationHotPatchField\n from: string\n to: string\n /**\n * True when the generation held `to` already, because an earlier call of\n * the same request wrote it. Console wrote nothing. This is how a lost\n * answer is retried.\n */\n appliedBefore: boolean\n /**\n * Every cluster on the generation when console answered, in lower case.\n * control-backend gives each one the new spec.\n */\n clusterIds: string[]\n}\n\n/**\n * The body of `POST api/admin/approvals/clusters/:clusterId/hot-patch` of\n * console-backend, without the actor envelope.\n */\nexport interface HotPatchClusterRequestDto {\n /** The patched generation that the cluster was on when the run read it. */\n generationId: string\n}\n\n/**\n * What a hot patch did to one cluster.\n *\n * - `patched`: the CR holds the new spec.\n * - `deferred`: the cluster sleeps. Console wrote no spec, and recorded the\n * change in `deferredSpecChange`. The next resume writes the full spec\n * from the database, with the new image.\n * - `skipped`: the cluster is gone, or it moved to another generation.\n * - `errored`: the spec write failed, or a pause on the CR stopped it.\n */\nexport type HotPatchClusterOutcome =\n | 'patched'\n | 'deferred'\n | 'skipped'\n | 'errored'\n\n/** The answer of `POST api/admin/approvals/clusters/:clusterId/hot-patch`. */\nexport interface HotPatchClusterResultDto {\n result: HotPatchClusterOutcome\n /** Why a cluster was skipped or errored. */\n error?: string\n}\n"],
5
+ "mappings": "AAMA;AAAA,EACE;AAAA,OAEK;AAQA,MAAM,0BAA0B;AAGhC,MAAM,+BAA+B;AAAA,EAC1C;AAAA,EACA;AAAA,EACA;AACF;AAGO,MAAM,8BAA8B;AAAA,EACzC,GAAG;AAAA,EACH;AACF;AAMO,SAAS,oBACd,OACuC;AACvC,SAAO,UAAU,0BACb,+BACA,CAAC,KAAK;AACZ;AAMO,MAAM,6BAA6B;AASnC,MAAM,wCAAwC;AAG9C,MAAM,6BAA6B;",
6
+ "names": []
7
+ }
@@ -53,6 +53,7 @@ export declare const APPROVAL_USE_CASE_TYPES: {
53
53
  readonly removeCustomHardwareSizing: "remove-custom-hardware-sizing";
54
54
  readonly changeGenerationVersions: "change-generation-versions";
55
55
  readonly editGeneration: "edit-generation";
56
+ readonly hotPatchGenerations: "hot-patch-generations";
56
57
  readonly automatedEnterpriseOnboarding: "automated-enterprise-onboarding";
57
58
  readonly createCustomGeneration: "create-custom-generation";
58
59
  readonly removeCustomGeneration: "remove-custom-generation";
@@ -76,6 +76,10 @@ const APPROVAL_USE_CASE_TYPES = {
76
76
  // `control.camundiApprovalFlow`. Console sends a new spec to every cluster of
77
77
  // the generation, which is why the write needs a second Camundi.
78
78
  editGeneration: "edit-generation",
79
+ // One image field of one or more generations, changed in place for a
80
+ // security incident, behind `control.hotPatchGenerations`. Every cluster
81
+ // of those generations gets the new spec, one after the other.
82
+ hotPatchGenerations: "hot-patch-generations",
79
83
  // A new enterprise customer: a production and a development organization
80
84
  // in one step, behind `control.camundiApprovalFlow`. See
81
85
  // `automated-enterprise-onboarding.ts` in control-backend.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/approvals/use-cases.const.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 { AccountsPermissions } from '../permissions/accounts.permissions.js'\n\n/**\n * The names and the value ranges of the registered use cases.\n *\n * control-backend owns the registry, and a frontend reads it at run time\n * (`GET /api/approvals/use-cases`). Two things cannot wait for that answer:\n *\n * - **The identifier**, because a caller must NAME a use case to find it in the\n * registry, and to open a request of it.\n * - **The range of a payload field**, because a form holds the value before any\n * call goes out.\n *\n * Both live here, so the schema of the service and the form of the browser can\n * never hold different numbers.\n */\n\n/** The identifier of each use case, on the wire and in the table. */\nexport const APPROVAL_USE_CASE_TYPES = {\n sendToExpiredTrial: 'send-to-expired-trial',\n extendTrial: 'extend-trial',\n moveClusterOrg: 'move-cluster-org',\n // One use case for each type of a cluster bulk operation. The types need\n // different permissions and different approval counts, and a use case holds\n // one of each. See `cluster-bulk-operation.ts` beside this file.\n clusterBulkGenerationUpdate: 'cluster-bulk-generation-update',\n clusterBulkPlanUpdate: 'cluster-bulk-plan-update',\n clusterBulkPlanTypeUpdate: 'cluster-bulk-plan-type-update',\n clusterBulkSleepWakeup: 'cluster-bulk-sleep-wakeup',\n clusterBulkDeletion: 'cluster-bulk-deletion',\n clusterBulkSpecUpdate: 'cluster-bulk-spec-update',\n // The second group, behind `control.camundiApprovalFlow`.\n changePlatformRoles: 'change-platform-roles',\n deleteInternalBackup: 'delete-internal-backup',\n changeOrgLimits: 'change-org-limits',\n // The cluster reservations of one organization, behind\n // `control.camundiApprovalFlow`. It is not the enterprise contract: a\n // reservation change and a contract change are two requests. See\n // `change-org-reservations.ts` in control-backend.\n changeOrgReservations: 'change-org-reservations',\n deleteSsoConnection: 'delete-sso-connection',\n createSsoConnection: 'create-sso-connection',\n updateSsoConnection: 'update-sso-connection',\n createEarlyAccessFeature: 'create-early-access-feature',\n changeSalesPlan: 'change-sales-plan',\n llmBudgetTopUp: 'llm-budget-top-up',\n requestInNegotiation: 'request-in-negotiation',\n // Behind its own flag `control.removeOrgMember`, and not\n // `control.camundiApprovalFlow`. See `REMOVE_ORG_MEMBER_FLAG`.\n removeOrgMember: 'remove-org-member',\n // The third group, behind `control.camundiApprovalFlow`.\n deleteOrganization: 'delete-organization',\n // Many organizations in one request. Behind `control.camundiApprovalFlow`\n // and its own flag `control.orgBulkDeletion`. See `org-bulk-deletion.ts`\n // beside this file.\n orgBulkDeletion: 'org-bulk-deletion',\n deleteUser: 'delete-user',\n changeUserEmail: 'change-user-email',\n purgeUsers: 'purge-users',\n updateUserMetadata: 'update-user-metadata',\n // A change of the feature flag table, on a stage where\n // `isFeatureFlagApprovalRequired` is true.\n changeFeatureFlag: 'change-feature-flag',\n // Turns one flag off, and nothing else. A rollback needs fewer approvals\n // than a change.\n disableFeatureFlag: 'disable-feature-flag',\n // Engages one kill switch: the action that it guards stops for everybody,\n // or for the items of the lists of the request. To release a switch with\n // lists, empty the lists with a `change-feature-flag` request. To release\n // any other switch, use a `disable-feature-flag` request.\n engageKillSwitch: 'engage-kill-switch',\n // The publish and the rollback of a release-train generation. See\n // `release-train.ts` beside this file.\n releaseTrainPublish: 'release-train-publish',\n releaseTrainRollback: 'release-train-rollback',\n // Open to every Camundi, and it needs no approval on any stage.\n createPersonalOrganisation: 'create-personal-organisation',\n // Open to the owner of a trial organization, who must be a Camundi. It needs\n // no approval on any stage and moves the organization to the internal plan.\n convertTrialToInternal: 'convert-trial-to-internal',\n // Open to the owner of an internal or trial organization, who must be a\n // Camundi. It needs no approval on any stage and deletes the organization.\n deleteOwnTestOrg: 'delete-own-test-org',\n // Open to every Camundi, runs on dev only, and needs no approval. The two\n // use cases of custom hardware sizing.\n createCustomHardwareSizing: 'create-custom-hardware-sizing',\n removeCustomHardwareSizing: 'remove-custom-hardware-sizing',\n // The mutable versions of one or more generations, behind\n // `control.camundiApprovalFlow`. Console restarts every cluster of\n // each generation, which is why the write needs a second Camundi.\n changeGenerationVersions: 'change-generation-versions',\n // The name and the env vars of one generation, behind\n // `control.camundiApprovalFlow`. Console sends a new spec to every cluster of\n // the generation, which is why the write needs a second Camundi.\n editGeneration: 'edit-generation',\n // A new enterprise customer: a production and a development organization\n // in one step, behind `control.camundiApprovalFlow`. See\n // `automated-enterprise-onboarding.ts` in control-backend.\n automatedEnterpriseOnboarding: 'automated-enterprise-onboarding',\n // Open to every Camundi, runs on dev only, and needs no approval. The two\n // use cases of custom generations.\n createCustomGeneration: 'create-custom-generation',\n removeCustomGeneration: 'remove-custom-generation',\n // Open to org owners, runs on dev only, and needs no approval. It applies\n // or deactivates a cluster modification config of one cluster.\n selfServiceClusterModification: 'self-service-cluster-modification',\n // The enterprise onboarding of one organization, behind\n // `control.camundiApprovalFlow`: the contract, the plan type of\n // each cluster, and the reservations, in one request.\n onboardToEnterprise: 'onboard-to-enterprise',\n // The term, the start date and the included value metrics of the contract\n // of one enterprise organization, behind `control.camundiApprovalFlow`. See\n // `change-enterprise-contract.ts` in control-backend.\n changeEnterpriseContract: 'change-enterprise-contract',\n // The plan type and the hardware packages of ONE cluster, behind\n // `control.camundiApprovalFlow`. The bulk plan type update beside it also\n // checks the reservations and moves the cluster plan, but each cluster\n // keeps its packages there. This one can change the packages, and it has a\n // stale guard. See `change-cluster-plan-type.ts` in control-backend.\n changeClusterPlanType: 'change-cluster-plan-type',\n // The deletion of one cluster whose TTL ran out. Only the delete cron of\n // console-backend opens it, and it needs no approval. It is a record of the\n // deletion. See `cluster-ttl-deletion.ts` in control-backend.\n clusterTtlDeletion: 'cluster-ttl-deletion',\n // The deletion of the DB corpses or of the Kubernetes corpses that console\n // finds, behind `control.camundiApprovalFlow`. See\n // `delete-cluster-corpses.ts` in control-backend.\n deleteClusterCorpses: 'delete-cluster-corpses',\n // The force delete of a cluster plan type and of every cluster on it,\n // behind `control.camundiApprovalFlow`. See\n // `force-delete-cluster-plan-type.ts` in control-backend.\n forceDeleteClusterPlanType: 'force-delete-cluster-plan-type',\n // A change of the data retention limits of a cluster plan type, which\n // console sends to every cluster of the type. Behind\n // `control.camundiApprovalFlow`. See\n // `change-plan-type-retention-limits.ts` in control-backend.\n changePlanTypeRetentionLimits: 'change-plan-type-retention-limits',\n // The generation upgrade of one cluster with `--yolo` or with the upgrade\n // gate ignored, behind `control.camundiApprovalFlow`. A plain upgrade stays\n // a direct call. See `force-generation-upgrade.ts` in control-backend.\n forceGenerationUpgrade: 'force-generation-upgrade',\n // The deletion of one Console API client of an organization. See\n // `delete-api-client.ts` in control-backend.\n deleteApiClient: 'delete-api-client',\n // The licensing model of one enterprise organization, behind\n // `control.camundiApprovalFlow`. See `change-licensing-model.ts` in\n // control-backend.\n changeLicensingModel: 'change-licensing-model',\n // A time-limited grant that lets one Camundi run a pending request with no\n // approval, and the scheduled request that ends it. Behind\n // `control.approvalOverride`. See `approval-override.ts` in control-backend.\n grantApprovalOverride: 'grant-approval-override',\n revokeApprovalOverride: 'revoke-approval-override',\n // The deletion of the managed LLM tenant of one organization: the tenant,\n // the key and the spend history. Behind `control.camundiApprovalFlow`. See\n // `delete-managed-llm-tenant.ts` in control-backend.\n deleteManagedLlmTenant: 'delete-managed-llm-tenant',\n // The signup spam patterns of accounts, behind `control.camundiApprovalFlow`.\n changeSignupSpamPatterns: 'change-signup-spam-patterns',\n // One email may sign up on dev and int, behind `control.camundiApprovalFlow`.\n // See `unlock-preprod-signup.ts` in control-backend.\n unlockPreprodSignup: 'unlock-preprod-signup',\n // Removes the signup rule of one email on dev and int, behind\n // `control.camundiApprovalFlow`. See `remove-preprod-signup.ts` in\n // control-backend.\n removePreprodSignup: 'remove-preprod-signup',\n} as const\n\n/** The days that one unlock of a preprod signup lasts when it names none. */\nexport const PREPROD_UNLOCK_DEFAULT_DAYS = 30\n/** The most days that one unlock of a preprod signup can last. */\nexport const PREPROD_UNLOCK_MAX_DAYS = 365\n/** The longest approval override grant, in hours: 14 days. */\nexport const APPROVAL_OVERRIDE_MAX_HOURS = 14 * 24\n\n/** The duration that the form of control-frontend offers first: one day. */\nexport const APPROVAL_OVERRIDE_DEFAULT_HOURS = 24\n\n/**\n * The use cases that an approval override grant can NOT run.\n *\n * Every other use case is overridable. These change who holds a permission,\n * the override mechanism itself, the feature flags of a stage, the address\n * that a person signs in with, who may sign up on a preprod stage, or delete\n * customer data, a backup, a sign-in path, or a whole fleet of clusters. None\n * of them is an emergency that one Camundi must fix alone.\n *\n * The list fails open: a use case that is not here IS overridable. Thus a new\n * use case that deletes or that changes access must be added here. Its route\n * in accounts-ng or console-backend then refuses `overriddenBy` by\n * itself: `approvalActorSchemaFor` of their `AdminApprovalsRouter.ts` reads\n * this list.\n */\nexport const APPROVAL_OVERRIDE_DENYLIST: readonly string[] = [\n APPROVAL_USE_CASE_TYPES.changePlatformRoles,\n APPROVAL_USE_CASE_TYPES.grantApprovalOverride,\n APPROVAL_USE_CASE_TYPES.revokeApprovalOverride,\n APPROVAL_USE_CASE_TYPES.changeFeatureFlag,\n APPROVAL_USE_CASE_TYPES.disableFeatureFlag,\n APPROVAL_USE_CASE_TYPES.engageKillSwitch,\n APPROVAL_USE_CASE_TYPES.purgeUsers,\n APPROVAL_USE_CASE_TYPES.deleteUser,\n APPROVAL_USE_CASE_TYPES.deleteOrganization,\n APPROVAL_USE_CASE_TYPES.orgBulkDeletion,\n APPROVAL_USE_CASE_TYPES.clusterBulkDeletion,\n APPROVAL_USE_CASE_TYPES.forceDeleteClusterPlanType,\n APPROVAL_USE_CASE_TYPES.releaseTrainPublish,\n APPROVAL_USE_CASE_TYPES.releaseTrainRollback,\n APPROVAL_USE_CASE_TYPES.deleteSsoConnection,\n APPROVAL_USE_CASE_TYPES.changeUserEmail,\n APPROVAL_USE_CASE_TYPES.deleteInternalBackup,\n APPROVAL_USE_CASE_TYPES.deleteApiClient,\n APPROVAL_USE_CASE_TYPES.removeOrgMember,\n APPROVAL_USE_CASE_TYPES.deleteManagedLlmTenant,\n APPROVAL_USE_CASE_TYPES.unlockPreprodSignup,\n APPROVAL_USE_CASE_TYPES.removePreprodSignup,\n]\n\n/** isApprovalOverridable reports whether a grant can run a request of this type. */\nexport const isApprovalOverridable = (type: string): boolean =>\n !APPROVAL_OVERRIDE_DENYLIST.includes(type)\n\n/**\n * The most personal organizations that one Camundi can own at a time.\n *\n * The request runs with no approval, so this cap is the only guard against a\n * loop that creates organizations without end. It counts the personal\n * organizations that the Camundi owns now, so a deleted organization frees its\n * slot. A move of the ownership, or of the sales plan to a type that is not\n * trial or internal, frees the slot too.\n */\nexport const PERSONAL_ORGANIZATION_MAX_PER_REQUESTER = 10\n\n/** The shortest and longest name of a personal organization. */\nexport const PERSONAL_ORGANIZATION_NAME_MIN_LENGTH = 3\nexport const PERSONAL_ORGANIZATION_NAME_MAX_LENGTH = 100\n\nexport type ApprovalUseCaseType =\n (typeof APPROVAL_USE_CASE_TYPES)[keyof typeof APPROVAL_USE_CASE_TYPES]\n\n/**\n * The shortest extension that accounts-ng accepts.\n *\n * `POST /:orgId/extendtrial` refuses a date that is less than 14 days away\n * when the body carries `onBehalfOf`, and it measures those 14 days when the\n * CALL arrives. The floor here is 15 and not 14, for two reasons:\n *\n * - The two clocks are not the same instant. Accounts builds its own \"14 days\n * from now\" a few milliseconds after control-backend builds the date, so a\n * date of exactly 14 days is already in the past for the comparison.\n * - Accounts counts with `setDate`, which is calendar arithmetic. A change of\n * the daylight saving time moves its limit by an hour.\n */\nexport const EXTEND_TRIAL_MIN_DAYS = 15\n\n/**\n * The longest extension that accounts-ng accepts.\n *\n * The same route refuses a date more than 62 days away. 61 keeps the same\n * margin as the floor above.\n */\nexport const EXTEND_TRIAL_MAX_DAYS = 61\n\n/**\n * The most roles that one change-platform-roles request adds, or removes.\n *\n * The form of control-frontend offers every platform role, and a person who\n * gives a Camundi a new position rarely changes more than a few. A request with\n * more roles than this is a request that nobody reads before they approve it.\n */\nexport const PLATFORM_ROLE_CHANGE_MAX_ROLES = 10\n\n/**\n * The bounds of one change-signup-spam-patterns request. A pattern set is a\n * map from a signup field (`first`, `last`) to the text that blocks a signup.\n * The bounds keep a request readable for the person who approves it, and keep\n * a typo from writing a set that nobody can review. The limits allow about\n * 2 MB (20 \u00D7 500 \u00D7 200 characters). A request body over 1 MiB, `previous`\n * included, gets a 413 from control-backend. A real set is far smaller.\n */\nexport const SIGNUP_SPAM_PATTERNS_MAX_FIELDS = 20\nexport const SIGNUP_SPAM_PATTERNS_MAX_PER_FIELD = 500\nexport const SIGNUP_SPAM_PATTERN_MAX_LENGTH = 200\n\n/**\n * The longest text value that one change-org-limits request writes.\n *\n * A text limit holds a short value, such as a list of regions. The bound keeps\n * a request readable for the person who approves it.\n */\nexport const ORG_LIMIT_TEXT_MAX_LENGTH = 2000\n\n/**\n * LLM_BUDGET_TOP_UP_THRESHOLD is the share of the budget that the spend of a\n * managed LLM key must reach before a top-up is the normal case.\n *\n * A request below it is still possible, but the person who asks must confirm\n * it, and the request says so to the approver. Accounts refuses a top-up\n * below it that does not carry that confirmation.\n */\nexport const LLM_BUDGET_TOP_UP_THRESHOLD = 0.9\n\n/**\n * isLlmSpendBelowTopUpThreshold reports whether a top-up of a managed LLM key\n * needs the explicit confirmation of `LLM_BUDGET_TOP_UP_THRESHOLD`.\n */\nexport const isLlmSpendBelowTopUpThreshold = (\n spend: number,\n maxBudget: number,\n): boolean => spend < maxBudget * LLM_BUDGET_TOP_UP_THRESHOLD\n\n/**\n * The most users that one purge-users request deletes.\n *\n * The God Mode purge deletes one user after the other, and Auth0 limits how\n * fast that goes. A list longer than this is also a list that no approver\n * reads before they agree.\n */\nexport const PURGE_USERS_MAX_USERS = 1000\n\n/**\n * What a person must hold to open or to approve a purge-users request.\n *\n * The purge route of accounts, `DELETE /api/users/:userId/purge`, needs both\n * of the caller. The approval route of accounts checks both of the person who\n * asked, when control-backend sends `purge: true`. The use case of\n * control-backend returns this list from `permissionsFor`, and the form passes\n * it to `canCreate`, so the button and the server never disagree.\n */\nexport const PURGE_USERS_REQUIRED_PERMISSIONS: readonly string[] = [\n AccountsPermissions.GOD_PURGE_USERS,\n AccountsPermissions.DELETE_USER,\n]\n\n/**\n * The flag that opens the create route of remove-org-member. It is its own\n * flag, so the removal of an owner can go live on a stage where\n * `control.camundiApprovalFlow` is off.\n */\nexport const REMOVE_ORG_MEMBER_FLAG = 'control.removeOrgMember'\n\n/**\n * What a person must hold to open or to approve a remove-org-member request,\n * with or without a new owner. CS holds it through the Camundi permission\n * rules. Accounts checks the same list for the person who asked.\n */\nexport const REMOVE_ORG_MEMBER_REQUIRED_PERMISSIONS: readonly string[] = [\n AccountsPermissions.REMOVE_FROM_ORG_WITH_APPROVAL,\n]\n\n/**\n * The largest metadata object that one update-user-metadata request writes,\n * in characters of its JSON text.\n *\n * This is a bound of the product, and not the limit of Auth0, which is far\n * larger. The approvers read the whole object before they agree, and an\n * object that is longer than this is an object that nobody reads.\n */\nexport const USER_METADATA_MAX_LENGTH = 16_000\n\n/**\n * The largest metadata object that a request carries as the object that the\n * person who asked READ.\n *\n * It is larger than `USER_METADATA_MAX_LENGTH`, so a user whose metadata grew\n * past that bound can still get an edit that makes it smaller. It still has a\n * bound, because the request keeps the copy in its row.\n */\nexport const USER_METADATA_EXPECTED_MAX_LENGTH = 500_000\n\n/**\n * The bounds of an automated-enterprise-onboarding request.\n *\n * The accounts wizard holds the first four, and the schema of control-backend\n * and the form of control-frontend read them here, so the form never sends\n * what the service refuses.\n */\nexport const ENTERPRISE_ONBOARDING_NAME_MAX_LENGTH = 50\nexport const ENTERPRISE_ONBOARDING_SFDC_ID_MAX_LENGTH = 50\nexport const ENTERPRISE_ONBOARDING_TERM_MIN_MONTHS = 1\nexport const ENTERPRISE_ONBOARDING_TERM_MAX_MONTHS = 60\n/** The most of one value metric that a contract includes. */\nexport const ENTERPRISE_ONBOARDING_METRIC_MAX = 1_000_000_000_000\n/**\n * The most clusters of one plan type that an onboarding reserves: the cap of\n * the accounts wizard. Accounts checks the limit of the plan only when it\n * reserves, after it created the two organizations, so the request must not\n * carry a count that the plan refuses.\n */\nexport const ENTERPRISE_ONBOARDING_RESERVATION_MAX = 20\n\n/**\n * The most clusters of one plan type that a change-org-reservations request\n * reserves. The approval route of accounts-ng has the same bound.\n * `PATCH /api/salesplans/reserved` has no bound. A request with `force`\n * skips the maximum of the sales plan, thus this bound is its only bound.\n */\nexport const ORG_RESERVATION_MAX = 1000\n\n/**\n * Whether a string is a calendar day, `YYYY-MM-DD`, that exists.\n *\n * The shape alone is not enough: `Date` rolls `2026-02-30` to March 2 with\n * no error, and `2026-13-45` becomes an invalid date that a database refuses\n * only at the write. A request carries the day for days before it runs, so\n * the check is at the open, and in the form.\n */\nexport const isCalendarDay = (value: string): boolean =>\n /^\\d{4}-\\d{2}-\\d{2}$/.test(value) &&\n !Number.isNaN(Date.parse(value)) &&\n new Date(value).toISOString().startsWith(value)\n\n/**\n * What a person must hold to open or to approve a change-enterprise-contract\n * request.\n *\n * `PATCH /:orgId/enterprise` of accounts needs `ENTERPRISE_ORG_MODIFY`, and\n * also `ENTERPRISE_ORG_MODIFY_START_DATE` for a new start date. The approval\n * route of accounts checks the same list for the person who asked. The use\n * case of control-backend returns this list from `permissionsFor`, and the\n * form passes it to `canCreate`, so the button and the server never disagree.\n */\nexport const enterpriseContractChangePermissions = (\n changesStartDate: boolean,\n): string[] =>\n changesStartDate\n ? [\n AccountsPermissions.ENTERPRISE_ORG_MODIFY,\n AccountsPermissions.ENTERPRISE_ORG_MODIFY_START_DATE,\n ]\n : [AccountsPermissions.ENTERPRISE_ORG_MODIFY]\n\n/** The longest email address that a change-user-email request carries. */\nexport const APPROVAL_EMAIL_MAX_LENGTH = 320\n\n/**\n * The email addresses that a change-user-email request accepts.\n *\n * It is the email pattern of zod 4.6. The pattern is here, so the schema of\n * control-backend and the form of control-frontend accept the same addresses,\n * and a form never sends an address that the service refuses.\n */\nexport const APPROVAL_EMAIL_PATTERN =\n // biome-ignore lint/complexity/noUselessEscapeInRegex: the same source as zod, character for character\n /^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$/\n\n/**\n * The most generations that one change-generation-versions request changes.\n *\n * Each generation restarts every cluster on it. A request over more\n * generations than this is a request that no approver reads to the end.\n *\n * The two bounds of this use case also keep a request under the body limit\n * of control-backend (1 MiB, `server-options.ts` of the shared Fastify\n * layer): 20 generations, each with the expected value of the 2 image\n * versions of 2000 characters, is 80 000 characters before the rest of the\n * payload.\n */\nexport const GENERATION_VERSIONS_MAX_GENERATIONS = 20\n\n/**\n * The longest value of one mutable version of a generation.\n *\n * An image reference is short, and only the two image versions go through\n * the use case (`GENERATION_IMAGE_VERSION_KEYS`). The bound keeps a request\n * readable for the approver. See `GENERATION_VERSIONS_MAX_GENERATIONS` for\n * the sum.\n */\nexport const GENERATION_VERSION_VALUE_MAX_LENGTH = 2000\n"],
5
- "mappings": "AAMA,SAAS,2BAA2B;AAkB7B,MAAM,0BAA0B;AAAA,EACrC,oBAAoB;AAAA,EACpB,aAAa;AAAA,EACb,gBAAgB;AAAA;AAAA;AAAA;AAAA,EAIhB,6BAA6B;AAAA,EAC7B,uBAAuB;AAAA,EACvB,2BAA2B;AAAA,EAC3B,wBAAwB;AAAA,EACxB,qBAAqB;AAAA,EACrB,uBAAuB;AAAA;AAAA,EAEvB,qBAAqB;AAAA,EACrB,sBAAsB;AAAA,EACtB,iBAAiB;AAAA;AAAA;AAAA;AAAA;AAAA,E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A,EACpB,oBAAoB;AACtB;AAOO,MAAM,yBAAyB;AAO/B,MAAM,yCAA4D;AAAA,EACvE,oBAAoB;AACtB;AAUO,MAAM,2BAA2B;AAUjC,MAAM,oCAAoC;AAS1C,MAAM,wCAAwC;AAC9C,MAAM,2CAA2C;AACjD,MAAM,wCAAwC;AAC9C,MAAM,wCAAwC;AAE9C,MAAM,mCAAmC;AAOzC,MAAM,wCAAwC;AAQ9C,MAAM,sBAAsB;AAU5B,MAAM,gBAAgB,CAAC,UAC5B,sBAAsB,KAAK,KAAK,KAChC,CAAC,OAAO,MAAM,KAAK,MAAM,KAAK,CAAC,KAC/B,IAAI,KAAK,KAAK,EAAE,YAAY,EAAE,WAAW,KAAK;AAYzC,MAAM,sCAAsC,CACjD,qBAEA,mBACI;AAAA,EACE,oBAAoB;AAAA,EACpB,oBAAoB;AACtB,IACA,CAAC,oBAAoB,qBAAqB;AAGzC,MAAM,4BAA4B;AASlC,MAAM;AAAA;AAAA,EAEX;AAAA;AAcK,MAAM,sCAAsC;AAU5C,MAAM,sCAAsC;",
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 { AccountsPermissions } from '../permissions/accounts.permissions.js'\n\n/**\n * The names and the value ranges of the registered use cases.\n *\n * control-backend owns the registry, and a frontend reads it at run time\n * (`GET /api/approvals/use-cases`). Two things cannot wait for that answer:\n *\n * - **The identifier**, because a caller must NAME a use case to find it in the\n * registry, and to open a request of it.\n * - **The range of a payload field**, because a form holds the value before any\n * call goes out.\n *\n * Both live here, so the schema of the service and the form of the browser can\n * never hold different numbers.\n */\n\n/** The identifier of each use case, on the wire and in the table. */\nexport const APPROVAL_USE_CASE_TYPES = {\n sendToExpiredTrial: 'send-to-expired-trial',\n extendTrial: 'extend-trial',\n moveClusterOrg: 'move-cluster-org',\n // One use case for each type of a cluster bulk operation. The types need\n // different permissions and different approval counts, and a use case holds\n // one of each. See `cluster-bulk-operation.ts` beside this file.\n clusterBulkGenerationUpdate: 'cluster-bulk-generation-update',\n clusterBulkPlanUpdate: 'cluster-bulk-plan-update',\n clusterBulkPlanTypeUpdate: 'cluster-bulk-plan-type-update',\n clusterBulkSleepWakeup: 'cluster-bulk-sleep-wakeup',\n clusterBulkDeletion: 'cluster-bulk-deletion',\n clusterBulkSpecUpdate: 'cluster-bulk-spec-update',\n // The second group, behind `control.camundiApprovalFlow`.\n changePlatformRoles: 'change-platform-roles',\n deleteInternalBackup: 'delete-internal-backup',\n changeOrgLimits: 'change-org-limits',\n // The cluster reservations of one organization, behind\n // `control.camundiApprovalFlow`. It is not the enterprise contract: a\n // reservation change and a contract change are two requests. See\n // `change-org-reservations.ts` in control-backend.\n changeOrgReservations: 'change-org-reservations',\n deleteSsoConnection: 'delete-sso-connection',\n createSsoConnection: 'create-sso-connection',\n updateSsoConnection: 'update-sso-connection',\n createEarlyAccessFeature: 'create-early-access-feature',\n changeSalesPlan: 'change-sales-plan',\n llmBudgetTopUp: 'llm-budget-top-up',\n requestInNegotiation: 'request-in-negotiation',\n // Behind its own flag `control.removeOrgMember`, and not\n // `control.camundiApprovalFlow`. See `REMOVE_ORG_MEMBER_FLAG`.\n removeOrgMember: 'remove-org-member',\n // The third group, behind `control.camundiApprovalFlow`.\n deleteOrganization: 'delete-organization',\n // Many organizations in one request. Behind `control.camundiApprovalFlow`\n // and its own flag `control.orgBulkDeletion`. See `org-bulk-deletion.ts`\n // beside this file.\n orgBulkDeletion: 'org-bulk-deletion',\n deleteUser: 'delete-user',\n changeUserEmail: 'change-user-email',\n purgeUsers: 'purge-users',\n updateUserMetadata: 'update-user-metadata',\n // A change of the feature flag table, on a stage where\n // `isFeatureFlagApprovalRequired` is true.\n changeFeatureFlag: 'change-feature-flag',\n // Turns one flag off, and nothing else. A rollback needs fewer approvals\n // than a change.\n disableFeatureFlag: 'disable-feature-flag',\n // Engages one kill switch: the action that it guards stops for everybody,\n // or for the items of the lists of the request. To release a switch with\n // lists, empty the lists with a `change-feature-flag` request. To release\n // any other switch, use a `disable-feature-flag` request.\n engageKillSwitch: 'engage-kill-switch',\n // The publish and the rollback of a release-train generation. See\n // `release-train.ts` beside this file.\n releaseTrainPublish: 'release-train-publish',\n releaseTrainRollback: 'release-train-rollback',\n // Open to every Camundi, and it needs no approval on any stage.\n createPersonalOrganisation: 'create-personal-organisation',\n // Open to the owner of a trial organization, who must be a Camundi. It needs\n // no approval on any stage and moves the organization to the internal plan.\n convertTrialToInternal: 'convert-trial-to-internal',\n // Open to the owner of an internal or trial organization, who must be a\n // Camundi. It needs no approval on any stage and deletes the organization.\n deleteOwnTestOrg: 'delete-own-test-org',\n // Open to every Camundi, runs on dev only, and needs no approval. The two\n // use cases of custom hardware sizing.\n createCustomHardwareSizing: 'create-custom-hardware-sizing',\n removeCustomHardwareSizing: 'remove-custom-hardware-sizing',\n // The mutable versions of one or more generations, behind\n // `control.camundiApprovalFlow`. Console restarts every cluster of\n // each generation, which is why the write needs a second Camundi.\n changeGenerationVersions: 'change-generation-versions',\n // The name and the env vars of one generation, behind\n // `control.camundiApprovalFlow`. Console sends a new spec to every cluster of\n // the generation, which is why the write needs a second Camundi.\n editGeneration: 'edit-generation',\n // One image field of one or more generations, changed in place for a\n // security incident, behind `control.hotPatchGenerations`. Every cluster\n // of those generations gets the new spec, one after the other.\n hotPatchGenerations: 'hot-patch-generations',\n // A new enterprise customer: a production and a development organization\n // in one step, behind `control.camundiApprovalFlow`. See\n // `automated-enterprise-onboarding.ts` in control-backend.\n automatedEnterpriseOnboarding: 'automated-enterprise-onboarding',\n // Open to every Camundi, runs on dev only, and needs no approval. The two\n // use cases of custom generations.\n createCustomGeneration: 'create-custom-generation',\n removeCustomGeneration: 'remove-custom-generation',\n // Open to org owners, runs on dev only, and needs no approval. It applies\n // or deactivates a cluster modification config of one cluster.\n selfServiceClusterModification: 'self-service-cluster-modification',\n // The enterprise onboarding of one organization, behind\n // `control.camundiApprovalFlow`: the contract, the plan type of\n // each cluster, and the reservations, in one request.\n onboardToEnterprise: 'onboard-to-enterprise',\n // The term, the start date and the included value metrics of the contract\n // of one enterprise organization, behind `control.camundiApprovalFlow`. See\n // `change-enterprise-contract.ts` in control-backend.\n changeEnterpriseContract: 'change-enterprise-contract',\n // The plan type and the hardware packages of ONE cluster, behind\n // `control.camundiApprovalFlow`. The bulk plan type update beside it also\n // checks the reservations and moves the cluster plan, but each cluster\n // keeps its packages there. This one can change the packages, and it has a\n // stale guard. See `change-cluster-plan-type.ts` in control-backend.\n changeClusterPlanType: 'change-cluster-plan-type',\n // The deletion of one cluster whose TTL ran out. Only the delete cron of\n // console-backend opens it, and it needs no approval. It is a record of the\n // deletion. See `cluster-ttl-deletion.ts` in control-backend.\n clusterTtlDeletion: 'cluster-ttl-deletion',\n // The deletion of the DB corpses or of the Kubernetes corpses that console\n // finds, behind `control.camundiApprovalFlow`. See\n // `delete-cluster-corpses.ts` in control-backend.\n deleteClusterCorpses: 'delete-cluster-corpses',\n // The force delete of a cluster plan type and of every cluster on it,\n // behind `control.camundiApprovalFlow`. See\n // `force-delete-cluster-plan-type.ts` in control-backend.\n forceDeleteClusterPlanType: 'force-delete-cluster-plan-type',\n // A change of the data retention limits of a cluster plan type, which\n // console sends to every cluster of the type. Behind\n // `control.camundiApprovalFlow`. See\n // `change-plan-type-retention-limits.ts` in control-backend.\n changePlanTypeRetentionLimits: 'change-plan-type-retention-limits',\n // The generation upgrade of one cluster with `--yolo` or with the upgrade\n // gate ignored, behind `control.camundiApprovalFlow`. A plain upgrade stays\n // a direct call. See `force-generation-upgrade.ts` in control-backend.\n forceGenerationUpgrade: 'force-generation-upgrade',\n // The deletion of one Console API client of an organization. See\n // `delete-api-client.ts` in control-backend.\n deleteApiClient: 'delete-api-client',\n // The licensing model of one enterprise organization, behind\n // `control.camundiApprovalFlow`. See `change-licensing-model.ts` in\n // control-backend.\n changeLicensingModel: 'change-licensing-model',\n // A time-limited grant that lets one Camundi run a pending request with no\n // approval, and the scheduled request that ends it. Behind\n // `control.approvalOverride`. See `approval-override.ts` in control-backend.\n grantApprovalOverride: 'grant-approval-override',\n revokeApprovalOverride: 'revoke-approval-override',\n // The deletion of the managed LLM tenant of one organization: the tenant,\n // the key and the spend history. Behind `control.camundiApprovalFlow`. See\n // `delete-managed-llm-tenant.ts` in control-backend.\n deleteManagedLlmTenant: 'delete-managed-llm-tenant',\n // The signup spam patterns of accounts, behind `control.camundiApprovalFlow`.\n changeSignupSpamPatterns: 'change-signup-spam-patterns',\n // One email may sign up on dev and int, behind `control.camundiApprovalFlow`.\n // See `unlock-preprod-signup.ts` in control-backend.\n unlockPreprodSignup: 'unlock-preprod-signup',\n // Removes the signup rule of one email on dev and int, behind\n // `control.camundiApprovalFlow`. See `remove-preprod-signup.ts` in\n // control-backend.\n removePreprodSignup: 'remove-preprod-signup',\n} as const\n\n/** The days that one unlock of a preprod signup lasts when it names none. */\nexport const PREPROD_UNLOCK_DEFAULT_DAYS = 30\n/** The most days that one unlock of a preprod signup can last. */\nexport const PREPROD_UNLOCK_MAX_DAYS = 365\n/** The longest approval override grant, in hours: 14 days. */\nexport const APPROVAL_OVERRIDE_MAX_HOURS = 14 * 24\n\n/** The duration that the form of control-frontend offers first: one day. */\nexport const APPROVAL_OVERRIDE_DEFAULT_HOURS = 24\n\n/**\n * The use cases that an approval override grant can NOT run.\n *\n * Every other use case is overridable. These change who holds a permission,\n * the override mechanism itself, the feature flags of a stage, the address\n * that a person signs in with, who may sign up on a preprod stage, or delete\n * customer data, a backup, a sign-in path, or a whole fleet of clusters. None\n * of them is an emergency that one Camundi must fix alone.\n *\n * The list fails open: a use case that is not here IS overridable. Thus a new\n * use case that deletes or that changes access must be added here. Its route\n * in accounts-ng or console-backend then refuses `overriddenBy` by\n * itself: `approvalActorSchemaFor` of their `AdminApprovalsRouter.ts` reads\n * this list.\n */\nexport const APPROVAL_OVERRIDE_DENYLIST: readonly string[] = [\n APPROVAL_USE_CASE_TYPES.changePlatformRoles,\n APPROVAL_USE_CASE_TYPES.grantApprovalOverride,\n APPROVAL_USE_CASE_TYPES.revokeApprovalOverride,\n APPROVAL_USE_CASE_TYPES.changeFeatureFlag,\n APPROVAL_USE_CASE_TYPES.disableFeatureFlag,\n APPROVAL_USE_CASE_TYPES.engageKillSwitch,\n APPROVAL_USE_CASE_TYPES.purgeUsers,\n APPROVAL_USE_CASE_TYPES.deleteUser,\n APPROVAL_USE_CASE_TYPES.deleteOrganization,\n APPROVAL_USE_CASE_TYPES.orgBulkDeletion,\n APPROVAL_USE_CASE_TYPES.clusterBulkDeletion,\n APPROVAL_USE_CASE_TYPES.forceDeleteClusterPlanType,\n APPROVAL_USE_CASE_TYPES.releaseTrainPublish,\n APPROVAL_USE_CASE_TYPES.releaseTrainRollback,\n APPROVAL_USE_CASE_TYPES.deleteSsoConnection,\n APPROVAL_USE_CASE_TYPES.changeUserEmail,\n APPROVAL_USE_CASE_TYPES.deleteInternalBackup,\n APPROVAL_USE_CASE_TYPES.deleteApiClient,\n APPROVAL_USE_CASE_TYPES.removeOrgMember,\n APPROVAL_USE_CASE_TYPES.deleteManagedLlmTenant,\n APPROVAL_USE_CASE_TYPES.unlockPreprodSignup,\n APPROVAL_USE_CASE_TYPES.removePreprodSignup,\n]\n\n/** isApprovalOverridable reports whether a grant can run a request of this type. */\nexport const isApprovalOverridable = (type: string): boolean =>\n !APPROVAL_OVERRIDE_DENYLIST.includes(type)\n\n/**\n * The most personal organizations that one Camundi can own at a time.\n *\n * The request runs with no approval, so this cap is the only guard against a\n * loop that creates organizations without end. It counts the personal\n * organizations that the Camundi owns now, so a deleted organization frees its\n * slot. A move of the ownership, or of the sales plan to a type that is not\n * trial or internal, frees the slot too.\n */\nexport const PERSONAL_ORGANIZATION_MAX_PER_REQUESTER = 10\n\n/** The shortest and longest name of a personal organization. */\nexport const PERSONAL_ORGANIZATION_NAME_MIN_LENGTH = 3\nexport const PERSONAL_ORGANIZATION_NAME_MAX_LENGTH = 100\n\nexport type ApprovalUseCaseType =\n (typeof APPROVAL_USE_CASE_TYPES)[keyof typeof APPROVAL_USE_CASE_TYPES]\n\n/**\n * The shortest extension that accounts-ng accepts.\n *\n * `POST /:orgId/extendtrial` refuses a date that is less than 14 days away\n * when the body carries `onBehalfOf`, and it measures those 14 days when the\n * CALL arrives. The floor here is 15 and not 14, for two reasons:\n *\n * - The two clocks are not the same instant. Accounts builds its own \"14 days\n * from now\" a few milliseconds after control-backend builds the date, so a\n * date of exactly 14 days is already in the past for the comparison.\n * - Accounts counts with `setDate`, which is calendar arithmetic. A change of\n * the daylight saving time moves its limit by an hour.\n */\nexport const EXTEND_TRIAL_MIN_DAYS = 15\n\n/**\n * The longest extension that accounts-ng accepts.\n *\n * The same route refuses a date more than 62 days away. 61 keeps the same\n * margin as the floor above.\n */\nexport const EXTEND_TRIAL_MAX_DAYS = 61\n\n/**\n * The most roles that one change-platform-roles request adds, or removes.\n *\n * The form of control-frontend offers every platform role, and a person who\n * gives a Camundi a new position rarely changes more than a few. A request with\n * more roles than this is a request that nobody reads before they approve it.\n */\nexport const PLATFORM_ROLE_CHANGE_MAX_ROLES = 10\n\n/**\n * The bounds of one change-signup-spam-patterns request. A pattern set is a\n * map from a signup field (`first`, `last`) to the text that blocks a signup.\n * The bounds keep a request readable for the person who approves it, and keep\n * a typo from writing a set that nobody can review. The limits allow about\n * 2 MB (20 \u00D7 500 \u00D7 200 characters). A request body over 1 MiB, `previous`\n * included, gets a 413 from control-backend. A real set is far smaller.\n */\nexport const SIGNUP_SPAM_PATTERNS_MAX_FIELDS = 20\nexport const SIGNUP_SPAM_PATTERNS_MAX_PER_FIELD = 500\nexport const SIGNUP_SPAM_PATTERN_MAX_LENGTH = 200\n\n/**\n * The longest text value that one change-org-limits request writes.\n *\n * A text limit holds a short value, such as a list of regions. The bound keeps\n * a request readable for the person who approves it.\n */\nexport const ORG_LIMIT_TEXT_MAX_LENGTH = 2000\n\n/**\n * LLM_BUDGET_TOP_UP_THRESHOLD is the share of the budget that the spend of a\n * managed LLM key must reach before a top-up is the normal case.\n *\n * A request below it is still possible, but the person who asks must confirm\n * it, and the request says so to the approver. Accounts refuses a top-up\n * below it that does not carry that confirmation.\n */\nexport const LLM_BUDGET_TOP_UP_THRESHOLD = 0.9\n\n/**\n * isLlmSpendBelowTopUpThreshold reports whether a top-up of a managed LLM key\n * needs the explicit confirmation of `LLM_BUDGET_TOP_UP_THRESHOLD`.\n */\nexport const isLlmSpendBelowTopUpThreshold = (\n spend: number,\n maxBudget: number,\n): boolean => spend < maxBudget * LLM_BUDGET_TOP_UP_THRESHOLD\n\n/**\n * The most users that one purge-users request deletes.\n *\n * The God Mode purge deletes one user after the other, and Auth0 limits how\n * fast that goes. A list longer than this is also a list that no approver\n * reads before they agree.\n */\nexport const PURGE_USERS_MAX_USERS = 1000\n\n/**\n * What a person must hold to open or to approve a purge-users request.\n *\n * The purge route of accounts, `DELETE /api/users/:userId/purge`, needs both\n * of the caller. The approval route of accounts checks both of the person who\n * asked, when control-backend sends `purge: true`. The use case of\n * control-backend returns this list from `permissionsFor`, and the form passes\n * it to `canCreate`, so the button and the server never disagree.\n */\nexport const PURGE_USERS_REQUIRED_PERMISSIONS: readonly string[] = [\n AccountsPermissions.GOD_PURGE_USERS,\n AccountsPermissions.DELETE_USER,\n]\n\n/**\n * The flag that opens the create route of remove-org-member. It is its own\n * flag, so the removal of an owner can go live on a stage where\n * `control.camundiApprovalFlow` is off.\n */\nexport const REMOVE_ORG_MEMBER_FLAG = 'control.removeOrgMember'\n\n/**\n * What a person must hold to open or to approve a remove-org-member request,\n * with or without a new owner. CS holds it through the Camundi permission\n * rules. Accounts checks the same list for the person who asked.\n */\nexport const REMOVE_ORG_MEMBER_REQUIRED_PERMISSIONS: readonly string[] = [\n AccountsPermissions.REMOVE_FROM_ORG_WITH_APPROVAL,\n]\n\n/**\n * The largest metadata object that one update-user-metadata request writes,\n * in characters of its JSON text.\n *\n * This is a bound of the product, and not the limit of Auth0, which is far\n * larger. The approvers read the whole object before they agree, and an\n * object that is longer than this is an object that nobody reads.\n */\nexport const USER_METADATA_MAX_LENGTH = 16_000\n\n/**\n * The largest metadata object that a request carries as the object that the\n * person who asked READ.\n *\n * It is larger than `USER_METADATA_MAX_LENGTH`, so a user whose metadata grew\n * past that bound can still get an edit that makes it smaller. It still has a\n * bound, because the request keeps the copy in its row.\n */\nexport const USER_METADATA_EXPECTED_MAX_LENGTH = 500_000\n\n/**\n * The bounds of an automated-enterprise-onboarding request.\n *\n * The accounts wizard holds the first four, and the schema of control-backend\n * and the form of control-frontend read them here, so the form never sends\n * what the service refuses.\n */\nexport const ENTERPRISE_ONBOARDING_NAME_MAX_LENGTH = 50\nexport const ENTERPRISE_ONBOARDING_SFDC_ID_MAX_LENGTH = 50\nexport const ENTERPRISE_ONBOARDING_TERM_MIN_MONTHS = 1\nexport const ENTERPRISE_ONBOARDING_TERM_MAX_MONTHS = 60\n/** The most of one value metric that a contract includes. */\nexport const ENTERPRISE_ONBOARDING_METRIC_MAX = 1_000_000_000_000\n/**\n * The most clusters of one plan type that an onboarding reserves: the cap of\n * the accounts wizard. Accounts checks the limit of the plan only when it\n * reserves, after it created the two organizations, so the request must not\n * carry a count that the plan refuses.\n */\nexport const ENTERPRISE_ONBOARDING_RESERVATION_MAX = 20\n\n/**\n * The most clusters of one plan type that a change-org-reservations request\n * reserves. The approval route of accounts-ng has the same bound.\n * `PATCH /api/salesplans/reserved` has no bound. A request with `force`\n * skips the maximum of the sales plan, thus this bound is its only bound.\n */\nexport const ORG_RESERVATION_MAX = 1000\n\n/**\n * Whether a string is a calendar day, `YYYY-MM-DD`, that exists.\n *\n * The shape alone is not enough: `Date` rolls `2026-02-30` to March 2 with\n * no error, and `2026-13-45` becomes an invalid date that a database refuses\n * only at the write. A request carries the day for days before it runs, so\n * the check is at the open, and in the form.\n */\nexport const isCalendarDay = (value: string): boolean =>\n /^\\d{4}-\\d{2}-\\d{2}$/.test(value) &&\n !Number.isNaN(Date.parse(value)) &&\n new Date(value).toISOString().startsWith(value)\n\n/**\n * What a person must hold to open or to approve a change-enterprise-contract\n * request.\n *\n * `PATCH /:orgId/enterprise` of accounts needs `ENTERPRISE_ORG_MODIFY`, and\n * also `ENTERPRISE_ORG_MODIFY_START_DATE` for a new start date. The approval\n * route of accounts checks the same list for the person who asked. The use\n * case of control-backend returns this list from `permissionsFor`, and the\n * form passes it to `canCreate`, so the button and the server never disagree.\n */\nexport const enterpriseContractChangePermissions = (\n changesStartDate: boolean,\n): string[] =>\n changesStartDate\n ? [\n AccountsPermissions.ENTERPRISE_ORG_MODIFY,\n AccountsPermissions.ENTERPRISE_ORG_MODIFY_START_DATE,\n ]\n : [AccountsPermissions.ENTERPRISE_ORG_MODIFY]\n\n/** The longest email address that a change-user-email request carries. */\nexport const APPROVAL_EMAIL_MAX_LENGTH = 320\n\n/**\n * The email addresses that a change-user-email request accepts.\n *\n * It is the email pattern of zod 4.6. The pattern is here, so the schema of\n * control-backend and the form of control-frontend accept the same addresses,\n * and a form never sends an address that the service refuses.\n */\nexport const APPROVAL_EMAIL_PATTERN =\n // biome-ignore lint/complexity/noUselessEscapeInRegex: the same source as zod, character for character\n /^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$/\n\n/**\n * The most generations that one change-generation-versions request changes.\n *\n * Each generation restarts every cluster on it. A request over more\n * generations than this is a request that no approver reads to the end.\n *\n * The two bounds of this use case also keep a request under the body limit\n * of control-backend (1 MiB, `server-options.ts` of the shared Fastify\n * layer): 20 generations, each with the expected value of the 2 image\n * versions of 2000 characters, is 80 000 characters before the rest of the\n * payload.\n */\nexport const GENERATION_VERSIONS_MAX_GENERATIONS = 20\n\n/**\n * The longest value of one mutable version of a generation.\n *\n * An image reference is short, and only the two image versions go through\n * the use case (`GENERATION_IMAGE_VERSION_KEYS`). The bound keeps a request\n * readable for the approver. See `GEN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Model?: LicensingModelType;
30
30
  autoJoin?: AutoJoinAssignment;
31
+ /**
32
+ * The choices of the members about the email of infra notices (#11886).
33
+ * A missing key, a missing list and an empty list mean the same: the
34
+ * default rule applies. A user id is in one list at most.
35
+ *
36
+ * `toDto` of accounts-ng leaves it out. Only the infra notice routes of
37
+ * accounts-ng read and write it.
38
+ */
39
+ infraNotices?: {
40
+ /** The user ids that get the email although no default gives it. */
41
+ optedIn?: string[];
42
+ /** The user ids that do not get the email although a default gives it. */
43
+ optedOut?: string[];
44
+ };
31
45
  llm?: {
32
46
  /**
33
47
  * The managed LLM key. A key that is set shows as `REDACTED_LLM_KEY` in every response, except
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/dtos/Organization.dto.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 { OrganizationPermissions } from '../types/OrganizationPermission.type.js'\nimport type { SalesPlanType } from '../types/SalesPlanType.type.js'\nimport type { ClusterCreationDefaults } from './ClusterCreationDefaults.dto.js'\nimport type { OrganizationToSalesPlanDto } from './OrganizationToSalesPlan.dto.js'\n\nexport type LicensingModelType = 'legacy' | '2025'\n\nexport const VALID_LICENSING_MODELS: readonly LicensingModelType[] = [\n 'legacy',\n '2025',\n] as const\n\nexport const LICENSING_MODEL_DISPLAY_NAMES: Record<LicensingModelType, string> =\n {\n legacy: 'Legacy (PI, DI, TU)',\n '2025': '2025 (PI+Tenant)',\n } as const\n\n/**\n * Upstream that holds a managed LLM key.\n *\n * `@camunda-cloud/featureflags` owns the `LlmProvider` type and its rollout\n * rules. This package must not depend on that one, so the union is repeated\n * here. Keep the two in step.\n */\nexport type LlmProviderName = 'litellm' | 'openrouter'\n\nexport interface OrganizationMetadata {\n clickedRequestPaidPlan?: boolean\n /**\n * Default values for the settings of a new cluster of this organization\n * (#9732). They seed a cluster at creation and are never applied again.\n *\n * A field that is absent takes the value that the console backend writes.\n * The whole key is absent for almost every organization.\n */\n clusterDefaults?: ClusterCreationDefaults\n salesForceId?: string\n enterpriseDevOnly?: boolean\n awsOnly?: boolean\n licensingModel?: LicensingModelType\n autoJoin?: AutoJoinAssignment\n llm?: {\n /**\n * The managed LLM key. A key that is set shows as `REDACTED_LLM_KEY` in every response, except\n * `GET /api/organizations/:orgId` for a machine caller that may read it.\n * A client only tests that the key exists.\n */\n tenantKey: string\n /**\n * Team that holds the key on LiteLLM.\n *\n * Optional, and every call site already treats it as such. Old LiteLLM\n * orgs got a key without a team. OpenRouter has no teams at all.\n */\n teamId?: string\n created: number\n /** Epoch ms of the last key rotation \u2014 set when the tenant key is regenerated. */\n updated?: number\n /**\n * Upstream that holds this key. Absent means `litellm`, because every key\n * from before the OpenRouter rollout is on LiteLLM.\n *\n * This value, and not the OpenRouter feature flag, decides where the\n * read, block, top-up and delete paths look for the key. A flag change\n * must never move a live key to a provider that does not hold it.\n */\n provider?: LlmProviderName\n /**\n * Handle for the key on OpenRouter, which addresses a key by hash and not\n * by its value. Absent for a LiteLLM key.\n *\n * Without it, an OpenRouter key can be found again only by a list request\n * that matches on the name of the key.\n */\n keyHash?: string\n /**\n * UUID of the OpenRouter workspace that holds this key. Absent for a\n * LiteLLM key, and for an OpenRouter key that lives in the default\n * workspace.\n *\n * A key stays in its workspace for its whole life, and a list request\n * covers one workspace. So the lost-hash recovery by name needs this value\n * to look in the right workspace after the configured one changed.\n */\n workspaceId?: string\n /**\n * True while the enterprise org has the `camunda-provided-llm` early access\n * feature off, or a revoke of its key is not finished. Console then writes\n * no connector secrets for this key, and a sweep removes the ones that\n * exist.\n *\n * It does not prove that the upstream blocked the key. A block can still be\n * pending in the operation queue (`litellm.blockKey`). Absent means not\n * suspended.\n */\n suspended?: boolean\n /**\n * The key that a provider migration replaced, kept until the delete of\n * that key is confirmed.\n *\n * The migration to OpenRouter writes the new key over `tenantKey` before\n * it deletes the old one. Without this record the old key stays alive on\n * the old upstream and nothing points at it. The migration removes this\n * field when the old upstream confirms the delete, and it uses the field\n * to find the orgs that a re-run must finish.\n *\n * Absent for every org that never moved upstream.\n */\n migratedFrom?: {\n /** Upstream that holds the replaced key. */\n provider: LlmProviderName\n /** The replaced key itself. It is a credential. Never log it. */\n tenantKey: string\n /** Team that held the replaced key on LiteLLM. */\n teamId?: string\n }\n }\n}\n\nexport interface AutoJoinAssignment {\n departments: Array<{ hibobId: string; roles: string[] }>\n divisions: Array<{ hibobId: string; roles: string[] }>\n subdivisions: Array<{ hibobId: string; roles: string[] }>\n}\nexport interface OrganizationDto {\n uuid: string\n name: string\n organizationToSalesPlan?: OrganizationToSalesPlanDto\n permissions?: OrganizationPermissions\n metadata?: OrganizationMetadata\n created: Date\n internal: boolean\n /** Months that Activity entries stay. 0 is \"Not set\". */\n activityRetentionMonths?: number\n}\n\nexport interface OrgOwner {\n owner: string\n email: string\n first: string\n last: string\n}\n\nexport interface OrgWithNameAndSalesPlan {\n uuid: string\n name: string | undefined\n salesPlanName: string | undefined\n salesPlanUuid: string | undefined\n salesPlanType: SalesPlanType | undefined\n}\n"],
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 { OrganizationPermissions } from '../types/OrganizationPermission.type.js'\nimport type { SalesPlanType } from '../types/SalesPlanType.type.js'\nimport type { ClusterCreationDefaults } from './ClusterCreationDefaults.dto.js'\nimport type { OrganizationToSalesPlanDto } from './OrganizationToSalesPlan.dto.js'\n\nexport type LicensingModelType = 'legacy' | '2025'\n\nexport const VALID_LICENSING_MODELS: readonly LicensingModelType[] = [\n 'legacy',\n '2025',\n] as const\n\nexport const LICENSING_MODEL_DISPLAY_NAMES: Record<LicensingModelType, string> =\n {\n legacy: 'Legacy (PI, DI, TU)',\n '2025': '2025 (PI+Tenant)',\n } as const\n\n/**\n * Upstream that holds a managed LLM key.\n *\n * `@camunda-cloud/featureflags` owns the `LlmProvider` type and its rollout\n * rules. This package must not depend on that one, so the union is repeated\n * here. Keep the two in step.\n */\nexport type LlmProviderName = 'litellm' | 'openrouter'\n\nexport interface OrganizationMetadata {\n clickedRequestPaidPlan?: boolean\n /**\n * Default values for the settings of a new cluster of this organization\n * (#9732). They seed a cluster at creation and are never applied again.\n *\n * A field that is absent takes the value that the console backend writes.\n * The whole key is absent for almost every organization.\n */\n clusterDefaults?: ClusterCreationDefaults\n salesForceId?: string\n enterpriseDevOnly?: boolean\n awsOnly?: boolean\n licensingModel?: LicensingModelType\n autoJoin?: AutoJoinAssignment\n /**\n * The choices of the members about the email of infra notices (#11886).\n * A missing key, a missing list and an empty list mean the same: the\n * default rule applies. A user id is in one list at most.\n *\n * `toDto` of accounts-ng leaves it out. Only the infra notice routes of\n * accounts-ng read and write it.\n */\n infraNotices?: {\n /** The user ids that get the email although no default gives it. */\n optedIn?: string[]\n /** The user ids that do not get the email although a default gives it. */\n optedOut?: string[]\n }\n llm?: {\n /**\n * The managed LLM key. A key that is set shows as `REDACTED_LLM_KEY` in every response, except\n * `GET /api/organizations/:orgId` for a machine caller that may read it.\n * A client only tests that the key exists.\n */\n tenantKey: string\n /**\n * Team that holds the key on LiteLLM.\n *\n * Optional, and every call site already treats it as such. Old LiteLLM\n * orgs got a key without a team. OpenRouter has no teams at all.\n */\n teamId?: string\n created: number\n /** Epoch ms of the last key rotation \u2014 set when the tenant key is regenerated. */\n updated?: number\n /**\n * Upstream that holds this key. Absent means `litellm`, because every key\n * from before the OpenRouter rollout is on LiteLLM.\n *\n * This value, and not the OpenRouter feature flag, decides where the\n * read, block, top-up and delete paths look for the key. A flag change\n * must never move a live key to a provider that does not hold it.\n */\n provider?: LlmProviderName\n /**\n * Handle for the key on OpenRouter, which addresses a key by hash and not\n * by its value. Absent for a LiteLLM key.\n *\n * Without it, an OpenRouter key can be found again only by a list request\n * that matches on the name of the key.\n */\n keyHash?: string\n /**\n * UUID of the OpenRouter workspace that holds this key. Absent for a\n * LiteLLM key, and for an OpenRouter key that lives in the default\n * workspace.\n *\n * A key stays in its workspace for its whole life, and a list request\n * covers one workspace. So the lost-hash recovery by name needs this value\n * to look in the right workspace after the configured one changed.\n */\n workspaceId?: string\n /**\n * True while the enterprise org has the `camunda-provided-llm` early access\n * feature off, or a revoke of its key is not finished. Console then writes\n * no connector secrets for this key, and a sweep removes the ones that\n * exist.\n *\n * It does not prove that the upstream blocked the key. A block can still be\n * pending in the operation queue (`litellm.blockKey`). Absent means not\n * suspended.\n */\n suspended?: boolean\n /**\n * The key that a provider migration replaced, kept until the delete of\n * that key is confirmed.\n *\n * The migration to OpenRouter writes the new key over `tenantKey` before\n * it deletes the old one. Without this record the old key stays alive on\n * the old upstream and nothing points at it. The migration removes this\n * field when the old upstream confirms the delete, and it uses the field\n * to find the orgs that a re-run must finish.\n *\n * Absent for every org that never moved upstream.\n */\n migratedFrom?: {\n /** Upstream that holds the replaced key. */\n provider: LlmProviderName\n /** The replaced key itself. It is a credential. Never log it. */\n tenantKey: string\n /** Team that held the replaced key on LiteLLM. */\n teamId?: string\n }\n }\n}\n\nexport interface AutoJoinAssignment {\n departments: Array<{ hibobId: string; roles: string[] }>\n divisions: Array<{ hibobId: string; roles: string[] }>\n subdivisions: Array<{ hibobId: string; roles: string[] }>\n}\nexport interface OrganizationDto {\n uuid: string\n name: string\n organizationToSalesPlan?: OrganizationToSalesPlanDto\n permissions?: OrganizationPermissions\n metadata?: OrganizationMetadata\n created: Date\n internal: boolean\n /** Months that Activity entries stay. 0 is \"Not set\". */\n activityRetentionMonths?: number\n}\n\nexport interface OrgOwner {\n owner: string\n email: string\n first: string\n last: string\n}\n\nexport interface OrgWithNameAndSalesPlan {\n uuid: string\n name: string | undefined\n salesPlanName: string | undefined\n salesPlanUuid: string | undefined\n salesPlanType: SalesPlanType | undefined\n}\n"],
5
5
  "mappings": "AAaO,MAAM,yBAAwD;AAAA,EACnE;AAAA,EACA;AACF;AAEO,MAAM,gCACX;AAAA,EACE,QAAQ;AAAA,EACR,QAAQ;AACV;",
6
6
  "names": []
7
7
  }
package/dist/index.d.ts CHANGED
@@ -35,6 +35,8 @@ export type { ApprovalExpectedChange } from './approvals/expected-value.js';
35
35
  export { isSameApprovalValue, staleApprovalKeys, } from './approvals/expected-value.js';
36
36
  export type { ClusterPlanTypeClusterDto, ClusterPlanTypeClustersDto, ForceDeleteClusterPlanTypeStepResult, } from './approvals/force-delete-cluster-plan-type.js';
37
37
  export { FORCE_DELETE_CLUSTER_PLAN_TYPE_MAX_CLUSTERS } from './approvals/force-delete-cluster-plan-type.js';
38
+ export type { GenerationHotPatchField, HotPatchClusterOutcome, HotPatchClusterRequestDto, HotPatchClusterResultDto, HotPatchGenerationDto, HotPatchGenerationRequestDto, HotPatchGenerationResultDto, HotPatchGenerationsPayloadDto, } from './approvals/hot-patch-generations.js';
39
+ export { GENERATION_HOT_PATCH_FIELDS, HOT_PATCH_GENERATIONS_FLAG, HOT_PATCH_GENERATIONS_MAX_GENERATIONS, HOT_PATCH_IMAGE_MAX_LENGTH, HOT_PATCH_UNIFIED_FIELD, HOT_PATCH_UNIFIED_IMAGE_KEYS, hotPatchImageKeysOf, } from './approvals/hot-patch-generations.js';
38
40
  export type { ApprovalIncidentDto, ApprovalIncidentLinkRequest, } from './approvals/incident-link.js';
39
41
  export { APPROVAL_INCIDENT_FILTER_ANY, APPROVAL_INCIDENT_ID_MAX_LENGTH, APPROVAL_INCIDENT_NAME_MAX_LENGTH, APPROVAL_INCIDENT_PERMALINK_MAX_LENGTH, APPROVAL_INCIDENT_REFERENCE_MAX_LENGTH, APPROVAL_INCIDENTS_FLAG, isIncidentIoPermalink, } from './approvals/incident-link.js';
40
42
  export type { OrgBulkDeletionFinalStatus, OrgBulkDeletionOrgDto, OrgBulkDeletionOrgResultDto, OrgBulkDeletionPayloadDto, OrgSalesPlanTypesRequest, OrgSalesPlanTypesResult, } from './approvals/org-bulk-deletion.js';
@@ -141,8 +143,8 @@ export { INTERNAL_LOW_HARDWARE_PLAN_NAME, isActivitySleepEligible, isClusterTagE
141
143
  export type { BotContext, BotOptions, BotRequest, GetUserDetailsResponse, ListRolesForUserResponse, UpdateUserRolesRequest, UpdateUserRolesResponse, UserContext, UserDetails, } from './types/Bot.types.js';
142
144
  export type { BulkClusterDeletionContent, BulkClusterDeletionItem, BulkClusterGenerationUpdateItem, BulkClusterPlanTypeUpdateContent, BulkClusterPlanTypeUpdateItem, BulkClusterPlanUpdateContent, BulkClusterPlanUpdateItem, BulkGenerationUpdateContent, GenericBulkClusterOperationContent, GenericBulkOperationContent, GenericClusterBulkOperationItem, } from './types/BulkOperation.type.js';
143
145
  export { isBulkClusterDeletionItem, isBulkClusterPlanTypeUpdateItem, isBulkClusterPlanUpdateItem, isIsBulkClusterGenerationUpdateIten, } from './types/BulkOperation.type.js';
144
- export type { GenerationEnvVarsDto, GenerationEnvVarsKey, GenerationImageVersionsDto, ImmutableZeebeClusterVersionsDto, MutableZeebeClusterVersionsDto, ZeebeClusterVersionsDto, } from './types/C8ClusterComponentVersions.type.js';
145
- export { AllThings, GENERATION_ENV_VARS_KEYS, GENERATION_IMAGE_VERSION_KEYS, ImmutableThings, MutableThings, } from './types/C8ClusterComponentVersions.type.js';
146
+ export type { GenerationEnvVarsDto, GenerationEnvVarsKey, GenerationHotPatchImageKey, GenerationImageVersionsDto, ImmutableZeebeClusterVersionsDto, MutableZeebeClusterVersionsDto, ZeebeClusterVersionsDto, } from './types/C8ClusterComponentVersions.type.js';
147
+ export { AllThings, GENERATION_ENV_VARS_KEYS, GENERATION_HOT_PATCH_IMAGE_KEYS, GENERATION_IMAGE_VERSION_KEYS, ImmutableThings, MutableThings, } from './types/C8ClusterComponentVersions.type.js';
146
148
  export type { CamundaClusterStage, CamundaClusterStageLabel, ClusterLabels, } from './types/CamundaClusterLabels.type.js';
147
149
  export { ALLOWED_CAMUNDA_LABELS, StageClusterLabels, } from './types/CamundaClusterLabels.type.js';
148
150
  export type { SubscriptionItem } from './types/Chargebee.type.js';
package/dist/index.js CHANGED
@@ -233,6 +233,15 @@ import {
233
233
  staleApprovalKeys
234
234
  } from "./approvals/expected-value.js";
235
235
  import { FORCE_DELETE_CLUSTER_PLAN_TYPE_MAX_CLUSTERS } from "./approvals/force-delete-cluster-plan-type.js";
236
+ import {
237
+ GENERATION_HOT_PATCH_FIELDS,
238
+ HOT_PATCH_GENERATIONS_FLAG,
239
+ HOT_PATCH_GENERATIONS_MAX_GENERATIONS,
240
+ HOT_PATCH_IMAGE_MAX_LENGTH,
241
+ HOT_PATCH_UNIFIED_FIELD,
242
+ HOT_PATCH_UNIFIED_IMAGE_KEYS,
243
+ hotPatchImageKeysOf
244
+ } from "./approvals/hot-patch-generations.js";
236
245
  import {
237
246
  APPROVAL_INCIDENT_FILTER_ANY,
238
247
  APPROVAL_INCIDENT_ID_MAX_LENGTH,
@@ -548,6 +557,7 @@ import {
548
557
  import {
549
558
  AllThings,
550
559
  GENERATION_ENV_VARS_KEYS,
560
+ GENERATION_HOT_PATCH_IMAGE_KEYS,
551
561
  GENERATION_IMAGE_VERSION_KEYS,
552
562
  ImmutableThings,
553
563
  MutableThings
@@ -982,6 +992,8 @@ export {
982
992
  FeedbackType,
983
993
  GATEWAY_SPEC_8_9_MIN_VERSION,
984
994
  GENERATION_ENV_VARS_KEYS,
995
+ GENERATION_HOT_PATCH_FIELDS,
996
+ GENERATION_HOT_PATCH_IMAGE_KEYS,
985
997
  GENERATION_IMAGE_VERSION_KEYS,
986
998
  GENERATION_VERSIONS_MAX_GENERATIONS,
987
999
  GENERATION_VERSION_VALUE_MAX_LENGTH,
@@ -992,6 +1004,11 @@ export {
992
1004
  HMAC_SUPPORTED_ALGORITHM,
993
1005
  HOTBACKUP_MIN_CREATE_PERIOD,
994
1006
  HOT_BACKUP_MIN_VERSION,
1007
+ HOT_PATCH_GENERATIONS_FLAG,
1008
+ HOT_PATCH_GENERATIONS_MAX_GENERATIONS,
1009
+ HOT_PATCH_IMAGE_MAX_LENGTH,
1010
+ HOT_PATCH_UNIFIED_FIELD,
1011
+ HOT_PATCH_UNIFIED_IMAGE_KEYS,
995
1012
  HOUR,
996
1013
  AlertSubscriptionReportType2 as HdpAlertSubscriptionReportType,
997
1014
  AlertSubscriptionType2 as HdpAlertSubscriptionType,
@@ -1245,6 +1262,7 @@ export {
1245
1262
  hasEveryPermission,
1246
1263
  hasFailedRun,
1247
1264
  hasNoAvailabilityClass,
1265
+ hotPatchImageKeysOf,
1248
1266
  idSetPredicate,
1249
1267
  isActivityRetentionMonths,
1250
1268
  isActivitySleepEligible,