@camunda/ccma-shared-types 6.0.0 → 7.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/dist/_tests/constants/customer-hardware-sizing.const.spec.d.ts +1 -0
  2. package/dist/_tests/dtos/ClusterPlanWhiteList.spec.d.ts +1 -0
  3. package/dist/_tests/utils/upgradeGateReason.utils.spec.d.ts +1 -0
  4. package/dist/approvals/policy.js +1 -1
  5. package/dist/approvals/policy.js.map +2 -2
  6. package/dist/approvals/use-cases.const.d.ts +16 -0
  7. package/dist/approvals/use-cases.const.js +18 -1
  8. package/dist/approvals/use-cases.const.js.map +2 -2
  9. package/dist/constants/customer-hardware-sizing.const.d.ts +124 -0
  10. package/dist/constants/customer-hardware-sizing.const.js +266 -0
  11. package/dist/constants/customer-hardware-sizing.const.js.map +7 -0
  12. package/dist/constants/version-gates.const.d.ts +12 -0
  13. package/dist/constants/version-gates.const.js +2 -0
  14. package/dist/constants/version-gates.const.js.map +2 -2
  15. package/dist/dtos/ApprovalJob.dto.d.ts +33 -3
  16. package/dist/dtos/ApprovalJob.dto.js.map +2 -2
  17. package/dist/dtos/ClusterPlanTypeChange.dto.d.ts +23 -0
  18. package/dist/dtos/ClusterPlanTypeChange.dto.js +1 -0
  19. package/dist/dtos/ClusterPlanTypeChange.dto.js.map +7 -0
  20. package/dist/dtos/CommonCluster.dto.d.ts +5 -0
  21. package/dist/dtos/EarlyAccessFeature.dto.d.ts +1 -0
  22. package/dist/dtos/FeatureFlags.dto.d.ts +9 -1
  23. package/dist/dtos/Organization.dto.d.ts +11 -0
  24. package/dist/dtos/Organization.dto.js.map +1 -1
  25. package/dist/dtos/SalesPlan.dto.d.ts +18 -0
  26. package/dist/dtos/SalesPlan.dto.js +18 -0
  27. package/dist/dtos/SalesPlan.dto.js.map +2 -2
  28. package/dist/dtos/UpgradeReadiness.dto.d.ts +32 -0
  29. package/dist/dtos/UpgradeReadiness.dto.js +1 -0
  30. package/dist/dtos/UpgradeReadiness.dto.js.map +7 -0
  31. package/dist/enums/SystemAuditEntity.enum.d.ts +1 -0
  32. package/dist/enums/SystemAuditEntity.enum.js +1 -0
  33. package/dist/enums/SystemAuditEntity.enum.js.map +2 -2
  34. package/dist/index.d.ts +7 -3
  35. package/dist/index.js +42 -0
  36. package/dist/index.js.map +2 -2
  37. package/dist/search/organization-search-fields.d.ts +5 -2
  38. package/dist/search/organization-search-fields.js +9 -1
  39. package/dist/search/organization-search-fields.js.map +2 -2
  40. package/dist/types/ClusterBulkOperation.type.d.ts +14 -0
  41. package/dist/utils/elasticsearchPlanPath.utils.d.ts +3 -1
  42. package/dist/utils/elasticsearchPlanPath.utils.js +14 -5
  43. package/dist/utils/elasticsearchPlanPath.utils.js.map +2 -2
  44. package/dist/utils/upgradeGateReason.utils.d.ts +8 -0
  45. package/dist/utils/upgradeGateReason.utils.js +23 -0
  46. package/dist/utils/upgradeGateReason.utils.js.map +7 -0
  47. package/package.json +1 -1
@@ -5,5 +5,8 @@ import type { SearchFieldSpec } from './fields.js';
5
5
  * on). A bare term (no `field:`) searches {@link ORG_DEFAULT_SEARCH_FIELDS}.
6
6
  */
