Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[patch] move cell value type to a new attribute "cellValueType" in custom function metadata #867

Closed
Closed
7 changes: 7 additions & 0 deletions packages/custom-functions-metadata/src/parseTree.ts
Original file line number Diff line number Diff line change
@@ -34,6 +34,7 @@ export interface IFunctionParameter {
name: string;
description?: string;
type: string;
cellValueType?: string;
dimensionality?: string;
optional?: boolean;
repeating?: boolean;
@@ -697,6 +698,12 @@ function getParameters(parameterItem: IGetParametersArguments): IFunctionParamet
type: ptype,
};

// for backward compatibility, we put cell value type in cellValueType instead of type.
if (Object.values(CELLVALUETYPE_MAPPINGS).includes(ptype)) {
pMetadataItem.type = "any";
pMetadataItem.cellValueType = ptype
}

// Only return dimensionality = matrix. Default assumed scalar
if (pMetadataItem.dimensionality === "scalar") {
delete pMetadataItem.dimensionality;
Original file line number Diff line number Diff line change
@@ -8,7 +8,8 @@
"parameters": [
{
"name": "x",
"type": "cellvalue"
"type": "any",
"cellValueType": "cellvalue"
}
],
"result": {}
@@ -20,7 +21,8 @@
"parameters": [
{
"name": "x",
"type": "booleancellvalue"
"type": "any",
"cellValueType": "booleancellvalue"
}
],
"result": {}
@@ -32,7 +34,8 @@
"parameters": [
{
"name": "x",
"type": "doublecellvalue"
"type": "any",
"cellValueType": "doublecellvalue"
}
],
"result": {}
@@ -44,7 +47,8 @@
"parameters": [
{
"name": "x",
"type": "entitycellvalue"
"type": "any",
"cellValueType": "entitycellvalue"
}
],
"result": {}
@@ -56,7 +60,8 @@
"parameters": [
{
"name": "x",
"type": "errorcellvalue"
"type": "any",
"cellValueType": "errorcellvalue"
}
],
"result": {}
@@ -68,7 +73,8 @@
"parameters": [
{
"name": "x",
"type": "formattednumbercellvalue"
"type": "any",
"cellValueType": "formattednumbercellvalue"
}
],
"result": {}
@@ -80,7 +86,8 @@
"parameters": [
{
"name": "x",
"type": "linkedentitycellvalue"
"type": "any",
"cellValueType": "linkedentitycellvalue"
}
],
"result": {}
@@ -92,7 +99,8 @@
"parameters": [
{
"name": "x",
"type": "localimagecellvalue"
"type": "any",
"cellValueType": "localimagecellvalue"
}
],
"result": {}
@@ -104,7 +112,8 @@
"parameters": [
{
"name": "x",
"type": "stringcellvalue"
"type": "any",
"cellValueType": "stringcellvalue"
}
],
"result": {}
@@ -116,7 +125,8 @@
"parameters": [
{
"name": "x",
"type": "webimagecellvalue"
"type": "any",
"cellValueType": "webimagecellvalue"
}
],
"result": {}
@@ -129,7 +139,8 @@
{
"name": "x",
"repeating": true,
"type": "booleancellvalue"
"type": "any",
"cellValueType": "booleancellvalue"
}
],
"result": {}
@@ -142,7 +153,8 @@
{
"dimensionality": "matrix",
"name": "x",
"type": "booleancellvalue"
"type": "any",
"cellValueType": "booleancellvalue"
}
],
"result": {}
@@ -156,7 +168,8 @@
"dimensionality": "matrix",
"name": "x",
"repeating": true,
"type": "booleancellvalue"
"type": "any",
"cellValueType": "booleancellvalue"
}
],
"result": {}
@@ -169,7 +182,8 @@
{
"name": "x",
"repeating": true,
"type": "booleancellvalue"
"type": "any",
"cellValueType": "booleancellvalue"
}
],
"result": {}
@@ -182,7 +196,8 @@
{
"dimensionality": "matrix",
"name": "x",
"type": "booleancellvalue"
"type": "any",
"cellValueType": "booleancellvalue"
}
],
"result": {}
@@ -196,7 +211,8 @@
"dimensionality": "matrix",
"name": "x",
"repeating": true,
"type": "booleancellvalue"
"type": "any",
"cellValueType": "booleancellvalue"
}
],
"result": {}