@gooddata/code-cli 0.52.0-alpha.5 → 0.52.0-alpha.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/NOTICE +1 -1
  2. package/dist/index.js +463 -122
  3. package/package.json +1 -1
package/NOTICE CHANGED
@@ -9,7 +9,7 @@ The following 3rd-party software packages may be used by or distributed with gdc
9
9
 
10
10
  Date generated: 2026-9-8
11
11
 
12
- Revision ID: b372da4ff3ae3c4227dff9b1a0b3343f7fa8a9f5
12
+ Revision ID: c3978e6d95b691f58341d7a2af5e76ea67f3bf55
13
13
 
14
14
  ================================================================================
15
15
  ================================================================================
package/dist/index.js CHANGED
@@ -37370,7 +37370,7 @@ function isPromise(value) {
37370
37370
  //#endregion
37371
37371
  //#region package.json
37372
37372
  var name$1 = "@gooddata/code-cli";
37373
- var version$1 = "0.52.0-alpha.5";
37373
+ var version$1 = "0.52.0-alpha.7";
37374
37374
  //#endregion
37375
37375
  //#region ../../../common/temp/aac/node_modules/.pnpm/vscode-languageserver@8.1.0/node_modules/vscode-languageserver/lib/common/utils/is.js
37376
37376
  var require_is$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
@@ -103070,6 +103070,8 @@ var CoreErrorCode;
103070
103070
  CoreErrorCode["ParameterDuplicateAllowedTitle"] = "core.parameter.duplicateAllowedTitle";
103071
103071
  CoreErrorCode["ParameterLengthRange"] = "core.parameter.lengthRange";
103072
103072
  CoreErrorCode["ParameterDefaultOutOfBounds"] = "core.parameter.defaultOutOfBounds";
103073
+ CoreErrorCode["ParameterNumberRange"] = "core.parameter.numberRange";
103074
+ CoreErrorCode["ParameterDefaultOutOfRange"] = "core.parameter.defaultOutOfRange";
103073
103075
  CoreErrorCode["MissingDataSourceId"] = "core.missingDataSourceId";
103074
103076
  CoreErrorCode["NonExistingRemoteReference"] = "core.nonExistingRemoteReference";
103075
103077
  CoreErrorCode["NonExistingRemoteReferences"] = "core.nonExistingRemoteReferences";
@@ -103169,6 +103171,8 @@ const CoreErrorMessages$1 = {
103169
103171
  [CoreErrorCode.ParameterDuplicateAllowedTitle]: `allowed_values contains duplicate title "{0}". Each title must be unique.`,
103170
103172
  [CoreErrorCode.ParameterLengthRange]: `minLength {0} is greater than maxLength {1}. The bounds must describe a non-empty range.`,
103171
103173
  [CoreErrorCode.ParameterDefaultOutOfBounds]: `Default "{0}" has length {1}, which is outside the declared bounds {2}.`,
103174
+ [CoreErrorCode.ParameterNumberRange]: `min {0} is greater than max {1}. The bounds must describe a non-empty range.`,
103175
+ [CoreErrorCode.ParameterDefaultOutOfRange]: `Default {0} is outside the declared bounds {1}.`,
103172
103176
  [CoreErrorCode.MissingDataSourceId]: `Missing data source. Data source must be specified in profile or directly on dataset. Use "data_source" property in profile or "data_source" property in current dataset definition.`,
103173
103177
  [CoreErrorCode.SqlIsNotRefreshedFromServer]: `SQL statement not loaded from server and need to be refreshed. Use "Run" button over the SQL statement to force retrieve new definition.`,
103174
103178
  [SpecificCoreErrorCode.UniquenessDatasetsId]: `There are more datasets with id "{0}". Use unique names for datasets.`,
@@ -103254,6 +103258,8 @@ const CoreErrorTypes$1 = {
103254
103258
  [CoreErrorCode.ParameterDuplicateAllowedTitle]: "ParameterDuplicateAllowedTitle",
103255
103259
  [CoreErrorCode.ParameterLengthRange]: "ParameterLengthRange",
103256
103260
  [CoreErrorCode.ParameterDefaultOutOfBounds]: "ParameterDefaultOutOfBounds",
103261
+ [CoreErrorCode.ParameterNumberRange]: "ParameterNumberRange",
103262
+ [CoreErrorCode.ParameterDefaultOutOfRange]: "ParameterDefaultOutOfRange",
103257
103263
  [CoreErrorCode.MissingDataSourceId]: "MissingDataSourceId",
103258
103264
  [SpecificCoreErrorCode.UniquenessDatasetsId]: "UniquenessDatasetsId",
103259
103265
  [SpecificCoreErrorCode.UniquenessMetricsId]: "UniquenessMetricsId",
@@ -106661,7 +106667,12 @@ function normalizeUrl(urlString, options) {
106661
106667
  }
106662
106668
  //#endregion
106663
106669
  //#region ../code/esm/features/references/utils/index.js
106670
+ /**
106671
+ * The computed attribute token precedes "attribute" in the alternation the patterns build from
106672
+ * this list, so the longer token wins.
106673
+ */
106664
106674
  const SupportedReferenceTypes$1 = [
106675
+ "computed_attribute",
106665
106676
  "fact",
106666
106677
  "label",
106667
106678
  "metric",
@@ -106669,14 +106680,21 @@ const SupportedReferenceTypes$1 = [
106669
106680
  "attribute"
106670
106681
  ];
106671
106682
  /**
106672
- * MAQL can additionally name a parameter and a computed attribute; custom URLs and shorthand fields
106673
- * cannot. The computed attribute token precedes "attribute" in the alternation the patterns build
106674
- * from this list, so the longer token wins.
106683
+ * MAQL can additionally name a parameter.
106675
106684
  */
106676
- const SupportedMaqlReferenceTypes = [
106677
- "computed_attribute",
106678
- ...SupportedReferenceTypes$1,
106679
- "parameter"
106685
+ const SupportedMaqlReferenceTypes = [...SupportedReferenceTypes$1, "parameter"];
106686
+ /**
106687
+ * A custom URL substitutes attribute values only; it cannot name a computed attribute or a parameter.
106688
+ */
106689
+ const SupportedCustomUrlReferenceTypes = SupportedReferenceTypes$1.filter((type) => type !== "computed_attribute");
106690
+ /**
106691
+ * Reference prefixes that stand for an attribute-like object a query field, an attribute filter
106692
+ * or a drill can use. A computed attribute behaves as a label with computed values.
106693
+ */
106694
+ const AttributeLikeReferenceTypes$1 = [
106695
+ "attribute",
106696
+ "label",
106697
+ "computed_attribute"
106680
106698
  ];
106681
106699
  /** The id fragment of a `type/id` reference, shared by every pattern that matches one. */
106682
106700
  const REFERENCE_ID_PATTERN = "(?!\\.)[.A-Za-z0-9_-]{1,255}";
@@ -106883,11 +106901,7 @@ function isShothandField(obj) {
106883
106901
  function isAttributeField$1(obj) {
106884
106902
  if (typeof obj === "object" && obj && "using" in obj && typeof obj.using === "string" && !("aggregation" in obj)) {
106885
106903
  const id = parseReferenceObject$1(obj.using);
106886
- return Boolean(id && [
106887
- "attribute",
106888
- "label",
106889
- "fact"
106890
- ].includes(id.type));
106904
+ return Boolean(id && [...AttributeLikeReferenceTypes$1, "fact"].includes(id.type));
106891
106905
  }
106892
106906
  return false;
106893
106907
  }
@@ -106938,14 +106952,14 @@ function isAllTimeDateFilter$1(obj) {
106938
106952
  function isAttributeFilter$2(obj) {
106939
106953
  if (typeof obj === "object" && obj && "using" in obj && "type" in obj && obj.type === "attribute_filter") {
106940
106954
  const id = parseReferenceObject$1(obj.using);
106941
- return Boolean(id && ["attribute", "label"].includes(id.type));
106955
+ return Boolean(id && AttributeLikeReferenceTypes$1.includes(id.type));
106942
106956
  }
106943
106957
  return false;
106944
106958
  }
106945
106959
  function isTextFilter$1(obj) {
106946
106960
  if (typeof obj === "object" && obj && "using" in obj && typeof obj.using === "string" && "type" in obj && obj.type === "text_filter") {
106947
106961
  const id = parseReferenceObject$1(obj.using);
106948
- return Boolean(id && ["attribute", "label"].includes(id.type));
106962
+ return Boolean(id && AttributeLikeReferenceTypes$1.includes(id.type));
106949
106963
  }
106950
106964
  return false;
106951
106965
  }
@@ -106999,7 +107013,7 @@ function isDashboardAttributeFilter$2(obj) {
106999
107013
  function isDashboardTextFilter$1(obj) {
107000
107014
  if (typeof obj === "object" && obj && "type" in obj && obj.type === "text_filter" && "using" in obj && typeof obj.using === "string") {
107001
107015
  const id = parseReferenceObject$1(obj.using);
107002
- return Boolean(id && ["attribute", "label"].includes(id.type));
107016
+ return Boolean(id && AttributeLikeReferenceTypes$1.includes(id.type));
107003
107017
  }
107004
107018
  return false;
107005
107019
  }
@@ -135226,15 +135240,32 @@ function getIdentifier(obj, untype, errorContext) {
135226
135240
  identifier: obj.identifier.id
135227
135241
  } : obj;
135228
135242
  if (isLocalIdRef(idRef)) return idRef.localIdentifier;
135229
- if (isIdentifierRef(idRef) && !untype) return `${idRef.type === "measure" ? "metric" : idRef.type}/${idRef.identifier}`;
135243
+ if (isIdentifierRef(idRef) && !untype) return `${declarativeTypeToReferencePrefix(idRef.type)}/${idRef.identifier}`;
135230
135244
  if (isIdentifierRef(idRef) && untype) return idRef.identifier;
135231
135245
  throw newError("core.referenceTypeNotSupported", [JSON.stringify(obj)], errorContext);
135232
135246
  }
135247
+ /**
135248
+ * Maps the yaml reference prefix (`metric/`, `computed_attribute/`, ...) to the object type the
135249
+ * declarative API uses for the same object.
135250
+ */
135251
+ function referencePrefixToDeclarativeType(prefix, forceMetric) {
135252
+ if (prefix === "metric" && !forceMetric) return "measure";
135253
+ if (prefix === "computed_attribute") return "computedAttribute";
135254
+ return prefix;
135255
+ }
135256
+ /**
135257
+ * Inverse of {@link referencePrefixToDeclarativeType}.
135258
+ */
135259
+ function declarativeTypeToReferencePrefix(type) {
135260
+ if (type === "measure") return "metric";
135261
+ if (type === "computedAttribute") return "computed_attribute";
135262
+ return type;
135263
+ }
135233
135264
  /** @public */
135234
135265
  function createIdentifier(data, { forceMetric, forceType } = {}) {
135235
135266
  const [type, objId] = data.split("/");
135236
135267
  if (type && objId) return { identifier: {
135237
- type: forceType || (type === "metric" && !forceMetric ? "measure" : type),
135268
+ type: forceType || referencePrefixToDeclarativeType(type, forceMetric),
135238
135269
  id: objId
135239
135270
  } };
135240
135271
  if (forceType) return { identifier: {
@@ -135540,6 +135571,14 @@ function yamlMetricToDeclarative(input) {
135540
135571
  function isDeclarativeStringParameter(parameter) {
135541
135572
  return parameter.content.type === "STRING";
135542
135573
  }
135574
+ /** @public */
135575
+ function isDeclarativeNumberParameter(parameter) {
135576
+ return parameter.content.type === "NUMBER";
135577
+ }
135578
+ /** @public */
135579
+ function isDeclarativeCodeParameter(parameter) {
135580
+ return isDeclarativeStringParameter(parameter) || isDeclarativeNumberParameter(parameter);
135581
+ }
135543
135582
  /**
135544
135583
  * Spreadable `constraints` entry for a parameter definition: present only when at least one
135545
135584
  * restriction is set, and never carrying a key whose value is undefined.
@@ -135568,6 +135607,9 @@ function yamlParameterToDeclarative(input) {
135568
135607
  };
135569
135608
  }
135570
135609
  function yamlParameterDefinitionToDeclarative(definition) {
135610
+ return definition.type === "NUMBER" ? yamlNumberDefinitionToDeclarative(definition) : yamlStringDefinitionToDeclarative(definition);
135611
+ }
135612
+ function yamlStringDefinitionToDeclarative(definition) {
135571
135613
  const { minLength, maxLength, allowedValues } = definition.constraints ?? {};
135572
135614
  return {
135573
135615
  type: "STRING",
@@ -135579,15 +135621,19 @@ function yamlParameterDefinitionToDeclarative(definition) {
135579
135621
  })
135580
135622
  };
135581
135623
  }
135624
+ function yamlNumberDefinitionToDeclarative(definition) {
135625
+ const { min, max } = definition.constraints ?? {};
135626
+ return {
135627
+ type: "NUMBER",
135628
+ defaultValue: definition.defaultValue,
135629
+ ...optionalConstraints({
135630
+ min,
135631
+ max
135632
+ })
135633
+ };
135634
+ }
135582
135635
  //#endregion
135583
135636
  //#region ../../../sdk/libs/sdk-code-convertors/src/to/yamlComputedAttributeToDeclarative.ts
135584
- /**
135585
- * A computed attribute is textual for now: the backend does not transfer the value type from
135586
- * metadata yet, so every computed attribute is interpreted as a STRING/TEXT one. The YAML shape
135587
- * therefore does not expose dataType/valueType and the defaults are filled in here.
135588
- */
135589
- const DEFAULT_DATA_TYPE = "STRING";
135590
- const DEFAULT_VALUE_TYPE = "TEXT";
135591
135637
  /** @public */
135592
135638
  function yamlComputedAttributeToDeclarative(input) {
135593
135639
  const output = {
@@ -135595,10 +135641,15 @@ function yamlComputedAttributeToDeclarative(input) {
135595
135641
  title: input.title ?? convertIdToTitle$1(input.id),
135596
135642
  description: input.description ?? "",
135597
135643
  tags: input.tags ?? [],
135598
- content: { maql: input.maql },
135599
- dataType: DEFAULT_DATA_TYPE,
135600
- valueType: DEFAULT_VALUE_TYPE
135601
- };
135644
+ content: { maql: input.maql }
135645
+ };
135646
+ if (input.format !== void 0) output.content.format = input.format;
135647
+ if (input.metric_type !== void 0) output.content.metricType = input.metric_type;
135648
+ if (input.data_type !== void 0) output.dataType = input.data_type;
135649
+ if (input.value_type !== void 0) output.valueType = input.value_type;
135650
+ if (input.is_nullable !== void 0) output.isNullable = input.is_nullable;
135651
+ if (input.null_value_join_replacement !== void 0) output.nullValue = input.null_value_join_replacement;
135652
+ if (input.show_in_ai_results !== void 0) output.isHidden = input.show_in_ai_results === false;
135602
135653
  if (input.locale !== void 0) output.locale = input.locale;
135603
135654
  return output;
135604
135655
  }
@@ -135655,10 +135706,20 @@ function addInPath(base, path, newValue) {
135655
135706
  const SupportedReferenceTypes = [
135656
135707
  "fact",
135657
135708
  "label",
135709
+ "computed_attribute",
135658
135710
  "metric",
135659
135711
  "dataset",
135660
135712
  "attribute"
135661
135713
  ];
135714
+ /**
135715
+ * Reference prefixes that stand for an attribute-like object a query field, an attribute filter
135716
+ * or a drill can use. A computed attribute behaves as a label with computed values.
135717
+ */
135718
+ const AttributeLikeReferenceTypes = [
135719
+ "attribute",
135720
+ "label",
135721
+ "computed_attribute"
135722
+ ];
135662
135723
  function parseReferenceObject(obj) {
135663
135724
  const [t, identifier] = obj?.split("/") ?? [];
135664
135725
  const type = t;
@@ -135676,14 +135737,16 @@ function isAttribute(obj) {
135676
135737
  function isAttributeField(obj) {
135677
135738
  if (typeof obj === "object" && obj && "using" in obj && typeof obj.using === "string" && !("aggregation" in obj)) {
135678
135739
  const id = parseReferenceObject(obj.using);
135679
- return Boolean(id && [
135680
- "attribute",
135681
- "label",
135682
- "fact"
135683
- ].includes(id.type));
135740
+ return Boolean(id && [...AttributeLikeReferenceTypes, "fact"].includes(id.type));
135684
135741
  }
135685
135742
  return false;
135686
135743
  }
135744
+ /**
135745
+ * Whether the reference names a computed attribute (`computed_attribute/{id}`).
135746
+ */
135747
+ function isComputedAttributeReference(reference) {
135748
+ return parseReferenceObject(reference)?.type === "computed_attribute";
135749
+ }
135687
135750
  function isInlineMetricField(obj) {
135688
135751
  return typeof obj === "object" && obj !== null && "maql" in obj && typeof obj.maql === "string";
135689
135752
  }
@@ -135731,7 +135794,7 @@ function isAllTimeDateFilter(obj) {
135731
135794
  function isAttributeFilter(obj) {
135732
135795
  if (typeof obj === "object" && obj && "using" in obj && "type" in obj && obj.type === "attribute_filter") {
135733
135796
  const id = parseReferenceObject(obj.using);
135734
- return Boolean(id && ["attribute", "label"].includes(id.type));
135797
+ return Boolean(id && AttributeLikeReferenceTypes.includes(id.type));
135735
135798
  }
135736
135799
  return false;
135737
135800
  }
@@ -139638,6 +139701,10 @@ function findObjectProps(entities, item) {
139638
139701
  switch (item.identifier.type) {
139639
139702
  case "attribute": return { title: items.attributes.find((attribute) => attribute.attribute.id === item.identifier.id)?.attribute.title ?? firstLetterUpperCase(convertIdToTitle$1(item.identifier.id).toLowerCase()) };
139640
139703
  case "fact": return { title: items.facts.find((fact) => fact.fact.id === item.identifier.id)?.fact.title ?? firstLetterUpperCase(convertIdToTitle$1(item.identifier.id).toLowerCase()) };
139704
+ case "computedAttribute": {
139705
+ const found = entities.find((entity) => entity.type === "computed_attribute" && entity.id === item.identifier.id);
139706
+ return { title: (found ? found.data.title : void 0) ?? firstLetterUpperCase(convertIdToTitle$1(item.identifier.id).toLowerCase()) };
139707
+ }
139641
139708
  case "label":
139642
139709
  case "metric": return { title: items.labels.find((label) => label.id === item.identifier.id)?.title ?? firstLetterUpperCase(convertIdToTitle$1(item.identifier.id).toLowerCase()) };
139643
139710
  }
@@ -141057,7 +141124,7 @@ function sourceInsightFilterIdToDeclarative(filterId, sourceVisualizationFilters
141057
141124
  }
141058
141125
  function yamlIgnoredFilterToDeclarative(input) {
141059
141126
  const ref = parseReferenceObject(input);
141060
- if (ref?.type === "label") return {
141127
+ if (ref?.type === "label" || ref?.type === "computed_attribute") return {
141061
141128
  type: "attributeFilterReference",
141062
141129
  displayForm: createIdentifier(input)
141063
141130
  };
@@ -141620,6 +141687,9 @@ function declarativeParameterToYaml(parameter) {
141620
141687
  };
141621
141688
  }
141622
141689
  function declarativeParameterDefinitionToYaml(definition) {
141690
+ return definition.type === "NUMBER" ? declarativeNumberDefinitionToYaml(definition) : declarativeStringDefinitionToYaml(definition);
141691
+ }
141692
+ function declarativeStringDefinitionToYaml(definition) {
141623
141693
  const { minLength, maxLength, allowedValues } = definition.constraints ?? {};
141624
141694
  const [first, ...rest] = allowedValues ?? [];
141625
141695
  return {
@@ -141632,6 +141702,17 @@ function declarativeParameterDefinitionToYaml(definition) {
141632
141702
  })
141633
141703
  };
141634
141704
  }
141705
+ function declarativeNumberDefinitionToYaml(definition) {
141706
+ const { min, max } = definition.constraints ?? {};
141707
+ return {
141708
+ type: "NUMBER",
141709
+ defaultValue: definition.defaultValue,
141710
+ ...optionalConstraints({
141711
+ min,
141712
+ max
141713
+ })
141714
+ };
141715
+ }
141635
141716
  //#endregion
141636
141717
  //#region ../../../sdk/libs/sdk-code-convertors/src/from/declarativeComputedAttributeToYaml.ts
141637
141718
  /** @public */
@@ -141643,6 +141724,13 @@ function declarativeComputedAttributeToYaml(computedAttribute) {
141643
141724
  doc.commentBefore = COMPUTED_ATTRIBUTE_COMMENT;
141644
141725
  fillOptionalMetaFields(doc, computedAttribute);
141645
141726
  doc.add(entryWithSpace("maql", computedAttribute.content.maql ?? ""));
141727
+ if (computedAttribute.content.format) doc.add(doc.createPair("format", computedAttribute.content.format));
141728
+ if (computedAttribute.content.metricType) doc.add(doc.createPair("metric_type", computedAttribute.content.metricType));
141729
+ if (computedAttribute.dataType) doc.add(doc.createPair("data_type", computedAttribute.dataType));
141730
+ if (computedAttribute.valueType) doc.add(doc.createPair("value_type", computedAttribute.valueType));
141731
+ if (computedAttribute.isNullable !== void 0) doc.add(doc.createPair("is_nullable", computedAttribute.isNullable));
141732
+ if (computedAttribute.nullValue !== void 0) doc.add(doc.createPair("null_value_join_replacement", computedAttribute.nullValue));
141733
+ if (computedAttribute.isHidden === true) doc.add(doc.createPair("show_in_ai_results", false));
141646
141734
  if (computedAttribute.locale) doc.add(doc.createPair("locale", computedAttribute.locale));
141647
141735
  return {
141648
141736
  content: doc.toString({ lineWidth: 0 }),
@@ -143510,7 +143598,7 @@ function buildExecution(entities, query) {
143510
143598
  const fieldDef = getFullField$1(fields[field]);
143511
143599
  if (isAttributeField(fieldDef)) return {
143512
143600
  localIdentifier: field,
143513
- label: createIdentifier(fieldDef.using, { forceType: "label" }),
143601
+ label: isComputedAttributeReference(fieldDef.using) ? createIdentifier(fieldDef.using) : createIdentifier(fieldDef.using, { forceType: "label" }),
143514
143602
  showAllValues: fieldDef.show_all_values
143515
143603
  };
143516
143604
  return null;
@@ -143794,8 +143882,8 @@ const SupportedUrlTargetPlaceholders = [
143794
143882
  "workspace_id"
143795
143883
  ];
143796
143884
  const SupportFilterPlaceholders = ["dash_attribute_filter_selection", "attribute_filter_selection"];
143797
- new RegExp(`\\{((?:${SupportedReferenceTypes$1.join("|")})\\/(?!\\.)[.A-Za-z0-9_-]{1,255})\\}`);
143798
- const referenceAndPlaceholdersRegex = new RegExp(`\\{((?:${SupportedReferenceTypes$1.join("|")})\\/(?!\\.)[.A-Za-z0-9_-]{1,255}|(?:${SupportedUrlTargetPlaceholders.join("|")})|(?:${SupportFilterPlaceholders.join("|")})\\((?!\\.)[.A-Za-z0-9_-]{1,255}\\))\\}`);
143885
+ new RegExp(`\\{((?:${SupportedCustomUrlReferenceTypes.join("|")})\\/(?!\\.)[.A-Za-z0-9_-]{1,255})\\}`);
143886
+ const referenceAndPlaceholdersRegex = new RegExp(`\\{((?:${SupportedCustomUrlReferenceTypes.join("|")})\\/(?!\\.)[.A-Za-z0-9_-]{1,255}|(?:${SupportedUrlTargetPlaceholders.join("|")})|(?:${SupportFilterPlaceholders.join("|")})\\((?!\\.)[.A-Za-z0-9_-]{1,255}\\))\\}`);
143799
143887
  function loadUrlTarget(data) {
143800
143888
  const parsed = data.split(referenceAndPlaceholdersRegex);
143801
143889
  const result = [];
@@ -145212,7 +145300,7 @@ function resolveCurrentInsightWidgetQueryFieldAttribute(references, widget, type
145212
145300
  visualisation: visualisation.id
145213
145301
  };
145214
145302
  if (!isDateAttribute && types.includes("attribute")) return {
145215
- id: attributesMap[field.using],
145303
+ id: attributesMap[field.using] ?? field.using,
145216
145304
  ..."title" in field ? { title: field.title } : {},
145217
145305
  ..."alias" in field ? { title: field.alias } : {},
145218
145306
  visualisation: visualisation.id
@@ -147501,9 +147589,59 @@ const metadata_v1 = {
147501
147589
  "description": "Define MAQL syntax for the computed attribute. Values are assigned with break points written as CASE WHEN branches over a metric, and the first matching branch wins.",
147502
147590
  "$semantic": { "type": "maql" }
147503
147591
  },
147504
- "locale": {
147592
+ "format": {
147593
+ "type": "string",
147594
+ "description": "An optional Excel-like format string applied to the computed values."
147595
+ },
147596
+ "metric_type": {
147505
147597
  "type": "string",
147506
- "description": "An optional locale whose collation order the computed values are sorted by."
147598
+ "enum": ["UNSPECIFIED", "CURRENCY"],
147599
+ "description": "An optional categorization of the computed values semantics, for example currency."
147600
+ },
147601
+ "data_type": {
147602
+ "type": "string",
147603
+ "enum": [
147604
+ "INT",
147605
+ "STRING",
147606
+ "DATE",
147607
+ "NUMERIC",
147608
+ "TIMESTAMP",
147609
+ "TIMESTAMP_TZ",
147610
+ "BOOLEAN",
147611
+ "HLL"
147612
+ ],
147613
+ "description": "An optional data type of the computed values. Defaults to STRING on the backend."
147614
+ },
147615
+ "value_type": {
147616
+ "type": "string",
147617
+ "enum": [
147618
+ "TEXT",
147619
+ "HYPERLINK",
147620
+ "GEO",
147621
+ "GEO_LONGITUDE",
147622
+ "GEO_LATITUDE",
147623
+ "GEO_AREA",
147624
+ "GEO_ICON",
147625
+ "IMAGE",
147626
+ "HYPERLOGLOG"
147627
+ ],
147628
+ "description": "An optional specific type of the computed values. Defaults to TEXT on the backend."
147629
+ },
147630
+ "is_nullable": {
147631
+ "type": "boolean",
147632
+ "description": "Optional flag to indicate if the computed attribute can contain null values."
147633
+ },
147634
+ "null_value_join_replacement": {
147635
+ "type": "string",
147636
+ "description": "Optional value which can be used as replacement for NULL in join conditions."
147637
+ },
147638
+ "show_in_ai_results": {
147639
+ "type": "boolean",
147640
+ "description": "Optional flag to indicate if the computed attribute should be shown in AI results. When omitted, the computed attribute is visible."
147641
+ },
147642
+ "locale": {
147643
+ "$ref": "#/$global/gaac/locale",
147644
+ "description": "An optional locale in BCP 47 format (for example en-US) whose collation order the computed values are sorted by."
147507
147645
  }
147508
147646
  },
147509
147647
  "$semantic": {
@@ -149781,6 +149919,12 @@ const metadata_v1 = {
149781
149919
  "typePrefix": true
149782
149920
  }
149783
149921
  },
149922
+ "locale": {
149923
+ "title": "Locale",
149924
+ "type": "string",
149925
+ "pattern": "^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{1,8})*$",
149926
+ "description": "Locale string in BCP 47 format (for example en-US or cs-CZ-u-kn-true)."
149927
+ },
149784
149928
  "dashboardFilters": {
149785
149929
  "title": "Dashboard Filters",
149786
149930
  "type": "object",
@@ -149861,6 +150005,17 @@ const metadata_v1 = {
149861
150005
  "typePrefix": true
149862
150006
  }
149863
150007
  },
150008
+ "computedAttributeIdentifier": {
150009
+ "title": "Computed Attribute Identifier",
150010
+ "description": "A computed attribute identifier in the form of computed_attribute/{id}.",
150011
+ "type": "string",
150012
+ "pattern": "^computed_attribute/(?!\\.)[.A-Za-z0-9_-]{1,255}$",
150013
+ "$semantic": {
150014
+ "type": "reference",
150015
+ "source": "computedAttribute.id",
150016
+ "typePrefix": true
150017
+ }
150018
+ },
149864
150019
  "queryFilters": {
149865
150020
  "title": "Query Filters",
149866
150021
  "type": "object",
@@ -150606,6 +150761,17 @@ const metadata_v1 = {
150606
150761
  "typePrefix": true
150607
150762
  }
150608
150763
  },
150764
+ "computedAttributeIdentifier": {
150765
+ "title": "Computed Attribute Identifier",
150766
+ "description": "A computed attribute identifier in the form of computed_attribute/{id}.",
150767
+ "type": "string",
150768
+ "pattern": "^computed_attribute/(?!\\.)[.A-Za-z0-9_-]{1,255}$",
150769
+ "$semantic": {
150770
+ "type": "reference",
150771
+ "source": "computedAttribute.id",
150772
+ "typePrefix": true
150773
+ }
150774
+ },
150609
150775
  "displayAsLabelIdentifier": {
150610
150776
  "title": "Display As Label Identifier",
150611
150777
  "description": "Configures the label used for representing attribute filter elements in UI.",
@@ -150831,7 +150997,11 @@ const metadata_v1 = {
150831
150997
  },
150832
150998
  "using": {
150833
150999
  "description": "Attribute or label to use in this filter.",
150834
- "oneOf": [{ "$ref": "#/$defs/attributeIdentifier" }, { "$ref": "#/$defs/labelIdentifier" }],
151000
+ "oneOf": [
151001
+ { "$ref": "#/$defs/attributeIdentifier" },
151002
+ { "$ref": "#/$defs/labelIdentifier" },
151003
+ { "$ref": "#/$defs/computedAttributeIdentifier" }
151004
+ ],
150835
151005
  "$semantic": { "type": "one_attribute_item_only" }
150836
151006
  },
150837
151007
  "multiselect": {
@@ -150919,7 +151089,11 @@ const metadata_v1 = {
150919
151089
  },
150920
151090
  "using": {
150921
151091
  "description": "Attribute or label to use in this filter.",
150922
- "oneOf": [{ "$ref": "#/$defs/attributeIdentifier" }, { "$ref": "#/$defs/labelIdentifier" }]
151092
+ "oneOf": [
151093
+ { "$ref": "#/$defs/attributeIdentifier" },
151094
+ { "$ref": "#/$defs/labelIdentifier" },
151095
+ { "$ref": "#/$defs/computedAttributeIdentifier" }
151096
+ ]
150923
151097
  },
150924
151098
  "multiselect": {
150925
151099
  "type": "boolean",
@@ -151019,7 +151193,11 @@ const metadata_v1 = {
151019
151193
  },
151020
151194
  "using": {
151021
151195
  "description": "Attribute or label to use in this filter.",
151022
- "oneOf": [{ "$ref": "#/$defs/attributeIdentifier" }, { "$ref": "#/$defs/labelIdentifier" }]
151196
+ "oneOf": [
151197
+ { "$ref": "#/$defs/attributeIdentifier" },
151198
+ { "$ref": "#/$defs/labelIdentifier" },
151199
+ { "$ref": "#/$defs/computedAttributeIdentifier" }
151200
+ ]
151023
151201
  },
151024
151202
  "multiselect": {
151025
151203
  "type": "boolean",
@@ -151127,7 +151305,11 @@ const metadata_v1 = {
151127
151305
  },
151128
151306
  "using": {
151129
151307
  "description": "Attribute or label to use in this filter.",
151130
- "oneOf": [{ "$ref": "#/$defs/attributeIdentifier" }, { "$ref": "#/$defs/labelIdentifier" }],
151308
+ "oneOf": [
151309
+ { "$ref": "#/$defs/attributeIdentifier" },
151310
+ { "$ref": "#/$defs/labelIdentifier" },
151311
+ { "$ref": "#/$defs/computedAttributeIdentifier" }
151312
+ ],
151131
151313
  "$semantic": { "type": "one_attribute_item_only" }
151132
151314
  },
151133
151315
  "case_sensitive": { "type": "boolean" },
@@ -151229,7 +151411,11 @@ const metadata_v1 = {
151229
151411
  },
151230
151412
  "using": {
151231
151413
  "description": "Attribute or label to use in this filter.",
151232
- "oneOf": [{ "$ref": "#/$defs/attributeIdentifier" }, { "$ref": "#/$defs/labelIdentifier" }],
151414
+ "oneOf": [
151415
+ { "$ref": "#/$defs/attributeIdentifier" },
151416
+ { "$ref": "#/$defs/labelIdentifier" },
151417
+ { "$ref": "#/$defs/computedAttributeIdentifier" }
151418
+ ],
151233
151419
  "$semantic": { "type": "one_attribute_item_only" }
151234
151420
  },
151235
151421
  "condition": { "enum": ["is", "isNot"] },
@@ -151342,7 +151528,11 @@ const metadata_v1 = {
151342
151528
  },
151343
151529
  "using": {
151344
151530
  "description": "Attribute or label to use in this filter.",
151345
- "oneOf": [{ "$ref": "#/$defs/attributeIdentifier" }, { "$ref": "#/$defs/labelIdentifier" }],
151531
+ "oneOf": [
151532
+ { "$ref": "#/$defs/attributeIdentifier" },
151533
+ { "$ref": "#/$defs/labelIdentifier" },
151534
+ { "$ref": "#/$defs/computedAttributeIdentifier" }
151535
+ ],
151346
151536
  "$semantic": { "type": "one_attribute_item_only" }
151347
151537
  },
151348
151538
  "condition": { "enum": [
@@ -151421,8 +151611,8 @@ const metadata_v1 = {
151421
151611
  },
151422
151612
  "dimensionality": {
151423
151613
  "type": "array",
151424
- "description": "Optional array of label references to apply dimensionality to the filter.",
151425
- "items": { "$ref": "#/$defs/labelIdentifier" }
151614
+ "description": "Optional array of label or computed attribute references to apply dimensionality to the filter.",
151615
+ "items": { "oneOf": [{ "$ref": "#/$defs/labelIdentifier" }, { "$ref": "#/$defs/computedAttributeIdentifier" }] }
151426
151616
  },
151427
151617
  "null_values_as_zero": {
151428
151618
  "type": "boolean",
@@ -151909,7 +152099,11 @@ const metadata_v1 = {
151909
152099
  },
151910
152100
  "using": {
151911
152101
  "description": "Attribute or label to use in this filter.",
151912
- "oneOf": [{ "$ref": "#/$defs/attributeIdentifier" }, { "$ref": "#/$defs/labelIdentifier" }]
152102
+ "oneOf": [
152103
+ { "$ref": "#/$defs/attributeIdentifier" },
152104
+ { "$ref": "#/$defs/labelIdentifier" },
152105
+ { "$ref": "#/$defs/computedAttributeIdentifier" }
152106
+ ]
151913
152107
  },
151914
152108
  "display_as": {
151915
152109
  "type": "string",
@@ -151973,7 +152167,11 @@ const metadata_v1 = {
151973
152167
  },
151974
152168
  "using": {
151975
152169
  "description": "Attribute or label to use in this filter.",
151976
- "oneOf": [{ "$ref": "#/$defs/attributeIdentifier" }, { "$ref": "#/$defs/labelIdentifier" }]
152170
+ "oneOf": [
152171
+ { "$ref": "#/$defs/attributeIdentifier" },
152172
+ { "$ref": "#/$defs/labelIdentifier" },
152173
+ { "$ref": "#/$defs/computedAttributeIdentifier" }
152174
+ ]
151977
152175
  },
151978
152176
  "case_sensitive": { "type": "boolean" },
151979
152177
  "display_as": {
@@ -151990,7 +152188,11 @@ const metadata_v1 = {
151990
152188
  },
151991
152189
  "using": {
151992
152190
  "description": "Attribute or label to use in this filter.",
151993
- "oneOf": [{ "$ref": "#/$defs/attributeIdentifier" }, { "$ref": "#/$defs/labelIdentifier" }]
152191
+ "oneOf": [
152192
+ { "$ref": "#/$defs/attributeIdentifier" },
152193
+ { "$ref": "#/$defs/labelIdentifier" },
152194
+ { "$ref": "#/$defs/computedAttributeIdentifier" }
152195
+ ]
151994
152196
  },
151995
152197
  "condition": { "enum": ["is", "isNot"] },
151996
152198
  "values": {
@@ -152018,7 +152220,11 @@ const metadata_v1 = {
152018
152220
  },
152019
152221
  "using": {
152020
152222
  "description": "Attribute or label to use in this filter.",
152021
- "oneOf": [{ "$ref": "#/$defs/attributeIdentifier" }, { "$ref": "#/$defs/labelIdentifier" }]
152223
+ "oneOf": [
152224
+ { "$ref": "#/$defs/attributeIdentifier" },
152225
+ { "$ref": "#/$defs/labelIdentifier" },
152226
+ { "$ref": "#/$defs/computedAttributeIdentifier" }
152227
+ ]
152022
152228
  },
152023
152229
  "condition": { "enum": [
152024
152230
  "contains",
@@ -152122,13 +152328,17 @@ const metadata_v1 = {
152122
152328
  "dimensionality": {
152123
152329
  "type": "array",
152124
152330
  "description": "Optional array of attribute or label references or local identifiers to apply dimensionality to the filter.",
152125
- "items": { "oneOf": [{ "$ref": "#/$defs/labelIdentifier" }, {
152126
- "type": "string",
152127
- "$semantic": {
152128
- "type": "reference",
152129
- "sources": ["current.query.attribute.localId"]
152331
+ "items": { "oneOf": [
152332
+ { "$ref": "#/$defs/labelIdentifier" },
152333
+ { "$ref": "#/$defs/computedAttributeIdentifier" },
152334
+ {
152335
+ "type": "string",
152336
+ "$semantic": {
152337
+ "type": "reference",
152338
+ "sources": ["current.query.attribute.localId"]
152339
+ }
152130
152340
  }
152131
- }] }
152341
+ ] }
152132
152342
  }
152133
152343
  },
152134
152344
  "required": [
@@ -152191,13 +152401,17 @@ const metadata_v1 = {
152191
152401
  "dimensionality": {
152192
152402
  "type": "array",
152193
152403
  "description": "Optional array of attribute or label references or local identifiers to apply dimensionality to the filter.",
152194
- "items": { "oneOf": [{ "$ref": "#/$defs/labelIdentifier" }, {
152195
- "type": "string",
152196
- "$semantic": {
152197
- "type": "reference",
152198
- "sources": ["current.query.attribute.localId"]
152404
+ "items": { "oneOf": [
152405
+ { "$ref": "#/$defs/labelIdentifier" },
152406
+ { "$ref": "#/$defs/computedAttributeIdentifier" },
152407
+ {
152408
+ "type": "string",
152409
+ "$semantic": {
152410
+ "type": "reference",
152411
+ "sources": ["current.query.attribute.localId"]
152412
+ }
152199
152413
  }
152200
- }] }
152414
+ ] }
152201
152415
  }
152202
152416
  },
152203
152417
  "required": [
@@ -152251,13 +152465,17 @@ const metadata_v1 = {
152251
152465
  "dimensionality": {
152252
152466
  "type": "array",
152253
152467
  "description": "Optional array of attribute or label references or local identifiers to apply dimensionality to the filter.",
152254
- "items": { "oneOf": [{ "$ref": "#/$defs/labelIdentifier" }, {
152255
- "type": "string",
152256
- "$semantic": {
152257
- "type": "reference",
152258
- "sources": ["current.query.attribute.localId"]
152468
+ "items": { "oneOf": [
152469
+ { "$ref": "#/$defs/labelIdentifier" },
152470
+ { "$ref": "#/$defs/computedAttributeIdentifier" },
152471
+ {
152472
+ "type": "string",
152473
+ "$semantic": {
152474
+ "type": "reference",
152475
+ "sources": ["current.query.attribute.localId"]
152476
+ }
152259
152477
  }
152260
- }] }
152478
+ ] }
152261
152479
  }
152262
152480
  },
152263
152481
  "required": [
@@ -152298,13 +152516,17 @@ const metadata_v1 = {
152298
152516
  "dimensionality": {
152299
152517
  "type": "array",
152300
152518
  "description": "Optional array of attribute or label references or local identifiers to apply dimensionality to the filter.",
152301
- "items": { "oneOf": [{ "$ref": "#/$defs/labelIdentifier" }, {
152302
- "type": "string",
152303
- "$semantic": {
152304
- "type": "reference",
152305
- "sources": ["current.query.attribute.localId"]
152519
+ "items": { "oneOf": [
152520
+ { "$ref": "#/$defs/labelIdentifier" },
152521
+ { "$ref": "#/$defs/computedAttributeIdentifier" },
152522
+ {
152523
+ "type": "string",
152524
+ "$semantic": {
152525
+ "type": "reference",
152526
+ "sources": ["current.query.attribute.localId"]
152527
+ }
152306
152528
  }
152307
- }] }
152529
+ ] }
152308
152530
  }
152309
152531
  },
152310
152532
  "required": ["type", "using"]
@@ -152339,13 +152561,17 @@ const metadata_v1 = {
152339
152561
  },
152340
152562
  "attribute": {
152341
152563
  "description": "Label reference or local identifier to use for this filter.",
152342
- "oneOf": [{ "$ref": "#/$defs/labelIdentifier" }, {
152343
- "type": "string",
152344
- "$semantic": {
152345
- "type": "reference",
152346
- "source": "current.query.attribute.localId"
152564
+ "oneOf": [
152565
+ { "$ref": "#/$defs/labelIdentifier" },
152566
+ { "$ref": "#/$defs/computedAttributeIdentifier" },
152567
+ {
152568
+ "type": "string",
152569
+ "$semantic": {
152570
+ "type": "reference",
152571
+ "source": "current.query.attribute.localId"
152572
+ }
152347
152573
  }
152348
- }]
152574
+ ]
152349
152575
  },
152350
152576
  "bottom": {
152351
152577
  "type": "number",
@@ -152420,9 +152646,59 @@ const metadata_v1 = {
152420
152646
  "description": "Define MAQL syntax for the computed attribute. Values are assigned with break points written as CASE WHEN branches over a metric, and the first matching branch wins.",
152421
152647
  "$semantic": { "type": "maql" }
152422
152648
  },
152423
- "locale": {
152649
+ "format": {
152650
+ "type": "string",
152651
+ "description": "An optional Excel-like format string applied to the computed values."
152652
+ },
152653
+ "metric_type": {
152654
+ "type": "string",
152655
+ "enum": ["UNSPECIFIED", "CURRENCY"],
152656
+ "description": "An optional categorization of the computed values semantics, for example currency."
152657
+ },
152658
+ "data_type": {
152659
+ "type": "string",
152660
+ "enum": [
152661
+ "INT",
152662
+ "STRING",
152663
+ "DATE",
152664
+ "NUMERIC",
152665
+ "TIMESTAMP",
152666
+ "TIMESTAMP_TZ",
152667
+ "BOOLEAN",
152668
+ "HLL"
152669
+ ],
152670
+ "description": "An optional data type of the computed values. Defaults to STRING on the backend."
152671
+ },
152672
+ "value_type": {
152673
+ "type": "string",
152674
+ "enum": [
152675
+ "TEXT",
152676
+ "HYPERLINK",
152677
+ "GEO",
152678
+ "GEO_LONGITUDE",
152679
+ "GEO_LATITUDE",
152680
+ "GEO_AREA",
152681
+ "GEO_ICON",
152682
+ "IMAGE",
152683
+ "HYPERLOGLOG"
152684
+ ],
152685
+ "description": "An optional specific type of the computed values. Defaults to TEXT on the backend."
152686
+ },
152687
+ "is_nullable": {
152688
+ "type": "boolean",
152689
+ "description": "Optional flag to indicate if the computed attribute can contain null values."
152690
+ },
152691
+ "null_value_join_replacement": {
152424
152692
  "type": "string",
152425
- "description": "An optional locale whose collation order the computed values are sorted by."
152693
+ "description": "Optional value which can be used as replacement for NULL in join conditions."
152694
+ },
152695
+ "show_in_ai_results": {
152696
+ "type": "boolean",
152697
+ "description": "Optional flag to indicate if the computed attribute should be shown in AI results. When omitted, the computed attribute is visible."
152698
+ },
152699
+ "locale": {
152700
+ "$ref": "#/$global/gaac/locale",
152701
+ "description": "An optional locale in BCP 47 format (for example en-US) whose collation order the computed values are sorted by."
152426
152702
  }
152427
152703
  },
152428
152704
  "$semantic": {
@@ -153222,13 +153498,14 @@ const metadata_v1 = {
153222
153498
  "description": "A list of dashboard filters to be ignored for this widget",
153223
153499
  "items": {
153224
153500
  "type": "string",
153225
- "description": "An id of the dashboard label, attribute, metric or date to be ignored",
153501
+ "description": "An id of the dashboard label, attribute, computed attribute, metric or date to be ignored",
153226
153502
  "$semantic": {
153227
153503
  "type": "reference",
153228
153504
  "sources": [
153229
153505
  "dateDataset.id",
153230
153506
  "attribute.id",
153231
153507
  "label.id",
153508
+ "computedAttribute.id",
153232
153509
  "metric.id"
153233
153510
  ],
153234
153511
  "typePrefix": true
@@ -153282,11 +153559,19 @@ const metadata_v1 = {
153282
153559
  "properties": {
153283
153560
  "href": {
153284
153561
  "description": "An ID of the attribute that holds the url to be opened on interaction",
153285
- "oneOf": [{ "$ref": "#/$global/gaac/attributeIdentifier" }, { "$ref": "#/$global/gaac/labelIdentifier" }]
153562
+ "oneOf": [
153563
+ { "$ref": "#/$global/gaac/attributeIdentifier" },
153564
+ { "$ref": "#/$global/gaac/labelIdentifier" },
153565
+ { "$ref": "#/$global/gaac/computedAttributeIdentifier" }
153566
+ ]
153286
153567
  },
153287
153568
  "label": {
153288
153569
  "description": "An id of the attribute that holds the label for the url to be opened on interaction",
153289
- "oneOf": [{ "$ref": "#/$global/gaac/attributeIdentifier" }, { "$ref": "#/$global/gaac/labelIdentifier" }]
153570
+ "oneOf": [
153571
+ { "$ref": "#/$global/gaac/attributeIdentifier" },
153572
+ { "$ref": "#/$global/gaac/labelIdentifier" },
153573
+ { "$ref": "#/$global/gaac/computedAttributeIdentifier" }
153574
+ ]
153290
153575
  }
153291
153576
  }
153292
153577
  },
@@ -153824,7 +154109,7 @@ const metadata_v1 = {
153824
154109
  "deprecated": true
153825
154110
  },
153826
154111
  "locale": {
153827
- "$ref": "#/$defs/locale",
154112
+ "$ref": "#/$global/gaac/locale",
153828
154113
  "description": "Locale string in BCP 47 format used for default label sorting."
153829
154114
  },
153830
154115
  "is_nullable": {
@@ -154009,11 +154294,6 @@ const metadata_v1 = {
154009
154294
  "code": "core.reference.table.column.dataType"
154010
154295
  }
154011
154296
  },
154012
- "locale": {
154013
- "type": "string",
154014
- "pattern": "^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{1,8})*$",
154015
- "description": "Locale string in BCP 47 format (for example en-US or cs-CZ-u-kn-true)."
154016
- },
154017
154297
  "label": {
154018
154298
  "title": "Label",
154019
154299
  "type": "object",
@@ -154067,7 +154347,7 @@ const metadata_v1 = {
154067
154347
  "deprecated": true
154068
154348
  },
154069
154349
  "locale": {
154070
- "$ref": "#/$defs/locale",
154350
+ "$ref": "#/$global/gaac/locale",
154071
154351
  "description": "Locale string in BCP 47 format used for default label sorting."
154072
154352
  },
154073
154353
  "translations": {
@@ -154114,7 +154394,7 @@ const metadata_v1 = {
154114
154394
  "description": "Column that stores the localized label values."
154115
154395
  },
154116
154396
  "locale": {
154117
- "$ref": "#/$defs/locale",
154397
+ "$ref": "#/$global/gaac/locale",
154118
154398
  "description": "Locale string in BCP 47 format that identifies the translation."
154119
154399
  }
154120
154400
  },
@@ -154269,17 +154549,23 @@ const metadata_v1 = {
154269
154549
  },
154270
154550
  "parameterDefinition": {
154271
154551
  "title": "Parameter Definition",
154272
- "description": "A typed parameter definition. Only textual parameters are supported as code.",
154552
+ "description": "A typed parameter definition: textual or numeric.",
154273
154553
  "allOf": [{
154274
154554
  "if": {
154275
154555
  "properties": { "type": { "const": "STRING" } },
154276
154556
  "required": ["type"]
154277
154557
  },
154278
154558
  "then": { "$ref": "#/$defs/stringParameterDefinition" }
154559
+ }, {
154560
+ "if": {
154561
+ "properties": { "type": { "const": "NUMBER" } },
154562
+ "required": ["type"]
154563
+ },
154564
+ "then": { "$ref": "#/$defs/numberParameterDefinition" }
154279
154565
  }],
154280
154566
  "properties": { "type": {
154281
154567
  "type": "string",
154282
- "enum": ["STRING"]
154568
+ "enum": ["STRING", "NUMBER"]
154283
154569
  } },
154284
154570
  "required": ["type"]
154285
154571
  },
@@ -154326,6 +154612,40 @@ const metadata_v1 = {
154326
154612
  "required": ["type", "defaultValue"],
154327
154613
  "$semantic": { "type": "parameter_constraints" }
154328
154614
  },
154615
+ "numberParameterDefinition": {
154616
+ "title": "Number Parameter Definition",
154617
+ "description": "A numeric parameter definition. Without 'constraints' the parameter accepts any number.",
154618
+ "type": "object",
154619
+ "additionalProperties": false,
154620
+ "properties": {
154621
+ "type": {
154622
+ "type": "string",
154623
+ "enum": ["NUMBER"]
154624
+ },
154625
+ "defaultValue": {
154626
+ "type": "number",
154627
+ "description": "The value used whenever the parameter is not overridden."
154628
+ },
154629
+ "constraints": {
154630
+ "title": "Number Parameter Constraints",
154631
+ "type": "object",
154632
+ "additionalProperties": false,
154633
+ "description": "Optional bounds the parameter value must satisfy.",
154634
+ "properties": {
154635
+ "min": {
154636
+ "type": "number",
154637
+ "description": "The smallest accepted value, inclusive."
154638
+ },
154639
+ "max": {
154640
+ "type": "number",
154641
+ "description": "The largest accepted value, inclusive."
154642
+ }
154643
+ }
154644
+ }
154645
+ },
154646
+ "required": ["type", "defaultValue"],
154647
+ "$semantic": { "type": "parameter_constraints" }
154648
+ },
154329
154649
  "parameterAllowedValue": {
154330
154650
  "title": "Parameter Allowed Value",
154331
154651
  "type": "object",
@@ -154404,6 +154724,7 @@ const metadata_v1 = {
154404
154724
  "oneOf": [
154405
154725
  { "$ref": "#/$global/gaac/attributeIdentifier" },
154406
154726
  { "$ref": "#/$global/gaac/labelIdentifier" },
154727
+ { "$ref": "#/$global/gaac/computedAttributeIdentifier" },
154407
154728
  { "$ref": "#/$global/gaac/metricIdentifier" },
154408
154729
  { "$ref": "#/$global/gaac/factIdentifier" },
154409
154730
  {
@@ -154501,6 +154822,7 @@ const metadata_v1 = {
154501
154822
  "oneOf": [
154502
154823
  { "$ref": "#/$global/gaac/attributeIdentifier" },
154503
154824
  { "$ref": "#/$global/gaac/labelIdentifier" },
154825
+ { "$ref": "#/$global/gaac/computedAttributeIdentifier" },
154504
154826
  { "$ref": "#/$global/gaac/factIdentifier" }
154505
154827
  ]
154506
154828
  }
@@ -154866,7 +155188,8 @@ const metadata_v1 = {
154866
155188
  }
154867
155189
  },
154868
155190
  { "$ref": "#/$global/gaac/attributeIdentifier" },
154869
- { "$ref": "#/$global/gaac/labelIdentifier" }
155191
+ { "$ref": "#/$global/gaac/labelIdentifier" },
155192
+ { "$ref": "#/$global/gaac/computedAttributeIdentifier" }
154870
155193
  ]
154871
155194
  },
154872
155195
  "direction": {
@@ -154925,7 +155248,8 @@ const metadata_v1 = {
154925
155248
  }
154926
155249
  },
154927
155250
  { "$ref": "#/$global/gaac/attributeIdentifier" },
154928
- { "$ref": "#/$global/gaac/labelIdentifier" }
155251
+ { "$ref": "#/$global/gaac/labelIdentifier" },
155252
+ { "$ref": "#/$global/gaac/computedAttributeIdentifier" }
154929
155253
  ]
154930
155254
  },
154931
155255
  "element": {
@@ -157473,26 +157797,43 @@ function validateYamlSemanticForParameterConstraints(schemas, schema, node) {
157473
157797
  const report = (code, params) => {
157474
157798
  currentDiagnostics.diagnostics.push(createDiagnostic$1(SchemaDiagnosticSeverity.Error, node.position, getSchemaArray(schemas, schema), code, CoreErrorMessages$1[code], params));
157475
157799
  };
157476
- const { defaultValue, constraints } = definition;
157477
- const { minLength, maxLength, allowedValues } = constraints ?? {};
157478
- if (minLength !== void 0 && maxLength !== void 0 && minLength > maxLength) report(CoreErrorCode.ParameterLengthRange, [String(minLength), String(maxLength)]);
157479
- const declared = Array.isArray(allowedValues) ? allowedValues.filter((allowed) => typeof allowed?.value === "string") : [];
157480
- for (const value of findDuplicates(declared.map((allowed) => allowed.value))) report(CoreErrorCode.ParameterDuplicateAllowedValue, [value]);
157481
- const distinct = uniqueBy(declared, (allowed) => allowed.value);
157482
- for (const title of findDuplicates(distinct.map((allowed) => allowed.title ?? allowed.value))) report(CoreErrorCode.ParameterDuplicateAllowedTitle, [title]);
157483
- if (typeof defaultValue !== "string") return currentDiagnostics;
157484
- const values = distinct.map((allowed) => allowed.value);
157485
- if (values.length > 0 && !values.includes(defaultValue)) report(CoreErrorCode.ParameterDefaultNotAllowed, [defaultValue, values.join(", ")]);
157486
- const tooShort = minLength !== void 0 && defaultValue.length < minLength;
157487
- const tooLong = maxLength !== void 0 && defaultValue.length > maxLength;
157488
- if (tooShort || tooLong) report(CoreErrorCode.ParameterDefaultOutOfBounds, [
157489
- defaultValue,
157490
- String(defaultValue.length),
157491
- describeBounds(minLength, maxLength)
157492
- ]);
157800
+ if (definition.type === "NUMBER") validateNumberDefinition(definition, report);
157801
+ else validateStringDefinition(definition, report);
157493
157802
  return currentDiagnostics;
157494
157803
  }));
157495
157804
  }
157805
+ function validateStringDefinition(definition, report) {
157806
+ const { defaultValue, constraints } = definition;
157807
+ const { minLength, maxLength, allowedValues } = constraints ?? {};
157808
+ if (minLength !== void 0 && maxLength !== void 0 && minLength > maxLength) {
157809
+ report(CoreErrorCode.ParameterLengthRange, [String(minLength), String(maxLength)]);
157810
+ return;
157811
+ }
157812
+ const declared = Array.isArray(allowedValues) ? allowedValues.filter((allowed) => typeof allowed?.value === "string") : [];
157813
+ for (const value of findDuplicates(declared.map((allowed) => allowed.value))) report(CoreErrorCode.ParameterDuplicateAllowedValue, [value]);
157814
+ const distinct = uniqueBy(declared, (allowed) => allowed.value);
157815
+ for (const title of findDuplicates(distinct.map((allowed) => allowed.title ?? allowed.value))) report(CoreErrorCode.ParameterDuplicateAllowedTitle, [title]);
157816
+ if (typeof defaultValue !== "string") return;
157817
+ const values = distinct.map((allowed) => allowed.value);
157818
+ if (values.length > 0 && !values.includes(defaultValue)) report(CoreErrorCode.ParameterDefaultNotAllowed, [defaultValue, values.join(", ")]);
157819
+ const tooShort = minLength !== void 0 && defaultValue.length < minLength;
157820
+ const tooLong = maxLength !== void 0 && defaultValue.length > maxLength;
157821
+ if (tooShort || tooLong) report(CoreErrorCode.ParameterDefaultOutOfBounds, [
157822
+ defaultValue,
157823
+ String(defaultValue.length),
157824
+ describeBounds(minLength, maxLength)
157825
+ ]);
157826
+ }
157827
+ function validateNumberDefinition(definition, report) {
157828
+ const { defaultValue, constraints } = definition;
157829
+ const { min, max } = constraints ?? {};
157830
+ if (typeof min === "number" && typeof max === "number" && min > max) {
157831
+ report(CoreErrorCode.ParameterNumberRange, [String(min), String(max)]);
157832
+ return;
157833
+ }
157834
+ if (typeof defaultValue !== "number") return;
157835
+ if (typeof min === "number" && defaultValue < min || typeof max === "number" && defaultValue > max) report(CoreErrorCode.ParameterDefaultOutOfRange, [String(defaultValue), describeBounds(min, max)]);
157836
+ }
157496
157837
  function describeBounds(minLength, maxLength) {
157497
157838
  if (minLength === void 0) return `at most ${maxLength}`;
157498
157839
  if (maxLength === void 0) return `at least ${minLength}`;
@@ -161410,7 +161751,7 @@ async function open(state, emitter, file) {
161410
161751
  //#endregion
161411
161752
  //#region ../code/package.json
161412
161753
  var name = "@gooddata/code";
161413
- var version = "0.52.0-alpha.5";
161754
+ var version = "0.52.0-alpha.7";
161414
161755
  //#endregion
161415
161756
  //#region ../../../sdk/libs/api-client-tiger/src/axios.ts
161416
161757
  /**
@@ -161432,7 +161773,7 @@ const _CONFIG = {
161432
161773
  common: {
161433
161774
  "X-Requested-With": "XMLHttpRequest",
161434
161775
  "X-GDC-JS-PACKAGE": "@gooddata/api-client-tiger",
161435
- "X-GDC-JS-PACKAGE-VERSION": "11.56.0-alpha.5"
161776
+ "X-GDC-JS-PACKAGE-VERSION": "11.56.0-alpha.7"
161436
161777
  },
161437
161778
  post: { "Content-Type": "application/json;charset=utf8" },
161438
161779
  put: { "Content-Type": "application/json;charset=utf8" }
@@ -201533,7 +201874,7 @@ async function makeRequest(func) {
201533
201874
  }
201534
201875
  function mergeParameters(current, fromFiles) {
201535
201876
  const authored = new Set(fromFiles.map((parameter) => parameter.id));
201536
- return [...(current ?? []).filter((parameter) => !isDeclarativeStringParameter(parameter) && !authored.has(parameter.id)), ...fromFiles];
201877
+ return [...(current ?? []).filter((parameter) => !isDeclarativeCodeParameter(parameter) && !authored.has(parameter.id)), ...fromFiles];
201537
201878
  }
201538
201879
  function updateDeclarativeLayout(currentWs, newWs) {
201539
201880
  return {
@@ -202089,7 +202430,7 @@ async function fromDeclarative(workspace, basePath, profile, { tables = {}, stor
202089
202430
  });
202090
202431
  return createNewFile(store, filePath, createFileContent({ content: Buffer.from(content, "utf8") }), { mode: "remote" });
202091
202432
  }) ?? []);
202092
- if (workspace?.analytics?.parameters) mergeResults(update, workspace.analytics.parameters.filter(isDeclarativeStringParameter).map((parameter) => {
202433
+ if (workspace?.analytics?.parameters) mergeResults(update, workspace.analytics.parameters.filter(isDeclarativeCodeParameter).map((parameter) => {
202093
202434
  const { content, json } = declarativeParameterToYaml(parameter);
202094
202435
  const filePath = generateFileName(files, parametersPath, parameter.id, parameter.title);
202095
202436
  if (json && content) entitiesLoaded.push({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gooddata/code-cli",
3
- "version": "0.52.0-alpha.5",
3
+ "version": "0.52.0-alpha.7",
4
4
  "description": "GoodData CLI",
5
5
  "keywords": [
6
6
  "analytics",