7
7
  export declare const ORGANIZATION_SEARCH_FIELDS: readonly SearchFieldSpec[];
8
- /** Fields a bare term searches for orgs (name or id substring — matches `q`). */
9
- export declare const ORG_DEFAULT_SEARCH_FIELDS: readonly ["name", "id"];
8
+ /**
9
+ * Fields a bare term searches for orgs (name, id or Salesforce ID substring —
10
+ * matches `q`).
11
+ */
12
+ export declare const ORG_DEFAULT_SEARCH_FIELDS: readonly ["name", "id", "salesForceId"];
@@ -16,6 +16,14 @@ const ORGANIZATION_SEARCH_FIELDS = [
16
16
  capabilities: ["match"],
17
17
  example: "id:2f1a"
18
18
  },
19
+ {
20
+ field: "salesForceId",
21
+ label: "Salesforce ID",
22
+ description: "Salesforce project ID of the organization (substring match; supports * and ?).",
23
+ type: "string",
24
+ capabilities: ["match"],
25
+ example: "salesForceId:0068"
26
+ },
19
27
  {
20
28
  field: "internal",
21
29
  label: "Internal",
@@ -42,7 +50,7 @@ const ORGANIZATION_SEARCH_FIELDS = [
42
50
  example: "created:>2024-01-01"
43
51
  }
44
52
  ];
