@camunda/ccma-shared-types 10.12.1 → 10.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_tests/utils/objectPath.utils.spec.d.ts +1 -0
- package/dist/approvals/approval-rules.d.ts +3 -0
- package/dist/approvals/approval-rules.js +1 -0
- package/dist/approvals/approval-rules.js.map +2 -2
- package/dist/approvals/use-cases.const.d.ts +7 -0
- package/dist/approvals/use-cases.const.js +7 -1
- package/dist/approvals/use-cases.const.js.map +2 -2
- package/dist/config/camundi-permission-rules.js +8 -1
- package/dist/config/camundi-permission-rules.js.map +2 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +10 -0
- package/dist/index.js.map +2 -2
- package/dist/permissions/accounts.permissions.d.ts +7 -0
- package/dist/permissions/accounts.permissions.js +7 -0
- package/dist/permissions/accounts.permissions.js.map +2 -2
- package/dist/types/ClusterPlanFields.type.d.ts +3 -1
- package/dist/types/ClusterPlanFields.type.js +19 -0
- package/dist/types/ClusterPlanFields.type.js.map +2 -2
- package/dist/types/Roles.d.ts +1 -1
- package/dist/types/Roles.js.map +2 -2
- package/dist/utils/jvmOptions.d.ts +20 -0
- package/dist/utils/jvmOptions.js +24 -0
- package/dist/utils/jvmOptions.js.map +2 -2
- package/dist/utils/objectPath.utils.d.ts +6 -0
- package/dist/utils/objectPath.utils.js +10 -0
- package/dist/utils/objectPath.utils.js.map +7 -0
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/types/ClusterPlanFields.type.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 { parseEnvVars } from '../utils/envVars.js'\n\n/**\n * Field specification for a cluster plan config: one entry per configurable\n * leaf, mirroring the shape of the `plan` object stored on a cluster plan.\n *\n * It drives the per-field create/edit forms in the admin frontends (accounts\n * `Create Cluster Plan`, control `Create cluster plan`) so a plan can be filled\n * in field by field instead of hand-writing JSON \u2014 the descriptions, input\n * types and validators live here rather than in either app.\n */\nexport interface ClusterPlanFieldSpec {\n type: 'text' | 'number' | 'textarea' | 'checkbox'\n description: string\n placeholder?: string\n validator: (value: any) => boolean\n /** Only settable on a cluster (modification), not on a cluster plan. */\n notOnClusterPlan?: boolean\n}\n\n/** A nested group of field specs, keyed like the config object itself. */\nexport interface ClusterPlanFieldTree {\n [key: string]: ClusterPlanFieldSpec | ClusterPlanFieldTree\n}\n\n/** Narrow a node of the tree to a leaf field spec. */\nexport const isClusterPlanFieldSpec = (\n node: ClusterPlanFieldSpec | ClusterPlanFieldTree,\n): node is ClusterPlanFieldSpec => typeof node.type === 'string'\n\n// A k8s quantity: a number, then an optional unit suffix (`Gi`, `Mi`, `m`, \u2026)\n// or exponent (`e-3`). The suffix must start with a letter or a sign so the\n// digits of the number cannot also be matched by the suffix \u2014 an ambiguity that\n// made the previous form backtrack quadratically on input like `.0000000000x`.\nconst quantityRegexp =\n /^[+-]?[0-9.]+([BeEinumkKMGTP]+[-+]?[0-9]*|[-+][0-9]+)?$/u\nconst thresholdRegexp = /^[0-9]{1,3}%$/u\n\nconst numberValidator = (val: any) => {\n const num = Number(val)\n return !Number.isNaN(num)\n}\n\nconst notEmptyStringValidator = (val: string) => {\n return val !== undefined && val.length > 0\n}\n\nconst numberMin1Validator = (val: any) => {\n return numberValidator(val) && Number(val) > 0\n}\n\nconst numberMin0OrUndefinedValidator = (val: any) => {\n return !val || (numberValidator(val) && Number(val) >= 0)\n}\n\nconst thresholdValidator = (val: string) => {\n return thresholdRegexp.test(val)\n}\n\nconst quantityValidator = (val: string) => {\n return quantityRegexp.test(val)\n}\n\nconst envVarsValidator = (val: string | undefined) => {\n if (!val || val.trim() === '') return true\n return parseEnvVars(val).length > 0\n}\n\nconst undefinedOrQuantityValidator = (val: string) => {\n return val === undefined || val === '' || quantityValidator(val)\n}\n\nconst undefinedOrEnvVarsValidator = (val: string | undefined) => {\n return envVarsValidator(val)\n}\nconst undefinedOrBooleanStringValidator = (val: any) => {\n return val === undefined || typeof val === 'boolean'\n}\n\nexport const CLUSTER_PLAN_FIELDS: ClusterPlanFieldTree = {\n gateway: {\n replicas: {\n type: 'number',\n placeholder: 'e.g. 1',\n validator: numberMin0OrUndefinedValidator,\n description: 'the replication for gateway',\n },\n resources: {\n limits: {\n memory: {\n type: 'text',\n placeholder: 'e.g. 150Mi',\n validator: undefinedOrQuantityValidator,\n description: 'Memory limit of a gateway pod, e.g. 150Mi, 2Gi',\n },\n cpu: {\n type: 'text',\n placeholder: 'e.g. 200m',\n validator: undefinedOrQuantityValidator,\n description: 'CPU limit of a gateway pod, e.g. 150m, 0.5, 1',\n },\n },\n requests: {\n memory: {\n type: 'text',\n placeholder: 'e.g. 150Mi',\n validator: undefinedOrQuantityValidator,\n description: 'Memory request of a gateway pod, e.g. 150Mi, 2Gi',\n },\n cpu: {\n type: 'text',\n placeholder: 'e.g. 200m',\n validator: undefinedOrQuantityValidator,\n description: 'CPU request of a gateway pod, e.g. 150m, 0.5, 1',\n },\n },\n },\n dataRetentionDays: {\n notOnClusterPlan: true,\n type: 'number',\n placeholder: 'e.g. 7',\n validator: numberMin0OrUndefinedValidator,\n description: 'number of days for gateway retention',\n },\n envVars: {\n type: 'textarea',\n placeholder: 'e.g. TEST=123',\n validator: undefinedOrEnvVarsValidator,\n description: 'env vars going into the system, no linebreakes are allowed',\n },\n },\n zeebe: {\n broker: {\n clusterSize: {\n type: 'number',\n description: 'the amount of borkers',\n placeholder: 'e.g. 1',\n validator: numberMin1Validator,\n },\n replicationFactor: {\n type: 'number',\n placeholder: 'e.g. 1',\n description: 'the replication factor configured into the zeebe nodes',\n validator: numberMin1Validator,\n },\n partitionsCount: {\n type: 'number',\n placeholder: 'e.g. 1',\n description: 'the number of partitions configured into the zeebe nodes',\n validator: numberMin1Validator,\n },\n storage: {\n storageClassName: {\n type: 'text',\n placeholder: 'e.g. fast-v2',\n validator: notEmptyStringValidator,\n description:\n 'This needs to be set to a storageclass present in the k8s system. Can not be undefined if one value in storage: is set',\n },\n resources: {\n requests: {\n storage: {\n type: 'text',\n placeholder: 'e.g. 1GiB',\n validator: quantityValidator,\n description: 'The initial storage size of the statefulset',\n },\n },\n limits: {\n storage: {\n type: 'text',\n placeholder: 'e.g. 1GiB',\n validator: quantityValidator,\n description: 'The upper limit the pvc autoscaler can scale up to',\n },\n },\n },\n autoResizing: {\n threshold: {\n type: 'text',\n placeholder: 'e.g. 10%',\n validator: thresholdValidator,\n description:\n 'The free space percentage threshold where vpc autoscaling will kicks in. (example 10%)',\n },\n increase: {\n type: 'text',\n placeholder: 'e.g. 1GiB',\n validator: quantityValidator,\n description:\n 'The amount of disk space which is added as soon as autoscaling kicks in. (example 2Gi)',\n },\n },\n },\n resources: {\n limits: {\n memory: {\n type: 'text',\n placeholder: 'e.g. 150Mi',\n validator: undefinedOrQuantityValidator,\n description: 'Memory limit of a zeebe broker, e.g. 150Mi, 2Gi',\n },\n cpu: {\n type: 'text',\n placeholder: 'e.g. 200m',\n validator: undefinedOrQuantityValidator,\n description: 'CPU limit of a zeebe broker, e.g. 150m, 0.5, 1',\n },\n },\n requests: {\n memory: {\n type: 'text',\n placeholder: 'e.g. 150Mi',\n validator: undefinedOrQuantityValidator,\n description: 'Memory request of a zeebe broker, e.g. 150Mi, 2Gi',\n },\n cpu: {\n type: 'text',\n placeholder: 'e.g. 200m',\n validator: undefinedOrQuantityValidator,\n description: 'CPU request of a zeebe broker, e.g. 150m, 0.5, 1',\n },\n },\n },\n envVars: {\n type: 'textarea',\n placeholder: 'e.g. TEST=123',\n validator: undefinedOrEnvVarsValidator,\n description:\n 'env vars going into the system, no linebreakes are allowed',\n },\n dataRetentionDays: {\n notOnClusterPlan: true,\n type: 'number',\n placeholder: 'e.g. 7',\n validator: numberMin0OrUndefinedValidator,\n description: 'number of days for zeebe broker retention',\n },\n },\n gateway: {\n replicas: {\n type: 'number',\n placeholder: 'e.g. 0',\n validator: numberValidator,\n description: 'number of gateways',\n },\n standalone: {\n type: 'checkbox',\n placeholder: undefined,\n validator: undefinedOrBooleanStringValidator,\n description: 'if this is a standalone gateway',\n },\n backend: {\n resources: {\n limits: {\n memory: {\n type: 'text',\n placeholder: 'e.g. 150Mi',\n validator: undefinedOrQuantityValidator,\n description: 'Memory limit of an gateway pod, e.g. 150Mi, 2Gi',\n },\n cpu: {\n type: 'text',\n placeholder: 'e.g. 200m',\n validator: undefinedOrQuantityValidator,\n description: 'CPU limit of an gateway pod, e.g. 150m, 0.5, 1',\n },\n },\n requests: {\n memory: {\n type: 'text',\n placeholder: 'e.g. 150Mi',\n validator: undefinedOrQuantityValidator,\n description: 'Memory request of an gateway pod, e.g. 150Mi, 2Gi',\n },\n cpu: {\n type: 'text',\n placeholder: 'e.g. 200m',\n validator: undefinedOrQuantityValidator,\n description: 'CPU request of a an gateway pod, e.g. 150m, 0.5, 1',\n },\n },\n },\n envVars: {\n type: 'textarea',\n placeholder: 'e.g. TEST=123',\n validator: undefinedOrEnvVarsValidator,\n description:\n 'env vars going into the system, no linebreakes are allowed',\n },\n },\n },\n },\n operate: {\n backend: {\n resources: {\n limits: {\n memory: {\n type: 'text',\n placeholder: 'e.g. 150Mi',\n validator: undefinedOrQuantityValidator,\n description: 'Memory limit of an operate pod, e.g. 150Mi, 2Gi',\n },\n cpu: {\n type: 'text',\n placeholder: 'e.g. 200m',\n validator: undefinedOrQuantityValidator,\n description: 'CPU limit of an operate pod, e.g. 150m, 0.5, 1',\n },\n },\n requests: {\n memory: {\n type: 'text',\n placeholder: 'e.g. 150Mi',\n validator: undefinedOrQuantityValidator,\n description: 'Memory request of an operate pod, e.g. 150Mi, 2Gi',\n },\n cpu: {\n type: 'text',\n placeholder: 'e.g. 200m',\n validator: undefinedOrQuantityValidator,\n description: 'CPU request of a an operate pod, e.g. 150m, 0.5, 1',\n },\n },\n },\n envVars: {\n type: 'textarea',\n placeholder: 'e.g. TEST=123',\n validator: undefinedOrEnvVarsValidator,\n description:\n 'env vars going into the system, no linebreakes are allowed',\n },\n },\n replicas: {\n type: 'number',\n placeholder: 'e.g. 1',\n validator: numberMin1Validator,\n description: 'the replication for operate',\n },\n dataRetentionDays: {\n notOnClusterPlan: true,\n type: 'number',\n placeholder: 'e.g. 7',\n validator: numberMin0OrUndefinedValidator,\n description: 'number of days for operate retention',\n },\n },\n elasticsearch: {\n resources: {\n limits: {\n memory: {\n type: 'text',\n placeholder: 'e.g. 150Mi',\n validator: undefinedOrQuantityValidator,\n description: 'Memory limit of an elastic node, e.g. 150Mi, 2Gi',\n },\n cpu: {\n type: 'text',\n placeholder: 'e.g. 200m',\n validator: undefinedOrQuantityValidator,\n description: 'CPU limit of an elastic node, e.g. 150m, 0.5, 1',\n },\n },\n requests: {\n memory: {\n type: 'text',\n placeholder: 'e.g. 150Mi',\n validator: undefinedOrQuantityValidator,\n description: 'Memory request of an elastic node, e.g. 150Mi, 2Gi',\n },\n cpu: {\n type: 'text',\n placeholder: 'e.g. 200m',\n validator: undefinedOrQuantityValidator,\n description: 'CPU request of a an elastic node, e.g. 150m, 0.5, 1',\n },\n },\n },\n config: {\n nodesCount: {\n type: 'number',\n placeholder: 'e.g. 1',\n validator: numberMin1Validator,\n description:\n 'The count of elasticsearch nodes - e.g. how many pods it runs, if its value is more than 1 it is deployed through the elastic-operator',\n },\n storage: {\n storageClassName: {\n type: 'text',\n placeholder: 'e.g. fast-v2',\n validator: notEmptyStringValidator,\n description:\n 'This needs to be set to a storageclass present in the k8s system. Can not be undefined if one value in storage: is set',\n },\n resources: {\n requests: {\n storage: {\n type: 'text',\n placeholder: 'e.g. 1GiB',\n validator: quantityValidator,\n description: 'The initial storage size of the statefulset',\n },\n },\n limits: {\n storage: {\n type: 'text',\n placeholder: 'e.g. 1GiB',\n validator: undefinedOrQuantityValidator,\n description: 'The upper limit the pvc autoscaler can scale up to',\n },\n },\n },\n autoResizing: {\n threshold: {\n type: 'text',\n placeholder: 'e.g. 10%',\n validator: thresholdValidator,\n description:\n 'The free space percentage threshold where pvc autoscaling kicks in. (example 10%)',\n },\n increase: {\n type: 'text',\n placeholder: 'e.g. 1GiB',\n validator: quantityValidator,\n description:\n 'The amount of disk space which is added as soon as autoscaling kicks in. (example 2Gi)',\n },\n },\n },\n },\n },\n tasklist: {\n backend: {\n resources: {\n limits: {\n memory: {\n type: 'text',\n placeholder: 'e.g. 150Mi',\n validator: undefinedOrQuantityValidator,\n description: 'Memory limit of a tasklist pod, e.g. 150Mi, 2Gi',\n },\n cpu: {\n type: 'text',\n placeholder: 'e.g. 200m',\n validator: undefinedOrQuantityValidator,\n description: 'CPU limit of a tasklist pod, e.g. 150m, 0.5, 1',\n },\n },\n requests: {\n memory: {\n type: 'text',\n placeholder: 'e.g. 150Mi',\n validator: undefinedOrQuantityValidator,\n description: 'Memory request of a tasklist pod, e.g. 150Mi, 2Gi',\n },\n cpu: {\n type: 'text',\n placeholder: 'e.g. 200m',\n validator: undefinedOrQuantityValidator,\n description: 'CPU request of a a tasklist pod, e.g. 150m, 0.5, 1',\n },\n },\n },\n envVars: {\n type: 'textarea',\n placeholder: 'e.g. TEST=123',\n validator: undefinedOrEnvVarsValidator,\n description:\n 'env vars going into the system, no linebreakes are allowed',\n },\n },\n replicas: {\n type: 'number',\n placeholder: 'e.g. 1',\n validator: numberMin0OrUndefinedValidator,\n description: 'the replication for tasklist',\n },\n dataRetentionDays: {\n notOnClusterPlan: true,\n type: 'number',\n placeholder: 'e.g. 7',\n validator: numberMin0OrUndefinedValidator,\n description: 'number of days for tasklist retention',\n },\n },\n optimize: {\n backend: {\n resources: {\n limits: {\n memory: {\n type: 'text',\n placeholder: 'e.g. 150Mi',\n validator: undefinedOrQuantityValidator,\n description: 'Memory limit of a optimize pod, e.g. 150Mi, 2Gi',\n },\n cpu: {\n type: 'text',\n placeholder: 'e.g. 200m',\n validator: undefinedOrQuantityValidator,\n description: 'CPU limit of a optimize pod, e.g. 150m, 0.5, 1',\n },\n },\n requests: {\n memory: {\n type: 'text',\n placeholder: 'e.g. 150Mi',\n validator: undefinedOrQuantityValidator,\n description: 'Memory request of a optimize pod, e.g. 150Mi, 2Gi',\n },\n cpu: {\n type: 'text',\n placeholder: 'e.g. 200m',\n validator: undefinedOrQuantityValidator,\n description: 'CPU request of a a optimize pod, e.g. 150m, 0.5, 1',\n },\n },\n },\n envVars: {\n type: 'textarea',\n placeholder: 'e.g. TEST=123',\n validator: undefinedOrEnvVarsValidator,\n description:\n 'env vars going into the system, no linebreakes are allowed',\n },\n },\n replicas: {\n type: 'number',\n placeholder: 'e.g. 1',\n validator: numberMin0OrUndefinedValidator,\n description: 'the replication for optimize',\n },\n dataRetentionDays: {\n notOnClusterPlan: true,\n type: 'number',\n placeholder: 'e.g. 7',\n validator: numberMin0OrUndefinedValidator,\n description: 'number of days for optimize retention',\n },\n },\n zeebeAnalytics: {\n backend: {\n resources: {\n limits: {\n memory: {\n type: 'text',\n placeholder: 'e.g. 150Mi',\n validator: undefinedOrQuantityValidator,\n description:\n 'Memory limit of a zeebeAnalytics pod, e.g. 150Mi, 2Gi',\n },\n cpu: {\n type: 'text',\n placeholder: 'e.g. 200m',\n validator: undefinedOrQuantityValidator,\n description: 'CPU limit of a zeebeAnalytics pod, e.g. 150m, 0.5, 1',\n },\n },\n requests: {\n memory: {\n type: 'text',\n placeholder: 'e.g. 150Mi',\n validator: undefinedOrQuantityValidator,\n description:\n 'Memory request of a zeebeAnalytics pod, e.g. 150Mi, 2Gi',\n },\n cpu: {\n type: 'text',\n placeholder: 'e.g. 200m',\n validator: undefinedOrQuantityValidator,\n description:\n 'CPU request of a a zeebeAnalytics pod, e.g. 150m, 0.5, 1',\n },\n },\n },\n envVars: {\n type: 'textarea',\n placeholder: 'e.g. TEST=123',\n validator: undefinedOrEnvVarsValidator,\n description:\n 'env vars going into the system, no linebreakes are allowed',\n },\n },\n replicas: {\n type: 'number',\n placeholder: 'e.g. 1',\n validator: numberMin0OrUndefinedValidator,\n description: 'the replication for zeebeAnalytics',\n },\n },\n connectorBridge: {\n backend: {\n resources: {\n limits: {\n memory: {\n type: 'text',\n placeholder: 'e.g. 150Mi',\n validator: undefinedOrQuantityValidator,\n description:\n 'Memory limit of a connectorBridge pod, e.g. 150Mi, 2Gi',\n },\n cpu: {\n type: 'text',\n placeholder: 'e.g. 200m',\n validator: undefinedOrQuantityValidator,\n description:\n 'CPU limit of a connectorBridge pod, e.g. 150m, 0.5, 1',\n },\n },\n requests: {\n memory: {\n type: 'text',\n placeholder: 'e.g. 150Mi',\n validator: undefinedOrQuantityValidator,\n description:\n 'Memory request of a connectorBridge pod, e.g. 150Mi, 2Gi',\n },\n cpu: {\n type: 'text',\n placeholder: 'e.g. 200m',\n validator: undefinedOrQuantityValidator,\n description:\n 'CPU request of a a connectorBridge pod, e.g. 150m, 0.5, 1',\n },\n },\n },\n envVars: {\n type: 'textarea',\n placeholder: 'e.g. TEST=123',\n validator: undefinedOrEnvVarsValidator,\n description:\n 'env vars going into the system, no linebreakes are allowed',\n },\n },\n replicas: {\n type: 'number',\n placeholder: 'e.g. 1',\n validator: numberMin0OrUndefinedValidator,\n description: 'the replication for connectorBridge',\n },\n },\n reconciliation: {\n paused: {\n notOnClusterPlan: true,\n type: 'checkbox',\n placeholder: undefined,\n validator: undefinedOrBooleanStringValidator,\n description: 'pause reconciliation of the cluster CRD',\n },\n },\n}\n"],
|
|
5
|
-
"mappings": "AAMA,SAAS,oBAAoB;
|
|
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 { parseEnvVars } from '../utils/envVars.js'\nimport { isValidJvmOptionsPlanValue } from '../utils/jvmOptions.js'\n\n/**\n * Field specification for a cluster plan config: one entry per configurable\n * leaf, mirroring the shape of the `plan` object stored on a cluster plan.\n *\n * It drives the per-field create/edit forms in the admin frontends (accounts\n * `Create Cluster Plan`, control `Create cluster plan`) so a plan can be filled\n * in field by field instead of hand-writing JSON \u2014 the descriptions, input\n * types and validators live here rather than in either app.\n */\nexport interface ClusterPlanFieldSpec {\n type: 'text' | 'number' | 'textarea' | 'checkbox' | 'jvmOptions'\n description: string\n placeholder?: string\n validator: (value: any) => boolean\n /** The accessible name of a field that has no visible label of its own. */\n label?: string\n /** Only settable on a cluster (modification), not on a cluster plan. */\n notOnClusterPlan?: boolean\n}\n\n/** A nested group of field specs, keyed like the config object itself. */\nexport interface ClusterPlanFieldTree {\n [key: string]: ClusterPlanFieldSpec | ClusterPlanFieldTree\n}\n\n/** Narrow a node of the tree to a leaf field spec. */\nexport const isClusterPlanFieldSpec = (\n node: ClusterPlanFieldSpec | ClusterPlanFieldTree,\n): node is ClusterPlanFieldSpec => typeof node.type === 'string'\n\n// A k8s quantity: a number, then an optional unit suffix (`Gi`, `Mi`, `m`, \u2026)\n// or exponent (`e-3`). The suffix must start with a letter or a sign so the\n// digits of the number cannot also be matched by the suffix \u2014 an ambiguity that\n// made the previous form backtrack quadratically on input like `.0000000000x`.\nconst quantityRegexp =\n /^[+-]?[0-9.]+([BeEinumkKMGTP]+[-+]?[0-9]*|[-+][0-9]+)?$/u\nconst thresholdRegexp = /^[0-9]{1,3}%$/u\n\nconst numberValidator = (val: any) => {\n const num = Number(val)\n return !Number.isNaN(num)\n}\n\nconst notEmptyStringValidator = (val: string) => {\n return val !== undefined && val.length > 0\n}\n\nconst numberMin1Validator = (val: any) => {\n return numberValidator(val) && Number(val) > 0\n}\n\nconst numberMin0OrUndefinedValidator = (val: any) => {\n return !val || (numberValidator(val) && Number(val) >= 0)\n}\n\nconst thresholdValidator = (val: string) => {\n return thresholdRegexp.test(val)\n}\n\nconst quantityValidator = (val: string) => {\n return quantityRegexp.test(val)\n}\n\nconst envVarsValidator = (val: string | undefined) => {\n if (!val || val.trim() === '') return true\n return parseEnvVars(val).length > 0\n}\n\nconst undefinedOrQuantityValidator = (val: string) => {\n return val === undefined || val === '' || quantityValidator(val)\n}\n\nconst undefinedOrEnvVarsValidator = (val: string | undefined) => {\n return envVarsValidator(val)\n}\nconst undefinedOrBooleanStringValidator = (val: any) => {\n return val === undefined || typeof val === 'boolean'\n}\n\nexport const CLUSTER_PLAN_FIELDS: ClusterPlanFieldTree = {\n gateway: {\n replicas: {\n type: 'number',\n placeholder: 'e.g. 1',\n validator: numberMin0OrUndefinedValidator,\n description: 'the replication for gateway',\n },\n resources: {\n limits: {\n memory: {\n type: 'text',\n placeholder: 'e.g. 150Mi',\n validator: undefinedOrQuantityValidator,\n description: 'Memory limit of a gateway pod, e.g. 150Mi, 2Gi',\n },\n cpu: {\n type: 'text',\n placeholder: 'e.g. 200m',\n validator: undefinedOrQuantityValidator,\n description: 'CPU limit of a gateway pod, e.g. 150m, 0.5, 1',\n },\n },\n requests: {\n memory: {\n type: 'text',\n placeholder: 'e.g. 150Mi',\n validator: undefinedOrQuantityValidator,\n description: 'Memory request of a gateway pod, e.g. 150Mi, 2Gi',\n },\n cpu: {\n type: 'text',\n placeholder: 'e.g. 200m',\n validator: undefinedOrQuantityValidator,\n description: 'CPU request of a gateway pod, e.g. 150m, 0.5, 1',\n },\n },\n },\n dataRetentionDays: {\n notOnClusterPlan: true,\n type: 'number',\n placeholder: 'e.g. 7',\n validator: numberMin0OrUndefinedValidator,\n description: 'number of days for gateway retention',\n },\n envVars: {\n type: 'textarea',\n placeholder: 'e.g. TEST=123',\n validator: undefinedOrEnvVarsValidator,\n description: 'env vars going into the system, no linebreakes are allowed',\n },\n jvm: {\n options: {\n type: 'jvmOptions',\n label: 'Camunda gateway JVM flags',\n placeholder: 'e.g. -XX:+UseG1GC',\n validator: isValidJvmOptionsPlanValue,\n description:\n 'JVM flags for the Camunda gateway, only for 8.9 and later, with operator 2.28.1 or later. A flag replaces the flag with the same name from the env vars, and all other flags stay.',\n },\n },\n },\n zeebe: {\n broker: {\n clusterSize: {\n type: 'number',\n description: 'the amount of borkers',\n placeholder: 'e.g. 1',\n validator: numberMin1Validator,\n },\n replicationFactor: {\n type: 'number',\n placeholder: 'e.g. 1',\n description: 'the replication factor configured into the zeebe nodes',\n validator: numberMin1Validator,\n },\n partitionsCount: {\n type: 'number',\n placeholder: 'e.g. 1',\n description: 'the number of partitions configured into the zeebe nodes',\n validator: numberMin1Validator,\n },\n storage: {\n storageClassName: {\n type: 'text',\n placeholder: 'e.g. fast-v2',\n validator: notEmptyStringValidator,\n description:\n 'This needs to be set to a storageclass present in the k8s system. Can not be undefined if one value in storage: is set',\n },\n resources: {\n requests: {\n storage: {\n type: 'text',\n placeholder: 'e.g. 1GiB',\n validator: quantityValidator,\n description: 'The initial storage size of the statefulset',\n },\n },\n limits: {\n storage: {\n type: 'text',\n placeholder: 'e.g. 1GiB',\n validator: quantityValidator,\n description: 'The upper limit the pvc autoscaler can scale up to',\n },\n },\n },\n autoResizing: {\n threshold: {\n type: 'text',\n placeholder: 'e.g. 10%',\n validator: thresholdValidator,\n description:\n 'The free space percentage threshold where vpc autoscaling will kicks in. (example 10%)',\n },\n increase: {\n type: 'text',\n placeholder: 'e.g. 1GiB',\n validator: quantityValidator,\n description:\n 'The amount of disk space which is added as soon as autoscaling kicks in. (example 2Gi)',\n },\n },\n },\n resources: {\n limits: {\n memory: {\n type: 'text',\n placeholder: 'e.g. 150Mi',\n validator: undefinedOrQuantityValidator,\n description: 'Memory limit of a zeebe broker, e.g. 150Mi, 2Gi',\n },\n cpu: {\n type: 'text',\n placeholder: 'e.g. 200m',\n validator: undefinedOrQuantityValidator,\n description: 'CPU limit of a zeebe broker, e.g. 150m, 0.5, 1',\n },\n },\n requests: {\n memory: {\n type: 'text',\n placeholder: 'e.g. 150Mi',\n validator: undefinedOrQuantityValidator,\n description: 'Memory request of a zeebe broker, e.g. 150Mi, 2Gi',\n },\n cpu: {\n type: 'text',\n placeholder: 'e.g. 200m',\n validator: undefinedOrQuantityValidator,\n description: 'CPU request of a zeebe broker, e.g. 150m, 0.5, 1',\n },\n },\n },\n envVars: {\n type: 'textarea',\n placeholder: 'e.g. TEST=123',\n validator: undefinedOrEnvVarsValidator,\n description:\n 'env vars going into the system, no linebreakes are allowed',\n },\n jvm: {\n options: {\n type: 'jvmOptions',\n label: 'Broker JVM flags',\n placeholder: 'e.g. -XX:+UseG1GC',\n validator: isValidJvmOptionsPlanValue,\n description:\n 'JVM flags for the broker, with operator 2.28.1 or later. A flag replaces the flag with the same name from the env vars, and all other flags stay.',\n },\n },\n dataRetentionDays: {\n notOnClusterPlan: true,\n type: 'number',\n placeholder: 'e.g. 7',\n validator: numberMin0OrUndefinedValidator,\n description: 'number of days for zeebe broker retention',\n },\n },\n gateway: {\n replicas: {\n type: 'number',\n placeholder: 'e.g. 0',\n validator: numberValidator,\n description: 'number of gateways',\n },\n standalone: {\n type: 'checkbox',\n placeholder: undefined,\n validator: undefinedOrBooleanStringValidator,\n description: 'if this is a standalone gateway',\n },\n backend: {\n resources: {\n limits: {\n memory: {\n type: 'text',\n placeholder: 'e.g. 150Mi',\n validator: undefinedOrQuantityValidator,\n description: 'Memory limit of an gateway pod, e.g. 150Mi, 2Gi',\n },\n cpu: {\n type: 'text',\n placeholder: 'e.g. 200m',\n validator: undefinedOrQuantityValidator,\n description: 'CPU limit of an gateway pod, e.g. 150m, 0.5, 1',\n },\n },\n requests: {\n memory: {\n type: 'text',\n placeholder: 'e.g. 150Mi',\n validator: undefinedOrQuantityValidator,\n description: 'Memory request of an gateway pod, e.g. 150Mi, 2Gi',\n },\n cpu: {\n type: 'text',\n placeholder: 'e.g. 200m',\n validator: undefinedOrQuantityValidator,\n description: 'CPU request of a an gateway pod, e.g. 150m, 0.5, 1',\n },\n },\n },\n envVars: {\n type: 'textarea',\n placeholder: 'e.g. TEST=123',\n validator: undefinedOrEnvVarsValidator,\n description:\n 'env vars going into the system, no linebreakes are allowed',\n },\n },\n },\n },\n operate: {\n backend: {\n resources: {\n limits: {\n memory: {\n type: 'text',\n placeholder: 'e.g. 150Mi',\n validator: undefinedOrQuantityValidator,\n description: 'Memory limit of an operate pod, e.g. 150Mi, 2Gi',\n },\n cpu: {\n type: 'text',\n placeholder: 'e.g. 200m',\n validator: undefinedOrQuantityValidator,\n description: 'CPU limit of an operate pod, e.g. 150m, 0.5, 1',\n },\n },\n requests: {\n memory: {\n type: 'text',\n placeholder: 'e.g. 150Mi',\n validator: undefinedOrQuantityValidator,\n description: 'Memory request of an operate pod, e.g. 150Mi, 2Gi',\n },\n cpu: {\n type: 'text',\n placeholder: 'e.g. 200m',\n validator: undefinedOrQuantityValidator,\n description: 'CPU request of a an operate pod, e.g. 150m, 0.5, 1',\n },\n },\n },\n envVars: {\n type: 'textarea',\n placeholder: 'e.g. TEST=123',\n validator: undefinedOrEnvVarsValidator,\n description:\n 'env vars going into the system, no linebreakes are allowed',\n },\n },\n replicas: {\n type: 'number',\n placeholder: 'e.g. 1',\n validator: numberMin1Validator,\n description: 'the replication for operate',\n },\n dataRetentionDays: {\n notOnClusterPlan: true,\n type: 'number',\n placeholder: 'e.g. 7',\n validator: numberMin0OrUndefinedValidator,\n description: 'number of days for operate retention',\n },\n },\n elasticsearch: {\n resources: {\n limits: {\n memory: {\n type: 'text',\n placeholder: 'e.g. 150Mi',\n validator: undefinedOrQuantityValidator,\n description: 'Memory limit of an elastic node, e.g. 150Mi, 2Gi',\n },\n cpu: {\n type: 'text',\n placeholder: 'e.g. 200m',\n validator: undefinedOrQuantityValidator,\n description: 'CPU limit of an elastic node, e.g. 150m, 0.5, 1',\n },\n },\n requests: {\n memory: {\n type: 'text',\n placeholder: 'e.g. 150Mi',\n validator: undefinedOrQuantityValidator,\n description: 'Memory request of an elastic node, e.g. 150Mi, 2Gi',\n },\n cpu: {\n type: 'text',\n placeholder: 'e.g. 200m',\n validator: undefinedOrQuantityValidator,\n description: 'CPU request of a an elastic node, e.g. 150m, 0.5, 1',\n },\n },\n },\n config: {\n nodesCount: {\n type: 'number',\n placeholder: 'e.g. 1',\n validator: numberMin1Validator,\n description:\n 'The count of elasticsearch nodes - e.g. how many pods it runs, if its value is more than 1 it is deployed through the elastic-operator',\n },\n storage: {\n storageClassName: {\n type: 'text',\n placeholder: 'e.g. fast-v2',\n validator: notEmptyStringValidator,\n description:\n 'This needs to be set to a storageclass present in the k8s system. Can not be undefined if one value in storage: is set',\n },\n resources: {\n requests: {\n storage: {\n type: 'text',\n placeholder: 'e.g. 1GiB',\n validator: quantityValidator,\n description: 'The initial storage size of the statefulset',\n },\n },\n limits: {\n storage: {\n type: 'text',\n placeholder: 'e.g. 1GiB',\n validator: undefinedOrQuantityValidator,\n description: 'The upper limit the pvc autoscaler can scale up to',\n },\n },\n },\n autoResizing: {\n threshold: {\n type: 'text',\n placeholder: 'e.g. 10%',\n validator: thresholdValidator,\n description:\n 'The free space percentage threshold where pvc autoscaling kicks in. (example 10%)',\n },\n increase: {\n type: 'text',\n placeholder: 'e.g. 1GiB',\n validator: quantityValidator,\n description:\n 'The amount of disk space which is added as soon as autoscaling kicks in. (example 2Gi)',\n },\n },\n },\n },\n },\n tasklist: {\n backend: {\n resources: {\n limits: {\n memory: {\n type: 'text',\n placeholder: 'e.g. 150Mi',\n validator: undefinedOrQuantityValidator,\n description: 'Memory limit of a tasklist pod, e.g. 150Mi, 2Gi',\n },\n cpu: {\n type: 'text',\n placeholder: 'e.g. 200m',\n validator: undefinedOrQuantityValidator,\n description: 'CPU limit of a tasklist pod, e.g. 150m, 0.5, 1',\n },\n },\n requests: {\n memory: {\n type: 'text',\n placeholder: 'e.g. 150Mi',\n validator: undefinedOrQuantityValidator,\n description: 'Memory request of a tasklist pod, e.g. 150Mi, 2Gi',\n },\n cpu: {\n type: 'text',\n placeholder: 'e.g. 200m',\n validator: undefinedOrQuantityValidator,\n description: 'CPU request of a a tasklist pod, e.g. 150m, 0.5, 1',\n },\n },\n },\n envVars: {\n type: 'textarea',\n placeholder: 'e.g. TEST=123',\n validator: undefinedOrEnvVarsValidator,\n description:\n 'env vars going into the system, no linebreakes are allowed',\n },\n },\n replicas: {\n type: 'number',\n placeholder: 'e.g. 1',\n validator: numberMin0OrUndefinedValidator,\n description: 'the replication for tasklist',\n },\n dataRetentionDays: {\n notOnClusterPlan: true,\n type: 'number',\n placeholder: 'e.g. 7',\n validator: numberMin0OrUndefinedValidator,\n description: 'number of days for tasklist retention',\n },\n },\n optimize: {\n backend: {\n resources: {\n limits: {\n memory: {\n type: 'text',\n placeholder: 'e.g. 150Mi',\n validator: undefinedOrQuantityValidator,\n description: 'Memory limit of a optimize pod, e.g. 150Mi, 2Gi',\n },\n cpu: {\n type: 'text',\n placeholder: 'e.g. 200m',\n validator: undefinedOrQuantityValidator,\n description: 'CPU limit of a optimize pod, e.g. 150m, 0.5, 1',\n },\n },\n requests: {\n memory: {\n type: 'text',\n placeholder: 'e.g. 150Mi',\n validator: undefinedOrQuantityValidator,\n description: 'Memory request of a optimize pod, e.g. 150Mi, 2Gi',\n },\n cpu: {\n type: 'text',\n placeholder: 'e.g. 200m',\n validator: undefinedOrQuantityValidator,\n description: 'CPU request of a a optimize pod, e.g. 150m, 0.5, 1',\n },\n },\n },\n envVars: {\n type: 'textarea',\n placeholder: 'e.g. TEST=123',\n validator: undefinedOrEnvVarsValidator,\n description:\n 'env vars going into the system, no linebreakes are allowed',\n },\n },\n replicas: {\n type: 'number',\n placeholder: 'e.g. 1',\n validator: numberMin0OrUndefinedValidator,\n description: 'the replication for optimize',\n },\n dataRetentionDays: {\n notOnClusterPlan: true,\n type: 'number',\n placeholder: 'e.g. 7',\n validator: numberMin0OrUndefinedValidator,\n description: 'number of days for optimize retention',\n },\n },\n zeebeAnalytics: {\n backend: {\n resources: {\n limits: {\n memory: {\n type: 'text',\n placeholder: 'e.g. 150Mi',\n validator: undefinedOrQuantityValidator,\n description:\n 'Memory limit of a zeebeAnalytics pod, e.g. 150Mi, 2Gi',\n },\n cpu: {\n type: 'text',\n placeholder: 'e.g. 200m',\n validator: undefinedOrQuantityValidator,\n description: 'CPU limit of a zeebeAnalytics pod, e.g. 150m, 0.5, 1',\n },\n },\n requests: {\n memory: {\n type: 'text',\n placeholder: 'e.g. 150Mi',\n validator: undefinedOrQuantityValidator,\n description:\n 'Memory request of a zeebeAnalytics pod, e.g. 150Mi, 2Gi',\n },\n cpu: {\n type: 'text',\n placeholder: 'e.g. 200m',\n validator: undefinedOrQuantityValidator,\n description:\n 'CPU request of a a zeebeAnalytics pod, e.g. 150m, 0.5, 1',\n },\n },\n },\n envVars: {\n type: 'textarea',\n placeholder: 'e.g. TEST=123',\n validator: undefinedOrEnvVarsValidator,\n description:\n 'env vars going into the system, no linebreakes are allowed',\n },\n },\n replicas: {\n type: 'number',\n placeholder: 'e.g. 1',\n validator: numberMin0OrUndefinedValidator,\n description: 'the replication for zeebeAnalytics',\n },\n },\n connectorBridge: {\n backend: {\n resources: {\n limits: {\n memory: {\n type: 'text',\n placeholder: 'e.g. 150Mi',\n validator: undefinedOrQuantityValidator,\n description:\n 'Memory limit of a connectorBridge pod, e.g. 150Mi, 2Gi',\n },\n cpu: {\n type: 'text',\n placeholder: 'e.g. 200m',\n validator: undefinedOrQuantityValidator,\n description:\n 'CPU limit of a connectorBridge pod, e.g. 150m, 0.5, 1',\n },\n },\n requests: {\n memory: {\n type: 'text',\n placeholder: 'e.g. 150Mi',\n validator: undefinedOrQuantityValidator,\n description:\n 'Memory request of a connectorBridge pod, e.g. 150Mi, 2Gi',\n },\n cpu: {\n type: 'text',\n placeholder: 'e.g. 200m',\n validator: undefinedOrQuantityValidator,\n description:\n 'CPU request of a a connectorBridge pod, e.g. 150m, 0.5, 1',\n },\n },\n },\n envVars: {\n type: 'textarea',\n placeholder: 'e.g. TEST=123',\n validator: undefinedOrEnvVarsValidator,\n description:\n 'env vars going into the system, no linebreakes are allowed',\n },\n },\n replicas: {\n type: 'number',\n placeholder: 'e.g. 1',\n validator: numberMin0OrUndefinedValidator,\n description: 'the replication for connectorBridge',\n },\n },\n reconciliation: {\n paused: {\n notOnClusterPlan: true,\n type: 'checkbox',\n placeholder: undefined,\n validator: undefinedOrBooleanStringValidator,\n description: 'pause reconciliation of the cluster CRD',\n },\n },\n}\n"],
|
|
5
|
+
"mappings": "AAMA,SAAS,oBAAoB;AAC7B,SAAS,kCAAkC;AA4BpC,MAAM,yBAAyB,CACpC,SACiC,OAAO,KAAK,SAAS;AAMxD,MAAM,iBACJ;AACF,MAAM,kBAAkB;AAExB,MAAM,kBAAkB,CAAC,QAAa;AACpC,QAAM,MAAM,OAAO,GAAG;AACtB,SAAO,CAAC,OAAO,MAAM,GAAG;AAC1B;AAEA,MAAM,0BAA0B,CAAC,QAAgB;AAC/C,SAAO,QAAQ,UAAa,IAAI,SAAS;AAC3C;AAEA,MAAM,sBAAsB,CAAC,QAAa;AACxC,SAAO,gBAAgB,GAAG,KAAK,OAAO,GAAG,IAAI;AAC/C;AAEA,MAAM,iCAAiC,CAAC,QAAa;AACnD,SAAO,CAAC,OAAQ,gBAAgB,GAAG,KAAK,OAAO,GAAG,KAAK;AACzD;AAEA,MAAM,qBAAqB,CAAC,QAAgB;AAC1C,SAAO,gBAAgB,KAAK,GAAG;AACjC;AAEA,MAAM,oBAAoB,CAAC,QAAgB;AACzC,SAAO,eAAe,KAAK,GAAG;AAChC;AAEA,MAAM,mBAAmB,CAAC,QAA4B;AACpD,MAAI,CAAC,OAAO,IAAI,KAAK,MAAM,GAAI,QAAO;AACtC,SAAO,aAAa,GAAG,EAAE,SAAS;AACpC;AAEA,MAAM,+BAA+B,CAAC,QAAgB;AACpD,SAAO,QAAQ,UAAa,QAAQ,MAAM,kBAAkB,GAAG;AACjE;AAEA,MAAM,8BAA8B,CAAC,QAA4B;AAC/D,SAAO,iBAAiB,GAAG;AAC7B;AACA,MAAM,oCAAoC,CAAC,QAAa;AACtD,SAAO,QAAQ,UAAa,OAAO,QAAQ;AAC7C;AAEO,MAAM,sBAA4C;AAAA,EACvD,SAAS;AAAA,IACP,UAAU;AAAA,MACR,MAAM;AAAA,MACN,aAAa;AAAA,MAC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AAAA,EACA,gBAAgB;AAAA,IACd,QAAQ;AAAA,MACN,kBAAkB;AAAA,MAClB,MAAM;AAAA,MACN,aAAa;AAAA,MACb,WAAW;AAAA,MACX,aAAa;AAAA,IACf;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/types/Roles.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type AccountRoles = 'accounts:read' | 'accounts:onboard' | 'accounts:orgCreator' | 'accounts:enterpriseAdmin' | 'accounts:enterpriseOffboarding' | 'accounts:admin' | 'accounts:god' | 'accounts:editSalesPlans' | 'support:agent' | 'supersupport:agent' | 'accounts:trialExtender' | 'accounts:limitExtender' | 'accounts:connections:create' | 'accounts:connections:update' | 'accounts:connections:delete' | 'accounts:clusterUpdates' | 'accounts:notifications:global' | 'accounts:addSafeRoles' | 'accounts:consultingManager' | 'accounts:earlyAccessEditor' | 'accounts:pdfWatermarkReader' | 'accounts:pdfWatermarkWriter';
|
|
1
|
+
export type AccountRoles = 'accounts:read' | 'accounts:onboard' | 'accounts:orgCreator' | 'accounts:enterpriseAdmin' | 'accounts:enterpriseOffboarding' | 'accounts:admin' | 'accounts:god' | 'accounts:editSalesPlans' | 'support:agent' | 'supersupport:agent' | 'accounts:trialExtender' | 'accounts:limitExtender' | 'accounts:connections:create' | 'accounts:connections:update' | 'accounts:connections:delete' | 'accounts:clusterUpdates' | 'accounts:notifications:global' | 'accounts:addSafeRoles' | 'accounts:consultingManager' | 'accounts:earlyAccessEditor' | 'accounts:pdfWatermarkReader' | 'accounts:pdfWatermarkWriter' | 'accounts:orgMemberRemover';
|
|
2
2
|
export type ConsoleRoles = 'console:admin' | 'betatester:true' | 'console:admin:readonly' | 'console:god' | 'consoleTeam' | 'console:operationsEngineer' | 'console:C8ReleaseManager' | 'console:C8UpdateEnforcer' | 'console:clusterPlanManager' | 'console:optionalTelemetryManager' | 'console:clusterMover';
|
|
3
3
|
export type ModelerRoles = 'modeler:admin';
|
|
4
4
|
export type Roles = AccountRoles | ConsoleRoles | ModelerRoles;
|
package/dist/types/Roles.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/types/Roles.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 type AccountRoles =\n | 'accounts:read'\n | 'accounts:onboard'\n | 'accounts:orgCreator'\n | 'accounts:enterpriseAdmin'\n | 'accounts:enterpriseOffboarding'\n | 'accounts:admin'\n | 'accounts:god'\n | 'accounts:editSalesPlans'\n | 'support:agent'\n | 'supersupport:agent'\n | 'accounts:trialExtender'\n | 'accounts:limitExtender'\n | 'accounts:connections:create'\n | 'accounts:connections:update'\n | 'accounts:connections:delete'\n | 'accounts:clusterUpdates'\n | 'accounts:notifications:global'\n | 'accounts:addSafeRoles'\n | 'accounts:consultingManager'\n | 'accounts:earlyAccessEditor'\n | 'accounts:pdfWatermarkReader'\n | 'accounts:pdfWatermarkWriter'\nexport type ConsoleRoles =\n | 'console:admin'\n | 'betatester:true'\n | 'console:admin:readonly'\n | 'console:god'\n | 'consoleTeam'\n | 'console:operationsEngineer'\n | 'console:C8ReleaseManager'\n | 'console:C8UpdateEnforcer'\n | 'console:clusterPlanManager'\n | 'console:optionalTelemetryManager'\n | 'console:clusterMover'\nexport type ModelerRoles = 'modeler:admin'\nexport type Roles = AccountRoles | ConsoleRoles | ModelerRoles\nexport const SAFE_ROLES: Roles[] = [\n 'accounts:read',\n 'console:admin:readonly',\n 'accounts:trialExtender',\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\nexport type AccountRoles =\n | 'accounts:read'\n | 'accounts:onboard'\n | 'accounts:orgCreator'\n | 'accounts:enterpriseAdmin'\n | 'accounts:enterpriseOffboarding'\n | 'accounts:admin'\n | 'accounts:god'\n | 'accounts:editSalesPlans'\n | 'support:agent'\n | 'supersupport:agent'\n | 'accounts:trialExtender'\n | 'accounts:limitExtender'\n | 'accounts:connections:create'\n | 'accounts:connections:update'\n | 'accounts:connections:delete'\n | 'accounts:clusterUpdates'\n | 'accounts:notifications:global'\n | 'accounts:addSafeRoles'\n | 'accounts:consultingManager'\n | 'accounts:earlyAccessEditor'\n | 'accounts:pdfWatermarkReader'\n | 'accounts:pdfWatermarkWriter'\n | 'accounts:orgMemberRemover'\nexport type ConsoleRoles =\n | 'console:admin'\n | 'betatester:true'\n | 'console:admin:readonly'\n | 'console:god'\n | 'consoleTeam'\n | 'console:operationsEngineer'\n | 'console:C8ReleaseManager'\n | 'console:C8UpdateEnforcer'\n | 'console:clusterPlanManager'\n | 'console:optionalTelemetryManager'\n | 'console:clusterMover'\nexport type ModelerRoles = 'modeler:admin'\nexport type Roles = AccountRoles | ConsoleRoles | ModelerRoles\nexport const SAFE_ROLES: Roles[] = [\n 'accounts:read',\n 'console:admin:readonly',\n 'accounts:trialExtender',\n]\n"],
|
|
5
|
+
"mappings": "AA4CO,MAAM,aAAsB;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -77,4 +77,24 @@ export declare function validateJvmOptions(options: string[], existing?: string[
|
|
|
77
77
|
* value is a string of flags separated by white space.
|
|
78
78
|
*/
|
|
79
79
|
export declare function validateJvmOptionsValue(value: unknown): string[];
|
|
80
|
+
/**
|
|
81
|
+
* jvmOptionsOfPlanValue returns the flags of a JVM options value of a cluster
|
|
82
|
+
* plan. A plan stores a list of flags, and a plan modification stores one
|
|
83
|
+
* string, so both forms come back as the same list. Nothing is validated.
|
|
84
|
+
*/
|
|
85
|
+
export declare function jvmOptionsOfPlanValue(value: unknown): string[];
|
|
86
|
+
/**
|
|
87
|
+
* validateJvmOptionsPlanValue returns one message per problem of a JVM options
|
|
88
|
+
* value of a cluster plan, or an empty array when the value is valid. The value
|
|
89
|
+
* is a list of flags, or a string of flags that white space separates. A plan
|
|
90
|
+
* that was stored before this key existed can hold `null`, and no value is the
|
|
91
|
+
* same as no flags, so `undefined` and `null` are valid.
|
|
92
|
+
*/
|
|
93
|
+
export declare function validateJvmOptionsPlanValue(value: unknown): string[];
|
|
94
|
+
/**
|
|
95
|
+
* isValidJvmOptionsPlanValue is the field validator of the JVM options keys of
|
|
96
|
+
* a cluster plan. Every plan field spec uses it, so the rule for `undefined`
|
|
97
|
+
* and `null` is in one place.
|
|
98
|
+
*/
|
|
99
|
+
export declare function isValidJvmOptionsPlanValue(value: unknown): boolean;
|
|
80
100
|
export {};
|
package/dist/utils/jvmOptions.js
CHANGED
|
@@ -101,6 +101,27 @@ function validateJvmOptionsValue(value) {
|
|
|
101
101
|
}
|
|
102
102
|
return validateJvmOptions(splitJvmOptions(value));
|
|
103
103
|
}
|
|
104
|
+
function jvmOptionsOfPlanValue(value) {
|
|
105
|
+
if (Array.isArray(value)) {
|
|
106
|
+
return value.map(String);
|
|
107
|
+
}
|
|
108
|
+
return value === void 0 || value === null ? [] : splitJvmOptions(String(value));
|
|
109
|
+
}
|
|
110
|
+
function validateJvmOptionsPlanValue(value) {
|
|
111
|
+
if (value === void 0 || value === null) {
|
|
112
|
+
return [];
|
|
113
|
+
}
|
|
114
|
+
if (typeof value === "string") {
|
|
115
|
+
return validateJvmOptionsValue(value);
|
|
116
|
+
}
|
|
117
|
+
if (!Array.isArray(value) || value.some((flag) => typeof flag !== "string")) {
|
|
118
|
+
return ["JVM options must be a list of flags"];
|
|
119
|
+
}
|
|
120
|
+
return validateJvmOptions(value);
|
|
121
|
+
}
|
|
122
|
+
function isValidJvmOptionsPlanValue(value) {
|
|
123
|
+
return validateJvmOptionsPlanValue(value).length === 0;
|
|
124
|
+
}
|
|
104
125
|
export {
|
|
105
126
|
JVM_OPTIONS_MAX_ITEMS,
|
|
106
127
|
JVM_OPTIONS_MODIFICATION_KEYS,
|
|
@@ -110,11 +131,14 @@ export {
|
|
|
110
131
|
addsEnvVarsOverrideValue,
|
|
111
132
|
isJvmOptionsModificationKey,
|
|
112
133
|
isUnderJvmSpec,
|
|
134
|
+
isValidJvmOptionsPlanValue,
|
|
113
135
|
joinJvmOptions,
|
|
136
|
+
jvmOptionsOfPlanValue,
|
|
114
137
|
parseJvmOption,
|
|
115
138
|
requiresEnvVarsOverride,
|
|
116
139
|
splitJvmOptions,
|
|
117
140
|
validateJvmOptions,
|
|
141
|
+
validateJvmOptionsPlanValue,
|
|
118
142
|
validateJvmOptionsValue
|
|
119
143
|
};
|
|
120
144
|
//# sourceMappingURL=jvmOptions.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/utils/jvmOptions.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// Port of the parsing rules in pkg/jvm/options.go and of the limits in the\n// JVMSpec kubebuilder markers in api/cloud/v1alpha1/zeebecluster_types.go, both\n// in camunda/camunda-operator. The operator rejects flags that do not match, so\n// change both files together.\n\n/**\n * JVM_OPTION_PATTERN is the syntax of one flag that the CRD accepts. It is not\n * the full check: parseJvmOption also refuses a flag that the Camunda launcher\n * sets, for example `-XX:+ExitOnOutOfMemoryError`.\n */\nexport const JVM_OPTION_PATTERN =\n /^(-XX:([+-][A-Za-z][A-Za-z0-9_]*|[A-Za-z][A-Za-z0-9_]*=[\\x21\\x23\\x25\\x26\\x28-\\x5b\\x5d-\\x7e]+)|-X(mx|ms|ss)[0-9]+[kKmMgGtT]?)$/\n\n/** JVM_OPTION_MAX_LENGTH is the `items:MaxLength` of `jvm.options` in the CRD. */\nexport const JVM_OPTION_MAX_LENGTH = 256\n\n/** JVM_OPTIONS_MAX_ITEMS is the `MaxItems` of `jvm.options` in the CRD. */\nexport const JVM_OPTIONS_MAX_ITEMS = 64\n\n/** JVM_OPTIONS_MODIFICATION_KEYS are the cluster modification keys that hold a list of JVM flags. */\nexport const JVM_OPTIONS_MODIFICATION_KEYS = [\n 'zeebe.broker.jvm.options',\n 'gateway.jvm.options',\n] as const\n\n/** JvmOptionsModificationKey is one of JVM_OPTIONS_MODIFICATION_KEYS. */\nexport type JvmOptionsModificationKey =\n (typeof JVM_OPTIONS_MODIFICATION_KEYS)[number]\n\n/** JVM_OPTIONS_TARGETS names the ZeebeCluster spec component whose `jvm.options` each key sets. */\nexport const JVM_OPTIONS_TARGETS = {\n 'zeebe.broker.jvm.options': 'zeebeBroker',\n 'gateway.jvm.options': 'gateway',\n} as const satisfies Record<\n JvmOptionsModificationKey,\n 'zeebeBroker' | 'gateway'\n>\n\n// -Xmx, -Xms and -Xss set the same setting as their -XX spelling\nconst SIZE_FLAG_KEYS: Record<string, string> = {\n '-Xmx': 'XX:MaxHeapSize',\n '-Xms': 'XX:InitialHeapSize',\n '-Xss': 'XX:ThreadStackSize',\n}\n\n// the Camunda launcher passes these after JAVA_OPTS, so no option can change them\nconst LAUNCHER_KEYS = ['XX:ExitOnOutOfMemoryError']\n\n/** ParsedJvmOption is a valid flag with the key that names its setting. */\nexport type ParsedJvmOption = { key: string; arg: string }\n\n/** isJvmOptionsModificationKey tells if `key` is in JVM_OPTIONS_MODIFICATION_KEYS. */\nexport function isJvmOptionsModificationKey(\n key: string,\n): key is JvmOptionsModificationKey {\n return (JVM_OPTIONS_MODIFICATION_KEYS as readonly string[]).includes(key)\n}\n\n// The `jvm` objects of the spec that JVM_OPTIONS_MODIFICATION_KEYS set a list in.\nconst JVM_SPEC_PATHS = JVM_OPTIONS_MODIFICATION_KEYS.map((key) =>\n key.slice(0, -'.options'.length),\n)\n\n/**\n * isUnderJvmSpec tells if `key` names a `jvm` object of the spec, or a path in\n * it, for example `zeebe.broker.jvm.options.0`. Only the keys of\n * JVM_OPTIONS_MODIFICATION_KEYS may set it: the plan overlay turns any other\n * such key into a list or an object in the spec.\n */\nexport function isUnderJvmSpec(key: string): boolean {\n return JVM_SPEC_PATHS.some(\n (path) => key === path || key.startsWith(`${path}.`),\n )\n}\n\n/**\n * requiresEnvVarsOverride tells if only a caller with `canOverrideEnvVars` can\n * set the modification key `key`: an `envVars` key, the JVM options keys, and\n * every key under them, because the plan overlay turns a key such as\n * `zeebe.broker.envVars.0` into the same field. The operator merges the JVM\n * options into `JAVA_TOOL_OPTIONS`, and replaces matching flags in\n * `JAVA_OPTS`, so they act like the env vars.\n */\nexport function requiresEnvVarsOverride(key: string): boolean {\n return key.split('.').includes('envVars') || isUnderJvmSpec(key)\n}\n\ntype PlanModificationEntry = { key: string; value?: unknown }\n\n// One string for each entry with a key that requiresEnvVarsOverride names, so\n// that a Set compares the key and the value together.\nfunction envVarsOverrideEntries(\n modifications: ReadonlyArray<PlanModificationEntry> | undefined,\n): string[] {\n return (modifications ?? [])\n .filter(({ key }) => requiresEnvVarsOverride(key))\n .map(({ key, value }) => JSON.stringify([key, String(value)]))\n}\n\n/**\n * addsEnvVarsOverrideValue tells if `after` holds an entry with a key that\n * needs `canOverrideEnvVars`, whose key and value are not in `allowed`. A\n * caller without the permission can keep or remove such an entry, but cannot\n * add one or change its value. A removal needs no check, because the\n * activation of a config without the entry removes it too.\n */\nexport function addsEnvVarsOverrideValue(\n allowed: ReadonlyArray<PlanModificationEntry> | undefined,\n after: ReadonlyArray<PlanModificationEntry> | undefined,\n): boolean {\n const known = new Set(envVarsOverrideEntries(allowed))\n return envVarsOverrideEntries(after).some((entry) => !known.has(entry))\n}\n\nfunction keyOf(arg: string): string {\n if (arg.startsWith('-XX:')) {\n const name = arg\n .slice('-XX:'.length)\n .replace(/^[+-]+/, '')\n .split('=')[0]\n return name === '' ? '' : `XX:${name}`\n }\n return SIZE_FLAG_KEYS[arg.slice(0, 4)] ?? ''\n}\n\n/**\n * parseJvmOption returns the key and the flag, or an error message when `arg`\n * is too long, does not match JVM_OPTION_PATTERN, or names a flag that the\n * Camunda launcher sets. Two flags with the same key set the same setting.\n */\nexport function parseJvmOption(\n arg: string,\n): ParsedJvmOption | { error: string } {\n if (arg.length > JVM_OPTION_MAX_LENGTH) {\n return {\n error: `\"${arg}\" is longer than ${JVM_OPTION_MAX_LENGTH} characters`,\n }\n }\n\n if (!JVM_OPTION_PATTERN.test(arg)) {\n return {\n error: `\"${arg}\" is not a JVM flag of the form -XX:+Name, -XX:-Name, -XX:Name=value or -Xmx, -Xms, -Xss with a size, where a value is printable ASCII without spaces, quotes, $ or backslashes`,\n }\n }\n\n const key = keyOf(arg)\n if (LAUNCHER_KEYS.includes(key)) {\n return {\n error: `\"${arg}\" cannot be changed, because the Camunda launcher sets it on the command line`,\n }\n }\n\n return { key, arg }\n}\n\n/** splitJvmOptions splits a stored value on any white space and drops empty tokens. */\nexport function splitJvmOptions(value: string | undefined): string[] {\n return value?.split(/\\s+/).filter(Boolean) ?? []\n}\n\n/** joinJvmOptions returns the stored form of a list: the flags joined by a space. */\nexport function joinJvmOptions(options: string[]): string {\n return options.join(' ')\n}\n\n/**\n * validateJvmOptions returns one message per problem of `options`, or an empty\n * array when `options` is valid. `existing` holds the flags that come before\n * `options` in the list. They count for duplicates and for the maximum number\n * of flags, but their own problems are not reported.\n */\nexport function validateJvmOptions(\n options: string[],\n existing: string[] = [],\n): string[] {\n const errors: string[] = []\n const firstByKey = new Map<string, string>()\n\n for (const arg of existing) {\n const parsed = parseJvmOption(arg)\n if (!('error' in parsed) && !firstByKey.has(parsed.key)) {\n firstByKey.set(parsed.key, arg)\n }\n }\n\n for (const arg of options) {\n const parsed = parseJvmOption(arg)\n if ('error' in parsed) {\n errors.push(parsed.error)\n continue\n }\n\n const first = firstByKey.get(parsed.key)\n if (first === undefined) {\n firstByKey.set(parsed.key, arg)\n } else {\n errors.push(`\"${arg}\" sets the same flag as \"${first}\"`)\n }\n }\n\n if (existing.length + options.length > JVM_OPTIONS_MAX_ITEMS) {\n errors.push(`Use at most ${JVM_OPTIONS_MAX_ITEMS} JVM flags`)\n }\n\n return errors\n}\n\n/**\n * validateJvmOptionsValue returns one message per problem of the stored value\n * of a JVM options key, or an empty array when the value is valid. The stored\n * value is a string of flags separated by white space.\n */\nexport function validateJvmOptionsValue(value: unknown): string[] {\n if (typeof value !== 'string') {\n return ['JVM options must be a string of flags']\n }\n return validateJvmOptions(splitJvmOptions(value))\n}\n"],
|
|
5
|
-
"mappings": "AAgBO,MAAM,qBACX;AAGK,MAAM,wBAAwB;AAG9B,MAAM,wBAAwB;AAG9B,MAAM,gCAAgC;AAAA,EAC3C;AAAA,EACA;AACF;AAOO,MAAM,sBAAsB;AAAA,EACjC,4BAA4B;AAAA,EAC5B,uBAAuB;AACzB;AAMA,MAAM,iBAAyC;AAAA,EAC7C,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;AACV;AAGA,MAAM,gBAAgB,CAAC,2BAA2B;AAM3C,SAAS,4BACd,KACkC;AAClC,SAAQ,8BAAoD,SAAS,GAAG;AAC1E;AAGA,MAAM,iBAAiB,8BAA8B;AAAA,EAAI,CAAC,QACxD,IAAI,MAAM,GAAG,CAAC,WAAW,MAAM;AACjC;AAQO,SAAS,eAAe,KAAsB;AACnD,SAAO,eAAe;AAAA,IACpB,CAAC,SAAS,QAAQ,QAAQ,IAAI,WAAW,GAAG,IAAI,GAAG;AAAA,EACrD;AACF;AAUO,SAAS,wBAAwB,KAAsB;AAC5D,SAAO,IAAI,MAAM,GAAG,EAAE,SAAS,SAAS,KAAK,eAAe,GAAG;AACjE;AAMA,SAAS,uBACP,eACU;AACV,UAAQ,iBAAiB,CAAC,GACvB,OAAO,CAAC,EAAE,IAAI,MAAM,wBAAwB,GAAG,CAAC,EAChD,IAAI,CAAC,EAAE,KAAK,MAAM,MAAM,KAAK,UAAU,C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AAW,CAAC,WAAW,IAAI,OAAO,GAAG,GAAG;AACvD,iBAAW,IAAI,OAAO,KAAK,GAAG;AAAA,IAChC;AAAA,EACF;AAEA,aAAW,OAAO,SAAS;AACzB,UAAM,SAAS,eAAe,GAAG;AACjC,QAAI,WAAW,QAAQ;AACrB,aAAO,KAAK,OAAO,KAAK;AACxB;AAAA,IACF;AAEA,UAAM,QAAQ,WAAW,IAAI,OAAO,GAAG;AACvC,QAAI,UAAU,QAAW;AACvB,iBAAW,IAAI,OAAO,KAAK,GAAG;AAAA,IAChC,OAAO;AACL,aAAO,KAAK,IAAI,GAAG,4BAA4B,KAAK,GAAG;AAAA,IACzD;AAAA,EACF;AAEA,MAAI,SAAS,SAAS,QAAQ,SAAS,uBAAuB;AAC5D,WAAO,KAAK,eAAe,qBAAqB,YAAY;AAAA,EAC9D;AAEA,SAAO;AACT;AAOO,SAAS,wBAAwB,OAA0B;AAChE,MAAI,OAAO,UAAU,UAAU;AAC7B,WAAO,CAAC,uCAAuC;AAAA,EACjD;AACA,SAAO,mBAAmB,gBAAgB,KAAK,CAAC;AAClD;",
|
|
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// Port of the parsing rules in pkg/jvm/options.go and of the limits in the\n// JVMSpec kubebuilder markers in api/cloud/v1alpha1/zeebecluster_types.go, both\n// in camunda/camunda-operator. The operator rejects flags that do not match, so\n// change both files together.\n\n/**\n * JVM_OPTION_PATTERN is the syntax of one flag that the CRD accepts. It is not\n * the full check: parseJvmOption also refuses a flag that the Camunda launcher\n * sets, for example `-XX:+ExitOnOutOfMemoryError`.\n */\nexport const JVM_OPTION_PATTERN =\n /^(-XX:([+-][A-Za-z][A-Za-z0-9_]*|[A-Za-z][A-Za-z0-9_]*=[\\x21\\x23\\x25\\x26\\x28-\\x5b\\x5d-\\x7e]+)|-X(mx|ms|ss)[0-9]+[kKmMgGtT]?)$/\n\n/** JVM_OPTION_MAX_LENGTH is the `items:MaxLength` of `jvm.options` in the CRD. */\nexport const JVM_OPTION_MAX_LENGTH = 256\n\n/** JVM_OPTIONS_MAX_ITEMS is the `MaxItems` of `jvm.options` in the CRD. */\nexport const JVM_OPTIONS_MAX_ITEMS = 64\n\n/** JVM_OPTIONS_MODIFICATION_KEYS are the cluster modification keys that hold a list of JVM flags. */\nexport const JVM_OPTIONS_MODIFICATION_KEYS = [\n 'zeebe.broker.jvm.options',\n 'gateway.jvm.options',\n] as const\n\n/** JvmOptionsModificationKey is one of JVM_OPTIONS_MODIFICATION_KEYS. */\nexport type JvmOptionsModificationKey =\n (typeof JVM_OPTIONS_MODIFICATION_KEYS)[number]\n\n/** JVM_OPTIONS_TARGETS names the ZeebeCluster spec component whose `jvm.options` each key sets. */\nexport const JVM_OPTIONS_TARGETS = {\n 'zeebe.broker.jvm.options': 'zeebeBroker',\n 'gateway.jvm.options': 'gateway',\n} as const satisfies Record<\n JvmOptionsModificationKey,\n 'zeebeBroker' | 'gateway'\n>\n\n// -Xmx, -Xms and -Xss set the same setting as their -XX spelling\nconst SIZE_FLAG_KEYS: Record<string, string> = {\n '-Xmx': 'XX:MaxHeapSize',\n '-Xms': 'XX:InitialHeapSize',\n '-Xss': 'XX:ThreadStackSize',\n}\n\n// the Camunda launcher passes these after JAVA_OPTS, so no option can change them\nconst LAUNCHER_KEYS = ['XX:ExitOnOutOfMemoryError']\n\n/** ParsedJvmOption is a valid flag with the key that names its setting. */\nexport type ParsedJvmOption = { key: string; arg: string }\n\n/** isJvmOptionsModificationKey tells if `key` is in JVM_OPTIONS_MODIFICATION_KEYS. */\nexport function isJvmOptionsModificationKey(\n key: string,\n): key is JvmOptionsModificationKey {\n return (JVM_OPTIONS_MODIFICATION_KEYS as readonly string[]).includes(key)\n}\n\n// The `jvm` objects of the spec that JVM_OPTIONS_MODIFICATION_KEYS set a list in.\nconst JVM_SPEC_PATHS = JVM_OPTIONS_MODIFICATION_KEYS.map((key) =>\n key.slice(0, -'.options'.length),\n)\n\n/**\n * isUnderJvmSpec tells if `key` names a `jvm` object of the spec, or a path in\n * it, for example `zeebe.broker.jvm.options.0`. Only the keys of\n * JVM_OPTIONS_MODIFICATION_KEYS may set it: the plan overlay turns any other\n * such key into a list or an object in the spec.\n */\nexport function isUnderJvmSpec(key: string): boolean {\n return JVM_SPEC_PATHS.some(\n (path) => key === path || key.startsWith(`${path}.`),\n )\n}\n\n/**\n * requiresEnvVarsOverride tells if only a caller with `canOverrideEnvVars` can\n * set the modification key `key`: an `envVars` key, the JVM options keys, and\n * every key under them, because the plan overlay turns a key such as\n * `zeebe.broker.envVars.0` into the same field. The operator merges the JVM\n * options into `JAVA_TOOL_OPTIONS`, and replaces matching flags in\n * `JAVA_OPTS`, so they act like the env vars.\n */\nexport function requiresEnvVarsOverride(key: string): boolean {\n return key.split('.').includes('envVars') || isUnderJvmSpec(key)\n}\n\ntype PlanModificationEntry = { key: string; value?: unknown }\n\n// One string for each entry with a key that requiresEnvVarsOverride names, so\n// that a Set compares the key and the value together.\nfunction envVarsOverrideEntries(\n modifications: ReadonlyArray<PlanModificationEntry> | undefined,\n): string[] {\n return (modifications ?? [])\n .filter(({ key }) => requiresEnvVarsOverride(key))\n .map(({ key, value }) => JSON.stringify([key, String(value)]))\n}\n\n/**\n * addsEnvVarsOverrideValue tells if `after` holds an entry with a key that\n * needs `canOverrideEnvVars`, whose key and value are not in `allowed`. A\n * caller without the permission can keep or remove such an entry, but cannot\n * add one or change its value. A removal needs no check, because the\n * activation of a config without the entry removes it too.\n */\nexport function addsEnvVarsOverrideValue(\n allowed: ReadonlyArray<PlanModificationEntry> | undefined,\n after: ReadonlyArray<PlanModificationEntry> | undefined,\n): boolean {\n const known = new Set(envVarsOverrideEntries(allowed))\n return envVarsOverrideEntries(after).some((entry) => !known.has(entry))\n}\n\nfunction keyOf(arg: string): string {\n if (arg.startsWith('-XX:')) {\n const name = arg\n .slice('-XX:'.length)\n .replace(/^[+-]+/, '')\n .split('=')[0]\n return name === '' ? '' : `XX:${name}`\n }\n return SIZE_FLAG_KEYS[arg.slice(0, 4)] ?? ''\n}\n\n/**\n * parseJvmOption returns the key and the flag, or an error message when `arg`\n * is too long, does not match JVM_OPTION_PATTERN, or names a flag that the\n * Camunda launcher sets. Two flags with the same key set the same setting.\n */\nexport function parseJvmOption(\n arg: string,\n): ParsedJvmOption | { error: string } {\n if (arg.length > JVM_OPTION_MAX_LENGTH) {\n return {\n error: `\"${arg}\" is longer than ${JVM_OPTION_MAX_LENGTH} characters`,\n }\n }\n\n if (!JVM_OPTION_PATTERN.test(arg)) {\n return {\n error: `\"${arg}\" is not a JVM flag of the form -XX:+Name, -XX:-Name, -XX:Name=value or -Xmx, -Xms, -Xss with a size, where a value is printable ASCII without spaces, quotes, $ or backslashes`,\n }\n }\n\n const key = keyOf(arg)\n if (LAUNCHER_KEYS.includes(key)) {\n return {\n error: `\"${arg}\" cannot be changed, because the Camunda launcher sets it on the command line`,\n }\n }\n\n return { key, arg }\n}\n\n/** splitJvmOptions splits a stored value on any white space and drops empty tokens. */\nexport function splitJvmOptions(value: string | undefined): string[] {\n return value?.split(/\\s+/).filter(Boolean) ?? []\n}\n\n/** joinJvmOptions returns the stored form of a list: the flags joined by a space. */\nexport function joinJvmOptions(options: string[]): string {\n return options.join(' ')\n}\n\n/**\n * validateJvmOptions returns one message per problem of `options`, or an empty\n * array when `options` is valid. `existing` holds the flags that come before\n * `options` in the list. They count for duplicates and for the maximum number\n * of flags, but their own problems are not reported.\n */\nexport function validateJvmOptions(\n options: string[],\n existing: string[] = [],\n): string[] {\n const errors: string[] = []\n const firstByKey = new Map<string, string>()\n\n for (const arg of existing) {\n const parsed = parseJvmOption(arg)\n if (!('error' in parsed) && !firstByKey.has(parsed.key)) {\n firstByKey.set(parsed.key, arg)\n }\n }\n\n for (const arg of options) {\n const parsed = parseJvmOption(arg)\n if ('error' in parsed) {\n errors.push(parsed.error)\n continue\n }\n\n const first = firstByKey.get(parsed.key)\n if (first === undefined) {\n firstByKey.set(parsed.key, arg)\n } else {\n errors.push(`\"${arg}\" sets the same flag as \"${first}\"`)\n }\n }\n\n if (existing.length + options.length > JVM_OPTIONS_MAX_ITEMS) {\n errors.push(`Use at most ${JVM_OPTIONS_MAX_ITEMS} JVM flags`)\n }\n\n return errors\n}\n\n/**\n * validateJvmOptionsValue returns one message per problem of the stored value\n * of a JVM options key, or an empty array when the value is valid. The stored\n * value is a string of flags separated by white space.\n */\nexport function validateJvmOptionsValue(value: unknown): string[] {\n if (typeof value !== 'string') {\n return ['JVM options must be a string of flags']\n }\n return validateJvmOptions(splitJvmOptions(value))\n}\n\n/**\n * jvmOptionsOfPlanValue returns the flags of a JVM options value of a cluster\n * plan. A plan stores a list of flags, and a plan modification stores one\n * string, so both forms come back as the same list. Nothing is validated.\n */\nexport function jvmOptionsOfPlanValue(value: unknown): string[] {\n if (Array.isArray(value)) {\n return value.map(String)\n }\n return value === undefined || value === null\n ? []\n : splitJvmOptions(String(value))\n}\n\n/**\n * validateJvmOptionsPlanValue returns one message per problem of a JVM options\n * value of a cluster plan, or an empty array when the value is valid. The value\n * is a list of flags, or a string of flags that white space separates. A plan\n * that was stored before this key existed can hold `null`, and no value is the\n * same as no flags, so `undefined` and `null` are valid.\n */\nexport function validateJvmOptionsPlanValue(value: unknown): string[] {\n if (value === undefined || value === null) {\n return []\n }\n if (typeof value === 'string') {\n return validateJvmOptionsValue(value)\n }\n if (!Array.isArray(value) || value.some((flag) => typeof flag !== 'string')) {\n return ['JVM options must be a list of flags']\n }\n return validateJvmOptions(value)\n}\n\n/**\n * isValidJvmOptionsPlanValue is the field validator of the JVM options keys of\n * a cluster plan. Every plan field spec uses it, so the rule for `undefined`\n * and `null` is in one place.\n */\nexport function isValidJvmOptionsPlanValue(value: unknown): boolean {\n return validateJvmOptionsPlanValue(value).length === 0\n}\n"],
|
|
5
|
+
"mappings": "AAgBO,MAAM,qBACX;AAGK,MAAM,wBA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EACF;AAEA,MAAI,SAAS,SAAS,QAAQ,SAAS,uBAAuB;AAC5D,WAAO,KAAK,eAAe,qBAAqB,YAAY;AAAA,EAC9D;AAEA,SAAO;AACT;AAOO,SAAS,wBAAwB,OAA0B;AAChE,MAAI,OAAO,UAAU,UAAU;AAC7B,WAAO,CAAC,uCAAuC;AAAA,EACjD;AACA,SAAO,mBAAmB,gBAAgB,KAAK,CAAC;AAClD;AAOO,SAAS,sBAAsB,OAA0B;AAC9D,MAAI,MAAM,QAAQ,KAAK,GAAG;AACxB,WAAO,MAAM,IAAI,MAAM;AAAA,EACzB;AACA,SAAO,UAAU,UAAa,UAAU,OACpC,CAAC,IACD,gBAAgB,OAAO,KAAK,CAAC;AACnC;AASO,SAAS,4BAA4B,OAA0B;AACpE,MAAI,UAAU,UAAa,UAAU,MAAM;AACzC,WAAO,CAAC;AAAA,EACV;AACA,MAAI,OAAO,UAAU,UAAU;AAC7B,WAAO,wBAAwB,KAAK;AAAA,EACtC;AACA,MAAI,CAAC,MAAM,QAAQ,KAAK,KAAK,MAAM,KAAK,CAAC,SAAS,OAAO,SAAS,QAAQ,GAAG;AAC3E,WAAO,CAAC,qCAAqC;AAAA,EAC/C;AACA,SAAO,mBAAmB,KAAK;AACjC;AAOO,SAAS,2BAA2B,OAAyB;AAClE,SAAO,4BAA4B,KAAK,EAAE,WAAW;AACvD;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* getAtPath returns the value at a dotted `path` of `value`, for example
|
|
3
|
+
* `zeebe.broker.jvm.options`. It returns `undefined` when a step of the path is
|
|
4
|
+
* missing, or is not an object.
|
|
5
|
+
*/
|
|
6
|
+
export declare function getAtPath(value: unknown, path: string): unknown;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/utils/objectPath.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 * getAtPath returns the value at a dotted `path` of `value`, for example\n * `zeebe.broker.jvm.options`. It returns `undefined` when a step of the path is\n * missing, or is not an object.\n */\nexport function getAtPath(value: unknown, path: string): unknown {\n return path\n .split('.')\n .reduce<unknown>(\n (node, key) =>\n node !== null && typeof node === 'object'\n ? (node as Record<string, unknown>)[key]\n : undefined,\n value,\n )\n}\n"],
|
|
5
|
+
"mappings": "AAWO,SAAS,UAAU,OAAgB,MAAuB;AAC/D,SAAO,KACJ,MAAM,GAAG,EACT;AAAA,IACC,CAAC,MAAM,QACL,SAAS,QAAQ,OAAO,SAAS,WAC5B,KAAiC,GAAG,IACrC;AAAA,IACN;AAAA,EACF;AACJ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/package.json
CHANGED