@osdk/generator-converters 2.5.2 → 2.6.0-beta.10
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/CHANGELOG.md +69 -28
- package/build/browser/valueFormatting/commonValueFormattingUtils.js +33 -0
- package/build/browser/valueFormatting/commonValueFormattingUtils.js.map +1 -0
- package/build/browser/valueFormatting/convertBooleanValueFormattingRule.js +24 -0
- package/build/browser/valueFormatting/convertBooleanValueFormattingRule.js.map +1 -0
- package/build/browser/valueFormatting/convertDateAndTimestampValueFormattingRule.js +62 -0
- package/build/browser/valueFormatting/convertDateAndTimestampValueFormattingRule.js.map +1 -0
- package/build/browser/valueFormatting/convertKnownTypeValueFormattingRule.js +39 -0
- package/build/browser/valueFormatting/convertKnownTypeValueFormattingRule.js.map +1 -0
- package/build/browser/valueFormatting/convertNumberValueFormattingRule.js +133 -0
- package/build/browser/valueFormatting/convertNumberValueFormattingRule.js.map +1 -0
- package/build/browser/wirePropertyFormattingToSdkFormatting.js +49 -0
- package/build/browser/wirePropertyFormattingToSdkFormatting.js.map +1 -0
- package/build/browser/wirePropertyFormattingToSdkFormatting.test.js +344 -0
- package/build/browser/wirePropertyFormattingToSdkFormatting.test.js.map +1 -0
- package/build/browser/wirePropertyV2ToSdkPropertyDefinition.js +5 -2
- package/build/browser/wirePropertyV2ToSdkPropertyDefinition.js.map +1 -1
- package/build/cjs/index.cjs +237 -2
- package/build/cjs/index.cjs.map +1 -1
- package/build/esm/valueFormatting/commonValueFormattingUtils.js +33 -0
- package/build/esm/valueFormatting/commonValueFormattingUtils.js.map +1 -0
- package/build/esm/valueFormatting/convertBooleanValueFormattingRule.js +24 -0
- package/build/esm/valueFormatting/convertBooleanValueFormattingRule.js.map +1 -0
- package/build/esm/valueFormatting/convertDateAndTimestampValueFormattingRule.js +62 -0
- package/build/esm/valueFormatting/convertDateAndTimestampValueFormattingRule.js.map +1 -0
- package/build/esm/valueFormatting/convertKnownTypeValueFormattingRule.js +39 -0
- package/build/esm/valueFormatting/convertKnownTypeValueFormattingRule.js.map +1 -0
- package/build/esm/valueFormatting/convertNumberValueFormattingRule.js +133 -0
- package/build/esm/valueFormatting/convertNumberValueFormattingRule.js.map +1 -0
- package/build/esm/wirePropertyFormattingToSdkFormatting.js +49 -0
- package/build/esm/wirePropertyFormattingToSdkFormatting.js.map +1 -0
- package/build/esm/wirePropertyFormattingToSdkFormatting.test.js +344 -0
- package/build/esm/wirePropertyFormattingToSdkFormatting.test.js.map +1 -0
- package/build/esm/wirePropertyV2ToSdkPropertyDefinition.js +5 -2
- package/build/esm/wirePropertyV2ToSdkPropertyDefinition.js.map +1 -1
- package/build/types/valueFormatting/commonValueFormattingUtils.d.ts +3 -0
- package/build/types/valueFormatting/commonValueFormattingUtils.d.ts.map +1 -0
- package/build/types/valueFormatting/convertBooleanValueFormattingRule.d.ts +3 -0
- package/build/types/valueFormatting/convertBooleanValueFormattingRule.d.ts.map +1 -0
- package/build/types/valueFormatting/convertDateAndTimestampValueFormattingRule.d.ts +4 -0
- package/build/types/valueFormatting/convertDateAndTimestampValueFormattingRule.d.ts.map +1 -0
- package/build/types/valueFormatting/convertKnownTypeValueFormattingRule.d.ts +3 -0
- package/build/types/valueFormatting/convertKnownTypeValueFormattingRule.d.ts.map +1 -0
- package/build/types/valueFormatting/convertNumberValueFormattingRule.d.ts +3 -0
- package/build/types/valueFormatting/convertNumberValueFormattingRule.d.ts.map +1 -0
- package/build/types/wirePropertyFormattingToSdkFormatting.d.ts +8 -0
- package/build/types/wirePropertyFormattingToSdkFormatting.d.ts.map +1 -0
- package/build/types/wirePropertyFormattingToSdkFormatting.test.d.ts +1 -0
- package/build/types/wirePropertyFormattingToSdkFormatting.test.d.ts.map +1 -0
- package/build/types/wirePropertyV2ToSdkPropertyDefinition.d.ts.map +1 -1
- package/package.json +5 -5
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convertDateAndTimestampValueFormattingRule.js","names":["convertPropertyTypeReferenceOrStringConstant","convertDateFormattingRule","wireFormatting","type","format","convertDatetimeFormat","convertTimestampFormattingRule","displayTimezone","convertDatetimeTimezone","wireFormat","pattern","Error","wireTimezone","zoneId"],"sources":["convertDateAndTimestampValueFormattingRule.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n DatetimeFormat,\n DatetimeTimezone,\n PropertyDateFormattingRule,\n PropertyTimestampFormattingRule,\n} from \"@osdk/api\";\nimport type * as Ontologies from \"@osdk/foundry.ontologies\";\nimport { convertPropertyTypeReferenceOrStringConstant } from \"./commonValueFormattingUtils.js\";\n\nexport function convertDateFormattingRule(\n wireFormatting: Ontologies.PropertyDateFormattingRule,\n): PropertyDateFormattingRule {\n return {\n type: \"date\",\n format: convertDatetimeFormat(wireFormatting.format),\n };\n}\n\nexport function convertTimestampFormattingRule(\n wireFormatting: Ontologies.PropertyTimestampFormattingRule,\n): PropertyTimestampFormattingRule {\n return {\n type: \"timestamp\",\n format: convertDatetimeFormat(wireFormatting.format),\n displayTimezone: convertDatetimeTimezone(\n wireFormatting.displayTimezone,\n ),\n };\n}\n\nfunction convertDatetimeFormat(\n wireFormat: Ontologies.DatetimeFormat,\n): DatetimeFormat {\n switch (wireFormat.type) {\n case \"stringFormat\":\n return {\n type: \"stringFormat\",\n pattern: wireFormat.pattern,\n };\n case \"localizedFormat\":\n return {\n type: \"localizedFormat\",\n format: wireFormat.format,\n };\n default:\n wireFormat satisfies never;\n throw new Error(\n `Unknown datetime format type: ${(wireFormat as any).type}`,\n );\n }\n}\n\nfunction convertDatetimeTimezone(\n wireTimezone: Ontologies.DatetimeTimezone,\n): DatetimeTimezone {\n switch (wireTimezone.type) {\n case \"static\":\n return {\n type: \"static\",\n zoneId: convertPropertyTypeReferenceOrStringConstant(\n wireTimezone.zoneId,\n ),\n };\n case \"user\":\n return { type: \"user\" };\n default:\n wireTimezone satisfies never;\n throw new Error(`Unknown timezone type: ${(wireTimezone as any).type}`);\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AASA,SAASA,4CAA4C,QAAQ,iCAAiC;AAE9F,OAAO,SAASC,yBAAyBA,CACvCC,cAAqD,EACzB;EAC5B,OAAO;IACLC,IAAI,EAAE,MAAM;IACZC,MAAM,EAAEC,qBAAqB,CAACH,cAAc,CAACE,MAAM;EACrD,CAAC;AACH;AAEA,OAAO,SAASE,8BAA8BA,CAC5CJ,cAA0D,EACzB;EACjC,OAAO;IACLC,IAAI,EAAE,WAAW;IACjBC,MAAM,EAAEC,qBAAqB,CAACH,cAAc,CAACE,MAAM,CAAC;IACpDG,eAAe,EAAEC,uBAAuB,CACtCN,cAAc,CAACK,eACjB;EACF,CAAC;AACH;AAEA,SAASF,qBAAqBA,CAC5BI,UAAqC,EACrB;EAChB,QAAQA,UAAU,CAACN,IAAI;IACrB,KAAK,cAAc;MACjB,OAAO;QACLA,IAAI,EAAE,cAAc;QACpBO,OAAO,EAAED,UAAU,CAACC;MACtB,CAAC;IACH,KAAK,iBAAiB;MACpB,OAAO;QACLP,IAAI,EAAE,iBAAiB;QACvBC,MAAM,EAAEK,UAAU,CAACL;MACrB,CAAC;IACH;MAEE,MAAM,IAAIO,KAAK,CACb,iCAAkCF,UAAU,CAASN,IAAI,EAC3D,CAAC;EACL;AACF;AAEA,SAASK,uBAAuBA,CAC9BI,YAAyC,EACvB;EAClB,QAAQA,YAAY,CAACT,IAAI;IACvB,KAAK,QAAQ;MACX,OAAO;QACLA,IAAI,EAAE,QAAQ;QACdU,MAAM,EAAEb,4CAA4C,CAClDY,YAAY,CAACC,MACf;MACF,CAAC;IACH,KAAK,MAAM;MACT,OAAO;QAAEV,IAAI,EAAE;MAAO,CAAC;IACzB;MAEE,MAAM,IAAIQ,KAAK,CAAC,0BAA2BC,YAAY,CAAST,IAAI,EAAE,CAAC;EAC3E;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2025 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
export function convertKnownTypeFormattingRule(wireFormatting) {
|
|
18
|
+
switch (wireFormatting.knownType) {
|
|
19
|
+
case "ARTIFACT_GID":
|
|
20
|
+
return {
|
|
21
|
+
type: "knownType",
|
|
22
|
+
knownType: "ARTIFACT_GID"
|
|
23
|
+
};
|
|
24
|
+
case "RESOURCE_RID":
|
|
25
|
+
return {
|
|
26
|
+
type: "knownType",
|
|
27
|
+
knownType: "RESOURCE_RID"
|
|
28
|
+
};
|
|
29
|
+
case "USER_OR_GROUP_ID":
|
|
30
|
+
return {
|
|
31
|
+
type: "knownType",
|
|
32
|
+
knownType: "USER_OR_GROUP_ID"
|
|
33
|
+
};
|
|
34
|
+
default:
|
|
35
|
+
wireFormatting.knownType;
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=convertKnownTypeValueFormattingRule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convertKnownTypeValueFormattingRule.js","names":["convertKnownTypeFormattingRule","wireFormatting","knownType","type","undefined"],"sources":["convertKnownTypeValueFormattingRule.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { PropertyKnownTypeFormattingRule } from \"@osdk/api\";\nimport type * as Ontologies from \"@osdk/foundry.ontologies\";\n\nexport function convertKnownTypeFormattingRule(\n wireFormatting: Ontologies.PropertyKnownTypeFormattingRule,\n): PropertyKnownTypeFormattingRule | undefined {\n switch (wireFormatting.knownType) {\n case \"ARTIFACT_GID\":\n return {\n type: \"knownType\",\n knownType: \"ARTIFACT_GID\",\n };\n case \"RESOURCE_RID\":\n return {\n type: \"knownType\",\n knownType: \"RESOURCE_RID\",\n };\n case \"USER_OR_GROUP_ID\":\n return {\n type: \"knownType\",\n knownType: \"USER_OR_GROUP_ID\",\n };\n default:\n wireFormatting.knownType satisfies never;\n return undefined;\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKA,OAAO,SAASA,8BAA8BA,CAC5CC,cAA0D,EACb;EAC7C,QAAQA,cAAc,CAACC,SAAS;IAC9B,KAAK,cAAc;MACjB,OAAO;QACLC,IAAI,EAAE,WAAW;QACjBD,SAAS,EAAE;MACb,CAAC;IACH,KAAK,cAAc;MACjB,OAAO;QACLC,IAAI,EAAE,WAAW;QACjBD,SAAS,EAAE;MACb,CAAC;IACH,KAAK,kBAAkB;MACrB,OAAO;QACLC,IAAI,EAAE,WAAW;QACjBD,SAAS,EAAE;MACb,CAAC;IACH;MACED,cAAc,CAACC,SAAS;MACxB,OAAOE,SAAS;EACpB;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2025 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { convertPropertyTypeReferenceOrStringConstant } from "./commonValueFormattingUtils.js";
|
|
18
|
+
export function convertNumberFormattingRule(wireFormatting) {
|
|
19
|
+
const numberType = convertNumberFormattingType(wireFormatting.numberType);
|
|
20
|
+
if (!numberType) {
|
|
21
|
+
return undefined;
|
|
22
|
+
}
|
|
23
|
+
return {
|
|
24
|
+
type: "number",
|
|
25
|
+
numberType
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
function convertNumberFormatOptions(wireOptions) {
|
|
29
|
+
return {
|
|
30
|
+
useGrouping: wireOptions.useGrouping,
|
|
31
|
+
convertNegativeToParenthesis: wireOptions.convertNegativeToParenthesis,
|
|
32
|
+
minimumIntegerDigits: wireOptions.minimumIntegerDigits,
|
|
33
|
+
minimumFractionDigits: wireOptions.minimumFractionDigits,
|
|
34
|
+
maximumFractionDigits: wireOptions.maximumFractionDigits,
|
|
35
|
+
minimumSignificantDigits: wireOptions.minimumSignificantDigits,
|
|
36
|
+
maximumSignificantDigits: wireOptions.maximumSignificantDigits,
|
|
37
|
+
notation: wireOptions.notation,
|
|
38
|
+
roundingMode: wireOptions.roundingMode
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
function convertDurationFormatStyle(formatStyle) {
|
|
42
|
+
switch (formatStyle.type) {
|
|
43
|
+
case "humanReadable":
|
|
44
|
+
return {
|
|
45
|
+
type: "humanReadable",
|
|
46
|
+
showFullUnits: formatStyle.showFullUnits
|
|
47
|
+
};
|
|
48
|
+
case "timecode":
|
|
49
|
+
return {
|
|
50
|
+
type: "timecode"
|
|
51
|
+
};
|
|
52
|
+
default:
|
|
53
|
+
throw new Error(`Unknown duration format style: ${formatStyle.type}`);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
function convertNumberFormattingType(wireNumberType) {
|
|
57
|
+
switch (wireNumberType.type) {
|
|
58
|
+
case "standard":
|
|
59
|
+
return {
|
|
60
|
+
type: "standard",
|
|
61
|
+
baseFormatOptions: convertNumberFormatOptions(wireNumberType.baseFormatOptions)
|
|
62
|
+
};
|
|
63
|
+
case "fixedValues":
|
|
64
|
+
return {
|
|
65
|
+
type: "fixedValues",
|
|
66
|
+
values: wireNumberType.values
|
|
67
|
+
};
|
|
68
|
+
case "currency":
|
|
69
|
+
{
|
|
70
|
+
return {
|
|
71
|
+
type: "currency",
|
|
72
|
+
baseFormatOptions: convertNumberFormatOptions(wireNumberType.baseFormatOptions),
|
|
73
|
+
style: wireNumberType.style,
|
|
74
|
+
currencyCode: convertPropertyTypeReferenceOrStringConstant(wireNumberType.currencyCode)
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
case "standardUnit":
|
|
78
|
+
{
|
|
79
|
+
return {
|
|
80
|
+
type: "standardUnit",
|
|
81
|
+
baseFormatOptions: convertNumberFormatOptions(wireNumberType.baseFormatOptions),
|
|
82
|
+
unit: convertPropertyTypeReferenceOrStringConstant(wireNumberType.unit)
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
case "customUnit":
|
|
86
|
+
{
|
|
87
|
+
return {
|
|
88
|
+
type: "customUnit",
|
|
89
|
+
baseFormatOptions: convertNumberFormatOptions(wireNumberType.baseFormatOptions),
|
|
90
|
+
unit: convertPropertyTypeReferenceOrStringConstant(wireNumberType.unit)
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
case "affix":
|
|
94
|
+
{
|
|
95
|
+
return {
|
|
96
|
+
type: "affix",
|
|
97
|
+
baseFormatOptions: convertNumberFormatOptions(wireNumberType.baseFormatOptions),
|
|
98
|
+
affix: {
|
|
99
|
+
prefix: wireNumberType.affix?.prefix != null ? convertPropertyTypeReferenceOrStringConstant(wireNumberType.affix.prefix) : undefined,
|
|
100
|
+
postfix: wireNumberType.affix?.postfix != null ? convertPropertyTypeReferenceOrStringConstant(wireNumberType.affix.postfix) : undefined
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
case "duration":
|
|
105
|
+
{
|
|
106
|
+
return {
|
|
107
|
+
type: "duration",
|
|
108
|
+
formatStyle: convertDurationFormatStyle(wireNumberType.formatStyle),
|
|
109
|
+
precision: wireNumberType.precision,
|
|
110
|
+
baseValue: wireNumberType.baseValue
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
case "scale":
|
|
114
|
+
{
|
|
115
|
+
return {
|
|
116
|
+
type: "scale",
|
|
117
|
+
scaleType: wireNumberType.scaleType,
|
|
118
|
+
baseFormatOptions: convertNumberFormatOptions(wireNumberType.baseFormatOptions)
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
case "ratio":
|
|
122
|
+
{
|
|
123
|
+
return {
|
|
124
|
+
type: "ratio",
|
|
125
|
+
ratioType: wireNumberType.ratioType,
|
|
126
|
+
baseFormatOptions: convertNumberFormatOptions(wireNumberType.baseFormatOptions)
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
default:
|
|
130
|
+
throw new Error(`Unknown number format type: ${wireNumberType.type}`);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
//# sourceMappingURL=convertNumberValueFormattingRule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convertNumberValueFormattingRule.js","names":["convertPropertyTypeReferenceOrStringConstant","convertNumberFormattingRule","wireFormatting","numberType","convertNumberFormattingType","undefined","type","convertNumberFormatOptions","wireOptions","useGrouping","convertNegativeToParenthesis","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","notation","roundingMode","convertDurationFormatStyle","formatStyle","showFullUnits","Error","wireNumberType","baseFormatOptions","values","style","currencyCode","unit","affix","prefix","postfix","precision","baseValue","scaleType","ratioType"],"sources":["convertNumberValueFormattingRule.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n DurationFormatStyle,\n NumberFormatOptions,\n PropertyNumberFormattingRule,\n PropertyNumberFormattingRuleType,\n} from \"@osdk/api\";\nimport type * as Ontologies from \"@osdk/foundry.ontologies\";\nimport { convertPropertyTypeReferenceOrStringConstant } from \"./commonValueFormattingUtils.js\";\n\nexport function convertNumberFormattingRule(\n wireFormatting: Ontologies.PropertyNumberFormattingRule,\n): PropertyNumberFormattingRule | undefined {\n const numberType = convertNumberFormattingType(wireFormatting.numberType);\n if (!numberType) {\n return undefined;\n }\n return {\n type: \"number\",\n numberType,\n };\n}\n\nfunction convertNumberFormatOptions(\n wireOptions: Ontologies.NumberFormatOptions,\n): NumberFormatOptions {\n return {\n useGrouping: wireOptions.useGrouping,\n convertNegativeToParenthesis: wireOptions.convertNegativeToParenthesis,\n minimumIntegerDigits: wireOptions.minimumIntegerDigits,\n minimumFractionDigits: wireOptions.minimumFractionDigits,\n maximumFractionDigits: wireOptions.maximumFractionDigits,\n minimumSignificantDigits: wireOptions.minimumSignificantDigits,\n maximumSignificantDigits: wireOptions.maximumSignificantDigits,\n notation: wireOptions.notation,\n roundingMode: wireOptions.roundingMode,\n };\n}\n\nfunction convertDurationFormatStyle(\n formatStyle: Ontologies.DurationFormatStyle,\n): DurationFormatStyle {\n switch (formatStyle.type) {\n case \"humanReadable\":\n return {\n type: \"humanReadable\",\n showFullUnits: formatStyle.showFullUnits,\n };\n case \"timecode\":\n return {\n type: \"timecode\",\n };\n default:\n formatStyle satisfies never;\n throw new Error(\n `Unknown duration format style: ${(formatStyle as any).type}`,\n );\n }\n}\n\nfunction convertNumberFormattingType(\n wireNumberType: Ontologies.PropertyNumberFormattingRuleType,\n): PropertyNumberFormattingRuleType | undefined {\n switch (wireNumberType.type) {\n case \"standard\":\n return {\n type: \"standard\",\n baseFormatOptions: convertNumberFormatOptions(\n wireNumberType.baseFormatOptions,\n ),\n };\n\n case \"fixedValues\":\n return {\n type: \"fixedValues\",\n values: wireNumberType.values,\n };\n\n case \"currency\": {\n return {\n type: \"currency\",\n baseFormatOptions: convertNumberFormatOptions(\n wireNumberType.baseFormatOptions,\n ),\n style: wireNumberType.style,\n currencyCode: convertPropertyTypeReferenceOrStringConstant(\n wireNumberType.currencyCode,\n ),\n };\n }\n\n case \"standardUnit\": {\n return {\n type: \"standardUnit\",\n baseFormatOptions: convertNumberFormatOptions(\n wireNumberType.baseFormatOptions,\n ),\n unit: convertPropertyTypeReferenceOrStringConstant(wireNumberType.unit),\n };\n }\n\n case \"customUnit\": {\n return {\n type: \"customUnit\",\n baseFormatOptions: convertNumberFormatOptions(\n wireNumberType.baseFormatOptions,\n ),\n unit: convertPropertyTypeReferenceOrStringConstant(wireNumberType.unit),\n };\n }\n\n case \"affix\": {\n return {\n type: \"affix\",\n baseFormatOptions: convertNumberFormatOptions(\n wireNumberType.baseFormatOptions,\n ),\n affix: {\n prefix: wireNumberType.affix?.prefix != null\n ? convertPropertyTypeReferenceOrStringConstant(\n wireNumberType.affix.prefix,\n )\n : undefined,\n postfix: wireNumberType.affix?.postfix != null\n ? convertPropertyTypeReferenceOrStringConstant(\n wireNumberType.affix.postfix,\n )\n : undefined,\n },\n };\n }\n\n case \"duration\": {\n return {\n type: \"duration\",\n formatStyle: convertDurationFormatStyle(wireNumberType.formatStyle),\n precision: wireNumberType.precision,\n baseValue: wireNumberType.baseValue,\n };\n }\n\n case \"scale\": {\n return {\n type: \"scale\",\n scaleType: wireNumberType.scaleType,\n baseFormatOptions: convertNumberFormatOptions(\n wireNumberType.baseFormatOptions,\n ),\n };\n }\n\n case \"ratio\": {\n return {\n type: \"ratio\",\n ratioType: wireNumberType.ratioType,\n baseFormatOptions: convertNumberFormatOptions(\n wireNumberType.baseFormatOptions,\n ),\n };\n }\n\n default:\n wireNumberType satisfies never;\n throw new Error(\n `Unknown number format type: ${(wireNumberType as any).type}`,\n );\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AASA,SAASA,4CAA4C,QAAQ,iCAAiC;AAE9F,OAAO,SAASC,2BAA2BA,CACzCC,cAAuD,EACb;EAC1C,MAAMC,UAAU,GAAGC,2BAA2B,CAACF,cAAc,CAACC,UAAU,CAAC;EACzE,IAAI,CAACA,UAAU,EAAE;IACf,OAAOE,SAAS;EAClB;EACA,OAAO;IACLC,IAAI,EAAE,QAAQ;IACdH;EACF,CAAC;AACH;AAEA,SAASI,0BAA0BA,CACjCC,WAA2C,EACtB;EACrB,OAAO;IACLC,WAAW,EAAED,WAAW,CAACC,WAAW;IAC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AO;UACLjB,IAAI,EAAE,OAAO;UACb4B,SAAS,EAAEZ,cAAc,CAACY,SAAS;UACnCX,iBAAiB,EAAEhB,0BAA0B,CAC3Ce,cAAc,CAACC,iBACjB;QACF,CAAC;MACH;IAEA;MAEE,MAAM,IAAIF,KAAK,CACb,+BAAgCC,cAAc,CAAShB,IAAI,EAC7D,CAAC;EACL;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2025 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { convertBooleanFormattingRule } from "./valueFormatting/convertBooleanValueFormattingRule.js";
|
|
18
|
+
import { convertDateFormattingRule, convertTimestampFormattingRule } from "./valueFormatting/convertDateAndTimestampValueFormattingRule.js";
|
|
19
|
+
import { convertKnownTypeFormattingRule } from "./valueFormatting/convertKnownTypeValueFormattingRule.js";
|
|
20
|
+
import { convertNumberFormattingRule } from "./valueFormatting/convertNumberValueFormattingRule.js";
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Converts a PropertyValueFormattingRule from the ontologies format to the SDK format
|
|
24
|
+
*/
|
|
25
|
+
export function wirePropertyFormattingToSdkFormatting(wireFormatting, log) {
|
|
26
|
+
try {
|
|
27
|
+
return convertPropertyFormattingInternal(wireFormatting);
|
|
28
|
+
} catch (error) {
|
|
29
|
+
log?.info(`Failed to convert property formatting rule: ${error}`);
|
|
30
|
+
return undefined;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
function convertPropertyFormattingInternal(wireFormatting) {
|
|
34
|
+
switch (wireFormatting.type) {
|
|
35
|
+
case "date":
|
|
36
|
+
return convertDateFormattingRule(wireFormatting);
|
|
37
|
+
case "timestamp":
|
|
38
|
+
return convertTimestampFormattingRule(wireFormatting);
|
|
39
|
+
case "boolean":
|
|
40
|
+
return convertBooleanFormattingRule(wireFormatting);
|
|
41
|
+
case "knownType":
|
|
42
|
+
return convertKnownTypeFormattingRule(wireFormatting);
|
|
43
|
+
case "number":
|
|
44
|
+
return convertNumberFormattingRule(wireFormatting);
|
|
45
|
+
default:
|
|
46
|
+
throw new Error(`Unknown formatting type: ${wireFormatting.type}`);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=wirePropertyFormattingToSdkFormatting.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wirePropertyFormattingToSdkFormatting.js","names":["convertBooleanFormattingRule","convertDateFormattingRule","convertTimestampFormattingRule","convertKnownTypeFormattingRule","convertNumberFormattingRule","wirePropertyFormattingToSdkFormatting","wireFormatting","log","convertPropertyFormattingInternal","error","info","undefined","type","Error"],"sources":["wirePropertyFormattingToSdkFormatting.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { PropertyValueFormattingRule } from \"@osdk/api\";\nimport type * as Ontologies from \"@osdk/foundry.ontologies\";\nimport { convertBooleanFormattingRule } from \"./valueFormatting/convertBooleanValueFormattingRule.js\";\nimport {\n convertDateFormattingRule,\n convertTimestampFormattingRule,\n} from \"./valueFormatting/convertDateAndTimestampValueFormattingRule.js\";\nimport { convertKnownTypeFormattingRule } from \"./valueFormatting/convertKnownTypeValueFormattingRule.js\";\nimport { convertNumberFormattingRule } from \"./valueFormatting/convertNumberValueFormattingRule.js\";\n\n/**\n * Converts a PropertyValueFormattingRule from the ontologies format to the SDK format\n */\nexport function wirePropertyFormattingToSdkFormatting(\n wireFormatting: Ontologies.PropertyValueFormattingRule,\n log?: { info: (msg: string) => void },\n): PropertyValueFormattingRule | undefined {\n try {\n return convertPropertyFormattingInternal(wireFormatting);\n } catch (error) {\n log?.info(`Failed to convert property formatting rule: ${error}`);\n return undefined;\n }\n}\n\nfunction convertPropertyFormattingInternal(\n wireFormatting: Ontologies.PropertyValueFormattingRule,\n): PropertyValueFormattingRule | undefined {\n switch (wireFormatting.type) {\n case \"date\":\n return convertDateFormattingRule(wireFormatting);\n\n case \"timestamp\":\n return convertTimestampFormattingRule(wireFormatting);\n\n case \"boolean\":\n return convertBooleanFormattingRule(wireFormatting);\n\n case \"knownType\":\n return convertKnownTypeFormattingRule(wireFormatting);\n\n case \"number\":\n return convertNumberFormattingRule(wireFormatting);\n\n default:\n wireFormatting satisfies never;\n throw new Error(\n `Unknown formatting type: ${(wireFormatting as any).type}`,\n );\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,SAASA,4BAA4B,QAAQ,wDAAwD;AACrG,SACEC,yBAAyB,EACzBC,8BAA8B,QACzB,iEAAiE;AACxE,SAASC,8BAA8B,QAAQ,0DAA0D;AACzG,SAASC,2BAA2B,QAAQ,uDAAuD;;AAEnG;AACA;AACA;AACA,OAAO,SAASC,qCAAqCA,CACnDC,cAAsD,EACtDC,GAAqC,EACI;EACzC,IAAI;IACF,OAAOC,iCAAiC,CAACF,cAAc,CAAC;EAC1D,CAAC,CAAC,OAAOG,KAAK,EAAE;IACdF,GAAG,EAAEG,IAAI,CAAC,+CAA+CD,KAAK,EAAE,CAAC;IACjE,OAAOE,SAAS;EAClB;AACF;AAEA,SAASH,iCAAiCA,CACxCF,cAAsD,EACb;EACzC,QAAQA,cAAc,CAACM,IAAI;IACzB,KAAK,MAAM;MACT,OAAOX,yBAAyB,CAACK,cAAc,CAAC;IAElD,KAAK,WAAW;MACd,OAAOJ,8BAA8B,CAACI,cAAc,CAAC;IAEvD,KAAK,SAAS;MACZ,OAAON,4BAA4B,CAACM,cAAc,CAAC;IAErD,KAAK,WAAW;MACd,OAAOH,8BAA8B,CAACG,cAAc,CAAC;IAEvD,KAAK,QAAQ;MACX,OAAOF,2BAA2B,CAACE,cAAc,CAAC;IAEpD;MAEE,MAAM,IAAIO,KAAK,CACb,4BAA6BP,cAAc,CAASM,IAAI,EAC1D,CAAC;EACL;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2025 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { describe, expect, it } from "vitest";
|
|
18
|
+
import { wirePropertyFormattingToSdkFormatting } from "./wirePropertyFormattingToSdkFormatting.js";
|
|
19
|
+
describe(wirePropertyFormattingToSdkFormatting, () => {
|
|
20
|
+
describe("number formatting", () => {
|
|
21
|
+
it("converts standard number format", () => {
|
|
22
|
+
const result = wirePropertyFormattingToSdkFormatting({
|
|
23
|
+
type: "number",
|
|
24
|
+
numberType: {
|
|
25
|
+
type: "standard",
|
|
26
|
+
baseFormatOptions: {
|
|
27
|
+
useGrouping: true,
|
|
28
|
+
minimumFractionDigits: 2,
|
|
29
|
+
maximumFractionDigits: 4,
|
|
30
|
+
notation: "COMPACT"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
expect(result).toEqual({
|
|
35
|
+
type: "number",
|
|
36
|
+
numberType: {
|
|
37
|
+
type: "standard",
|
|
38
|
+
baseFormatOptions: {
|
|
39
|
+
useGrouping: true,
|
|
40
|
+
minimumFractionDigits: 2,
|
|
41
|
+
maximumFractionDigits: 4,
|
|
42
|
+
notation: "COMPACT"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
it("converts currency format with property reference", () => {
|
|
48
|
+
const result = wirePropertyFormattingToSdkFormatting({
|
|
49
|
+
type: "number",
|
|
50
|
+
numberType: {
|
|
51
|
+
type: "currency",
|
|
52
|
+
baseFormatOptions: {
|
|
53
|
+
minimumFractionDigits: 2,
|
|
54
|
+
maximumFractionDigits: 2
|
|
55
|
+
},
|
|
56
|
+
style: "STANDARD",
|
|
57
|
+
currencyCode: {
|
|
58
|
+
type: "propertyType",
|
|
59
|
+
propertyApiName: "currencyField"
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
expect(result).toEqual({
|
|
64
|
+
type: "number",
|
|
65
|
+
numberType: {
|
|
66
|
+
type: "currency",
|
|
67
|
+
baseFormatOptions: {
|
|
68
|
+
minimumFractionDigits: 2,
|
|
69
|
+
maximumFractionDigits: 2
|
|
70
|
+
},
|
|
71
|
+
style: "STANDARD",
|
|
72
|
+
currencyCode: {
|
|
73
|
+
type: "propertyType",
|
|
74
|
+
propertyApiName: "currencyField"
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
it("converts duration format with human readable style", () => {
|
|
80
|
+
const result = wirePropertyFormattingToSdkFormatting({
|
|
81
|
+
type: "number",
|
|
82
|
+
numberType: {
|
|
83
|
+
type: "duration",
|
|
84
|
+
formatStyle: {
|
|
85
|
+
type: "humanReadable",
|
|
86
|
+
showFullUnits: true
|
|
87
|
+
},
|
|
88
|
+
precision: "MINUTES",
|
|
89
|
+
baseValue: "SECONDS"
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
expect(result).toEqual({
|
|
93
|
+
type: "number",
|
|
94
|
+
numberType: {
|
|
95
|
+
type: "duration",
|
|
96
|
+
formatStyle: {
|
|
97
|
+
type: "humanReadable",
|
|
98
|
+
showFullUnits: true
|
|
99
|
+
},
|
|
100
|
+
precision: "MINUTES",
|
|
101
|
+
baseValue: "SECONDS"
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
it("converts ratio format for percentage", () => {
|
|
106
|
+
const result = wirePropertyFormattingToSdkFormatting({
|
|
107
|
+
type: "number",
|
|
108
|
+
numberType: {
|
|
109
|
+
type: "ratio",
|
|
110
|
+
ratioType: "PERCENTAGE",
|
|
111
|
+
baseFormatOptions: {
|
|
112
|
+
minimumFractionDigits: 1,
|
|
113
|
+
maximumFractionDigits: 2
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
expect(result).toEqual({
|
|
118
|
+
type: "number",
|
|
119
|
+
numberType: {
|
|
120
|
+
type: "ratio",
|
|
121
|
+
ratioType: "PERCENTAGE",
|
|
122
|
+
baseFormatOptions: {
|
|
123
|
+
minimumFractionDigits: 1,
|
|
124
|
+
maximumFractionDigits: 2
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
});
|
|
129
|
+
it("returns undefined for unknown number format type", () => {
|
|
130
|
+
const result = wirePropertyFormattingToSdkFormatting({
|
|
131
|
+
type: "number",
|
|
132
|
+
numberType: {
|
|
133
|
+
type: "INVALID_FORMAT_TYPE",
|
|
134
|
+
someUnknownField: "value"
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
expect(result).toBeUndefined();
|
|
138
|
+
});
|
|
139
|
+
});
|
|
140
|
+
describe("date/timestamp formatting", () => {
|
|
141
|
+
it("converts date format with string pattern", () => {
|
|
142
|
+
const result = wirePropertyFormattingToSdkFormatting({
|
|
143
|
+
type: "date",
|
|
144
|
+
format: {
|
|
145
|
+
type: "stringFormat",
|
|
146
|
+
pattern: "yyyy-MM-dd"
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
expect(result).toEqual({
|
|
150
|
+
type: "date",
|
|
151
|
+
format: {
|
|
152
|
+
type: "stringFormat",
|
|
153
|
+
pattern: "yyyy-MM-dd"
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
});
|
|
157
|
+
it("converts timestamp format with localized format and static timezone", () => {
|
|
158
|
+
const result = wirePropertyFormattingToSdkFormatting({
|
|
159
|
+
type: "timestamp",
|
|
160
|
+
format: {
|
|
161
|
+
type: "localizedFormat",
|
|
162
|
+
format: "DATE_FORMAT_DATE_TIME"
|
|
163
|
+
},
|
|
164
|
+
displayTimezone: {
|
|
165
|
+
type: "static",
|
|
166
|
+
zoneId: {
|
|
167
|
+
type: "constant",
|
|
168
|
+
value: "America/New_York"
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
expect(result).toEqual({
|
|
173
|
+
type: "timestamp",
|
|
174
|
+
format: {
|
|
175
|
+
type: "localizedFormat",
|
|
176
|
+
format: "DATE_FORMAT_DATE_TIME"
|
|
177
|
+
},
|
|
178
|
+
displayTimezone: {
|
|
179
|
+
type: "static",
|
|
180
|
+
zoneId: {
|
|
181
|
+
type: "constant",
|
|
182
|
+
value: "America/New_York"
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
});
|
|
187
|
+
it("returns undefined for unknown datetime format type", () => {
|
|
188
|
+
const result = wirePropertyFormattingToSdkFormatting({
|
|
189
|
+
type: "date",
|
|
190
|
+
format: {
|
|
191
|
+
type: "UNKNOWN_FORMAT_TYPE"
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
expect(result).toBeUndefined();
|
|
195
|
+
});
|
|
196
|
+
});
|
|
197
|
+
describe("boolean formatting", () => {
|
|
198
|
+
it("converts boolean format", () => {
|
|
199
|
+
const result = wirePropertyFormattingToSdkFormatting({
|
|
200
|
+
type: "boolean",
|
|
201
|
+
valueIfTrue: "Yes",
|
|
202
|
+
valueIfFalse: "No"
|
|
203
|
+
});
|
|
204
|
+
expect(result).toEqual({
|
|
205
|
+
type: "boolean",
|
|
206
|
+
valueIfTrue: "Yes",
|
|
207
|
+
valueIfFalse: "No"
|
|
208
|
+
});
|
|
209
|
+
});
|
|
210
|
+
});
|
|
211
|
+
describe("known type formatting", () => {
|
|
212
|
+
it("converts valid known types", () => {
|
|
213
|
+
const testCases = [{
|
|
214
|
+
input: "USER_OR_GROUP_ID",
|
|
215
|
+
expected: "USER_OR_GROUP_ID"
|
|
216
|
+
}, {
|
|
217
|
+
input: "RESOURCE_RID",
|
|
218
|
+
expected: "RESOURCE_RID"
|
|
219
|
+
}, {
|
|
220
|
+
input: "ARTIFACT_GID",
|
|
221
|
+
expected: "ARTIFACT_GID"
|
|
222
|
+
}];
|
|
223
|
+
for (const {
|
|
224
|
+
input,
|
|
225
|
+
expected
|
|
226
|
+
} of testCases) {
|
|
227
|
+
const result = wirePropertyFormattingToSdkFormatting({
|
|
228
|
+
type: "knownType",
|
|
229
|
+
knownType: input
|
|
230
|
+
});
|
|
231
|
+
expect(result).toEqual({
|
|
232
|
+
type: "knownType",
|
|
233
|
+
knownType: expected
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
});
|
|
237
|
+
it("returns undefined for invalid known type", () => {
|
|
238
|
+
const result = wirePropertyFormattingToSdkFormatting({
|
|
239
|
+
type: "knownType",
|
|
240
|
+
knownType: "INVALID_KNOWN_TYPE"
|
|
241
|
+
});
|
|
242
|
+
expect(result).toBeUndefined();
|
|
243
|
+
});
|
|
244
|
+
});
|
|
245
|
+
describe("unknown formatting types", () => {
|
|
246
|
+
it("returns undefined for completely unknown formatting type", () => {
|
|
247
|
+
const result = wirePropertyFormattingToSdkFormatting({
|
|
248
|
+
type: "UNKNOWN_FORMAT_TYPE",
|
|
249
|
+
someField: "value"
|
|
250
|
+
});
|
|
251
|
+
expect(result).toBeUndefined();
|
|
252
|
+
});
|
|
253
|
+
describe("affix formatting", () => {
|
|
254
|
+
it("converts affix format with prefix and postfix", () => {
|
|
255
|
+
const result = wirePropertyFormattingToSdkFormatting({
|
|
256
|
+
type: "number",
|
|
257
|
+
numberType: {
|
|
258
|
+
type: "affix",
|
|
259
|
+
baseFormatOptions: {
|
|
260
|
+
useGrouping: true
|
|
261
|
+
},
|
|
262
|
+
affix: {
|
|
263
|
+
prefix: {
|
|
264
|
+
type: "constant",
|
|
265
|
+
value: "$"
|
|
266
|
+
},
|
|
267
|
+
postfix: {
|
|
268
|
+
type: "propertyType",
|
|
269
|
+
propertyApiName: "unitField"
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
});
|
|
274
|
+
expect(result).toEqual({
|
|
275
|
+
type: "number",
|
|
276
|
+
numberType: {
|
|
277
|
+
type: "affix",
|
|
278
|
+
baseFormatOptions: {
|
|
279
|
+
useGrouping: true
|
|
280
|
+
},
|
|
281
|
+
affix: {
|
|
282
|
+
prefix: {
|
|
283
|
+
type: "constant",
|
|
284
|
+
value: "$"
|
|
285
|
+
},
|
|
286
|
+
postfix: {
|
|
287
|
+
type: "propertyType",
|
|
288
|
+
propertyApiName: "unitField"
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
});
|
|
293
|
+
});
|
|
294
|
+
it("handles affix with missing prefix/postfix", () => {
|
|
295
|
+
const result = wirePropertyFormattingToSdkFormatting({
|
|
296
|
+
type: "number",
|
|
297
|
+
numberType: {
|
|
298
|
+
type: "affix",
|
|
299
|
+
baseFormatOptions: {},
|
|
300
|
+
affix: {}
|
|
301
|
+
}
|
|
302
|
+
});
|
|
303
|
+
expect(result).toEqual({
|
|
304
|
+
type: "number",
|
|
305
|
+
numberType: {
|
|
306
|
+
type: "affix",
|
|
307
|
+
baseFormatOptions: {},
|
|
308
|
+
affix: {
|
|
309
|
+
prefix: undefined,
|
|
310
|
+
postfix: undefined
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
});
|
|
314
|
+
});
|
|
315
|
+
});
|
|
316
|
+
describe("fixed values formatting", () => {
|
|
317
|
+
it("converts fixed values format", () => {
|
|
318
|
+
const result = wirePropertyFormattingToSdkFormatting({
|
|
319
|
+
type: "number",
|
|
320
|
+
numberType: {
|
|
321
|
+
type: "fixedValues",
|
|
322
|
+
values: {
|
|
323
|
+
1: "First",
|
|
324
|
+
2: "Second",
|
|
325
|
+
3: "Third"
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
});
|
|
329
|
+
expect(result).toEqual({
|
|
330
|
+
type: "number",
|
|
331
|
+
numberType: {
|
|
332
|
+
type: "fixedValues",
|
|
333
|
+
values: {
|
|
334
|
+
1: "First",
|
|
335
|
+
2: "Second",
|
|
336
|
+
3: "Third"
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
});
|
|
340
|
+
});
|
|
341
|
+
});
|
|
342
|
+
});
|
|
343
|
+
});
|
|
344
|
+
//# sourceMappingURL=wirePropertyFormattingToSdkFormatting.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wirePropertyFormattingToSdkFormatting.test.js","names":["describe","expect","it","wirePropertyFormattingToSdkFormatting","result","type","numberType","baseFormatOptions","useGrouping","minimumFractionDigits","maximumFractionDigits","notation","toEqual","style","currencyCode","propertyApiName","formatStyle","showFullUnits","precision","baseValue","ratioType","someUnknownField","toBeUndefined","format","pattern","displayTimezone","zoneId","value","valueIfTrue","valueIfFalse","testCases","input","expected","knownType","someField","affix","prefix","postfix","undefined","values"],"sources":["wirePropertyFormattingToSdkFormatting.test.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { KnownType } from \"@osdk/api\";\nimport type * as Ontologies from \"@osdk/foundry.ontologies\";\nimport { describe, expect, it } from \"vitest\";\nimport { wirePropertyFormattingToSdkFormatting } from \"./wirePropertyFormattingToSdkFormatting.js\";\n\ndescribe(wirePropertyFormattingToSdkFormatting, () => {\n describe(\"number formatting\", () => {\n it(\"converts standard number format\", () => {\n const wireFormat: Ontologies.PropertyValueFormattingRule = {\n type: \"number\",\n numberType: {\n type: \"standard\",\n baseFormatOptions: {\n useGrouping: true,\n minimumFractionDigits: 2,\n maximumFractionDigits: 4,\n notation: \"COMPACT\",\n },\n },\n };\n\n const result = wirePropertyFormattingToSdkFormatting(wireFormat);\n\n expect(result).toEqual({\n type: \"number\",\n numberType: {\n type: \"standard\",\n baseFormatOptions: {\n useGrouping: true,\n minimumFractionDigits: 2,\n maximumFractionDigits: 4,\n notation: \"COMPACT\",\n },\n },\n });\n });\n\n it(\"converts currency format with property reference\", () => {\n const wireFormat: Ontologies.PropertyValueFormattingRule = {\n type: \"number\",\n numberType: {\n type: \"currency\",\n baseFormatOptions: {\n minimumFractionDigits: 2,\n maximumFractionDigits: 2,\n },\n style: \"STANDARD\",\n currencyCode: {\n type: \"propertyType\",\n propertyApiName: \"currencyField\",\n },\n },\n };\n\n const result = wirePropertyFormattingToSdkFormatting(wireFormat);\n\n expect(result).toEqual({\n type: \"number\",\n numberType: {\n type: \"currency\",\n baseFormatOptions: {\n minimumFractionDigits: 2,\n maximumFractionDigits: 2,\n },\n style: \"STANDARD\",\n currencyCode: {\n type: \"propertyType\",\n propertyApiName: \"currencyField\",\n },\n },\n });\n });\n\n it(\"converts duration format with human readable style\", () => {\n const wireFormat: Ontologies.PropertyValueFormattingRule = {\n type: \"number\",\n numberType: {\n type: \"duration\",\n formatStyle: {\n type: \"humanReadable\",\n showFullUnits: true,\n },\n precision: \"MINUTES\",\n baseValue: \"SECONDS\",\n },\n };\n\n const result = wirePropertyFormattingToSdkFormatting(wireFormat);\n\n expect(result).toEqual({\n type: \"number\",\n numberType: {\n type: \"duration\",\n formatStyle: {\n type: \"humanReadable\",\n showFullUnits: true,\n },\n precision: \"MINUTES\",\n baseValue: \"SECONDS\",\n },\n });\n });\n\n it(\"converts ratio format for percentage\", () => {\n const wireFormat: Ontologies.PropertyValueFormattingRule = {\n type: \"number\",\n numberType: {\n type: \"ratio\",\n ratioType: \"PERCENTAGE\",\n baseFormatOptions: {\n minimumFractionDigits: 1,\n maximumFractionDigits: 2,\n },\n },\n };\n\n const result = wirePropertyFormattingToSdkFormatting(wireFormat);\n\n expect(result).toEqual({\n type: \"number\",\n numberType: {\n type: \"ratio\",\n ratioType: \"PERCENTAGE\",\n baseFormatOptions: {\n minimumFractionDigits: 1,\n maximumFractionDigits: 2,\n },\n },\n });\n });\n\n it(\"returns undefined for unknown number format type\", () => {\n const wireFormat = {\n type: \"number\",\n numberType: {\n type: \"INVALID_FORMAT_TYPE\",\n someUnknownField: \"value\",\n },\n } as any;\n\n const result = wirePropertyFormattingToSdkFormatting(wireFormat);\n\n expect(result).toBeUndefined();\n });\n });\n\n describe(\"date/timestamp formatting\", () => {\n it(\"converts date format with string pattern\", () => {\n const wireFormat: Ontologies.PropertyValueFormattingRule = {\n type: \"date\",\n format: {\n type: \"stringFormat\",\n pattern: \"yyyy-MM-dd\",\n },\n };\n\n const result = wirePropertyFormattingToSdkFormatting(wireFormat);\n\n expect(result).toEqual({\n type: \"date\",\n format: {\n type: \"stringFormat\",\n pattern: \"yyyy-MM-dd\",\n },\n });\n });\n\n it(\"converts timestamp format with localized format and static timezone\", () => {\n const wireFormat: Ontologies.PropertyValueFormattingRule = {\n type: \"timestamp\",\n format: {\n type: \"localizedFormat\",\n format: \"DATE_FORMAT_DATE_TIME\",\n },\n displayTimezone: {\n type: \"static\",\n zoneId: {\n type: \"constant\",\n value: \"America/New_York\",\n },\n },\n };\n\n const result = wirePropertyFormattingToSdkFormatting(wireFormat);\n\n expect(result).toEqual({\n type: \"timestamp\",\n format: {\n type: \"localizedFormat\",\n format: \"DATE_FORMAT_DATE_TIME\",\n },\n displayTimezone: {\n type: \"static\",\n zoneId: {\n type: \"constant\",\n value: \"America/New_York\",\n },\n },\n });\n });\n\n it(\"returns undefined for unknown datetime format type\", () => {\n const wireFormat: Ontologies.PropertyValueFormattingRule = {\n type: \"date\",\n format: {\n type: \"UNKNOWN_FORMAT_TYPE\",\n } as any,\n };\n\n const result = wirePropertyFormattingToSdkFormatting(wireFormat);\n\n expect(result).toBeUndefined();\n });\n });\n\n describe(\"boolean formatting\", () => {\n it(\"converts boolean format\", () => {\n const wireFormat: Ontologies.PropertyValueFormattingRule = {\n type: \"boolean\",\n valueIfTrue: \"Yes\",\n valueIfFalse: \"No\",\n };\n\n const result = wirePropertyFormattingToSdkFormatting(wireFormat);\n\n expect(result).toEqual({\n type: \"boolean\",\n valueIfTrue: \"Yes\",\n valueIfFalse: \"No\",\n });\n });\n });\n\n describe(\"known type formatting\", () => {\n it(\"converts valid known types\", () => {\n const testCases: Array<{\n input: Ontologies.KnownType;\n expected: KnownType;\n }> = [\n { input: \"USER_OR_GROUP_ID\", expected: \"USER_OR_GROUP_ID\" },\n { input: \"RESOURCE_RID\", expected: \"RESOURCE_RID\" },\n { input: \"ARTIFACT_GID\", expected: \"ARTIFACT_GID\" },\n ];\n\n for (const { input, expected } of testCases) {\n const wireFormat: Ontologies.PropertyValueFormattingRule = {\n type: \"knownType\",\n knownType: input,\n };\n\n const result = wirePropertyFormattingToSdkFormatting(wireFormat);\n\n expect(result).toEqual({\n type: \"knownType\",\n knownType: expected,\n });\n }\n });\n\n it(\"returns undefined for invalid known type\", () => {\n const wireFormat = {\n type: \"knownType\",\n knownType: \"INVALID_KNOWN_TYPE\",\n } as any;\n\n const result = wirePropertyFormattingToSdkFormatting(wireFormat);\n\n expect(result).toBeUndefined();\n });\n });\n\n describe(\"unknown formatting types\", () => {\n it(\"returns undefined for completely unknown formatting type\", () => {\n const wireFormat = {\n type: \"UNKNOWN_FORMAT_TYPE\",\n someField: \"value\",\n } as any;\n\n const result = wirePropertyFormattingToSdkFormatting(wireFormat);\n\n expect(result).toBeUndefined();\n });\n\n describe(\"affix formatting\", () => {\n it(\"converts affix format with prefix and postfix\", () => {\n const wireFormat: Ontologies.PropertyValueFormattingRule = {\n type: \"number\",\n numberType: {\n type: \"affix\",\n baseFormatOptions: {\n useGrouping: true,\n },\n affix: {\n prefix: {\n type: \"constant\",\n value: \"$\",\n },\n postfix: {\n type: \"propertyType\",\n propertyApiName: \"unitField\",\n },\n },\n },\n };\n\n const result = wirePropertyFormattingToSdkFormatting(wireFormat);\n\n expect(result).toEqual({\n type: \"number\",\n numberType: {\n type: \"affix\",\n baseFormatOptions: {\n useGrouping: true,\n },\n affix: {\n prefix: {\n type: \"constant\",\n value: \"$\",\n },\n postfix: {\n type: \"propertyType\",\n propertyApiName: \"unitField\",\n },\n },\n },\n });\n });\n\n it(\"handles affix with missing prefix/postfix\", () => {\n const wireFormat: Ontologies.PropertyValueFormattingRule = {\n type: \"number\",\n numberType: {\n type: \"affix\",\n baseFormatOptions: {},\n affix: {},\n },\n };\n\n const result = wirePropertyFormattingToSdkFormatting(wireFormat);\n\n expect(result).toEqual({\n type: \"number\",\n numberType: {\n type: \"affix\",\n baseFormatOptions: {},\n affix: {\n prefix: undefined,\n postfix: undefined,\n },\n },\n });\n });\n });\n\n describe(\"fixed values formatting\", () => {\n it(\"converts fixed values format\", () => {\n const wireFormat: Ontologies.PropertyValueFormattingRule = {\n type: \"number\",\n numberType: {\n type: \"fixedValues\",\n values: {\n 1: \"First\",\n 2: \"Second\",\n 3: \"Third\",\n },\n },\n };\n\n const result = wirePropertyFormattingToSdkFormatting(wireFormat);\n\n expect(result).toEqual({\n type: \"number\",\n numberType: {\n type: \"fixedValues\",\n values: {\n 1: \"First\",\n 2: \"Second\",\n 3: \"Third\",\n },\n },\n });\n });\n });\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,SAASA,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AAC7C,SAASC,qCAAqC,QAAQ,4CAA4C;AAElGH,QAAQ,CAACG,qCAAqC,EAAE,MAAM;EACpDH,QAAQ,CAAC,mBAAmB,EAAE,MAAM;IAClCE,EAAE,CAAC,iCAAiC,EAAE,MAAM;MAc1C,MAAME,MAAM,GAAGD,qCAAqC,CAbO;QACzDE,IAAI,EAAE,QAAQ;QACdC,UAAU,EAAE;UACVD,IAAI,EAAE,UAAU;UAChBE,iBAAiB,EAAE;YACjBC,WAAW,EAAE,IAAI;YACjBC,qBAAqB,EAAE,CAAC;YACxBC,qBAAqB,EAAE,CAAC;YACxBC,QAAQ,EAAE;UACZ;QACF;MACF,CAE+D,CAAC;MAEhEV,MAAM,CAACG,MAAM,CAAC,CAACQ,OAAO,CAAC;QACrBP,IAAI,EAAE,QAAQ;QACdC,UAAU,EAAE;UACVD,IAAI,EAAE,UAAU;UAChBE,iBAAiB,EAAE;YACjBC,WAAW,EAAE,IAAI;YACjBC,qBAAqB,EAAE,CAAC;YACxBC,qBAAqB,EAAE,CAAC;YACxBC,QAAQ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