45
- const ORG_DEFAULT_SEARCH_FIELDS = ["name", "id"];
53
+ const ORG_DEFAULT_SEARCH_FIELDS = ["name", "id", "salesForceId"];
46
54
  export {
47
55
  ORGANIZATION_SEARCH_FIELDS,
48
56
  ORG_DEFAULT_SEARCH_FIELDS
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/search/organization-search-fields.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 { SalesPlanType } from '../types/SalesPlanType.type.js'\nimport type { SearchFieldSpec } from './fields.js'\n\n/**\n * Searchable fields for the Organizations list (mirrors\n * `ListOrganizationsV2Params.filter` \u2014 the fields the endpoint already filters\n * on). A bare term (no `field:`) searches {@link ORG_DEFAULT_SEARCH_FIELDS}.\n */\nexport const ORGANIZATION_SEARCH_FIELDS: readonly SearchFieldSpec[] = [\n {\n field: 'name',\n label: 'Name',\n description: 'Organization name (substring match; supports * and ?).',\n type: 'string',\n capabilities: ['match'],\n example: 'name:acme',\n },\n {\n field: 'id',\n label: 'ID',\n description: 'Organization UUID (substring match).',\n type: 'string',\n capabilities: ['match'],\n example: 'id:2f1a',\n },\n {\n field: 'internal',\n label: 'Internal',\n description: 'Whether the organization is Camunda-internal.',\n type: 'boolean',\n capabilities: ['match'],\n example: 'internal:true',\n },\n {\n field: 'salesPlanType',\n label: 'Sales plan',\n description: 'The organization\u2019s sales-plan type.',\n type: 'enum',\n capabilities: ['match'],\n enumValues: Object.values(SalesPlanType),\n example: 'salesPlanType:enterprise',\n },\n {\n field: 'created',\n label: 'Created',\n description: 'Creation date (ISO, e.g. 2024-01-31). Supports ranges.',\n type: 'date',\n capabilities: ['match', 'range'],\n example: 'created:>2024-01-01',\n },\n] as const\n\n/** Fields a bare term searches for orgs (name or id substring \u2014 matches `q`). */\nexport const ORG_DEFAULT_SEARCH_FIELDS = ['name', 'id'] as const\n"],
5
- "mappings": "AAMA,SAAS,qBAAqB;AAQvB,MAAM,6BAAyD;AAAA,EACpE;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,IACN,cAAc,CAAC,OAAO;AAAA,IACtB,SAAS;AAAA,EACX;AAAA,EACA;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,IACN,cAAc,CAAC,OAAO;AAAA,IACtB,SAAS;AAAA,EACX;AAAA,EACA;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,IACN,cAAc,CAAC,OAAO;AAAA,IACtB,SAAS;AAAA,EACX;AAAA,EACA;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,IACN,cAAc,CAAC,OAAO;AAAA,IACtB,YAAY,OAAO,OAAO,aAAa;AAAA,IACvC,SAAS;AAAA,EACX;AAAA,EACA;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,IACN,cAAc,CAAC,SAAS,OAAO;AAAA,IAC/B,SAAS;AAAA,EACX;AACF;AAGO,MAAM,4BAA4B,CAAC,QAAQ,IAAI;",
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 { SalesPlanType } from '../types/SalesPlanType.type.js'\nimport type { SearchFieldSpec } from './fields.js'\n\n/**\n * Searchable fields for the Organizations list (mirrors\n * `ListOrganizationsV2Params.filter` \u2014 the fields the endpoint already filters\n * on). A bare term (no `field:`) searches {@link ORG_DEFAULT_SEARCH_FIELDS}.\n */\nexport const ORGANIZATION_SEARCH_FIELDS: readonly SearchFieldSpec[] = [\n {\n field: 'name',\n label: 'Name',\n description: 'Organization name (substring match; supports * and ?).',\n type: 'string',\n capabilities: ['match'],\n example: 'name:acme',\n },\n {\n field: 'id',\n label: 'ID',\n description: 'Organization UUID (substring match).',\n type: 'string',\n capabilities: ['match'],\n example: 'id:2f1a',\n },\n {\n field: 'salesForceId',\n label: 'Salesforce ID',\n description:\n 'Salesforce project ID of the organization (substring match; supports * and ?).',\n type: 'string',\n capabilities: ['match'],\n example: 'salesForceId:0068',\n },\n {\n field: 'internal',\n label: 'Internal',\n description: 'Whether the organization is Camunda-internal.',\n type: 'boolean',\n capabilities: ['match'],\n example: 'internal:true',\n },\n {\n field: 'salesPlanType',\n label: 'Sales plan',\n description: 'The organization\u2019s sales-plan type.',\n type: 'enum',\n capabilities: ['match'],\n enumValues: Object.values(SalesPlanType),\n example: 'salesPlanType:enterprise',\n },\n {\n field: 'created',\n label: 'Created',\n description: 'Creation date (ISO, e.g. 2024-01-31). Supports ranges.',\n type: 'date',\n capabilities: ['match', 'range'],\n example: 'created:>2024-01-01',\n },\n] as const\n\n/**\n * Fields a bare term searches for orgs (name, id or Salesforce ID substring \u2014\n * matches `q`).\n */\nexport const ORG_DEFAULT_SEARCH_FIELDS = ['name', 'id', 'salesForceId'] as const\n"],
5
+ "mappings": "AAMA,SAAS,qBAAqB;AAQvB,MAAM,6BAAyD;AAAA,EACpE;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,IACN,cAAc,CAAC,OAAO;AAAA,IACtB,SAAS;AAAA,EACX;AAAA,EACA;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,IACN,cAAc,CAAC,OAAO;AAAA,IACtB,SAAS;AAAA,EACX;AAAA,EACA;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,IACP,aACE;AAAA,IACF,MAAM;AAAA,IACN,cAAc,CAAC,OAAO;AAAA,IACtB,SAAS;AAAA,EACX;AAAA,EACA;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,IACN,cAAc,CAAC,OAAO;AAAA,IACtB,SAAS;AAAA,EACX;AAAA,EACA;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,IACN,cAAc,CAAC,OAAO;AAAA,IACtB,YAAY,OAAO,OAAO,aAAa;AAAA,IACvC,SAAS;AAAA,EACX;AAAA,EACA;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,IACN,cAAc,CAAC,SAAS,OAAO;AAAA,IAC/B,SAAS;AAAA,EACX;AACF;AAMO,MAAM,4BAA4B,CAAC,QAAQ,MAAM,cAAc;",
6
6
  "names": []
7
7
  }
