@camunda/ccma-shared-types 0.5.0 → 0.5.1
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.
- package/dist/_tests/utils/failoverKeyPolicy.utils.spec.d.ts +1 -0
- package/dist/constants/misc.const.d.ts +0 -55
- package/dist/constants/misc.const.js +0 -82
- package/dist/constants/misc.const.js.map +2 -2
- package/dist/dtos/CommonCluster.dto.d.ts +11 -0
- package/dist/dtos/SalesPlan.dto.d.ts +11 -0
- package/dist/dtos/SalesPlan.dto.js +14 -0
- package/dist/dtos/SalesPlan.dto.js.map +2 -2
- package/dist/index.d.ts +3 -1
- package/dist/index.js +18 -2
- package/dist/index.js.map +2 -2
- package/dist/types/ClusterPlanModification.type.d.ts +2 -0
- package/dist/utils/enterpriseTerm.utils.d.ts +78 -0
- package/dist/utils/enterpriseTerm.utils.js +69 -0
- package/dist/utils/enterpriseTerm.utils.js.map +7 -0
- package/dist/utils/enterpriseTerm.utils.spec.d.ts +1 -0
- package/dist/utils/failoverKeyPolicy.utils.d.ts +26 -0
- package/dist/utils/failoverKeyPolicy.utils.js +15 -0
- package/dist/utils/failoverKeyPolicy.utils.js.map +7 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -23,58 +23,3 @@ export declare const MAX_HARDWARE_PACKAGE_COUNT = 4;
|
|
|
23
23
|
* where the exporter starts honoring the filters) — this is the product rollout gate.
|
|
24
24
|
*/
|
|
25
25
|
export declare const OPTIMIZE_FILTERING_MIN_VERSION = "8.10.0-alpha1";
|
|
26
|
-
export declare const SENTRY: {
|
|
27
|
-
dsn: {
|
|
28
|
-
trial: string;
|
|
29
|
-
console: {
|
|
30
|
-
frontend: string;
|
|
31
|
-
backend: string;
|
|
32
|
-
};
|
|
33
|
-
accounts: {
|
|
34
|
-
frontend: string;
|
|
35
|
-
backend: string;
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
applicationKey: {
|
|
39
|
-
console: string;
|
|
40
|
-
accounts: string;
|
|
41
|
-
};
|
|
42
|
-
enabled: string[];
|
|
43
|
-
ignoreTransactions: string[];
|
|
44
|
-
ignoreErrors: string[];
|
|
45
|
-
config: {
|
|
46
|
-
tracesSampleRate: {
|
|
47
|
-
frontend: {
|
|
48
|
-
accounts: number[];
|
|
49
|
-
console: number[];
|
|
50
|
-
};
|
|
51
|
-
backend: {
|
|
52
|
-
accounts: number[];
|
|
53
|
-
console: number[];
|
|
54
|
-
};
|
|
55
|
-
};
|
|
56
|
-
replaysSessionSampleRate: {
|
|
57
|
-
frontend: {
|
|
58
|
-
accounts: number[];
|
|
59
|
-
console: number[];
|
|
60
|
-
};
|
|
61
|
-
};
|
|
62
|
-
replaysOnErrorSampleRate: {
|
|
63
|
-
frontend: {
|
|
64
|
-
accounts: number[];
|
|
65
|
-
console: number[];
|
|
66
|
-
};
|
|
67
|
-
};
|
|
68
|
-
profilesSampleRate: {
|
|
69
|
-
backend: {
|
|
70
|
-
accounts: number[];
|
|
71
|
-
console: number[];
|
|
72
|
-
};
|
|
73
|
-
frontend: {
|
|
74
|
-
accounts: number[];
|
|
75
|
-
console: number[];
|
|
76
|
-
};
|
|
77
|
-
};
|
|
78
|
-
};
|
|
79
|
-
configWeight: (env: string, values: number[]) => number;
|
|
80
|
-
};
|
|
@@ -19,87 +19,6 @@ const MINIMUM_EYEPAIRS = {
|
|
|
19
19
|
};
|
|
20
20
|
const MAX_HARDWARE_PACKAGE_COUNT = 4;
|
|
21
21
|
const OPTIMIZE_FILTERING_MIN_VERSION = "8.10.0-alpha1";
|
|
22
|
-
const SENTRY = {
|
|
23
|
-
dsn: {
|
|
24
|
-
trial: "https://a91625f8d3e1b34690588504ed020e14@o4507463051378688.ingest.de.sentry.io/4507463055376464",
|
|
25
|
-
console: {
|
|
26
|
-
frontend: "https://bbf8e6b13f91f7a49ab0b7f079ae8cc0@o132036.ingest.us.sentry.io/4507537062494208",
|
|
27
|
-
backend: "https://43de708d3ad0199f8c23975a3fd43aa0@o132036.ingest.us.sentry.io/4507537080188928"
|
|
28
|
-
},
|
|
29
|
-
accounts: {
|
|
30
|
-
frontend: "https://49c5d54e4d05418feb80cd4085fa32bd@o132036.ingest.us.sentry.io/4507537094541312",
|
|
31
|
-
backend: "https://d120a5f0acbf132b1edf58008c674164@o132036.ingest.us.sentry.io/4507537100505088"
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
applicationKey: {
|
|
35
|
-
console: "ccma-console-frontend-0xDEADBEEF",
|
|
36
|
-
accounts: "ccma-accounts-frontend-0xDEADBEEF"
|
|
37
|
-
},
|
|
38
|
-
enabled: ["dev", "int", "prod"],
|
|
39
|
-
ignoreTransactions: ["/events", "/assets", "/metrics"],
|
|
40
|
-
ignoreErrors: [
|
|
41
|
-
"No activity within 120000 milliseconds. No response received. Reconnecting.",
|
|
42
|
-
"network error",
|
|
43
|
-
"Load failed",
|
|
44
|
-
"Non-Error promise rejection captured with value: Could not clear consent from root domain.",
|
|
45
|
-
"NetworkError when attempting to fetch resource.",
|
|
46
|
-
"The initialization timeout of 3000ms has been hit before the network request has completed.",
|
|
47
|
-
"Non-Error promise rejection captured with value: Object Not Found Matching Id:3, MethodName:update, ParamCount:4",
|
|
48
|
-
"Non-Error promise rejection captured with value: Object Not Found Matching Id:3, MethodName:simulateEvent, ParamCount:1",
|
|
49
|
-
`Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.`,
|
|
50
|
-
`Failed to execute 'createPolicy' on 'TrustedTypePolicyFactory': Policy with name "default" already exists.`,
|
|
51
|
-
// SSE errors after reload
|
|
52
|
-
`TypeError: Error in input stream`,
|
|
53
|
-
`TypeError: Failed to fetch`,
|
|
54
|
-
`that is not 200. Aborting the connection.`,
|
|
55
|
-
`chars received. Reconnecting.`
|
|
56
|
-
],
|
|
57
|
-
// value pair: [preprod, prod]
|
|
58
|
-
config: {
|
|
59
|
-
tracesSampleRate: {
|
|
60
|
-
frontend: {
|
|
61
|
-
accounts: [0.1, 5e-3],
|
|
62
|
-
console: [0.2, 0.01]
|
|
63
|
-
},
|
|
64
|
-
backend: {
|
|
65
|
-
accounts: [0.1, 5e-3],
|
|
66
|
-
console: [2e-4, 5e-4]
|
|
67
|
-
}
|
|
68
|
-
},
|
|
69
|
-
replaysSessionSampleRate: {
|
|
70
|
-
frontend: {
|
|
71
|
-
accounts: [5e-3, 1e-3],
|
|
72
|
-
console: [5e-3, 1e-3]
|
|
73
|
-
}
|
|
74
|
-
},
|
|
75
|
-
replaysOnErrorSampleRate: {
|
|
76
|
-
frontend: {
|
|
77
|
-
accounts: [5e-3, 1e-3],
|
|
78
|
-
console: [5e-3, 1e-3]
|
|
79
|
-
}
|
|
80
|
-
},
|
|
81
|
-
profilesSampleRate: {
|
|
82
|
-
backend: {
|
|
83
|
-
accounts: [1e-3, 2e-4],
|
|
84
|
-
console: [1e-3, 2e-4]
|
|
85
|
-
},
|
|
86
|
-
frontend: {
|
|
87
|
-
accounts: [1e-3, 2e-4],
|
|
88
|
-
console: [1e-3, 2e-4]
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
},
|
|
92
|
-
configWeight: (env, values) => {
|
|
93
|
-
if (values && values.length === 2) {
|
|
94
|
-
if (env === "prod") {
|
|
95
|
-
return values[1];
|
|
96
|
-
} else {
|
|
97
|
-
return values[0];
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
return 0.1;
|
|
101
|
-
}
|
|
102
|
-
};
|
|
103
22
|
export {
|
|
104
23
|
CONSOLE_API_USER_ID,
|
|
105
24
|
FIRSTNAME_LASTNAME_MAX_LENGTH,
|
|
@@ -110,7 +29,6 @@ export {
|
|
|
110
29
|
NAMES_OF_ENTERPRISE_SALESPLANS_WITH_SLEEPING_CLUSTERS,
|
|
111
30
|
OPTIMIZE_FILTERING_MIN_VERSION,
|
|
112
31
|
SECRETS_MAX_LENGTH,
|
|
113
|
-
SENTRY,
|
|
114
32
|
STARTING_PRICE_PER_MONTH_IN_EURO,
|
|
115
33
|
TEMPORARY_CLUSTER_NAME
|
|
116
34
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/constants/misc.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\nexport const CONSOLE_API_USER_ID = 'console-api'\nexport const TEMPORARY_CLUSTER_NAME = 'Get Started'\nexport type Stage = 'local' | 'dev' | 'int' | 'prod'\nexport const HOTBACKUP_MIN_CREATE_PERIOD = 1000 * 60 * 60 * 0.25 // 15 minutes\n\nexport const SECRETS_MAX_LENGTH = 4096\nexport const FIRSTNAME_LASTNAME_MAX_LENGTH = 255\n\nexport const STARTING_PRICE_PER_MONTH_IN_EURO = 99\n\nexport const MAX_LENGTH_CLUSTER_NAME = 50\n\nexport const NAMES_OF_ENTERPRISE_SALESPLANS_WITH_SLEEPING_CLUSTERS = [\n 'CELP with sleeping clusters',\n 'Camunda Partner',\n]\n\nexport const MINIMUM_EYEPAIRS = {\n CLUSTER_DELETION: 3,\n CLUSTER_GENERATION_UPDATE: 2,\n CLUSTER_PLAN_UPDATE: 2,\n CLUSTER_PLAN_TYPE_UPDATE: 2,\n CLUSTER_PLAN_MODIFICATION: 1,\n CLUSTER_MODIFICATION: 1,\n}\n\nexport const MAX_HARDWARE_PACKAGE_COUNT = 4\n\n/**\n * Minimum cluster (zeebe) version for the Optimize data-filters feature. Shared by\n * the c4 settings tile, the new-cluster default, and CRD spec generation so the gate\n * stays consistent. Stricter than the operator's own gate (Camunda >= 8.9.0-alpha1,\n * where the exporter starts honoring the filters) \u2014 this is the product rollout gate.\n */\nexport const OPTIMIZE_FILTERING_MIN_VERSION = '8.10.0-alpha1'\n
|
|
5
|
-
"mappings": "AAMO,MAAM,sBAAsB;AAC5B,MAAM,yBAAyB;AAE/B,MAAM,8BAA8B,MAAO,KAAK,KAAK;AAErD,MAAM,qBAAqB;AAC3B,MAAM,gCAAgC;AAEtC,MAAM,mCAAmC;AAEzC,MAAM,0BAA0B;AAEhC,MAAM,wDAAwD;AAAA,EACnE;AAAA,EACA;AACF;AAEO,MAAM,mBAAmB;AAAA,EAC9B,kBAAkB;AAAA,EAClB,2BAA2B;AAAA,EAC3B,qBAAqB;AAAA,EACrB,0BAA0B;AAAA,EAC1B,2BAA2B;AAAA,EAC3B,sBAAsB;AACxB;AAEO,MAAM,6BAA6B;AAQnC,MAAM,iCAAiC;
|
|
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\nexport const CONSOLE_API_USER_ID = 'console-api'\nexport const TEMPORARY_CLUSTER_NAME = 'Get Started'\nexport type Stage = 'local' | 'dev' | 'int' | 'prod'\nexport const HOTBACKUP_MIN_CREATE_PERIOD = 1000 * 60 * 60 * 0.25 // 15 minutes\n\nexport const SECRETS_MAX_LENGTH = 4096\nexport const FIRSTNAME_LASTNAME_MAX_LENGTH = 255\n\nexport const STARTING_PRICE_PER_MONTH_IN_EURO = 99\n\nexport const MAX_LENGTH_CLUSTER_NAME = 50\n\nexport const NAMES_OF_ENTERPRISE_SALESPLANS_WITH_SLEEPING_CLUSTERS = [\n 'CELP with sleeping clusters',\n 'Camunda Partner',\n]\n\nexport const MINIMUM_EYEPAIRS = {\n CLUSTER_DELETION: 3,\n CLUSTER_GENERATION_UPDATE: 2,\n CLUSTER_PLAN_UPDATE: 2,\n CLUSTER_PLAN_TYPE_UPDATE: 2,\n CLUSTER_PLAN_MODIFICATION: 1,\n CLUSTER_MODIFICATION: 1,\n}\n\nexport const MAX_HARDWARE_PACKAGE_COUNT = 4\n\n/**\n * Minimum cluster (zeebe) version for the Optimize data-filters feature. Shared by\n * the c4 settings tile, the new-cluster default, and CRD spec generation so the gate\n * stays consistent. Stricter than the operator's own gate (Camunda >= 8.9.0-alpha1,\n * where the exporter starts honoring the filters) \u2014 this is the product rollout gate.\n */\nexport const OPTIMIZE_FILTERING_MIN_VERSION = '8.10.0-alpha1'\n"],
|
|
5
|
+
"mappings": "AAMO,MAAM,sBAAsB;AAC5B,MAAM,yBAAyB;AAE/B,MAAM,8BAA8B,MAAO,KAAK,KAAK;AAErD,MAAM,qBAAqB;AAC3B,MAAM,gCAAgC;AAEtC,MAAM,mCAAmC;AAEzC,MAAM,0BAA0B;AAEhC,MAAM,wDAAwD;AAAA,EACnE;AAAA,EACA;AACF;AAEO,MAAM,mBAAmB;AAAA,EAC9B,kBAAkB;AAAA,EAClB,2BAA2B;AAAA,EAC3B,qBAAqB;AAAA,EACrB,0BAA0B;AAAA,EAC1B,2BAA2B;AAAA,EAC3B,sBAAsB;AACxB;AAEO,MAAM,6BAA6B;AAQnC,MAAM,iCAAiC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -110,6 +110,17 @@ export interface CommonClusterDto {
|
|
|
110
110
|
* completed. Failover is only offered when this is true.
|
|
111
111
|
*/
|
|
112
112
|
secondaryBucketSyncCompleted?: boolean;
|
|
113
|
+
/**
|
|
114
|
+
* True once this cluster's reservation slot has been transferred to a
|
|
115
|
+
* failover cluster. It remains visible but can never be resumed again.
|
|
116
|
+
*/
|
|
117
|
+
isFailoverSource?: boolean;
|
|
118
|
+
/**
|
|
119
|
+
* Stable durable identity shared by both halves of a failover pair. Used to
|
|
120
|
+
* pair a failover cluster with its source, and to derive the pre-staged
|
|
121
|
+
* `clone-backup-<stableId>` IAM role ARN.
|
|
122
|
+
*/
|
|
123
|
+
stableId?: string;
|
|
113
124
|
encryption?: string;
|
|
114
125
|
primaryEncryptionKeyId?: string | null;
|
|
115
126
|
secondaryEncryptionKeyId?: string | null;
|
|
@@ -27,6 +27,17 @@ export interface ClusterLimits {
|
|
|
27
27
|
export interface Limits extends ClusterLimits {
|
|
28
28
|
maxMembers?: number;
|
|
29
29
|
hotBackup?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Overrides the operator's default retained count (3) for manual (on-demand)
|
|
32
|
+
* hot backups (ZeebeCluster spec.backup.retainedCount).
|
|
33
|
+
*/
|
|
34
|
+
hotBackupManualRetainedCount?: number;
|
|
35
|
+
/**
|
|
36
|
+
* Overrides the operator's default retained count (3) for scheduled hot
|
|
37
|
+
* backups (BackupSchedule spec.successfulBackupsHistoryLimit /
|
|
38
|
+
* failedBackupsHistoryLimit).
|
|
39
|
+
*/
|
|
40
|
+
hotBackupScheduledRetainedCount?: number;
|
|
30
41
|
ipWhiteList?: boolean;
|
|
31
42
|
secureConnectivity?: boolean;
|
|
32
43
|
failover?: boolean;
|
|
@@ -71,6 +71,20 @@ function allSalesPlanLimits() {
|
|
|
71
71
|
description: "used to activate the hot backup functionality in organizations. default = not active",
|
|
72
72
|
isClusterBasedLimit: false
|
|
73
73
|
},
|
|
74
|
+
{
|
|
75
|
+
key: "hotBackupManualRetainedCount",
|
|
76
|
+
type: "number",
|
|
77
|
+
description: "overrides how many manual (on-demand) hot backups the operator retains before deleting the oldest. default = 3",
|
|
78
|
+
isClusterBasedLimit: false,
|
|
79
|
+
validate: (input) => Number.isInteger(input) && input >= 1
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
key: "hotBackupScheduledRetainedCount",
|
|
83
|
+
type: "number",
|
|
84
|
+
description: "overrides how many scheduled hot backups the operator retains before deleting the oldest. default = 3",
|
|
85
|
+
isClusterBasedLimit: false,
|
|
86
|
+
validate: (input) => Number.isInteger(input) && input >= 1
|
|
87
|
+
},
|
|
74
88
|
{
|
|
75
89
|
key: "ipWhiteList",
|
|
76
90
|
type: "boolean",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/dtos/SalesPlan.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 { ClusterPlanTypesToConfig } from '../types/ClusterPlanTypesToConfig.type.js'\n\nexport interface SalesPlanDto {\n uuid?: string\n name: string\n salesPlanType?: string\n internal?: boolean\n clusterPlanTypesToConfig: ClusterPlanTypesToConfig\n metadata?: SalesPlanMetadata\n version: number\n orgs?: number\n}\n\nexport interface ConsumptionDataItem {\n type: string\n data: string\n itemPriceId: string\n}\n\nexport interface SalesPlanMetadata {\n description: string\n limits?: Limits\n}\n\nexport interface ClusterLimits {\n dataRetentionOperate?: number\n dataRetentionTasklist?: number\n dataRetentionOptimize?: number\n unifiedDataRetention?: number\n}\n\nexport interface Limits extends ClusterLimits {\n maxMembers?: number\n hotBackup?: boolean\n ipWhiteList?: boolean\n secureConnectivity?: boolean\n failover?: boolean\n allowedHostnamesForInvites?: string\n regionWhiteList?: string\n suppressDropDisks?: boolean\n maxTeams?: number\n legacyStreams?: boolean\n ignoreGracePeriod?: boolean\n /**\n * Maximum number of clients allowed per cluster.\n * Overrides the stage-based default (MAX_CLUSTER_CLIENTS_DEV on dev,\n * MAX_CLUSTER_CLIENTS_DEFAULT on int/prod).\n */\n maxClusterClients?: number\n /**\n * Comma-separated list of generation UUIDs that are unlocked for this org.\n * These generations will be available for cluster creation even if they\n * are not part of a channel's allowed generations. They are attached to\n * the Stable channel with classification 'orgUnlocked'.\n */\n generationWhiteList?: string\n /**\n * When true, users with only the Developer role cannot create clusters in this org.\n * Users who also hold Member, Admin, Owner, or Operations Engineer are unaffected.\n */\n developerNoClusterCreate?: boolean\n}\n\nexport const RETENTION_LIMIT_MINIMUM = {\n operate: 5,\n tasklist: 5,\n optimize: 5,\n unified: 5,\n}\nexport const RETENTION_LIMIT_MAXIMUM = {\n operate: 365,\n tasklist: 90,\n optimize: 720,\n unified: 365,\n}\nexport const RETENTION_LIMIT_DEFAULT = {\n operate: 30,\n tasklist: 30,\n optimize: 180,\n unified: 30,\n}\n\n/**\n * Default maximum number of clients per cluster on development stage.\n */\nexport const MAX_CLUSTER_CLIENTS_DEV = 10\n\n/**\n * Default maximum number of clients per cluster on integration and production stages.\n */\nexport const MAX_CLUSTER_CLIENTS_DEFAULT = 200\n\nexport function deprecatedLimit(key: string): string | undefined {\n if (['dataRetentionOperate', 'dataRetentionTasklist'].includes(key)) {\n return 'unifiedDataRetention'\n }\n return undefined\n}\n\nexport function allClusterBasedLimits(): {\n key: string\n type: 'number' | 'boolean' | 'string'\n description: string\n isClusterBasedLimit: boolean\n validate?: (input: number) => boolean\n}[] {\n return [\n {\n key: 'dataRetentionOperate',\n type: 'number',\n isClusterBasedLimit: true,\n description: `Data retention in days for Operate. default = ${RETENTION_LIMIT_DEFAULT.operate}days. Min = ${RETENTION_LIMIT_MINIMUM.operate}days, Max = ${RETENTION_LIMIT_MAXIMUM.operate}days.`,\n validate: (input) =>\n input >= RETENTION_LIMIT_MINIMUM.operate &&\n input <= RETENTION_LIMIT_MAXIMUM.operate,\n },\n {\n key: 'dataRetentionTasklist',\n type: 'number',\n isClusterBasedLimit: true,\n description: `Data retention in days for Tasklist. default = ${RETENTION_LIMIT_DEFAULT.tasklist}days. Min = ${RETENTION_LIMIT_MINIMUM.tasklist}days, Max = ${RETENTION_LIMIT_MAXIMUM.tasklist}days.`,\n validate: (input) =>\n input >= RETENTION_LIMIT_MINIMUM.tasklist &&\n input <= RETENTION_LIMIT_MAXIMUM.tasklist,\n },\n {\n key: 'dataRetentionOptimize',\n type: 'number',\n isClusterBasedLimit: true,\n description: `Data retention in days for Optimize. default = ${RETENTION_LIMIT_DEFAULT.optimize}days. Min = ${RETENTION_LIMIT_MINIMUM.optimize}days, Max = ${RETENTION_LIMIT_MAXIMUM.optimize}days.`,\n validate: (input) =>\n input >= RETENTION_LIMIT_MINIMUM.optimize &&\n input <= RETENTION_LIMIT_MAXIMUM.optimize,\n },\n {\n key: 'unifiedDataRetention',\n type: 'number',\n isClusterBasedLimit: true,\n description: `Unified data retention in days for Zeebe broker. default = ${RETENTION_LIMIT_DEFAULT.unified}days. Min = ${RETENTION_LIMIT_MINIMUM.unified}days, Max = ${RETENTION_LIMIT_MAXIMUM.unified}days.`,\n validate: (input) =>\n input >= RETENTION_LIMIT_MINIMUM.unified &&\n input <= RETENTION_LIMIT_MAXIMUM.unified,\n },\n ]\n}\n\nexport function allSalesPlanLimits(): {\n key: string\n type: 'number' | 'boolean' | 'string'\n description: string\n isClusterBasedLimit: boolean\n validate?: (input: number) => boolean\n}[] {\n return [\n {\n key: 'maxMembers',\n type: 'number',\n description:\n 'used to limit the amount of collaborators within one organization. default = no limit',\n isClusterBasedLimit: false,\n validate: (input) => Number.isInteger(input) && input >= 0,\n },\n {\n key: 'hotBackup',\n type: 'boolean',\n description:\n 'used to activate the hot backup functionality in organizations. default = not active',\n isClusterBasedLimit: false,\n },\n {\n key: 'ipWhiteList',\n type: 'boolean',\n description:\n 'used to activate the ipWhitelist feature in console. default = not active',\n isClusterBasedLimit: false,\n },\n {\n key: 'secureConnectivity',\n type: 'boolean',\n description:\n 'used to activate the secure connectivity feature in console. default = not active',\n isClusterBasedLimit: false,\n },\n {\n key: 'failover',\n type: 'boolean',\n description:\n 'used to activate the failover functionality for multi-region clusters. default = not active',\n isClusterBasedLimit: false,\n },\n {\n key: 'allowedHostnamesForInvites',\n type: 'string',\n description:\n 'allowed hostnames for invites - comma separated, default: every hostname is allowed',\n isClusterBasedLimit: false,\n },\n {\n key: 'regionWhiteList',\n type: 'string',\n description:\n 'allowed regions - comma separated, default: every region is allowed',\n isClusterBasedLimit: false,\n },\n {\n key: 'suppressDropDisks',\n type: 'boolean',\n description:\n 'used to not drop disks of sleeping clusters. default = not suppressed',\n isClusterBasedLimit: false,\n },\n {\n key: 'maxTeams',\n type: 'number',\n description:\n 'used to limit the amount of teams within one super organization. default = 100',\n isClusterBasedLimit: false,\n validate: (input) => Number.isInteger(input) && input >= 0,\n },\n {\n key: 'legacyStreams',\n type: 'boolean',\n description:\n 'used to allow organizations to use legacy minor streams (e.g. 8.5, 8.6) for cluster creation. default = not allowed',\n isClusterBasedLimit: false,\n },\n {\n key: 'ignoreGracePeriod',\n type: 'boolean',\n description:\n 'used to bypass the 24h grace period on cluster upgrades after a minor version bump. default = not active (grace period enforced)',\n isClusterBasedLimit: false,\n },\n {\n key: 'maxClusterClients',\n type: 'number',\n description: `maximum number of clients per cluster. default = ${MAX_CLUSTER_CLIENTS_DEFAULT} (${MAX_CLUSTER_CLIENTS_DEV} on dev). Can be overridden per org for special customers (e.g. OEM).`,\n isClusterBasedLimit: false,\n validate: (input) => Number.isInteger(input) && input >= 1,\n },\n {\n key: 'generationWhiteList',\n type: 'string',\n description:\n 'unlocked generation UUIDs - comma separated. These generations will be available for cluster creation regardless of channel membership. Attached to the Stable channel.',\n isClusterBasedLimit: false,\n },\n {\n key: 'developerNoClusterCreate',\n type: 'boolean',\n description:\n 'when enabled, users with only the Developer role cannot create clusters in this org. Admins, Owners, Members, and Operations Engineers are unaffected.',\n isClusterBasedLimit: false,\n },\n ...allClusterBasedLimits(),\n ]\n}\n\nexport function unusedClusterBasedLimits(limits: ClusterLimits): {\n key: string\n type: 'number' | 'boolean' | 'string'\n description: string\n isClusterBasedLimit: boolean\n}[] {\n return allClusterBasedLimits().filter(\n (current) =>\n !(\n Object.keys(limits).includes(current.key) &&\n (limits as Record<string, unknown>)[current.key] !== null\n ),\n )\n}\n\nexport function unusedSalesPlanLimits(limits: Limits): {\n key: string\n type: 'number' | 'boolean' | 'string'\n description: string\n isClusterBasedLimit: boolean\n}[] {\n return allSalesPlanLimits().filter(\n (current) =>\n !(\n Object.keys(limits).includes(current.key) &&\n (limits as Record<string, unknown>)[current.key] !== null\n ),\n )\n}\n"],
|
|
5
|
-
"mappings": "
|
|
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 { ClusterPlanTypesToConfig } from '../types/ClusterPlanTypesToConfig.type.js'\n\nexport interface SalesPlanDto {\n uuid?: string\n name: string\n salesPlanType?: string\n internal?: boolean\n clusterPlanTypesToConfig: ClusterPlanTypesToConfig\n metadata?: SalesPlanMetadata\n version: number\n orgs?: number\n}\n\nexport interface ConsumptionDataItem {\n type: string\n data: string\n itemPriceId: string\n}\n\nexport interface SalesPlanMetadata {\n description: string\n limits?: Limits\n}\n\nexport interface ClusterLimits {\n dataRetentionOperate?: number\n dataRetentionTasklist?: number\n dataRetentionOptimize?: number\n unifiedDataRetention?: number\n}\n\nexport interface Limits extends ClusterLimits {\n maxMembers?: number\n hotBackup?: boolean\n /**\n * Overrides the operator's default retained count (3) for manual (on-demand)\n * hot backups (ZeebeCluster spec.backup.retainedCount).\n */\n hotBackupManualRetainedCount?: number\n /**\n * Overrides the operator's default retained count (3) for scheduled hot\n * backups (BackupSchedule spec.successfulBackupsHistoryLimit /\n * failedBackupsHistoryLimit).\n */\n hotBackupScheduledRetainedCount?: number\n ipWhiteList?: boolean\n secureConnectivity?: boolean\n failover?: boolean\n allowedHostnamesForInvites?: string\n regionWhiteList?: string\n suppressDropDisks?: boolean\n maxTeams?: number\n legacyStreams?: boolean\n ignoreGracePeriod?: boolean\n /**\n * Maximum number of clients allowed per cluster.\n * Overrides the stage-based default (MAX_CLUSTER_CLIENTS_DEV on dev,\n * MAX_CLUSTER_CLIENTS_DEFAULT on int/prod).\n */\n maxClusterClients?: number\n /**\n * Comma-separated list of generation UUIDs that are unlocked for this org.\n * These generations will be available for cluster creation even if they\n * are not part of a channel's allowed generations. They are attached to\n * the Stable channel with classification 'orgUnlocked'.\n */\n generationWhiteList?: string\n /**\n * When true, users with only the Developer role cannot create clusters in this org.\n * Users who also hold Member, Admin, Owner, or Operations Engineer are unaffected.\n */\n developerNoClusterCreate?: boolean\n}\n\nexport const RETENTION_LIMIT_MINIMUM = {\n operate: 5,\n tasklist: 5,\n optimize: 5,\n unified: 5,\n}\nexport const RETENTION_LIMIT_MAXIMUM = {\n operate: 365,\n tasklist: 90,\n optimize: 720,\n unified: 365,\n}\nexport const RETENTION_LIMIT_DEFAULT = {\n operate: 30,\n tasklist: 30,\n optimize: 180,\n unified: 30,\n}\n\n/**\n * Default maximum number of clients per cluster on development stage.\n */\nexport const MAX_CLUSTER_CLIENTS_DEV = 10\n\n/**\n * Default maximum number of clients per cluster on integration and production stages.\n */\nexport const MAX_CLUSTER_CLIENTS_DEFAULT = 200\n\nexport function deprecatedLimit(key: string): string | undefined {\n if (['dataRetentionOperate', 'dataRetentionTasklist'].includes(key)) {\n return 'unifiedDataRetention'\n }\n return undefined\n}\n\nexport function allClusterBasedLimits(): {\n key: string\n type: 'number' | 'boolean' | 'string'\n description: string\n isClusterBasedLimit: boolean\n validate?: (input: number) => boolean\n}[] {\n return [\n {\n key: 'dataRetentionOperate',\n type: 'number',\n isClusterBasedLimit: true,\n description: `Data retention in days for Operate. default = ${RETENTION_LIMIT_DEFAULT.operate}days. Min = ${RETENTION_LIMIT_MINIMUM.operate}days, Max = ${RETENTION_LIMIT_MAXIMUM.operate}days.`,\n validate: (input) =>\n input >= RETENTION_LIMIT_MINIMUM.operate &&\n input <= RETENTION_LIMIT_MAXIMUM.operate,\n },\n {\n key: 'dataRetentionTasklist',\n type: 'number',\n isClusterBasedLimit: true,\n description: `Data retention in days for Tasklist. default = ${RETENTION_LIMIT_DEFAULT.tasklist}days. Min = ${RETENTION_LIMIT_MINIMUM.tasklist}days, Max = ${RETENTION_LIMIT_MAXIMUM.tasklist}days.`,\n validate: (input) =>\n input >= RETENTION_LIMIT_MINIMUM.tasklist &&\n input <= RETENTION_LIMIT_MAXIMUM.tasklist,\n },\n {\n key: 'dataRetentionOptimize',\n type: 'number',\n isClusterBasedLimit: true,\n description: `Data retention in days for Optimize. default = ${RETENTION_LIMIT_DEFAULT.optimize}days. Min = ${RETENTION_LIMIT_MINIMUM.optimize}days, Max = ${RETENTION_LIMIT_MAXIMUM.optimize}days.`,\n validate: (input) =>\n input >= RETENTION_LIMIT_MINIMUM.optimize &&\n input <= RETENTION_LIMIT_MAXIMUM.optimize,\n },\n {\n key: 'unifiedDataRetention',\n type: 'number',\n isClusterBasedLimit: true,\n description: `Unified data retention in days for Zeebe broker. default = ${RETENTION_LIMIT_DEFAULT.unified}days. Min = ${RETENTION_LIMIT_MINIMUM.unified}days, Max = ${RETENTION_LIMIT_MAXIMUM.unified}days.`,\n validate: (input) =>\n input >= RETENTION_LIMIT_MINIMUM.unified &&\n input <= RETENTION_LIMIT_MAXIMUM.unified,\n },\n ]\n}\n\nexport function allSalesPlanLimits(): {\n key: string\n type: 'number' | 'boolean' | 'string'\n description: string\n isClusterBasedLimit: boolean\n validate?: (input: number) => boolean\n}[] {\n return [\n {\n key: 'maxMembers',\n type: 'number',\n description:\n 'used to limit the amount of collaborators within one organization. default = no limit',\n isClusterBasedLimit: false,\n validate: (input) => Number.isInteger(input) && input >= 0,\n },\n {\n key: 'hotBackup',\n type: 'boolean',\n description:\n 'used to activate the hot backup functionality in organizations. default = not active',\n isClusterBasedLimit: false,\n },\n {\n key: 'hotBackupManualRetainedCount',\n type: 'number',\n description:\n 'overrides how many manual (on-demand) hot backups the operator retains before deleting the oldest. default = 3',\n isClusterBasedLimit: false,\n validate: (input) => Number.isInteger(input) && input >= 1,\n },\n {\n key: 'hotBackupScheduledRetainedCount',\n type: 'number',\n description:\n 'overrides how many scheduled hot backups the operator retains before deleting the oldest. default = 3',\n isClusterBasedLimit: false,\n validate: (input) => Number.isInteger(input) && input >= 1,\n },\n {\n key: 'ipWhiteList',\n type: 'boolean',\n description:\n 'used to activate the ipWhitelist feature in console. default = not active',\n isClusterBasedLimit: false,\n },\n {\n key: 'secureConnectivity',\n type: 'boolean',\n description:\n 'used to activate the secure connectivity feature in console. default = not active',\n isClusterBasedLimit: false,\n },\n {\n key: 'failover',\n type: 'boolean',\n description:\n 'used to activate the failover functionality for multi-region clusters. default = not active',\n isClusterBasedLimit: false,\n },\n {\n key: 'allowedHostnamesForInvites',\n type: 'string',\n description:\n 'allowed hostnames for invites - comma separated, default: every hostname is allowed',\n isClusterBasedLimit: false,\n },\n {\n key: 'regionWhiteList',\n type: 'string',\n description:\n 'allowed regions - comma separated, default: every region is allowed',\n isClusterBasedLimit: false,\n },\n {\n key: 'suppressDropDisks',\n type: 'boolean',\n description:\n 'used to not drop disks of sleeping clusters. default = not suppressed',\n isClusterBasedLimit: false,\n },\n {\n key: 'maxTeams',\n type: 'number',\n description:\n 'used to limit the amount of teams within one super organization. default = 100',\n isClusterBasedLimit: false,\n validate: (input) => Number.isInteger(input) && input >= 0,\n },\n {\n key: 'legacyStreams',\n type: 'boolean',\n description:\n 'used to allow organizations to use legacy minor streams (e.g. 8.5, 8.6) for cluster creation. default = not allowed',\n isClusterBasedLimit: false,\n },\n {\n key: 'ignoreGracePeriod',\n type: 'boolean',\n description:\n 'used to bypass the 24h grace period on cluster upgrades after a minor version bump. default = not active (grace period enforced)',\n isClusterBasedLimit: false,\n },\n {\n key: 'maxClusterClients',\n type: 'number',\n description: `maximum number of clients per cluster. default = ${MAX_CLUSTER_CLIENTS_DEFAULT} (${MAX_CLUSTER_CLIENTS_DEV} on dev). Can be overridden per org for special customers (e.g. OEM).`,\n isClusterBasedLimit: false,\n validate: (input) => Number.isInteger(input) && input >= 1,\n },\n {\n key: 'generationWhiteList',\n type: 'string',\n description:\n 'unlocked generation UUIDs - comma separated. These generations will be available for cluster creation regardless of channel membership. Attached to the Stable channel.',\n isClusterBasedLimit: false,\n },\n {\n key: 'developerNoClusterCreate',\n type: 'boolean',\n description:\n 'when enabled, users with only the Developer role cannot create clusters in this org. Admins, Owners, Members, and Operations Engineers are unaffected.',\n isClusterBasedLimit: false,\n },\n ...allClusterBasedLimits(),\n ]\n}\n\nexport function unusedClusterBasedLimits(limits: ClusterLimits): {\n key: string\n type: 'number' | 'boolean' | 'string'\n description: string\n isClusterBasedLimit: boolean\n}[] {\n return allClusterBasedLimits().filter(\n (current) =>\n !(\n Object.keys(limits).includes(current.key) &&\n (limits as Record<string, unknown>)[current.key] !== null\n ),\n )\n}\n\nexport function unusedSalesPlanLimits(limits: Limits): {\n key: string\n type: 'number' | 'boolean' | 'string'\n description: string\n isClusterBasedLimit: boolean\n}[] {\n return allSalesPlanLimits().filter(\n (current) =>\n !(\n Object.keys(limits).includes(current.key) &&\n (limits as Record<string, unknown>)[current.key] !== null\n ),\n )\n}\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { DAY, HOUR, MINUTE, SECOND, WEEK } from './constants/duration.const.js';
|
|
2
2
|
export { isSupportedFailoverRegionPair, SUPPORTED_FAILOVER_REGION_PAIRS, } from './constants/failoverRegionPairs.const.js';
|
|
3
3
|
export type { Stage } from './constants/misc.const.js';
|
|
4
|
-
export { CONSOLE_API_USER_ID, FIRSTNAME_LASTNAME_MAX_LENGTH, HOTBACKUP_MIN_CREATE_PERIOD, MAX_HARDWARE_PACKAGE_COUNT, MAX_LENGTH_CLUSTER_NAME, MINIMUM_EYEPAIRS, NAMES_OF_ENTERPRISE_SALESPLANS_WITH_SLEEPING_CLUSTERS, OPTIMIZE_FILTERING_MIN_VERSION, SECRETS_MAX_LENGTH,
|
|
4
|
+
export { CONSOLE_API_USER_ID, FIRSTNAME_LASTNAME_MAX_LENGTH, HOTBACKUP_MIN_CREATE_PERIOD, MAX_HARDWARE_PACKAGE_COUNT, MAX_LENGTH_CLUSTER_NAME, MINIMUM_EYEPAIRS, NAMES_OF_ENTERPRISE_SALESPLANS_WITH_SLEEPING_CLUSTERS, OPTIMIZE_FILTERING_MIN_VERSION, SECRETS_MAX_LENGTH, STARTING_PRICE_PER_MONTH_IN_EURO, TEMPORARY_CLUSTER_NAME, } from './constants/misc.const.js';
|
|
5
5
|
export { getGatewayPropertyHint, getGatewayPropertyPath, isAffectedByStreamlinedDeployment, isPre89AffectedPath, PRE89_AFFECTED_PATHS, PRE89_AFFECTED_PROPERTY_PREFIXES, PRE89_GATEWAY_PROPERTY_PATHS, PRE89_GATEWAY_RESOURCE_PREFIXES, } from './constants/pre89EnvVarMapping.const.js';
|
|
6
6
|
export { PRIVATE_LINK_REGIONS } from './constants/privateLinkRegions.const.js';
|
|
7
7
|
export { SECURE_CONNECTIVITY_ALLOWED_ENTRIES_LIMIT } from './constants/secureConnectivity.const.js';
|
|
@@ -119,8 +119,10 @@ export { ConsoleSelfManagedUtils } from './utils/console-sm.utils.js';
|
|
|
119
119
|
export { deriveEncryptionStatus, type EncryptionStatus, isEncryptionStatus, } from './utils/encryptionStatus.utils.js';
|
|
120
120
|
export type { EnterpriseConnectionOrganizationAssignment } from './utils/enterprise-connection.utils.js';
|
|
121
121
|
export { enterpriseConnectionMetadataToOrganizationAssignments, organizationAssignmentsToEnterpriseConnectionMetadata, } from './utils/enterprise-connection.utils.js';
|
|
122
|
+
export { addMonthsClamped, DEFAULT_ENTERPRISE_DURATION_IN_MONTHS, diffInWholeMonths, type EnterpriseTermWindow, getCurrentEnterpriseTerm, peakWithinTerm, toUtcDayStartMs, } from './utils/enterpriseTerm.utils.js';
|
|
122
123
|
export type { EnvVarEntry } from './utils/envVars.js';
|
|
123
124
|
export { parseEnvVars, serializeEnvVars } from './utils/envVars.js';
|
|
125
|
+
export { deriveFailoverKeyPolicyPrincipals, type FailoverKeyPolicyPrincipals, } from './utils/failoverKeyPolicy.utils.js';
|
|
124
126
|
export { KMS_ARN, KMS_MRK_ARN, type KmsArnValidationError, type ParsedKmsArn, parseKmsArn, validateKmsArnForRegion, } from './utils/kmsArn.utils.js';
|
|
125
127
|
export { validateLabels } from './utils/labelValidator.utils.js';
|
|
126
128
|
export { ObjectMergeUtils } from './utils/objectMerge.utils.js';
|
package/dist/index.js
CHANGED
|
@@ -13,7 +13,6 @@ import {
|
|
|
13
13
|
NAMES_OF_ENTERPRISE_SALESPLANS_WITH_SLEEPING_CLUSTERS,
|
|
14
14
|
OPTIMIZE_FILTERING_MIN_VERSION,
|
|
15
15
|
SECRETS_MAX_LENGTH,
|
|
16
|
-
SENTRY,
|
|
17
16
|
STARTING_PRICE_PER_MONTH_IN_EURO,
|
|
18
17
|
TEMPORARY_CLUSTER_NAME
|
|
19
18
|
} from "./constants/misc.const.js";
|
|
@@ -184,7 +183,18 @@ import {
|
|
|
184
183
|
enterpriseConnectionMetadataToOrganizationAssignments,
|
|
185
184
|
organizationAssignmentsToEnterpriseConnectionMetadata
|
|
186
185
|
} from "./utils/enterprise-connection.utils.js";
|
|
186
|
+
import {
|
|
187
|
+
addMonthsClamped,
|
|
188
|
+
DEFAULT_ENTERPRISE_DURATION_IN_MONTHS,
|
|
189
|
+
diffInWholeMonths,
|
|
190
|
+
getCurrentEnterpriseTerm,
|
|
191
|
+
peakWithinTerm,
|
|
192
|
+
toUtcDayStartMs
|
|
193
|
+
} from "./utils/enterpriseTerm.utils.js";
|
|
187
194
|
import { parseEnvVars, serializeEnvVars } from "./utils/envVars.js";
|
|
195
|
+
import {
|
|
196
|
+
deriveFailoverKeyPolicyPrincipals
|
|
197
|
+
} from "./utils/failoverKeyPolicy.utils.js";
|
|
188
198
|
import {
|
|
189
199
|
KMS_ARN,
|
|
190
200
|
KMS_MRK_ARN,
|
|
@@ -264,6 +274,7 @@ export {
|
|
|
264
274
|
ConsumptionData,
|
|
265
275
|
ConsumptionDataType,
|
|
266
276
|
DAY,
|
|
277
|
+
DEFAULT_ENTERPRISE_DURATION_IN_MONTHS,
|
|
267
278
|
ErrorType,
|
|
268
279
|
FIRSTNAME_LASTNAME_MAX_LENGTH,
|
|
269
280
|
FORBIDDEN_HOSTNAMES_FOR_WEBHOOK_ALERTS,
|
|
@@ -317,7 +328,6 @@ export {
|
|
|
317
328
|
SECOND,
|
|
318
329
|
SECRETS_MAX_LENGTH,
|
|
319
330
|
SECURE_CONNECTIVITY_ALLOWED_ENTRIES_LIMIT,
|
|
320
|
-
SENTRY,
|
|
321
331
|
SLEEP_CRON_ELIGIBLE_TAGS,
|
|
322
332
|
STARTING_PRICE_PER_MONTH_IN_EURO,
|
|
323
333
|
SUPPORTED_FAILOVER_REGION_PAIRS,
|
|
@@ -340,6 +350,7 @@ export {
|
|
|
340
350
|
VersionCheckOperator,
|
|
341
351
|
WEEK,
|
|
342
352
|
accountsUserFeaturesFromPermissions,
|
|
353
|
+
addMonthsClamped,
|
|
343
354
|
allClusterBasedLimits,
|
|
344
355
|
allSalesPlanLimits,
|
|
345
356
|
allSettledResultsCounts,
|
|
@@ -349,12 +360,15 @@ export {
|
|
|
349
360
|
consoleUserFeaturesFromPermissions,
|
|
350
361
|
deprecatedLimit,
|
|
351
362
|
deriveEncryptionStatus,
|
|
363
|
+
deriveFailoverKeyPolicyPrincipals,
|
|
364
|
+
diffInWholeMonths,
|
|
352
365
|
enterpriseConnectionMetadataToOrganizationAssignments,
|
|
353
366
|
expandRolesToPermissions,
|
|
354
367
|
extractCamundaUserEmail,
|
|
355
368
|
findSearchField,
|
|
356
369
|
getAnalyticsSalesPlanFromOrgSalesPlan,
|
|
357
370
|
getApplicableRolesForEmployee,
|
|
371
|
+
getCurrentEnterpriseTerm,
|
|
358
372
|
getDisplayedSalesPlan,
|
|
359
373
|
getFulfilledPromises,
|
|
360
374
|
getGatewayPropertyHint,
|
|
@@ -395,10 +409,12 @@ export {
|
|
|
395
409
|
parseKmsArn,
|
|
396
410
|
parseLuceneQuery,
|
|
397
411
|
passwordPolicyCheck,
|
|
412
|
+
peakWithinTerm,
|
|
398
413
|
serializeEnvVars,
|
|
399
414
|
sortByAvailabilityClasses,
|
|
400
415
|
sortByClusterPlanTypeCategory,
|
|
401
416
|
sortGenerationBySemverOfZeebe,
|
|
417
|
+
toUtcDayStartMs,
|
|
402
418
|
unusedClusterBasedLimits,
|
|
403
419
|
unusedSalesPlanLimits,
|
|
404
420
|
validateKmsArnForRegion,
|
package/dist/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.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\n// ============================================================================\n// Constants (runtime values)\n// ============================================================================\n\nexport { DAY, HOUR, MINUTE, SECOND, WEEK } from './constants/duration.const.js'\nexport {\n isSupportedFailoverRegionPair,\n SUPPORTED_FAILOVER_REGION_PAIRS,\n} from './constants/failoverRegionPairs.const.js'\nexport type { Stage } from './constants/misc.const.js'\nexport {\n CONSOLE_API_USER_ID,\n FIRSTNAME_LASTNAME_MAX_LENGTH,\n HOTBACKUP_MIN_CREATE_PERIOD,\n MAX_HARDWARE_PACKAGE_COUNT,\n MAX_LENGTH_CLUSTER_NAME,\n MINIMUM_EYEPAIRS,\n NAMES_OF_ENTERPRISE_SALESPLANS_WITH_SLEEPING_CLUSTERS,\n OPTIMIZE_FILTERING_MIN_VERSION,\n SECRETS_MAX_LENGTH,\n SENTRY,\n STARTING_PRICE_PER_MONTH_IN_EURO,\n TEMPORARY_CLUSTER_NAME,\n} from './constants/misc.const.js'\nexport {\n getGatewayPropertyHint,\n getGatewayPropertyPath,\n isAffectedByStreamlinedDeployment,\n isPre89AffectedPath,\n PRE89_AFFECTED_PATHS,\n PRE89_AFFECTED_PROPERTY_PREFIXES,\n PRE89_GATEWAY_PROPERTY_PATHS,\n PRE89_GATEWAY_RESOURCE_PREFIXES,\n} from './constants/pre89EnvVarMapping.const.js'\nexport { PRIVATE_LINK_REGIONS } from './constants/privateLinkRegions.const.js'\nexport { SECURE_CONNECTIVITY_ALLOWED_ENTRIES_LIMIT } from './constants/secureConnectivity.const.js'\nexport type {\n TrialExtensionSurveyAnswer,\n TrialExtensionSurveyQuestion,\n} from './constants/trialExtensionSurvey.const.js'\nexport { TRIAL_EXTENSION_SURVEY_QUESTIONS } from './constants/trialExtensionSurvey.const.js'\n\n// ============================================================================\n// DTOs - Types (interfaces and type aliases)\n// ============================================================================\n\nexport type {\n ALERT_SUBSCRIPTION_REPORT_TYPES,\n ALERT_SUBSCRIPTION_TYPES,\n AlertSubscriptionDto,\n AlertSubscriptionEntryDto,\n AlertSubscriptionWebhookAuth,\n CheckFailedReason,\n} from './dtos/AlertSubscription.dto.js'\n\n// DTOs - Values (constants)\nexport {\n FORBIDDEN_HOSTNAMES_FOR_WEBHOOK_ALERTS,\n HMAC_HEADER_POSITION,\n HMAC_SUPPORTED_ALGORITHM,\n} from './dtos/AlertSubscription.dto.js'\n\nexport type { AuditDto } from './dtos/Audit.dto.js'\nexport type { Auth0ResourceServerDto } from './dtos/Auth0ResourceServer.dto.js'\nexport type { BackupDto } from './dtos/Backup.dto.js'\nexport type { BackupScheduleDto } from './dtos/BackupSchedule.dto.js'\nexport type { ByomClientDto, ByomStatus } from './dtos/ByomClient.dto.js'\nexport type { ClusterIpWhitelistDto } from './dtos/ClusterIpWhitelist.dto.js'\nexport type { ClusterPlanDto } from './dtos/ClusterPlan.dto.js'\nexport type { ClusterPlanTypeDto } from './dtos/ClusterPlanType.dto.js'\nexport type {\n ClusterSpecChange,\n ClusterSpecChangeActor,\n ClusterSpecHistory,\n} from './dtos/ClusterSpecHistory.dto.js'\nexport type {\n CommonClusterDto,\n ExternalIdpConfig,\n OptimizeFilteringConfig,\n OptimizeFilteringIncludeExclude,\n OptimizeFilteringPatch,\n} from './dtos/CommonCluster.dto.js'\nexport type { ConsoleClusterDto } from './dtos/ConsoleCluster.dto.js'\nexport type {\n ClusterByClientV2Dto,\n ClusterDetailV2Dto,\n ClusterFacetsV2Dto,\n ClusterListItemV2Dto,\n ClusterParameterOptionV2Dto,\n ClusterParametersV2Dto,\n ControlResolvedPermissions,\n ControlSessionDto,\n ControlSessionUser,\n CursorPage,\n CursorParams,\n ListClustersV2Params,\n ListOrganizationsV2Params,\n ListOrgMembersV2Params,\n OrgDetailV2Dto,\n OrgListItemV2Dto,\n OrgMemberV2Dto,\n OrgSummaryV2Dto,\n} from './dtos/ControlV2.dto.js'\nexport type { EarlyAccessFeatureDto } from './dtos/EarlyAccessFeature.dto.js'\nexport type {\n CamundaWebApp,\n CamundaWebAppWithZeebe,\n ExternalClusterDto,\n ExternalOrganizationDto,\n} from './dtos/ExternalWebapp.dto.js'\n// Functions\nexport {\n type GenerationDto,\n type GenerationWithClusterCountDto,\n sortGenerationBySemverOfZeebe,\n type UpgradableGenerationsDto,\n} from './dtos/Generations.dto.js'\n// Namespace (type-only - contains only interfaces)\nexport type { Hdp } from './dtos/Hdp.dto.js'\nexport type {\n K8sConfig,\n K8sConfigLegacyFormat,\n K8sContext,\n K8sContextDto,\n} from './dtos/K8sContext.dto.js'\nexport type { MetaDto } from './dtos/Meta.dto.js'\nexport type {\n AutoJoinAssignment,\n LicensingModelType,\n OrganizationDto,\n OrganizationMetadata,\n OrgOwner,\n OrgWithNameAndSalesPlan,\n} from './dtos/Organization.dto.js'\nexport {\n LICENSING_MODEL_DISPLAY_NAMES,\n VALID_LICENSING_MODELS,\n} from './dtos/Organization.dto.js'\nexport type { OrganizationMemberDto } from './dtos/OrganizationMember.dto.js'\nexport type { OrganizationToSalesPlanDto } from './dtos/OrganizationToSalesPlan.dto.js'\nexport type {\n ReleaseTrainSanityReport,\n SanityFix,\n SanityRuleInfo,\n SanitySeverity,\n SanityViolation,\n} from './dtos/ReleaseTrainSanity.dto.js'\nexport type { RestoreDto, RestoreState } from './dtos/Restore.dto.js'\n// SalesPlan.dto - Types\nexport type {\n ClusterLimits,\n ConsumptionDataItem,\n Limits,\n SalesPlanDto,\n SalesPlanMetadata,\n} from './dtos/SalesPlan.dto.js'\n// SalesPlan.dto - Values (constants and functions)\nexport {\n allClusterBasedLimits,\n allSalesPlanLimits,\n deprecatedLimit,\n MAX_CLUSTER_CLIENTS_DEFAULT,\n MAX_CLUSTER_CLIENTS_DEV,\n RETENTION_LIMIT_DEFAULT,\n RETENTION_LIMIT_MAXIMUM,\n RETENTION_LIMIT_MINIMUM,\n unusedClusterBasedLimits,\n unusedSalesPlanLimits,\n} from './dtos/SalesPlan.dto.js'\nexport type { SecureConnectivityDto } from './dtos/SecureConnectivity.dto.js'\nexport type { SignupDto } from './dtos/Signup.dto.js'\nexport type {\n StorybookConfig,\n StorybookConfigBackup,\n StorybookConfigChannel,\n StorybookConfigDatacenter,\n StorybookConfigGeneration,\n} from './dtos/StorybookConfig.dto.js'\nexport type { SystemAuditDto } from './dtos/SystemAudit.dto.js'\n// UsageAlert.dto - Types\nexport type { UsageAlertDto } from './dtos/UsageAlert.dto.js'\n// UsageAlert.dto - Values (enum and constants)\nexport {\n UsageAlertInitValues,\n UsageAlertMetric,\n UsageAlertThresholdLimits,\n} from './dtos/UsageAlert.dto.js'\nexport type { UserMetaDataDto } from './dtos/UserMetaData.dto.js'\n// Lucene-style table search (parser + AST \u2192 SQL compiler + field registries).\nexport {\n type AndNode,\n CLUSTER_DEFAULT_SEARCH_FIELDS,\n CLUSTER_SEARCH_FIELDS,\n type CompileContext,\n type CompiledQuery,\n compileQuery,\n type FieldBinding,\n findSearchField,\n isLuceneQueryError,\n LuceneQueryError,\n likeArgument,\n type NotNode,\n ORG_DEFAULT_SEARCH_FIELDS,\n ORGANIZATION_SEARCH_FIELDS,\n type OrNode,\n parseLuceneQuery,\n type QueryNode,\n type RangeNode,\n type SearchFieldCapability,\n type SearchFieldSpec,\n type SearchFieldType,\n type SearchTermOperator,\n type TermNode,\n} from './search/index.js'\n\n// ============================================================================\n// Enums (runtime values)\n// ============================================================================\n\nexport {\n AlertSubscriptionReportType,\n AlertSubscriptionType,\n} from './enums/AlertSubscription.enum.js'\nexport { AuditEntity, AuditEntityAttribute } from './enums/AuditEntity.enum.js'\nexport { AuditService } from './enums/AuditService.enum.js'\nexport { BackupStatus } from './enums/BackupStatus.enum.js'\nexport {\n ClusterBulkOperationStatus,\n ClusterBulkOperationType,\n} from './enums/ClusterBulkOperation.enum.js'\nexport { ClusterClientPermission } from './enums/ClusterClientPermissions.enum.js'\nexport { ClusterEncryptionKey } from './enums/ClusterEncryptionKey.enum.js'\nexport { ClusterStatus } from './enums/ClusterStatus.enum.js'\nexport { ConsoleAPIClientPermission } from './enums/ConsoleApiClientPermission.enum.js'\nexport { ErrorType } from './enums/ErrorType.enum.js'\nexport type {\n AssignableOrganizationRoleType,\n OrganizationRoleType,\n UnassignableOrganizationRoleType,\n} from './enums/OrganizationRole.enum.js'\nexport {\n AssignableOrganizationRole,\n LegacyHeldOrganizationRole,\n OrganizationRole,\n UnassignableOrganizationRole,\n} from './enums/OrganizationRole.enum.js'\nexport { SseEntity, SseType } from './enums/Sse.enum.js'\nexport {\n SystemAuditEntity,\n SystemAuditEntityAttribute,\n} from './enums/SystemAuditEntity.enum.js'\n\n// ============================================================================\n// Permissions - Namespaces (runtime values)\n// ============================================================================\n\nexport { AccountsPermissions } from './permissions/accounts.permissions.js'\nexport { AlertDistributorPermissions } from './permissions/alert-distributor.permissions.js'\nexport { AuditLoggerPermissions } from './permissions/auditlogger.permissions.js'\nexport {\n accountsUserFeaturesFromPermissions,\n consoleUserFeaturesFromPermissions,\n} from './permissions/combo.js'\nexport { ConsolePermissions } from './permissions/console.permissions.js'\nexport { NotificationPermissions } from './permissions/notification.permissions.js'\n// profile.permissions - Types\nexport type { OnboardConfig } from './permissions/profile.permissions.js'\n// profile.permissions - Values (constants)\n// NOTE: the `allowed` email lists (CLOUD_TEAM_EMAILS, SRE_TEAM_EMAILS, etc.)\n// intentionally live in the private `@camunda-cloud/shared-backend` package\n// instead of here, since this package is published publicly to npm.\nexport { PROFILES } from './permissions/profile.permissions.js'\nexport { expandRolesToPermissions } from './permissions/roleExpansion.utils.js'\n\n// ============================================================================\n// Types - Type-only exports (interfaces and type aliases)\n// ============================================================================\n\nexport type { AuditData } from './types/AuditData.type.js'\n// AutoSleep.type - Types\nexport type {\n ActivitySleepEligibilityOptions,\n SleepCronEligibilityOptions,\n} from './types/AutoSleep.type.js'\n// AutoSleep.type - Values (constants and functions)\nexport {\n INTERNAL_LOW_HARDWARE_PLAN_NAME,\n isActivitySleepEligible,\n isClusterTagEligibleForSleepCron,\n isSalesPlanEligibleForSleepCron,\n isSleepCronEligible,\n SLEEP_CRON_ELIGIBLE_TAGS,\n} from './types/AutoSleep.type.js'\nexport type {\n BotContext,\n BotOptions,\n BotRequest,\n GetUserDetailsResponse,\n ListRolesForUserResponse,\n UpdateUserRolesRequest,\n UpdateUserRolesResponse,\n UserContext,\n UserDetails,\n} from './types/Bot.types.js'\n// BulkOperation.type - Types\nexport type {\n BulkClusterDeletionContent,\n BulkClusterDeletionItem,\n BulkClusterGenerationUpdateItem,\n BulkClusterPlanTypeUpdateContent,\n BulkClusterPlanTypeUpdateItem,\n BulkClusterPlanUpdateContent,\n BulkClusterPlanUpdateItem,\n BulkGenerationUpdateContent,\n GenericBulkClusterOperationContent,\n GenericBulkOperationContent,\n GenericClusterBulkOperationItem,\n} from './types/BulkOperation.type.js'\n// BulkOperation.type - Functions (type guards)\nexport {\n isBulkClusterDeletionItem,\n isBulkClusterPlanTypeUpdateItem,\n isBulkClusterPlanUpdateItem,\n isIsBulkClusterGenerationUpdateIten,\n} from './types/BulkOperation.type.js'\n// C8ClusterComponentVersions.type - Types\nexport type {\n ImmutableZeebeClusterVersionsDto,\n MutableZeebeClusterVersionsDto,\n ZeebeClusterVersionsDto,\n} from './types/C8ClusterComponentVersions.type.js'\n// C8ClusterComponentVersions.type - Values (constants)\nexport {\n AllThings,\n ImmutableThings,\n MutableThings,\n} from './types/C8ClusterComponentVersions.type.js'\n// CamundaClusterLabels.type - Types\nexport type {\n CamundaClusterStage,\n CamundaClusterStageLabel,\n ClusterLabels,\n} from './types/CamundaClusterLabels.type.js'\n// CamundaClusterLabels.type - Values (constants)\nexport {\n ALLOWED_CAMUNDA_LABELS,\n StageClusterLabels,\n} from './types/CamundaClusterLabels.type.js'\n// Chargebee.type - Types\nexport type { SubscriptionItem } from './types/Chargebee.type.js'\n// Chargebee.type - Values (enums)\nexport { ConsumptionData, ConsumptionDataType } from './types/Chargebee.type.js'\n// ClusterBulkOperation.type - Types\nexport type {\n ClusterBulkOperationAck,\n ClusterBulkOperationClusterDto,\n ClusterBulkOperationContent,\n ClusterBulkOperationDto,\n ClusterBulkOperationGenerationUpdateParameter,\n ClusterBulkOperationParameter,\n ClusterBulkOperationPlanTypeUpdateParameter,\n ClusterBulkOperationPlanUpdateParameter,\n ClusterBulkOperationPostContent,\n ClusterSleepWakeupParameter,\n} from './types/ClusterBulkOperation.type.js'\nexport type {\n ClusterModificationConfigDto,\n ClusterModificationDto,\n} from './types/ClusterModification.type.js'\n// ClusterPlanFields.type - Values (field spec and type guard)\nexport {\n CLUSTER_PLAN_FIELDS,\n type ClusterPlanFieldSpec,\n type ClusterPlanFieldTree,\n isClusterPlanFieldSpec,\n} from './types/ClusterPlanFields.type.js'\nexport type {\n ClusterPlanModificationAck,\n ClusterPlanModificationConfig,\n ClusterPlanModificationDto,\n} from './types/ClusterPlanModification.type.js'\n// ClusterPlanTypeAvailabilityClass.type - Values (enum and function)\nexport {\n ClusterPlanTypeAvailabilityClass,\n sortByAvailabilityClasses,\n} from './types/ClusterPlanTypeAvailabilityClass.type.js'\n// ClusterPlanTypeCategory.type - Values (enum and functions)\nexport {\n ClusterPlanTypeCategory,\n hasAvailabilityClass,\n sortByClusterPlanTypeCategory,\n} from './types/ClusterPlanTypeCategory.type.js'\nexport type { ClusterPlanTypesToConfig } from './types/ClusterPlanTypesToConfig.type.js'\nexport type { ClusterPlanTypesToReserved } from './types/ClusterPlanTypesToReserved.type.js'\nexport type {\n ClusterUsageDataRequest,\n ClusterUsageMetricsAddRequestByMetricHeap,\n ClusterUsageMetricsData,\n ClusterUsageMetricsFilter,\n ClusterUsageOrgStartDate,\n} from './types/ClusterUsageMetrics.type.js'\n// Namespace with runtime values (consts, functions, enums)\nexport { ConsoleSM } from './types/ConsoleSelfManaged.type.js'\n// Namespace (type-only - contains only interfaces)\nexport type { ConsoleSMAdminApi } from './types/ConsoleSelfManagedAdminApi.type.js'\n// Dashboard.types - Types\nexport type {\n DashboardConfig,\n DashboardMappingItem,\n DashboardMappingTarget,\n DashboardResultPrimitive,\n DashboardResultRow,\n EngineeringOperationsDashboardResponse,\n} from './types/Dashboard.types.js'\nexport type { EnterpriseIncludingValueMetrics } from './types/EnterpriseIncludingValueMetrics.type.js'\nexport type { HdpTenantUsagePoint } from './types/HdpTenantUsage.type.js'\n// hdp.types - Types (interfaces)\nexport type {\n AlertSubscription as HdpAlertSubscription,\n Audit as HdpAudit,\n ByomClient as HdpByomClient,\n Channel as HdpChannel,\n Cluster as HdpCluster,\n ClusterBackup as HdpClusterBackup,\n ClusterBackupSchedule as HdpClusterBackupSchedule,\n ClusterBulkOperation as HdpClusterBulkOperation,\n ClusterClient as HdpClusterClient,\n ClusterModification as HdpClusterModification,\n ClusterPlan as HdpClusterPlan,\n ClusterPlanType as HdpClusterPlanType,\n ConnectorSecret as HdpConnectorSecret,\n ConsoleApiClient as HdpConsoleApiClient,\n Datacenter as HdpDatacenter,\n Generation as HdpGeneration,\n HdpBackendChangeEvent,\n HdpClusterModificationConfig,\n HdpEntity,\n HdpPrometheusDataCapacityDataPoint,\n Invite as HdpInvite,\n LlmSpend as HdpLlmSpend,\n Organization as HdpOrganization,\n SecureConnectivity as HdpSecureConnectivity,\n SystemAudit as HdpSystemAudit,\n TelemetryData as HdpTelemetryData,\n UsageAlert as HdpUsageAlert,\n User as HdpUser,\n UserLogin as HdpUserLogin,\n} from './types/hdp.types.js'\n// hdp.types - Values (enums)\nexport {\n AlertSubscriptionReportType as HdpAlertSubscriptionReportType,\n AlertSubscriptionType as HdpAlertSubscriptionType,\n} from './types/hdp.types.js'\n// notification.type - Types\nexport type {\n GlobalNotification,\n NotificationDto,\n NotificationMeta,\n NotificationOptions,\n NotificationPermission,\n NotificationSource,\n NotificationState,\n NotificationType,\n OrgNotification,\n UserNotification,\n UserOrgNotification,\n} from './types/notification.type.js'\n// notification.type - Values (enums and constants)\nexport {\n NotificationPermissionValues,\n NotificationSourceEnum,\n NotificationStateEnum,\n NotificationTypeEnum,\n} from './types/notification.type.js'\n// OrganizationPermission.type - Types\nexport type {\n CreateReadUpdateDelete,\n OrganizationPermissions,\n} from './types/OrganizationPermission.type.js'\n// OrganizationPermission.type - Values (constants)\nexport {\n OrganizationPermissionsDescriptions,\n PermissionsForOrganizationRole,\n} from './types/OrganizationPermission.type.js'\n// Roles.js - Types\nexport type {\n AccountRoles,\n ConsoleRoles,\n ModelerRoles,\n Roles,\n} from './types/Roles.js'\n// Roles.js - Values (constants)\nexport { SAFE_ROLES } from './types/Roles.js'\n// SalesPlanType.type - Types\nexport type {\n DisplayedSalesPlan,\n RevisitedSalesPlanName,\n} from './types/SalesPlanType.type.js'\n// SalesPlanType.type - Values (enums and functions)\nexport {\n AnalyticsSalesPlanType,\n getAnalyticsSalesPlanFromOrgSalesPlan,\n getDisplayedSalesPlan,\n getRevisitedSalesPlanName,\n OPTIMIZE_DISABLED_PLAN_TYPES,\n SalesPlanType,\n} from './types/SalesPlanType.type.js'\n// SpamDetection.type - Types\nexport type { SpamDetectionPatterns } from './types/SpamDetection.type.js'\n// SpamDetection.type - Values (constants)\nexport { TEERGRUBE_PATTERNS } from './types/SpamDetection.type.js'\nexport type {\n AlertSubscriptionSseEvent,\n BackupSseEvent,\n ClusterClientSseEvent,\n ClusterSseEvent,\n ConnectorSecretsSseEvent,\n ConsoleApiClientSseEvent,\n ConsoleSseEvent,\n MonitoringSseEvent,\n SecureConnectivitySseEvent,\n SseClusterPayload,\n SseMonitoringPayload,\n SseSecureConnectivityPayload,\n} from './types/SseEvent.type.js'\n// Namespace (type-only - contains only interfaces)\nexport type { AccountsStats } from './types/Stats.types.js'\n// Survey.type - Types\nexport type { Persona, SurveyDto } from './types/Survey.type.js'\n// Survey.type - Values (enum)\nexport { FeedbackType } from './types/Survey.type.js'\n// SuspendStrategy.type - Types\nexport type {\n GetSuspendStrategyOptions,\n SuspendStrategy,\n} from './types/SuspendStrategy.type.js'\n// SuspendStrategy.type - Values (function)\nexport { getSuspendStrategy } from './types/SuspendStrategy.type.js'\nexport type { SystemAuditData } from './types/SystemAuditData.type.js'\n\n// Namespace (runtime value)\nexport { Telemetry } from './types/Telemetry.type.js'\n\n// User.type - Types\nexport type {\n AccountsData,\n AppMetadata,\n BasicUser,\n BlockedFor,\n Identity,\n OrgMembership,\n User,\n UserMetadata,\n UserRequest,\n} from './types/User.type.js'\n\n// User.type - Values (enum)\nexport { UserMetadataEvent } from './types/User.type.js'\n\nexport type {\n UniqueTaskUser,\n ValueMetrics,\n ValueMetricsPerYearMonth,\n} from './types/ValueMetrics.type.js'\n\n// ============================================================================\n// Utils - Classes (runtime values)\n// ============================================================================\n\nexport { ConsoleSelfManagedUtils } from './utils/console-sm.utils.js'\nexport {\n deriveEncryptionStatus,\n type EncryptionStatus,\n isEncryptionStatus,\n} from './utils/encryptionStatus.utils.js'\n// enterprise-connection.utils - Types\nexport type { EnterpriseConnectionOrganizationAssignment } from './utils/enterprise-connection.utils.js'\n// enterprise-connection.utils - Values (functions)\nexport {\n enterpriseConnectionMetadataToOrganizationAssignments,\n organizationAssignmentsToEnterpriseConnectionMetadata,\n} from './utils/enterprise-connection.utils.js'\nexport type { EnvVarEntry } from './utils/envVars.js'\nexport { parseEnvVars, serializeEnvVars } from './utils/envVars.js'\nexport {\n KMS_ARN,\n KMS_MRK_ARN,\n type KmsArnValidationError,\n type ParsedKmsArn,\n parseKmsArn,\n validateKmsArnForRegion,\n} from './utils/kmsArn.utils.js'\nexport { validateLabels } from './utils/labelValidator.utils.js'\nexport { ObjectMergeUtils } from './utils/objectMerge.utils.js'\nexport {\n getPermissionsByRoles,\n getUserPermissionsForOrg,\n} from './utils/orgs/OrgHelper.js'\n\n// PasswordPolicy - Types\nexport type {\n PasswordPolicyRequest,\n PasswordPolicyResult,\n} from './utils/PasswordPolicy.js'\n\n// PasswordPolicy - Values (constants and function)\nexport {\n MAXLENGTH as PASSWORD_POLICY_MAXLENGTH,\n MINLENGTH as PASSWORD_POLICY_MINLENGTH,\n passwordPolicyCheck,\n} from './utils/PasswordPolicy.js'\n\nexport {\n allSettledResultsCounts,\n getFulfilledPromises,\n getRejectedPromises,\n getSettledSummary,\n} from './utils/settledPromises.util.js'\n\nexport {\n isValidAwsArn,\n isValidCIDR,\n isValidCIDRList,\n isValidClientName,\n isValidHostname,\n isValidPrivateLinkRegion,\n} from './utils/string-validation.utils.js'\nexport {\n extractCamundaUserEmail,\n guessName,\n isCamundaUserId,\n} from './utils/user.utils.js'\n\n// versionCheck.utils - Values (enum and function)\nexport {\n checkVersion,\n VersionCheckOperator,\n} from './utils/versionCheck.utils.js'\n\n// ============================================================================\n// Config - Configuration files and types\n// ============================================================================\n\nexport { default as CAMUNDI_PERMISSION_RULES } from './config/camundi-permission-rules.js'\nexport type { CamundiPermissionRules } from './config/camundi-permission-rules.types.js'\n\nexport {\n augmentCamundiPermissions,\n getApplicableRolesForEmployee,\n isManager,\n} from './utils/camundiPermissionAugmenter.utils.js'\n"],
|
|
5
|
-
"mappings": "AAUA,SAAS,KAAK,MAAM,QAAQ,QAAQ,YAAY;AAChD;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAEP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,
|
|
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// ============================================================================\n// Constants (runtime values)\n// ============================================================================\n\nexport { DAY, HOUR, MINUTE, SECOND, WEEK } from './constants/duration.const.js'\nexport {\n isSupportedFailoverRegionPair,\n SUPPORTED_FAILOVER_REGION_PAIRS,\n} from './constants/failoverRegionPairs.const.js'\nexport type { Stage } from './constants/misc.const.js'\nexport {\n CONSOLE_API_USER_ID,\n FIRSTNAME_LASTNAME_MAX_LENGTH,\n HOTBACKUP_MIN_CREATE_PERIOD,\n MAX_HARDWARE_PACKAGE_COUNT,\n MAX_LENGTH_CLUSTER_NAME,\n MINIMUM_EYEPAIRS,\n NAMES_OF_ENTERPRISE_SALESPLANS_WITH_SLEEPING_CLUSTERS,\n OPTIMIZE_FILTERING_MIN_VERSION,\n SECRETS_MAX_LENGTH,\n STARTING_PRICE_PER_MONTH_IN_EURO,\n TEMPORARY_CLUSTER_NAME,\n} from './constants/misc.const.js'\nexport {\n getGatewayPropertyHint,\n getGatewayPropertyPath,\n isAffectedByStreamlinedDeployment,\n isPre89AffectedPath,\n PRE89_AFFECTED_PATHS,\n PRE89_AFFECTED_PROPERTY_PREFIXES,\n PRE89_GATEWAY_PROPERTY_PATHS,\n PRE89_GATEWAY_RESOURCE_PREFIXES,\n} from './constants/pre89EnvVarMapping.const.js'\nexport { PRIVATE_LINK_REGIONS } from './constants/privateLinkRegions.const.js'\nexport { SECURE_CONNECTIVITY_ALLOWED_ENTRIES_LIMIT } from './constants/secureConnectivity.const.js'\nexport type {\n TrialExtensionSurveyAnswer,\n TrialExtensionSurveyQuestion,\n} from './constants/trialExtensionSurvey.const.js'\nexport { TRIAL_EXTENSION_SURVEY_QUESTIONS } from './constants/trialExtensionSurvey.const.js'\n\n// ============================================================================\n// DTOs - Types (interfaces and type aliases)\n// ============================================================================\n\nexport type {\n ALERT_SUBSCRIPTION_REPORT_TYPES,\n ALERT_SUBSCRIPTION_TYPES,\n AlertSubscriptionDto,\n AlertSubscriptionEntryDto,\n AlertSubscriptionWebhookAuth,\n CheckFailedReason,\n} from './dtos/AlertSubscription.dto.js'\n\n// DTOs - Values (constants)\nexport {\n FORBIDDEN_HOSTNAMES_FOR_WEBHOOK_ALERTS,\n HMAC_HEADER_POSITION,\n HMAC_SUPPORTED_ALGORITHM,\n} from './dtos/AlertSubscription.dto.js'\n\nexport type { AuditDto } from './dtos/Audit.dto.js'\nexport type { Auth0ResourceServerDto } from './dtos/Auth0ResourceServer.dto.js'\nexport type { BackupDto } from './dtos/Backup.dto.js'\nexport type { BackupScheduleDto } from './dtos/BackupSchedule.dto.js'\nexport type { ByomClientDto, ByomStatus } from './dtos/ByomClient.dto.js'\nexport type { ClusterIpWhitelistDto } from './dtos/ClusterIpWhitelist.dto.js'\nexport type { ClusterPlanDto } from './dtos/ClusterPlan.dto.js'\nexport type { ClusterPlanTypeDto } from './dtos/ClusterPlanType.dto.js'\nexport type {\n ClusterSpecChange,\n ClusterSpecChangeActor,\n ClusterSpecHistory,\n} from './dtos/ClusterSpecHistory.dto.js'\nexport type {\n CommonClusterDto,\n ExternalIdpConfig,\n OptimizeFilteringConfig,\n OptimizeFilteringIncludeExclude,\n OptimizeFilteringPatch,\n} from './dtos/CommonCluster.dto.js'\nexport type { ConsoleClusterDto } from './dtos/ConsoleCluster.dto.js'\nexport type {\n ClusterByClientV2Dto,\n ClusterDetailV2Dto,\n ClusterFacetsV2Dto,\n ClusterListItemV2Dto,\n ClusterParameterOptionV2Dto,\n ClusterParametersV2Dto,\n ControlResolvedPermissions,\n ControlSessionDto,\n ControlSessionUser,\n CursorPage,\n CursorParams,\n ListClustersV2Params,\n ListOrganizationsV2Params,\n ListOrgMembersV2Params,\n OrgDetailV2Dto,\n OrgListItemV2Dto,\n OrgMemberV2Dto,\n OrgSummaryV2Dto,\n} from './dtos/ControlV2.dto.js'\nexport type { EarlyAccessFeatureDto } from './dtos/EarlyAccessFeature.dto.js'\nexport type {\n CamundaWebApp,\n CamundaWebAppWithZeebe,\n ExternalClusterDto,\n ExternalOrganizationDto,\n} from './dtos/ExternalWebapp.dto.js'\n// Functions\nexport {\n type GenerationDto,\n type GenerationWithClusterCountDto,\n sortGenerationBySemverOfZeebe,\n type UpgradableGenerationsDto,\n} from './dtos/Generations.dto.js'\n// Namespace (type-only - contains only interfaces)\nexport type { Hdp } from './dtos/Hdp.dto.js'\nexport type {\n K8sConfig,\n K8sConfigLegacyFormat,\n K8sContext,\n K8sContextDto,\n} from './dtos/K8sContext.dto.js'\nexport type { MetaDto } from './dtos/Meta.dto.js'\nexport type {\n AutoJoinAssignment,\n LicensingModelType,\n OrganizationDto,\n OrganizationMetadata,\n OrgOwner,\n OrgWithNameAndSalesPlan,\n} from './dtos/Organization.dto.js'\nexport {\n LICENSING_MODEL_DISPLAY_NAMES,\n VALID_LICENSING_MODELS,\n} from './dtos/Organization.dto.js'\nexport type { OrganizationMemberDto } from './dtos/OrganizationMember.dto.js'\nexport type { OrganizationToSalesPlanDto } from './dtos/OrganizationToSalesPlan.dto.js'\nexport type {\n ReleaseTrainSanityReport,\n SanityFix,\n SanityRuleInfo,\n SanitySeverity,\n SanityViolation,\n} from './dtos/ReleaseTrainSanity.dto.js'\nexport type { RestoreDto, RestoreState } from './dtos/Restore.dto.js'\n// SalesPlan.dto - Types\nexport type {\n ClusterLimits,\n ConsumptionDataItem,\n Limits,\n SalesPlanDto,\n SalesPlanMetadata,\n} from './dtos/SalesPlan.dto.js'\n// SalesPlan.dto - Values (constants and functions)\nexport {\n allClusterBasedLimits,\n allSalesPlanLimits,\n deprecatedLimit,\n MAX_CLUSTER_CLIENTS_DEFAULT,\n MAX_CLUSTER_CLIENTS_DEV,\n RETENTION_LIMIT_DEFAULT,\n RETENTION_LIMIT_MAXIMUM,\n RETENTION_LIMIT_MINIMUM,\n unusedClusterBasedLimits,\n unusedSalesPlanLimits,\n} from './dtos/SalesPlan.dto.js'\nexport type { SecureConnectivityDto } from './dtos/SecureConnectivity.dto.js'\nexport type { SignupDto } from './dtos/Signup.dto.js'\nexport type {\n StorybookConfig,\n StorybookConfigBackup,\n StorybookConfigChannel,\n StorybookConfigDatacenter,\n StorybookConfigGeneration,\n} from './dtos/StorybookConfig.dto.js'\nexport type { SystemAuditDto } from './dtos/SystemAudit.dto.js'\n// UsageAlert.dto - Types\nexport type { UsageAlertDto } from './dtos/UsageAlert.dto.js'\n// UsageAlert.dto - Values (enum and constants)\nexport {\n UsageAlertInitValues,\n UsageAlertMetric,\n UsageAlertThresholdLimits,\n} from './dtos/UsageAlert.dto.js'\nexport type { UserMetaDataDto } from './dtos/UserMetaData.dto.js'\n// Lucene-style table search (parser + AST \u2192 SQL compiler + field registries).\nexport {\n type AndNode,\n CLUSTER_DEFAULT_SEARCH_FIELDS,\n CLUSTER_SEARCH_FIELDS,\n type CompileContext,\n type CompiledQuery,\n compileQuery,\n type FieldBinding,\n findSearchField,\n isLuceneQueryError,\n LuceneQueryError,\n likeArgument,\n type NotNode,\n ORG_DEFAULT_SEARCH_FIELDS,\n ORGANIZATION_SEARCH_FIELDS,\n type OrNode,\n parseLuceneQuery,\n type QueryNode,\n type RangeNode,\n type SearchFieldCapability,\n type SearchFieldSpec,\n type SearchFieldType,\n type SearchTermOperator,\n type TermNode,\n} from './search/index.js'\n\n// ============================================================================\n// Enums (runtime values)\n// ============================================================================\n\nexport {\n AlertSubscriptionReportType,\n AlertSubscriptionType,\n} from './enums/AlertSubscription.enum.js'\nexport { AuditEntity, AuditEntityAttribute } from './enums/AuditEntity.enum.js'\nexport { AuditService } from './enums/AuditService.enum.js'\nexport { BackupStatus } from './enums/BackupStatus.enum.js'\nexport {\n ClusterBulkOperationStatus,\n ClusterBulkOperationType,\n} from './enums/ClusterBulkOperation.enum.js'\nexport { ClusterClientPermission } from './enums/ClusterClientPermissions.enum.js'\nexport { ClusterEncryptionKey } from './enums/ClusterEncryptionKey.enum.js'\nexport { ClusterStatus } from './enums/ClusterStatus.enum.js'\nexport { ConsoleAPIClientPermission } from './enums/ConsoleApiClientPermission.enum.js'\nexport { ErrorType } from './enums/ErrorType.enum.js'\nexport type {\n AssignableOrganizationRoleType,\n OrganizationRoleType,\n UnassignableOrganizationRoleType,\n} from './enums/OrganizationRole.enum.js'\nexport {\n AssignableOrganizationRole,\n LegacyHeldOrganizationRole,\n OrganizationRole,\n UnassignableOrganizationRole,\n} from './enums/OrganizationRole.enum.js'\nexport { SseEntity, SseType } from './enums/Sse.enum.js'\nexport {\n SystemAuditEntity,\n SystemAuditEntityAttribute,\n} from './enums/SystemAuditEntity.enum.js'\n\n// ============================================================================\n// Permissions - Namespaces (runtime values)\n// ============================================================================\n\nexport { AccountsPermissions } from './permissions/accounts.permissions.js'\nexport { AlertDistributorPermissions } from './permissions/alert-distributor.permissions.js'\nexport { AuditLoggerPermissions } from './permissions/auditlogger.permissions.js'\nexport {\n accountsUserFeaturesFromPermissions,\n consoleUserFeaturesFromPermissions,\n} from './permissions/combo.js'\nexport { ConsolePermissions } from './permissions/console.permissions.js'\nexport { NotificationPermissions } from './permissions/notification.permissions.js'\n// profile.permissions - Types\nexport type { OnboardConfig } from './permissions/profile.permissions.js'\n// profile.permissions - Values (constants)\n// NOTE: the `allowed` email lists (CLOUD_TEAM_EMAILS, SRE_TEAM_EMAILS, etc.)\n// intentionally live in the private `@camunda-cloud/shared-backend` package\n// instead of here, since this package is published publicly to npm.\nexport { PROFILES } from './permissions/profile.permissions.js'\nexport { expandRolesToPermissions } from './permissions/roleExpansion.utils.js'\n\n// ============================================================================\n// Types - Type-only exports (interfaces and type aliases)\n// ============================================================================\n\nexport type { AuditData } from './types/AuditData.type.js'\n// AutoSleep.type - Types\nexport type {\n ActivitySleepEligibilityOptions,\n SleepCronEligibilityOptions,\n} from './types/AutoSleep.type.js'\n// AutoSleep.type - Values (constants and functions)\nexport {\n INTERNAL_LOW_HARDWARE_PLAN_NAME,\n isActivitySleepEligible,\n isClusterTagEligibleForSleepCron,\n isSalesPlanEligibleForSleepCron,\n isSleepCronEligible,\n SLEEP_CRON_ELIGIBLE_TAGS,\n} from './types/AutoSleep.type.js'\nexport type {\n BotContext,\n BotOptions,\n BotRequest,\n GetUserDetailsResponse,\n ListRolesForUserResponse,\n UpdateUserRolesRequest,\n UpdateUserRolesResponse,\n UserContext,\n UserDetails,\n} from './types/Bot.types.js'\n// BulkOperation.type - Types\nexport type {\n BulkClusterDeletionContent,\n BulkClusterDeletionItem,\n BulkClusterGenerationUpdateItem,\n BulkClusterPlanTypeUpdateContent,\n BulkClusterPlanTypeUpdateItem,\n BulkClusterPlanUpdateContent,\n BulkClusterPlanUpdateItem,\n BulkGenerationUpdateContent,\n GenericBulkClusterOperationContent,\n GenericBulkOperationContent,\n GenericClusterBulkOperationItem,\n} from './types/BulkOperation.type.js'\n// BulkOperation.type - Functions (type guards)\nexport {\n isBulkClusterDeletionItem,\n isBulkClusterPlanTypeUpdateItem,\n isBulkClusterPlanUpdateItem,\n isIsBulkClusterGenerationUpdateIten,\n} from './types/BulkOperation.type.js'\n// C8ClusterComponentVersions.type - Types\nexport type {\n ImmutableZeebeClusterVersionsDto,\n MutableZeebeClusterVersionsDto,\n ZeebeClusterVersionsDto,\n} from './types/C8ClusterComponentVersions.type.js'\n// C8ClusterComponentVersions.type - Values (constants)\nexport {\n AllThings,\n ImmutableThings,\n MutableThings,\n} from './types/C8ClusterComponentVersions.type.js'\n// CamundaClusterLabels.type - Types\nexport type {\n CamundaClusterStage,\n CamundaClusterStageLabel,\n ClusterLabels,\n} from './types/CamundaClusterLabels.type.js'\n// CamundaClusterLabels.type - Values (constants)\nexport {\n ALLOWED_CAMUNDA_LABELS,\n StageClusterLabels,\n} from './types/CamundaClusterLabels.type.js'\n// Chargebee.type - Types\nexport type { SubscriptionItem } from './types/Chargebee.type.js'\n// Chargebee.type - Values (enums)\nexport { ConsumptionData, ConsumptionDataType } from './types/Chargebee.type.js'\n// ClusterBulkOperation.type - Types\nexport type {\n ClusterBulkOperationAck,\n ClusterBulkOperationClusterDto,\n ClusterBulkOperationContent,\n ClusterBulkOperationDto,\n ClusterBulkOperationGenerationUpdateParameter,\n ClusterBulkOperationParameter,\n ClusterBulkOperationPlanTypeUpdateParameter,\n ClusterBulkOperationPlanUpdateParameter,\n ClusterBulkOperationPostContent,\n ClusterSleepWakeupParameter,\n} from './types/ClusterBulkOperation.type.js'\nexport type {\n ClusterModificationConfigDto,\n ClusterModificationDto,\n} from './types/ClusterModification.type.js'\n// ClusterPlanFields.type - Values (field spec and type guard)\nexport {\n CLUSTER_PLAN_FIELDS,\n type ClusterPlanFieldSpec,\n type ClusterPlanFieldTree,\n isClusterPlanFieldSpec,\n} from './types/ClusterPlanFields.type.js'\nexport type {\n ClusterPlanModificationAck,\n ClusterPlanModificationConfig,\n ClusterPlanModificationDto,\n} from './types/ClusterPlanModification.type.js'\n// ClusterPlanTypeAvailabilityClass.type - Values (enum and function)\nexport {\n ClusterPlanTypeAvailabilityClass,\n sortByAvailabilityClasses,\n} from './types/ClusterPlanTypeAvailabilityClass.type.js'\n// ClusterPlanTypeCategory.type - Values (enum and functions)\nexport {\n ClusterPlanTypeCategory,\n hasAvailabilityClass,\n sortByClusterPlanTypeCategory,\n} from './types/ClusterPlanTypeCategory.type.js'\nexport type { ClusterPlanTypesToConfig } from './types/ClusterPlanTypesToConfig.type.js'\nexport type { ClusterPlanTypesToReserved } from './types/ClusterPlanTypesToReserved.type.js'\nexport type {\n ClusterUsageDataRequest,\n ClusterUsageMetricsAddRequestByMetricHeap,\n ClusterUsageMetricsData,\n ClusterUsageMetricsFilter,\n ClusterUsageOrgStartDate,\n} from './types/ClusterUsageMetrics.type.js'\n// Namespace with runtime values (consts, functions, enums)\nexport { ConsoleSM } from './types/ConsoleSelfManaged.type.js'\n// Namespace (type-only - contains only interfaces)\nexport type { ConsoleSMAdminApi } from './types/ConsoleSelfManagedAdminApi.type.js'\n// Dashboard.types - Types\nexport type {\n DashboardConfig,\n DashboardMappingItem,\n DashboardMappingTarget,\n DashboardResultPrimitive,\n DashboardResultRow,\n EngineeringOperationsDashboardResponse,\n} from './types/Dashboard.types.js'\nexport type { EnterpriseIncludingValueMetrics } from './types/EnterpriseIncludingValueMetrics.type.js'\nexport type { HdpTenantUsagePoint } from './types/HdpTenantUsage.type.js'\n// hdp.types - Types (interfaces)\nexport type {\n AlertSubscription as HdpAlertSubscription,\n Audit as HdpAudit,\n ByomClient as HdpByomClient,\n Channel as HdpChannel,\n Cluster as HdpCluster,\n ClusterBackup as HdpClusterBackup,\n ClusterBackupSchedule as HdpClusterBackupSchedule,\n ClusterBulkOperation as HdpClusterBulkOperation,\n ClusterClient as HdpClusterClient,\n ClusterModification as HdpClusterModification,\n ClusterPlan as HdpClusterPlan,\n ClusterPlanType as HdpClusterPlanType,\n ConnectorSecret as HdpConnectorSecret,\n ConsoleApiClient as HdpConsoleApiClient,\n Datacenter as HdpDatacenter,\n Generation as HdpGeneration,\n HdpBackendChangeEvent,\n HdpClusterModificationConfig,\n HdpEntity,\n HdpPrometheusDataCapacityDataPoint,\n Invite as HdpInvite,\n LlmSpend as HdpLlmSpend,\n Organization as HdpOrganization,\n SecureConnectivity as HdpSecureConnectivity,\n SystemAudit as HdpSystemAudit,\n TelemetryData as HdpTelemetryData,\n UsageAlert as HdpUsageAlert,\n User as HdpUser,\n UserLogin as HdpUserLogin,\n} from './types/hdp.types.js'\n// hdp.types - Values (enums)\nexport {\n AlertSubscriptionReportType as HdpAlertSubscriptionReportType,\n AlertSubscriptionType as HdpAlertSubscriptionType,\n} from './types/hdp.types.js'\n// notification.type - Types\nexport type {\n GlobalNotification,\n NotificationDto,\n NotificationMeta,\n NotificationOptions,\n NotificationPermission,\n NotificationSource,\n NotificationState,\n NotificationType,\n OrgNotification,\n UserNotification,\n UserOrgNotification,\n} from './types/notification.type.js'\n// notification.type - Values (enums and constants)\nexport {\n NotificationPermissionValues,\n NotificationSourceEnum,\n NotificationStateEnum,\n NotificationTypeEnum,\n} from './types/notification.type.js'\n// OrganizationPermission.type - Types\nexport type {\n CreateReadUpdateDelete,\n OrganizationPermissions,\n} from './types/OrganizationPermission.type.js'\n// OrganizationPermission.type - Values (constants)\nexport {\n OrganizationPermissionsDescriptions,\n PermissionsForOrganizationRole,\n} from './types/OrganizationPermission.type.js'\n// Roles.js - Types\nexport type {\n AccountRoles,\n ConsoleRoles,\n ModelerRoles,\n Roles,\n} from './types/Roles.js'\n// Roles.js - Values (constants)\nexport { SAFE_ROLES } from './types/Roles.js'\n// SalesPlanType.type - Types\nexport type {\n DisplayedSalesPlan,\n RevisitedSalesPlanName,\n} from './types/SalesPlanType.type.js'\n// SalesPlanType.type - Values (enums and functions)\nexport {\n AnalyticsSalesPlanType,\n getAnalyticsSalesPlanFromOrgSalesPlan,\n getDisplayedSalesPlan,\n getRevisitedSalesPlanName,\n OPTIMIZE_DISABLED_PLAN_TYPES,\n SalesPlanType,\n} from './types/SalesPlanType.type.js'\n// SpamDetection.type - Types\nexport type { SpamDetectionPatterns } from './types/SpamDetection.type.js'\n// SpamDetection.type - Values (constants)\nexport { TEERGRUBE_PATTERNS } from './types/SpamDetection.type.js'\nexport type {\n AlertSubscriptionSseEvent,\n BackupSseEvent,\n ClusterClientSseEvent,\n ClusterSseEvent,\n ConnectorSecretsSseEvent,\n ConsoleApiClientSseEvent,\n ConsoleSseEvent,\n MonitoringSseEvent,\n SecureConnectivitySseEvent,\n SseClusterPayload,\n SseMonitoringPayload,\n SseSecureConnectivityPayload,\n} from './types/SseEvent.type.js'\n// Namespace (type-only - contains only interfaces)\nexport type { AccountsStats } from './types/Stats.types.js'\n// Survey.type - Types\nexport type { Persona, SurveyDto } from './types/Survey.type.js'\n// Survey.type - Values (enum)\nexport { FeedbackType } from './types/Survey.type.js'\n// SuspendStrategy.type - Types\nexport type {\n GetSuspendStrategyOptions,\n SuspendStrategy,\n} from './types/SuspendStrategy.type.js'\n// SuspendStrategy.type - Values (function)\nexport { getSuspendStrategy } from './types/SuspendStrategy.type.js'\nexport type { SystemAuditData } from './types/SystemAuditData.type.js'\n\n// Namespace (runtime value)\nexport { Telemetry } from './types/Telemetry.type.js'\n\n// User.type - Types\nexport type {\n AccountsData,\n AppMetadata,\n BasicUser,\n BlockedFor,\n Identity,\n OrgMembership,\n User,\n UserMetadata,\n UserRequest,\n} from './types/User.type.js'\n\n// User.type - Values (enum)\nexport { UserMetadataEvent } from './types/User.type.js'\n\nexport type {\n UniqueTaskUser,\n ValueMetrics,\n ValueMetricsPerYearMonth,\n} from './types/ValueMetrics.type.js'\n\n// ============================================================================\n// Utils - Classes (runtime values)\n// ============================================================================\n\nexport { ConsoleSelfManagedUtils } from './utils/console-sm.utils.js'\nexport {\n deriveEncryptionStatus,\n type EncryptionStatus,\n isEncryptionStatus,\n} from './utils/encryptionStatus.utils.js'\n// enterprise-connection.utils - Types\nexport type { EnterpriseConnectionOrganizationAssignment } from './utils/enterprise-connection.utils.js'\n// enterprise-connection.utils - Values (functions)\nexport {\n enterpriseConnectionMetadataToOrganizationAssignments,\n organizationAssignmentsToEnterpriseConnectionMetadata,\n} from './utils/enterprise-connection.utils.js'\nexport {\n addMonthsClamped,\n DEFAULT_ENTERPRISE_DURATION_IN_MONTHS,\n diffInWholeMonths,\n type EnterpriseTermWindow,\n getCurrentEnterpriseTerm,\n peakWithinTerm,\n toUtcDayStartMs,\n} from './utils/enterpriseTerm.utils.js'\nexport type { EnvVarEntry } from './utils/envVars.js'\nexport { parseEnvVars, serializeEnvVars } from './utils/envVars.js'\nexport {\n deriveFailoverKeyPolicyPrincipals,\n type FailoverKeyPolicyPrincipals,\n} from './utils/failoverKeyPolicy.utils.js'\nexport {\n KMS_ARN,\n KMS_MRK_ARN,\n type KmsArnValidationError,\n type ParsedKmsArn,\n parseKmsArn,\n validateKmsArnForRegion,\n} from './utils/kmsArn.utils.js'\nexport { validateLabels } from './utils/labelValidator.utils.js'\nexport { ObjectMergeUtils } from './utils/objectMerge.utils.js'\nexport {\n getPermissionsByRoles,\n getUserPermissionsForOrg,\n} from './utils/orgs/OrgHelper.js'\n\n// PasswordPolicy - Types\nexport type {\n PasswordPolicyRequest,\n PasswordPolicyResult,\n} from './utils/PasswordPolicy.js'\n\n// PasswordPolicy - Values (constants and function)\nexport {\n MAXLENGTH as PASSWORD_POLICY_MAXLENGTH,\n MINLENGTH as PASSWORD_POLICY_MINLENGTH,\n passwordPolicyCheck,\n} from './utils/PasswordPolicy.js'\n\nexport {\n allSettledResultsCounts,\n getFulfilledPromises,\n getRejectedPromises,\n getSettledSummary,\n} from './utils/settledPromises.util.js'\n\nexport {\n isValidAwsArn,\n isValidCIDR,\n isValidCIDRList,\n isValidClientName,\n isValidHostname,\n isValidPrivateLinkRegion,\n} from './utils/string-validation.utils.js'\nexport {\n extractCamundaUserEmail,\n guessName,\n isCamundaUserId,\n} from './utils/user.utils.js'\n\n// versionCheck.utils - Values (enum and function)\nexport {\n checkVersion,\n VersionCheckOperator,\n} from './utils/versionCheck.utils.js'\n\n// ============================================================================\n// Config - Configuration files and types\n// ============================================================================\n\nexport { default as CAMUNDI_PERMISSION_RULES } from './config/camundi-permission-rules.js'\nexport type { CamundiPermissionRules } from './config/camundi-permission-rules.types.js'\n\nexport {\n augmentCamundiPermissions,\n getApplicableRolesForEmployee,\n isManager,\n} from './utils/camundiPermissionAugmenter.utils.js'\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
6
|
"names": ["AlertSubscriptionReportType", "AlertSubscriptionType", "default"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The enterprise contract period a usage figure belongs to.
|
|
3
|
+
*
|
|
4
|
+
* An enterprise contract starts at `enterpriseStartDate` and renews every
|
|
5
|
+
* `enterpriseDurationInMonth` months. Usage is measured against the *current*
|
|
6
|
+
* period's included quota, so anything summed or peaked over a wider window
|
|
7
|
+
* bills a previous term's usage against this term's inclusions.
|
|
8
|
+
*
|
|
9
|
+
* Extracted from c4's billing tab so that surface, control-frontend and
|
|
10
|
+
* accounts-frontend cannot disagree about which days a figure covers — three
|
|
11
|
+
* copies of this arithmetic is how the same metric ends up with three different
|
|
12
|
+
* values depending on where a Camundi reads it.
|
|
13
|
+
*/
|
|
14
|
+
export interface EnterpriseTermWindow {
|
|
15
|
+
/** First day of the current period. Keeps the wall-clock time of the start date. */
|
|
16
|
+
periodStart: Date;
|
|
17
|
+
/** Last day of the current period (inclusive). */
|
|
18
|
+
periodEnd: Date;
|
|
19
|
+
/** How many full periods have elapsed since the contract started. */
|
|
20
|
+
completedPeriods: number;
|
|
21
|
+
/** First day of the next period. */
|
|
22
|
+
nextRenewal: Date;
|
|
23
|
+
/** Months elapsed at `periodStart`, i.e. the first month index of this period. */
|
|
24
|
+
startMonth: number;
|
|
25
|
+
/** Last month index of this period. */
|
|
26
|
+
endMonth: number;
|
|
27
|
+
}
|
|
28
|
+
/** Default contract length when the org carries no explicit duration. */
|
|
29
|
+
export declare const DEFAULT_ENTERPRISE_DURATION_IN_MONTHS = 12;
|
|
30
|
+
/**
|
|
31
|
+
* Add months, clamping to the end of the target month rather than rolling into
|
|
32
|
+
* the next one — `addMonthsClamped(Jan 31, 1)` is Feb 28/29, not Mar 2/3.
|
|
33
|
+
*
|
|
34
|
+
* Deliberately local-time (`getMonth`/`setMonth`), matching how contract dates
|
|
35
|
+
* are compared elsewhere; only the day-bucket comparison against HDP rows
|
|
36
|
+
* switches to UTC, via `toUtcDayStartMs`.
|
|
37
|
+
*/
|
|
38
|
+
export declare function addMonthsClamped(date: Date, months: number): Date;
|
|
39
|
+
/** Whole months between two dates, ignoring the day of month. */
|
|
40
|
+
export declare function diffInWholeMonths(start: Date, end: Date): number;
|
|
41
|
+
/**
|
|
42
|
+
* The UTC day `date` falls on, as epoch millis.
|
|
43
|
+
*
|
|
44
|
+
* HDP buckets usage per UTC day (a BigQuery DATE column, so every row's ts is
|
|
45
|
+
* UTC midnight), whereas a contract bound keeps the wall-clock time it was
|
|
46
|
+
* created at. Comparing the two directly drops the term's first day whenever the
|
|
47
|
+
* plan was created after midnight, so both sides collapse to a UTC day first.
|
|
48
|
+
*/
|
|
49
|
+
export declare function toUtcDayStartMs(date: Date): number;
|
|
50
|
+
/**
|
|
51
|
+
* Resolve the contract period that `now` falls in.
|
|
52
|
+
*
|
|
53
|
+
* `durationInMonths` falls back to 12 for anything non-positive or absent,
|
|
54
|
+
* matching what the billing surfaces already assumed. `null` is accepted as well
|
|
55
|
+
* as `undefined` because the accounts MobX model stores the field as
|
|
56
|
+
* `types.maybeNull(types.number)` while the DTO has it optional — callers
|
|
57
|
+
* shouldn't have to normalise that difference at every call site.
|
|
58
|
+
*
|
|
59
|
+
* A contract dated in the future resolves to its first period — nothing has been
|
|
60
|
+
* used before it starts, so there is no earlier window to report on.
|
|
61
|
+
*/
|
|
62
|
+
export declare function getCurrentEnterpriseTerm(options: {
|
|
63
|
+
startDate: Date;
|
|
64
|
+
durationInMonths?: number | null;
|
|
65
|
+
now?: Date;
|
|
66
|
+
}): EnterpriseTermWindow;
|
|
67
|
+
/**
|
|
68
|
+
* Peak value among the points inside `term`, or 0 when none fall in it.
|
|
69
|
+
*
|
|
70
|
+
* For a gauge like tenants the org's figure for a period is its highest daily
|
|
71
|
+
* reading, never a sum — and the reading has to come from *this* period. Both
|
|
72
|
+
* ends are inclusive and compared as UTC days, so the term's first and last day
|
|
73
|
+
* count regardless of the time of day the contract was created at.
|
|
74
|
+
*/
|
|
75
|
+
export declare function peakWithinTerm(points: readonly {
|
|
76
|
+
ts: number;
|
|
77
|
+
value: number;
|
|
78
|
+
}[], term: Pick<EnterpriseTermWindow, 'periodStart' | 'periodEnd'>): number;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
const DAY_MS = 24 * 60 * 60 * 1e3;
|
|
2
|
+
const DEFAULT_ENTERPRISE_DURATION_IN_MONTHS = 12;
|
|
3
|
+
function addMonthsClamped(date, months) {
|
|
4
|
+
const next = new Date(date.getTime());
|
|
5
|
+
const originalDay = next.getDate();
|
|
6
|
+
next.setMonth(next.getMonth() + months);
|
|
7
|
+
if (next.getDate() !== originalDay) {
|
|
8
|
+
next.setDate(0);
|
|
9
|
+
}
|
|
10
|
+
return next;
|
|
11
|
+
}
|
|
12
|
+
function diffInWholeMonths(start, end) {
|
|
13
|
+
return (end.getFullYear() - start.getFullYear()) * 12 + (end.getMonth() - start.getMonth());
|
|
14
|
+
}
|
|
15
|
+
function toUtcDayStartMs(date) {
|
|
16
|
+
return Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate());
|
|
17
|
+
}
|
|
18
|
+
function getCurrentEnterpriseTerm(options) {
|
|
19
|
+
const now = options.now ?? /* @__PURE__ */ new Date();
|
|
20
|
+
const durationInMonths = typeof options.durationInMonths === "number" && options.durationInMonths > 0 ? options.durationInMonths : DEFAULT_ENTERPRISE_DURATION_IN_MONTHS;
|
|
21
|
+
let completedPeriods = Math.max(
|
|
22
|
+
0,
|
|
23
|
+
Math.floor(
|
|
24
|
+
Math.abs(diffInWholeMonths(options.startDate, now)) / durationInMonths
|
|
25
|
+
)
|
|
26
|
+
);
|
|
27
|
+
const nowDay = toUtcDayStartMs(now);
|
|
28
|
+
const periodStartDay = (periods) => toUtcDayStartMs(
|
|
29
|
+
addMonthsClamped(options.startDate, periods * durationInMonths)
|
|
30
|
+
);
|
|
31
|
+
while (completedPeriods > 0 && periodStartDay(completedPeriods) > nowDay) {
|
|
32
|
+
completedPeriods -= 1;
|
|
33
|
+
}
|
|
34
|
+
while (periodStartDay(completedPeriods + 1) <= nowDay) {
|
|
35
|
+
completedPeriods += 1;
|
|
36
|
+
}
|
|
37
|
+
const periodStart = addMonthsClamped(
|
|
38
|
+
options.startDate,
|
|
39
|
+
completedPeriods * durationInMonths
|
|
40
|
+
);
|
|
41
|
+
const nextRenewal = addMonthsClamped(periodStart, durationInMonths);
|
|
42
|
+
const periodEnd = new Date(nextRenewal.getTime() - DAY_MS);
|
|
43
|
+
const startMonth = completedPeriods * durationInMonths;
|
|
44
|
+
return {
|
|
45
|
+
periodStart,
|
|
46
|
+
periodEnd,
|
|
47
|
+
completedPeriods,
|
|
48
|
+
nextRenewal,
|
|
49
|
+
startMonth,
|
|
50
|
+
endMonth: startMonth + (durationInMonths - 1)
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
function peakWithinTerm(points, term) {
|
|
54
|
+
const from = toUtcDayStartMs(term.periodStart);
|
|
55
|
+
const to = toUtcDayStartMs(term.periodEnd);
|
|
56
|
+
return points.reduce(
|
|
57
|
+
(peak, point) => point.ts >= from && point.ts <= to ? Math.max(peak, point.value) : peak,
|
|
58
|
+
0
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
export {
|
|
62
|
+
DEFAULT_ENTERPRISE_DURATION_IN_MONTHS,
|
|
63
|
+
addMonthsClamped,
|
|
64
|
+
diffInWholeMonths,
|
|
65
|
+
getCurrentEnterpriseTerm,
|
|
66
|
+
peakWithinTerm,
|
|
67
|
+
toUtcDayStartMs
|
|
68
|
+
};
|
|
69
|
+
//# sourceMappingURL=enterpriseTerm.utils.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/utils/enterpriseTerm.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\n/**\n * The enterprise contract period a usage figure belongs to.\n *\n * An enterprise contract starts at `enterpriseStartDate` and renews every\n * `enterpriseDurationInMonth` months. Usage is measured against the *current*\n * period's included quota, so anything summed or peaked over a wider window\n * bills a previous term's usage against this term's inclusions.\n *\n * Extracted from c4's billing tab so that surface, control-frontend and\n * accounts-frontend cannot disagree about which days a figure covers \u2014 three\n * copies of this arithmetic is how the same metric ends up with three different\n * values depending on where a Camundi reads it.\n */\nexport interface EnterpriseTermWindow {\n /** First day of the current period. Keeps the wall-clock time of the start date. */\n periodStart: Date\n /** Last day of the current period (inclusive). */\n periodEnd: Date\n /** How many full periods have elapsed since the contract started. */\n completedPeriods: number\n /** First day of the next period. */\n nextRenewal: Date\n /** Months elapsed at `periodStart`, i.e. the first month index of this period. */\n startMonth: number\n /** Last month index of this period. */\n endMonth: number\n}\n\nconst DAY_MS = 24 * 60 * 60 * 1000\n\n/** Default contract length when the org carries no explicit duration. */\nexport const DEFAULT_ENTERPRISE_DURATION_IN_MONTHS = 12\n\n/**\n * Add months, clamping to the end of the target month rather than rolling into\n * the next one \u2014 `addMonthsClamped(Jan 31, 1)` is Feb 28/29, not Mar 2/3.\n *\n * Deliberately local-time (`getMonth`/`setMonth`), matching how contract dates\n * are compared elsewhere; only the day-bucket comparison against HDP rows\n * switches to UTC, via `toUtcDayStartMs`.\n */\nexport function addMonthsClamped(date: Date, months: number): Date {\n const next = new Date(date.getTime())\n const originalDay = next.getDate()\n next.setMonth(next.getMonth() + months)\n\n if (next.getDate() !== originalDay) {\n next.setDate(0)\n }\n\n return next\n}\n\n/** Whole months between two dates, ignoring the day of month. */\nexport function diffInWholeMonths(start: Date, end: Date): number {\n return (\n (end.getFullYear() - start.getFullYear()) * 12 +\n (end.getMonth() - start.getMonth())\n )\n}\n\n/**\n * The UTC day `date` falls on, as epoch millis.\n *\n * HDP buckets usage per UTC day (a BigQuery DATE column, so every row's ts is\n * UTC midnight), whereas a contract bound keeps the wall-clock time it was\n * created at. Comparing the two directly drops the term's first day whenever the\n * plan was created after midnight, so both sides collapse to a UTC day first.\n */\nexport function toUtcDayStartMs(date: Date): number {\n return Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate())\n}\n\n/**\n * Resolve the contract period that `now` falls in.\n *\n * `durationInMonths` falls back to 12 for anything non-positive or absent,\n * matching what the billing surfaces already assumed. `null` is accepted as well\n * as `undefined` because the accounts MobX model stores the field as\n * `types.maybeNull(types.number)` while the DTO has it optional \u2014 callers\n * shouldn't have to normalise that difference at every call site.\n *\n * A contract dated in the future resolves to its first period \u2014 nothing has been\n * used before it starts, so there is no earlier window to report on.\n */\nexport function getCurrentEnterpriseTerm(options: {\n startDate: Date\n durationInMonths?: number | null\n now?: Date\n}): EnterpriseTermWindow {\n const now = options.now ?? new Date()\n const durationInMonths =\n typeof options.durationInMonths === 'number' && options.durationInMonths > 0\n ? options.durationInMonths\n : DEFAULT_ENTERPRISE_DURATION_IN_MONTHS\n\n // `diffInWholeMonths` ignores the day of month, so this is only an estimate:\n // for a contract starting the 15th, `now` on the 1st of an anniversary month\n // counts a full extra month and the estimate overshoots into a period that\n // hasn't started yet. `abs` keeps a future-dated contract off a negative index.\n let completedPeriods = Math.max(\n 0,\n Math.floor(\n Math.abs(diffInWholeMonths(options.startDate, now)) / durationInMonths,\n ),\n )\n\n // Correct the estimate against the real dates until `now` actually sits in the\n // period. Compared as UTC days so the renewal day belongs to the new period\n // rather than to neither \u2014 the same day granularity `peakWithinTerm` uses.\n // Both loops are bounded: the day-of-month error is under one month, so the\n // estimate is at most one period out either way.\n const nowDay = toUtcDayStartMs(now)\n const periodStartDay = (periods: number): number =>\n toUtcDayStartMs(\n addMonthsClamped(options.startDate, periods * durationInMonths),\n )\n\n while (completedPeriods > 0 && periodStartDay(completedPeriods) > nowDay) {\n completedPeriods -= 1\n }\n while (periodStartDay(completedPeriods + 1) <= nowDay) {\n completedPeriods += 1\n }\n\n const periodStart = addMonthsClamped(\n options.startDate,\n completedPeriods * durationInMonths,\n )\n const nextRenewal = addMonthsClamped(periodStart, durationInMonths)\n const periodEnd = new Date(nextRenewal.getTime() - DAY_MS)\n const startMonth = completedPeriods * durationInMonths\n\n return {\n periodStart,\n periodEnd,\n completedPeriods,\n nextRenewal,\n startMonth,\n endMonth: startMonth + (durationInMonths - 1),\n }\n}\n\n/**\n * Peak value among the points inside `term`, or 0 when none fall in it.\n *\n * For a gauge like tenants the org's figure for a period is its highest daily\n * reading, never a sum \u2014 and the reading has to come from *this* period. Both\n * ends are inclusive and compared as UTC days, so the term's first and last day\n * count regardless of the time of day the contract was created at.\n */\nexport function peakWithinTerm(\n points: readonly { ts: number; value: number }[],\n term: Pick<EnterpriseTermWindow, 'periodStart' | 'periodEnd'>,\n): number {\n const from = toUtcDayStartMs(term.periodStart)\n const to = toUtcDayStartMs(term.periodEnd)\n\n return points.reduce(\n (peak, point) =>\n point.ts >= from && point.ts <= to ? Math.max(peak, point.value) : peak,\n 0,\n )\n}\n"],
|
|
5
|
+
"mappings": "AAkCA,MAAM,SAAS,KAAK,KAAK,KAAK;AAGvB,MAAM,wCAAwC;AAU9C,SAAS,iBAAiB,MAAY,QAAsB;AACjE,QAAM,OAAO,IAAI,KAAK,KAAK,QAAQ,CAAC;AACpC,QAAM,cAAc,KAAK,QAAQ;AACjC,OAAK,SAAS,KAAK,SAAS,IAAI,MAAM;AAEtC,MAAI,KAAK,QAAQ,MAAM,aAAa;AAClC,SAAK,QAAQ,CAAC;AAAA,EAChB;AAEA,SAAO;AACT;AAGO,SAAS,kBAAkB,OAAa,KAAmB;AAChE,UACG,IAAI,YAAY,IAAI,MAAM,YAAY,KAAK,MAC3C,IAAI,SAAS,IAAI,MAAM,SAAS;AAErC;AAUO,SAAS,gBAAgB,MAAoB;AAClD,SAAO,KAAK,IAAI,KAAK,eAAe,GAAG,KAAK,YAAY,GAAG,KAAK,WAAW,CAAC;AAC9E;AAcO,SAAS,yBAAyB,SAIhB;AACvB,QAAM,MAAM,QAAQ,OAAO,oBAAI,KAAK;AACpC,QAAM,mBACJ,OAAO,QAAQ,qBAAqB,YAAY,QAAQ,mBAAmB,IACvE,QAAQ,mBACR;AAMN,MAAI,mBAAmB,KAAK;AAAA,IAC1B;AAAA,IACA,KAAK;AAAA,MACH,KAAK,IAAI,kBAAkB,QAAQ,WAAW,GAAG,CAAC,IAAI;AAAA,IACxD;AAAA,EACF;AAOA,QAAM,SAAS,gBAAgB,GAAG;AAClC,QAAM,iBAAiB,CAAC,YACtB;AAAA,IACE,iBAAiB,QAAQ,WAAW,UAAU,gBAAgB;AAAA,EAChE;AAEF,SAAO,mBAAmB,KAAK,eAAe,gBAAgB,IAAI,QAAQ;AACxE,wBAAoB;AAAA,EACtB;AACA,SAAO,eAAe,mBAAmB,CAAC,KAAK,QAAQ;AACrD,wBAAoB;AAAA,EACtB;AAEA,QAAM,cAAc;AAAA,IAClB,QAAQ;AAAA,IACR,mBAAmB;AAAA,EACrB;AACA,QAAM,cAAc,iBAAiB,aAAa,gBAAgB;AAClE,QAAM,YAAY,IAAI,KAAK,YAAY,QAAQ,IAAI,MAAM;AACzD,QAAM,aAAa,mBAAmB;AAEtC,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU,cAAc,mBAAmB;AAAA,EAC7C;AACF;AAUO,SAAS,eACd,QACA,MACQ;AACR,QAAM,OAAO,gBAAgB,KAAK,WAAW;AAC7C,QAAM,KAAK,gBAAgB,KAAK,SAAS;AAEzC,SAAO,OAAO;AAAA,IACZ,CAAC,MAAM,UACL,MAAM,MAAM,QAAQ,MAAM,MAAM,KAAK,KAAK,IAAI,MAAM,MAAM,KAAK,IAAI;AAAA,IACrE;AAAA,EACF;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The three IAM principals that need access to a BYOK cluster's KMS keys after
|
|
3
|
+
* a failover. All three live in the failover region's account — the same
|
|
4
|
+
* account as the failover cluster's own role.
|
|
5
|
+
*/
|
|
6
|
+
export interface FailoverKeyPolicyPrincipals {
|
|
7
|
+
/** Reads the source cluster's secondary bucket during the BucketClone. */
|
|
8
|
+
cloneRole: string;
|
|
9
|
+
/** The failover cluster's own access to its new primary bucket. */
|
|
10
|
+
clusterRole: string;
|
|
11
|
+
/** Replicates the new primary bucket back out to its secondary. */
|
|
12
|
+
replicationRole: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Derive the three principals a customer must add to both KMS key policies
|
|
16
|
+
* after a failover, from the failover cluster's own role ARN and the stableId
|
|
17
|
+
* carried over from its source.
|
|
18
|
+
*
|
|
19
|
+
* The clone role is pre-staged as `clone-backup-<stableId>`, and the
|
|
20
|
+
* replication role is the cluster role with a `-replication` suffix — so the
|
|
21
|
+
* account parsed out of the cluster role ARN is all that is needed.
|
|
22
|
+
*
|
|
23
|
+
* Returns `undefined` when either input is missing or the role ARN is not in
|
|
24
|
+
* the expected shape, so callers render nothing rather than a wrong ARN.
|
|
25
|
+
*/
|
|
26
|
+
export declare function deriveFailoverKeyPolicyPrincipals(clusterRoleArn: string | undefined, stableId: string | undefined): FailoverKeyPolicyPrincipals | undefined;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const CLUSTER_ROLE_ARN = /^arn:aws:iam::(?<account>\d{12}):role\/c8-cluster\/c8-apps-(?<uuid>[0-9a-f-]{36})$/u;
|
|
2
|
+
function deriveFailoverKeyPolicyPrincipals(clusterRoleArn, stableId) {
|
|
3
|
+
if (!clusterRoleArn || !stableId) return void 0;
|
|
4
|
+
const account = CLUSTER_ROLE_ARN.exec(clusterRoleArn)?.groups?.account;
|
|
5
|
+
if (!account) return void 0;
|
|
6
|
+
return {
|
|
7
|
+
cloneRole: `arn:aws:iam::${account}:role/c8-cluster/clone-backup-${stableId}`,
|
|
8
|
+
clusterRole: clusterRoleArn,
|
|
9
|
+
replicationRole: `${clusterRoleArn}-replication`
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
deriveFailoverKeyPolicyPrincipals
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=failoverKeyPolicy.utils.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/utils/failoverKeyPolicy.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\n/**\n * The cluster's own IAM role ARN, surfaced by the operator on the ZeebeCluster\n * `status.accountId` field (the name is historical \u2014 the value is a role ARN,\n * not a bare account id):\n *\n * arn:aws:iam::<account>:role/c8-cluster/c8-apps-<clusterUuid>\n */\nconst CLUSTER_ROLE_ARN =\n /^arn:aws:iam::(?<account>\\d{12}):role\\/c8-cluster\\/c8-apps-(?<uuid>[0-9a-f-]{36})$/u\n\n/**\n * The three IAM principals that need access to a BYOK cluster's KMS keys after\n * a failover. All three live in the failover region's account \u2014 the same\n * account as the failover cluster's own role.\n */\nexport interface FailoverKeyPolicyPrincipals {\n /** Reads the source cluster's secondary bucket during the BucketClone. */\n cloneRole: string\n /** The failover cluster's own access to its new primary bucket. */\n clusterRole: string\n /** Replicates the new primary bucket back out to its secondary. */\n replicationRole: string\n}\n\n/**\n * Derive the three principals a customer must add to both KMS key policies\n * after a failover, from the failover cluster's own role ARN and the stableId\n * carried over from its source.\n *\n * The clone role is pre-staged as `clone-backup-<stableId>`, and the\n * replication role is the cluster role with a `-replication` suffix \u2014 so the\n * account parsed out of the cluster role ARN is all that is needed.\n *\n * Returns `undefined` when either input is missing or the role ARN is not in\n * the expected shape, so callers render nothing rather than a wrong ARN.\n */\nexport function deriveFailoverKeyPolicyPrincipals(\n clusterRoleArn: string | undefined,\n stableId: string | undefined,\n): FailoverKeyPolicyPrincipals | undefined {\n if (!clusterRoleArn || !stableId) return undefined\n\n const account = CLUSTER_ROLE_ARN.exec(clusterRoleArn)?.groups?.account\n if (!account) return undefined\n\n return {\n cloneRole: `arn:aws:iam::${account}:role/c8-cluster/clone-backup-${stableId}`,\n clusterRole: clusterRoleArn,\n replicationRole: `${clusterRoleArn}-replication`,\n }\n}\n"],
|
|
5
|
+
"mappings": "AAaA,MAAM,mBACJ;AA4BK,SAAS,kCACd,gBACA,UACyC;AACzC,MAAI,CAAC,kBAAkB,CAAC,SAAU,QAAO;AAEzC,QAAM,UAAU,iBAAiB,KAAK,cAAc,GAAG,QAAQ;AAC/D,MAAI,CAAC,QAAS,QAAO;AAErB,SAAO;AAAA,IACL,WAAW,gBAAgB,OAAO,iCAAiC,QAAQ;AAAA,IAC3E,aAAa;AAAA,IACb,iBAAiB,GAAG,cAAc;AAAA,EACpC;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/package.json
CHANGED