@@ -66,8 +66,22 @@ export interface ClusterBulkOperationGenerationUpdateParameter {
66
66
  *
67
67
  * Needs the permission `canUpgradeGenerationYolo`, on the creation of the
68
68
  * operation and on each acknowledgement and the execution.
69
+ *
70
+ * The flag also ignores the upgrade gate, as `ignoreUpgradeGate` does. A
71
+ * write past the operator for an unfinished upgrade answers the same
72
+ * question as the gate, so a run with this flag must not skip a cluster
73
+ * for that question first.
69
74
  */
70
75
  yoloForceUpdate?: boolean;
76
+ /**
77
+ * Ignores the upgrade gate of PDP-3067 for every cluster of the run: the
78
+ * upgrade readiness of the cluster and the 24-hour grace period. Without
79
+ * it, a blocked cluster gets the result `SKIPPED`.
80
+ *
81
+ * Needs the permission `canUpgradeGeneration`, on the creation of the
82
+ * operation and on each acknowledgement and the execution.
83
+ */
84
+ ignoreUpgradeGate?: boolean;
71
85
  }
72
86
  export interface ClusterBulkOperationPlanTypeUpdateParameter {
73
87
  toPlanTypeUuid: string;
@@ -7,7 +7,9 @@ export declare const canonicalPlanKey: (key: string) => string;
7
7
  /**
8
8
  * canonicalPlan returns a cluster plan config with `operate.elasticsearch`
9
9
  * merged under the top-level `elasticsearch`. If a field is set in both places,
10
- * the top-level value wins. The input does not change. A plan without the
10
+ * the top-level value wins: two records merge field by field, and any other
11
+ * top-level value, `null` included, replaces the legacy value. The input does
12
+ * not change. A plan without the
11
13
  * legacy block comes back as the same object, and a value that is not a record
12
14
  * comes back unchanged.
13
15
  *
@@ -1,7 +1,19 @@
1
- import { ObjectMergeUtils } from "./objectMerge.utils.js";
2
1
  const LEGACY_ELASTICSEARCH_PREFIX = "operate.elasticsearch.";
3
2
  const canonicalPlanKey = (key) => key.startsWith(LEGACY_ELASTICSEARCH_PREFIX) ? key.slice("operate.".length) : key;
4
3
  const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
4
+ const mergeTopLevelWins = (legacy, top) => {
5
+ if (top === void 0) {
6
+ return legacy;
7
+ }
8
+ if (!isRecord(legacy) || !isRecord(top)) {
9
+ return top;
10
+ }
11
+ const merged = { ...legacy };
12
+ for (const [key, value] of Object.entries(top)) {
13
+ merged[key] = mergeTopLevelWins(legacy[key], value);
14
+ }
15
+ return merged;
16
+ };
5
17
  function canonicalPlan(plan) {
6
18
  if (!isRecord(plan) || !isRecord(plan.operate) || plan.operate.elasticsearch === void 0) {
7
19
  return plan;
@@ -10,10 +22,7 @@ function canonicalPlan(plan) {
10
22
  return {
11
23
  ...plan,
12
24
  operate,
13
- elasticsearch: ObjectMergeUtils.merge({
14
- objectA: legacy,
15
- objectB: plan.elasticsearch
16
- })
25
+ elasticsearch: mergeTopLevelWins(legacy, plan.elasticsearch)
17
26
  };
18
27
  }
19
28
  export {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/utils/elasticsearchPlanPath.utils.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 { ObjectMergeUtils } from './objectMerge.utils.js'\n\n// Older cluster plans and modification configs keep the Elasticsearch config\n// under `operate.elasticsearch`. The ZeebeCluster resource reads it from the\n// top-level `spec.elasticsearch` only (camunda-operator#5124), so the top-level\n// `elasticsearch` is the canonical plan path.\nconst LEGACY_ELASTICSEARCH_PREFIX = 'operate.elasticsearch.'\n\n/**\n * canonicalPlanKey maps a dotted plan key to the path that Console reads. A\n * legacy `operate.elasticsearch.*` key becomes `elasticsearch.*`. Other keys\n * come back unchanged.\n */\nexport const canonicalPlanKey = (key: string): string =>\n key.startsWith(LEGACY_ELASTICSEARCH_PREFIX)\n ? key.slice('operate.'.length)\n : key\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n typeof value === 'object' && value !== null && !Array.isArray(value)\n\n/**\n * canonicalPlan returns a cluster plan config with `operate.elasticsearch`\n * merged under the top-level `elasticsearch`. If a field is set in both places,\n * the top-level value wins. The input does not change. A plan without the\n * legacy block comes back as the same object, and a value that is not a record\n * comes back unchanged.\n *\n * The result is typed as a plain record, not as the input type: the input type\n * still declares `operate.elasticsearch`, which the result does not have.\n */\nexport function canonicalPlan(\n plan: Record<string, unknown>,\n): Record<string, unknown>\nexport function canonicalPlan(plan: unknown): unknown\nexport function canonicalPlan(plan: unknown): unknown {\n if (\n !isRecord(plan) ||\n !isRecord(plan.operate) ||\n plan.operate.elasticsearch === undefined\n ) {\n return plan\n }\n const { elasticsearch: legacy, ...operate } = plan.operate\n return {\n ...plan,\n operate,\n elasticsearch: ObjectMergeUtils.merge({\n objectA: legacy,\n objectB: plan.elasticsearch,\n }),\n }\n}\n"],
5
- "mappings": "AAMA,SAAS,wBAAwB;AAMjC,MAAM,8BAA8B;AAO7B,MAAM,mBAAmB,CAAC,QAC/B,IAAI,WAAW,2BAA2B,IACtC,IAAI,MAAM,WAAW,MAAM,IAC3B;AAEN,MAAM,WAAW,CAAC,UAChB,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AAgB9D,SAAS,cAAc,MAAwB;AACpD,MACE,CAAC,SAAS,IAAI,KACd,CAAC,SAAS,KAAK,OAAO,KACtB,KAAK,QAAQ,kBAAkB,QAC/B;AACA,WAAO;AAAA,EACT;AACA,QAAM,EAAE,eAAe,QAAQ,GAAG,QAAQ,IAAI,KAAK;AACnD,SAAO;AAAA,IACL,GAAG;AAAA,IACH;AAAA,IACA,eAAe,iBAAiB,MAAM;AAAA,MACpC,SAAS;AAAA,MACT,SAAS,KAAK;AAAA,IAChB,CAAC;AAAA,EACH;AACF;",
4
+ "sourcesContent": ["/*\n * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH\n * under one or more contributor license agreements. Licensed under a commercial license.\n * You may not use this file except in compliance with the commercial license.\n */\n\n// Modification configs and exported plan JSON from before 2026-10 keep the\n// Elasticsearch config under `operate.elasticsearch`. The console-backend\n// migration 1790923213607 moved it in the stored plans. The ZeebeCluster\n// resource reads it from the top-level `spec.elasticsearch` only\n// (camunda-operator#5124), so the top-level `elasticsearch` is the canonical\n// plan path.\nconst LEGACY_ELASTICSEARCH_PREFIX = 'operate.elasticsearch.'\n\n/**\n * canonicalPlanKey maps a dotted plan key to the path that Console reads. A\n * legacy `operate.elasticsearch.*` key becomes `elasticsearch.*`. Other keys\n * come back unchanged.\n */\nexport const canonicalPlanKey = (key: string): string =>\n key.startsWith(LEGACY_ELASTICSEARCH_PREFIX)\n ? key.slice('operate.'.length)\n : key\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n typeof value === 'object' && value !== null && !Array.isArray(value)\n\n// ObjectMergeUtils.merge does not fit here: it keeps a legacy object when the\n// top-level value is `null` or a scalar, and a legacy array when it is `null`.\nconst mergeTopLevelWins = (legacy: unknown, top: unknown): unknown => {\n if (top === undefined) {\n return legacy\n }\n if (!isRecord(legacy) || !isRecord(top)) {\n return top\n }\n const merged: Record<string, unknown> = { ...legacy }\n for (const [key, value] of Object.entries(top)) {\n merged[key] = mergeTopLevelWins(legacy[key], value)\n }\n return merged\n}\n\n/**\n * canonicalPlan returns a cluster plan config with `operate.elasticsearch`\n * merged under the top-level `elasticsearch`. If a field is set in both places,\n * the top-level value wins: two records merge field by field, and any other\n * top-level value, `null` included, replaces the legacy value. The input does\n * not change. A plan without the\n * legacy block comes back as the same object, and a value that is not a record\n * comes back unchanged.\n *\n * The result is typed as a plain record, not as the input type: the input type\n * still declares `operate.elasticsearch`, which the result does not have.\n */\nexport function canonicalPlan(\n plan: Record<string, unknown>,\n): Record<string, unknown>\nexport function canonicalPlan(plan: unknown): unknown\nexport function canonicalPlan(plan: unknown): unknown {\n if (\n !isRecord(plan) ||\n !isRecord(plan.operate) ||\n plan.operate.elasticsearch === undefined\n ) {\n return plan\n }\n const { elasticsearch: legacy, ...operate } = plan.operate\n return {\n ...plan,\n operate,\n elasticsearch: mergeTopLevelWins(legacy, plan.elasticsearch),\n }\n}\n"],
5
+ "mappings": "AAYA,MAAM,8BAA8B;AAO7B,MAAM,mBAAmB,CAAC,QAC/B,IAAI,WAAW,2BAA2B,IACtC,IAAI,MAAM,WAAW,MAAM,IAC3B;AAEN,MAAM,WAAW,CAAC,UAChB,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AAIrE,MAAM,oBAAoB,CAAC,QAAiB,QAA0B;AACpE,MAAI,QAAQ,QAAW;AACrB,WAAO;AAAA,EACT;AACA,MAAI,CAAC,SAAS,MAAM,KAAK,CAAC,SAAS,GAAG,GAAG;AACvC,WAAO;AAAA,EACT;AACA,QAAM,SAAkC,EAAE,GAAG,OAAO;AACpD,aAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,GAAG,GAAG;AAC9C,WAAO,GAAG,IAAI,kBAAkB,OAAO,GAAG,GAAG,KAAK;AAAA,EACpD;AACA,SAAO;AACT;AAkBO,SAAS,cAAc,MAAwB;AACpD,MACE,CAAC,SAAS,IAAI,KACd,CAAC,SAAS,KAAK,OAAO,KACtB,KAAK,QAAQ,kBAAkB,QAC/B;AACA,WAAO;AAAA,EACT;AACA,QAAM,EAAE,eAAe,QAAQ,GAAG,QAAQ,IAAI,KAAK;AACnD,SAAO;AAAA,IACL,GAAG;AAAA,IACH;AAAA,IACA,eAAe,kBAAkB,QAAQ,KAAK,aAAa;AAAA,EAC7D;AACF;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,8 @@
1
+ import type { UpgradeReadinessDto } from '../dtos/UpgradeReadiness.dto.js';
2
+ /**
3
+ * The text for a blocked upgrade gate (PDP-3067). It names the next step.
4
+ * console-backend sends it as the message of the 409 and of a skipped
5
+ * cluster in a bulk run, and Control shows it on the cluster page, so the
6
+ * three always agree.
7
+ */
8
+ export declare function upgradeGateReason(gate: UpgradeReadinessDto): string;
@@ -0,0 +1,23 @@
1
+ function upgradeGateReason(gate) {
2
+ if (gate.gracePeriod) {
3
+ const hours = gate.gracePeriod.hoursRemaining;
4
+ return `The cluster got a new minor version recently. Try the upgrade again in about ${hours} ${hours === 1 ? "hour" : "hours"}.`;
5
+ }
6
+ switch (gate.readiness?.source) {
7
+ case "suspended":
8
+ return "The cluster is suspended and cannot report its migration state. Resume the cluster, then try the upgrade again.";
9
+ case "updating":
10
+ return "The cluster still rolls out its last upgrade. Try the upgrade again when the cluster is healthy.";
11
+ case "timeout":
12
+ case "error":
13
+ return "The cluster did not answer the upgrade readiness check. Try the upgrade again later.";
14
+ case "unsupported":
15
+ return "Console cannot reach the upgrade readiness check of this cluster. Try the upgrade again later.";
16
+ default:
17
+ return gate.readiness?.verdict === "notReady" ? "The cluster still completes the migrations of its last upgrade. Try the upgrade again later." : "The cluster could not read its own migration state. Try the upgrade again later.";
18
+ }
19
+ }
20
+ export {
21
+ upgradeGateReason
22
+ };
23
+ //# sourceMappingURL=upgradeGateReason.utils.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/utils/upgradeGateReason.utils.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 { UpgradeReadinessDto } from '../dtos/UpgradeReadiness.dto.js'\n\n/**\n * The text for a blocked upgrade gate (PDP-3067). It names the next step.\n * console-backend sends it as the message of the 409 and of a skipped\n * cluster in a bulk run, and Control shows it on the cluster page, so the\n * three always agree.\n */\nexport function upgradeGateReason(gate: UpgradeReadinessDto): string {\n if (gate.gracePeriod) {\n // The hours, not the end time: the wait is 24 hours, or half an hour on\n // dev, and a raw ISO time is hard to read in a 409.\n const hours = gate.gracePeriod.hoursRemaining\n return `The cluster got a new minor version recently. Try the upgrade again in about ${hours} ${hours === 1 ? 'hour' : 'hours'}.`\n }\n switch (gate.readiness?.source) {\n case 'suspended':\n return 'The cluster is suspended and cannot report its migration state. Resume the cluster, then try the upgrade again.'\n case 'updating':\n return 'The cluster still rolls out its last upgrade. Try the upgrade again when the cluster is healthy.'\n case 'timeout':\n case 'error':\n return 'The cluster did not answer the upgrade readiness check. Try the upgrade again later.'\n case 'unsupported':\n return 'Console cannot reach the upgrade readiness check of this cluster. Try the upgrade again later.'\n default:\n return gate.readiness?.verdict === 'notReady'\n ? 'The cluster still completes the migrations of its last upgrade. Try the upgrade again later.'\n : 'The cluster could not read its own migration state. Try the upgrade again later.'\n }\n}\n"],
5
+ "mappings": "AAcO,SAAS,kBAAkB,MAAmC;AACnE,MAAI,KAAK,aAAa;AAGpB,UAAM,QAAQ,KAAK,YAAY;AAC/B,WAAO,gFAAgF,KAAK,IAAI,UAAU,IAAI,SAAS,OAAO;AAAA,EAChI;AACA,UAAQ,KAAK,WAAW,QAAQ;AAAA,IAC9B,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AAAA,IACL,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT;AACE,aAAO,KAAK,WAAW,YAAY,aAC/B,iGACA;AAAA,EACR;AACF;",
6
+ "names": []
7
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/ccma-shared-types",
3
- "version": "6.0.0",
3
+ "version": "7.0.0",
4
4
  "description": "Shared TypeScript types for Camunda Cloud Management Apps",
5
5
  "bugs": {
6
6
  "url": "https://github.com/camunda/camunda-cloud-management-apps/issues"