@osdk/maker 0.14.0-beta.9 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +166 -0
- package/README.md +0 -1
- package/build/browser/api/code-snippets/createCodeSnippets.js +7 -4
- package/build/browser/api/code-snippets/createCodeSnippets.js.map +1 -1
- package/build/browser/api/code-snippets/snippetTypes.js +1 -0
- package/build/browser/api/code-snippets/snippetTypes.js.map +1 -1
- package/build/browser/api/defineAction.js +6 -0
- package/build/browser/api/defineAction.js.map +1 -1
- package/build/browser/api/defineCreateInterfaceObjectAction.js +8 -7
- package/build/browser/api/defineCreateInterfaceObjectAction.js.map +1 -1
- package/build/browser/api/defineModifyInterfaceObjectAction.js +8 -7
- package/build/browser/api/defineModifyInterfaceObjectAction.js.map +1 -1
- package/build/browser/api/defineObject.js +1 -2
- package/build/browser/api/defineObject.js.map +1 -1
- package/build/browser/api/object/ObjectPropertyTypeUserDefinition.js.map +1 -1
- package/build/browser/api/properties/PropertyTypeType.js.map +1 -1
- package/build/browser/api/test/actions.test.js +1243 -1
- package/build/browser/api/test/actions.test.js.map +1 -1
- package/build/browser/api/test/misc.test.js +2 -2
- package/build/browser/api/test/misc.test.js.map +1 -1
- package/build/browser/api/test/spt.test.js +204 -105
- package/build/browser/api/test/spt.test.js.map +1 -1
- package/build/browser/cli/main.js +1 -1
- package/build/browser/cli/main.js.map +1 -1
- package/build/browser/conversion/toMarketplace/propertyTypeTypeToOntologyIrType.js +19 -7
- package/build/browser/conversion/toMarketplace/propertyTypeTypeToOntologyIrType.js.map +1 -1
- package/build/cjs/index.cjs +52 -1167
- package/build/cjs/index.cjs.map +1 -1
- package/build/cjs/index.d.cts +14 -5
- package/build/esm/api/code-snippets/createCodeSnippets.js +7 -4
- package/build/esm/api/code-snippets/createCodeSnippets.js.map +1 -1
- package/build/esm/api/code-snippets/snippetTypes.js +1 -0
- package/build/esm/api/code-snippets/snippetTypes.js.map +1 -1
- package/build/esm/api/defineAction.js +6 -0
- package/build/esm/api/defineAction.js.map +1 -1
- package/build/esm/api/defineCreateInterfaceObjectAction.js +8 -7
- package/build/esm/api/defineCreateInterfaceObjectAction.js.map +1 -1
- package/build/esm/api/defineModifyInterfaceObjectAction.js +8 -7
- package/build/esm/api/defineModifyInterfaceObjectAction.js.map +1 -1
- package/build/esm/api/defineObject.js +1 -2
- package/build/esm/api/defineObject.js.map +1 -1
- package/build/esm/api/object/ObjectPropertyTypeUserDefinition.js.map +1 -1
- package/build/esm/api/properties/PropertyTypeType.js.map +1 -1
- package/build/esm/api/test/actions.test.js +1243 -1
- package/build/esm/api/test/actions.test.js.map +1 -1
- package/build/esm/api/test/misc.test.js +2 -2
- package/build/esm/api/test/misc.test.js.map +1 -1
- package/build/esm/api/test/spt.test.js +204 -105
- package/build/esm/api/test/spt.test.js.map +1 -1
- package/build/esm/cli/main.js +1 -1
- package/build/esm/cli/main.js.map +1 -1
- package/build/esm/conversion/toMarketplace/propertyTypeTypeToOntologyIrType.js +19 -7
- package/build/esm/conversion/toMarketplace/propertyTypeTypeToOntologyIrType.js.map +1 -1
- package/build/types/api/code-snippets/createCodeSnippets.d.ts.map +1 -1
- package/build/types/api/code-snippets/snippetTypes.d.ts +1 -0
- package/build/types/api/code-snippets/snippetTypes.d.ts.map +1 -1
- package/build/types/api/defineAction.d.ts +3 -0
- package/build/types/api/defineAction.d.ts.map +1 -1
- package/build/types/api/defineCreateInterfaceObjectAction.d.ts.map +1 -1
- package/build/types/api/defineModifyInterfaceObjectAction.d.ts.map +1 -1
- package/build/types/api/object/ObjectPropertyTypeUserDefinition.d.ts +1 -1
- package/build/types/api/object/ObjectPropertyTypeUserDefinition.d.ts.map +1 -1
- package/build/types/api/properties/PropertyTypeType.d.ts +11 -4
- package/build/types/api/properties/PropertyTypeType.d.ts.map +1 -1
- package/package.json +8 -6
|
@@ -15,14 +15,15 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import { convertMappingValue } from "../conversion/toMarketplace/convertMappingValue.js";
|
|
18
|
-
import { addNamespaceToActionDefinition, convertValidationRule, CREATE_INTERFACE_OBJECT_PARAMETER, createDefaultParameterOrdering, createParameters, defineAction, getInterfaceParameterName, isPropertyParameter, kebab, validateActionParameters, validateParameterOrdering } from "./defineAction.js";
|
|
18
|
+
import { addNamespaceToActionDefinition, convertValidationRule, CREATE_INTERFACE_OBJECT_PARAMETER, createDefaultParameterOrdering, createParameters, defineAction, getInterfaceParameterName, getNonNamespacedParameterName, isPropertyParameter, kebab, validateActionParameters, validateParameterOrdering } from "./defineAction.js";
|
|
19
19
|
import { getFlattenedInterfaceProperties } from "./interface/getFlattenedInterfaceProperties.js";
|
|
20
20
|
export function defineCreateInterfaceObjectAction(def) {
|
|
21
21
|
addNamespaceToActionDefinition(def);
|
|
22
22
|
const allProperties = getFlattenedInterfaceProperties(def.interfaceType);
|
|
23
23
|
validateActionParameters(def, Object.keys(allProperties), def.interfaceType.apiName);
|
|
24
|
-
const
|
|
25
|
-
const parameterNames = new Set(
|
|
24
|
+
const sptNames = Object.keys(allProperties).filter(apiName => isPropertyParameter(def, apiName, allProperties[apiName].sharedPropertyType.type));
|
|
25
|
+
const parameterNames = new Set(sptNames.map(apiName => getInterfaceParameterName(def, apiName)));
|
|
26
|
+
const propertyMap = Object.fromEntries(Object.entries(allProperties).map(([id, prop]) => [getInterfaceParameterName(def, id), prop.sharedPropertyType]));
|
|
26
27
|
Object.keys(def.parameterConfiguration ?? {}).forEach(param => parameterNames.add(getInterfaceParameterName(def, param)));
|
|
27
28
|
parameterNames.add(CREATE_INTERFACE_OBJECT_PARAMETER);
|
|
28
29
|
const actionApiName = def.apiName ?? `create-${kebab(def.interfaceType.apiName.split(".").pop() ?? def.interfaceType.apiName)}${def.objectType === undefined ? "" : `-${kebab(def.objectType.apiName.split(".").pop() ?? def.objectType.apiName)}`}`;
|
|
@@ -32,7 +33,7 @@ export function defineCreateInterfaceObjectAction(def) {
|
|
|
32
33
|
}
|
|
33
34
|
validateParameterOrdering(def.parameterOrdering, parameterNames, actionApiName);
|
|
34
35
|
}
|
|
35
|
-
const parameters = createParameters(def,
|
|
36
|
+
const parameters = createParameters(def, propertyMap, parameterNames, Object.fromEntries(Object.entries(allProperties).map(([id, prop]) => [id, prop.required])));
|
|
36
37
|
const mappings = Object.fromEntries(Object.entries(def.nonParameterMappings ?? {}).map(([id, value]) => [id, convertMappingValue(value)]));
|
|
37
38
|
return defineAction({
|
|
38
39
|
apiName: actionApiName,
|
|
@@ -51,15 +52,15 @@ export function defineCreateInterfaceObjectAction(def) {
|
|
|
51
52
|
interfaceApiName: def.interfaceType.apiName,
|
|
52
53
|
objectTypeParameter: CREATE_INTERFACE_OBJECT_PARAMETER,
|
|
53
54
|
sharedPropertyValues: {
|
|
54
|
-
...Object.fromEntries(
|
|
55
|
+
...Object.fromEntries(sptNames.map(id => [id, {
|
|
55
56
|
type: "parameterId",
|
|
56
|
-
parameterId: id
|
|
57
|
+
parameterId: def.useNonNamespacedParameters ? getNonNamespacedParameterName(def, id) : id
|
|
57
58
|
}])),
|
|
58
59
|
...mappings
|
|
59
60
|
}
|
|
60
61
|
}
|
|
61
62
|
}],
|
|
62
|
-
parameterOrdering: def.parameterOrdering ?? createDefaultParameterOrdering(def,
|
|
63
|
+
parameterOrdering: def.parameterOrdering ?? createDefaultParameterOrdering(def, Array.from(parameterNames), parameters, CREATE_INTERFACE_OBJECT_PARAMETER),
|
|
63
64
|
...(def.actionLevelValidation ? {
|
|
64
65
|
validation: convertValidationRule(def.actionLevelValidation, parameters)
|
|
65
66
|
} : {}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defineCreateInterfaceObjectAction.js","names":["convertMappingValue","addNamespaceToActionDefinition","convertValidationRule","CREATE_INTERFACE_OBJECT_PARAMETER","createDefaultParameterOrdering","createParameters","defineAction","getInterfaceParameterName","isPropertyParameter","kebab","validateActionParameters","validateParameterOrdering","getFlattenedInterfaceProperties","defineCreateInterfaceObjectAction","def","allProperties","interfaceType","Object","keys","apiName","propertyParameters","filter","sharedPropertyType","type","parameterNames","Set","parameterConfiguration","forEach","param","add","actionApiName","split","pop","objectType","undefined","parameterOrdering","includes","unshift","parameters","fromEntries","entries","map","id","prop","required","mappings","nonParameterMappings","value","displayName","displayMetadata","status","entities","affectedInterfaceTypes","affectedObjectTypes","affectedLinkTypes","typeGroups","rules","addInterfaceRule","interfaceApiName","objectTypeParameter","sharedPropertyValues","parameterId","actionLevelValidation","validation","defaultFormat","enableLayoutSwitch","tableConfiguration","displayAndFormat","table","sections","section","submissionMetadata"],"sources":["defineCreateInterfaceObjectAction.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 { convertMappingValue } from \"../conversion/toMarketplace/convertMappingValue.js\";\nimport { type ActionType } from \"./action/ActionType.js\";\nimport type { InterfaceActionTypeUserDefinition } from \"./defineAction.js\";\nimport {\n addNamespaceToActionDefinition,\n convertValidationRule,\n CREATE_INTERFACE_OBJECT_PARAMETER,\n createDefaultParameterOrdering,\n createParameters,\n defineAction,\n getInterfaceParameterName,\n isPropertyParameter,\n kebab,\n validateActionParameters,\n validateParameterOrdering,\n} from \"./defineAction.js\";\nimport { getFlattenedInterfaceProperties } from \"./interface/getFlattenedInterfaceProperties.js\";\n\nexport function defineCreateInterfaceObjectAction(\n def: InterfaceActionTypeUserDefinition,\n): ActionType {\n addNamespaceToActionDefinition(def);\n const allProperties = getFlattenedInterfaceProperties(def.interfaceType);\n validateActionParameters(\n def,\n Object.keys(allProperties),\n def.interfaceType.apiName,\n );\n const propertyParameters = Object.keys(allProperties).filter(apiName =>\n isPropertyParameter(\n def,\n apiName,\n allProperties[apiName].sharedPropertyType.type,\n )\n );\n const parameterNames = new Set(propertyParameters);\n Object.keys(def.parameterConfiguration ?? {}).forEach(param =>\n parameterNames.add(getInterfaceParameterName(def, param))\n );\n parameterNames.add(CREATE_INTERFACE_OBJECT_PARAMETER);\n const actionApiName = def.apiName ?? `create-${\n kebab(\n def.interfaceType.apiName.split(\".\").pop() ?? def.interfaceType.apiName,\n )\n }${\n def.objectType === undefined\n ? \"\"\n : `-${\n kebab(\n def.objectType.apiName.split(\".\").pop() ?? def.objectType.apiName,\n )\n }`\n }`;\n if (def.parameterOrdering) {\n if (!def.parameterOrdering.includes(CREATE_INTERFACE_OBJECT_PARAMETER)) {\n def.parameterOrdering.unshift(CREATE_INTERFACE_OBJECT_PARAMETER);\n }\n validateParameterOrdering(\n def.parameterOrdering,\n parameterNames,\n actionApiName,\n );\n }\n const parameters = createParameters(\n def,\n Object.fromEntries(\n Object.entries(allProperties).map((\n [id, prop],\n ) => [id, prop.sharedPropertyType]),\n ),\n parameterNames,\n Object.fromEntries(\n Object.entries(allProperties).map(([id, prop]) => [id, prop.required]),\n ),\n );\n const mappings = Object.fromEntries(\n Object.entries(def.nonParameterMappings ?? {}).map((\n [id, value],\n ) => [id, convertMappingValue(value)]),\n );\n\n return defineAction({\n apiName: actionApiName,\n displayName: def.displayName\n ?? `Create ${def.interfaceType.displayMetadata.displayName}`,\n parameters: parameters,\n status: def.status ?? (def.interfaceType.status.type !== \"deprecated\"\n ? def.interfaceType.status.type\n : def.interfaceType.status),\n entities: {\n affectedInterfaceTypes: [def.interfaceType.apiName],\n affectedObjectTypes: [],\n affectedLinkTypes: [],\n typeGroups: [],\n },\n rules: [\n {\n type: \"addInterfaceRule\",\n addInterfaceRule: {\n interfaceApiName: def.interfaceType.apiName,\n objectTypeParameter: CREATE_INTERFACE_OBJECT_PARAMETER,\n sharedPropertyValues: {\n ...Object.fromEntries(\n propertyParameters.map(\n id => [id, { type: \"parameterId\", parameterId: id }],\n ),\n ),\n ...mappings,\n },\n },\n },\n ],\n parameterOrdering: def.parameterOrdering\n ?? createDefaultParameterOrdering(\n def,\n Object.keys(allProperties),\n parameters,\n CREATE_INTERFACE_OBJECT_PARAMETER,\n ),\n ...(def.actionLevelValidation\n ? {\n validation: convertValidationRule(\n def.actionLevelValidation,\n parameters,\n ),\n }\n : {}),\n ...(def.defaultFormat && { defaultFormat: def.defaultFormat }),\n ...(def.enableLayoutSwitch\n && { enableLayoutSwitch: def.enableLayoutSwitch }),\n ...(def.tableConfiguration && {\n displayAndFormat: {\n table: def.tableConfiguration,\n },\n }),\n ...(def.sections\n && {\n sections: Object.fromEntries(\n def.sections.map(section => [section.id, section]),\n ),\n }),\n ...(def.submissionMetadata\n && { submissionMetadata: def.submissionMetadata }),\n });\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,mBAAmB,QAAQ,oDAAoD;AAGxF,SACEC,8BAA8B,EAC9BC,qBAAqB,EACrBC,iCAAiC,EACjCC,8BAA8B,EAC9BC,gBAAgB,EAChBC,YAAY,EACZC,yBAAyB,EACzBC,mBAAmB,EACnBC,KAAK,EACLC,wBAAwB,EACxBC,yBAAyB,QACpB,mBAAmB;AAC1B,SAASC,+BAA+B,QAAQ,gDAAgD;AAEhG,OAAO,SAASC,iCAAiCA,CAC/CC,GAAsC,EAC1B;EACZb,8BAA8B,CAACa,GAAG,CAAC;EACnC,MAAMC,aAAa,GAAGH,+BAA+B,CAACE,GAAG,CAACE,aAAa,CAAC;EACxEN,wBAAwB,CACtBI,GAAG,EACHG,MAAM,CAACC,IAAI,CAACH,aAAa,CAAC,EAC1BD,GAAG,CAACE,aAAa,CAACG,OACpB,CAAC;EACD,MAAMC,kBAAkB,GAAGH,MAAM,CAACC,IAAI,CAACH,aAAa,CAAC,C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AAC;EACrD,CAAC,CAAC;AACJ","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"defineCreateInterfaceObjectAction.js","names":["convertMappingValue","addNamespaceToActionDefinition","convertValidationRule","CREATE_INTERFACE_OBJECT_PARAMETER","createDefaultParameterOrdering","createParameters","defineAction","getInterfaceParameterName","getNonNamespacedParameterName","isPropertyParameter","kebab","validateActionParameters","validateParameterOrdering","getFlattenedInterfaceProperties","defineCreateInterfaceObjectAction","def","allProperties","interfaceType","Object","keys","apiName","sptNames","filter","sharedPropertyType","type","parameterNames","Set","map","propertyMap","fromEntries","entries","id","prop","parameterConfiguration","forEach","param","add","actionApiName","split","pop","objectType","undefined","parameterOrdering","includes","unshift","parameters","required","mappings","nonParameterMappings","value","displayName","displayMetadata","status","entities","affectedInterfaceTypes","affectedObjectTypes","affectedLinkTypes","typeGroups","rules","addInterfaceRule","interfaceApiName","objectTypeParameter","sharedPropertyValues","parameterId","useNonNamespacedParameters","Array","from","actionLevelValidation","validation","defaultFormat","enableLayoutSwitch","tableConfiguration","displayAndFormat","table","sections","section","submissionMetadata"],"sources":["defineCreateInterfaceObjectAction.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 { convertMappingValue } from \"../conversion/toMarketplace/convertMappingValue.js\";\nimport { type ActionType } from \"./action/ActionType.js\";\nimport type { InterfaceActionTypeUserDefinition } from \"./defineAction.js\";\nimport {\n addNamespaceToActionDefinition,\n convertValidationRule,\n CREATE_INTERFACE_OBJECT_PARAMETER,\n createDefaultParameterOrdering,\n createParameters,\n defineAction,\n getInterfaceParameterName,\n getNonNamespacedParameterName,\n isPropertyParameter,\n kebab,\n validateActionParameters,\n validateParameterOrdering,\n} from \"./defineAction.js\";\nimport { getFlattenedInterfaceProperties } from \"./interface/getFlattenedInterfaceProperties.js\";\n\nexport function defineCreateInterfaceObjectAction(\n def: InterfaceActionTypeUserDefinition,\n): ActionType {\n addNamespaceToActionDefinition(def);\n const allProperties = getFlattenedInterfaceProperties(def.interfaceType);\n validateActionParameters(\n def,\n Object.keys(allProperties),\n def.interfaceType.apiName,\n );\n const sptNames = Object.keys(allProperties).filter(apiName =>\n isPropertyParameter(\n def,\n apiName,\n allProperties[apiName].sharedPropertyType.type,\n )\n );\n const parameterNames = new Set(\n sptNames.map(apiName => getInterfaceParameterName(def, apiName)),\n );\n const propertyMap = Object.fromEntries(\n Object.entries(allProperties).map((\n [id, prop],\n ) => [getInterfaceParameterName(def, id), prop.sharedPropertyType]),\n );\n\n Object.keys(def.parameterConfiguration ?? {}).forEach(param =>\n parameterNames.add(getInterfaceParameterName(def, param))\n );\n parameterNames.add(CREATE_INTERFACE_OBJECT_PARAMETER);\n const actionApiName = def.apiName ?? `create-${\n kebab(\n def.interfaceType.apiName.split(\".\").pop() ?? def.interfaceType.apiName,\n )\n }${\n def.objectType === undefined\n ? \"\"\n : `-${\n kebab(\n def.objectType.apiName.split(\".\").pop() ?? def.objectType.apiName,\n )\n }`\n }`;\n if (def.parameterOrdering) {\n if (!def.parameterOrdering.includes(CREATE_INTERFACE_OBJECT_PARAMETER)) {\n def.parameterOrdering.unshift(CREATE_INTERFACE_OBJECT_PARAMETER);\n }\n validateParameterOrdering(\n def.parameterOrdering,\n parameterNames,\n actionApiName,\n );\n }\n const parameters = createParameters(\n def,\n propertyMap,\n parameterNames,\n Object.fromEntries(\n Object.entries(allProperties).map(([id, prop]) => [id, prop.required]),\n ),\n );\n const mappings = Object.fromEntries(\n Object.entries(def.nonParameterMappings ?? {}).map((\n [id, value],\n ) => [id, convertMappingValue(value)]),\n );\n\n return defineAction({\n apiName: actionApiName,\n displayName: def.displayName\n ?? `Create ${def.interfaceType.displayMetadata.displayName}`,\n parameters: parameters,\n status: def.status ?? (def.interfaceType.status.type !== \"deprecated\"\n ? def.interfaceType.status.type\n : def.interfaceType.status),\n entities: {\n affectedInterfaceTypes: [def.interfaceType.apiName],\n affectedObjectTypes: [],\n affectedLinkTypes: [],\n typeGroups: [],\n },\n rules: [\n {\n type: \"addInterfaceRule\",\n addInterfaceRule: {\n interfaceApiName: def.interfaceType.apiName,\n objectTypeParameter: CREATE_INTERFACE_OBJECT_PARAMETER,\n sharedPropertyValues: {\n ...Object.fromEntries(\n sptNames.map(\n id => [id, {\n type: \"parameterId\",\n parameterId: def.useNonNamespacedParameters\n ? getNonNamespacedParameterName(def, id)\n : id,\n }],\n ),\n ),\n ...mappings,\n },\n },\n },\n ],\n parameterOrdering: def.parameterOrdering\n ?? createDefaultParameterOrdering(\n def,\n Array.from(parameterNames),\n parameters,\n CREATE_INTERFACE_OBJECT_PARAMETER,\n ),\n ...(def.actionLevelValidation\n ? {\n validation: convertValidationRule(\n def.actionLevelValidation,\n parameters,\n ),\n }\n : {}),\n ...(def.defaultFormat && { defaultFormat: def.defaultFormat }),\n ...(def.enableLayoutSwitch\n && { enableLayoutSwitch: def.enableLayoutSwitch }),\n ...(def.tableConfiguration && {\n displayAndFormat: {\n table: def.tableConfiguration,\n },\n }),\n ...(def.sections\n && {\n sections: Object.fromEntries(\n def.sections.map(section => [section.id, section]),\n ),\n }),\n ...(def.submissionMetadata\n && { submissionMetadata: def.submissionMetadata }),\n });\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,mBAAmB,QAAQ,oDAAoD;AAGxF,SACEC,8BAA8B,EAC9BC,qBAAqB,EACrBC,iCAAiC,EACjCC,8BAA8B,EAC9BC,gBAAgB,EAChBC,YAAY,EACZC,yBAAyB,EACzBC,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AqB,EACzBtB,UACF;IACF,CAAC,GACC,CAAC,CAAC,CAAC;IACP,IAAI9B,GAAG,CAACsD,aAAa,IAAI;MAAEA,aAAa,EAAEtD,GAAG,CAACsD;IAAc,CAAC,CAAC;IAC9D,IAAItD,GAAG,CAACuD,kBAAkB,IACrB;MAAEA,kBAAkB,EAAEvD,GAAG,CAACuD;IAAmB,CAAC,CAAC;IACpD,IAAIvD,GAAG,CAACwD,kBAAkB,IAAI;MAC5BC,gBAAgB,EAAE;QAChBC,KAAK,EAAE1D,GAAG,CAACwD;MACb;IACF,CAAC,CAAC;IACF,IAAIxD,GAAG,CAAC2D,QAAQ,IACX;MACDA,QAAQ,EAAExD,MAAM,CAACW,WAAW,CAC1Bd,GAAG,CAAC2D,QAAQ,CAAC/C,GAAG,CAACgD,OAAO,IAAI,CAACA,OAAO,CAAC5C,EAAE,EAAE4C,OAAO,CAAC,CACnD;IACF,CAAC,CAAC;IACJ,IAAI5D,GAAG,CAAC6D,kBAAkB,IACrB;MAAEA,kBAAkB,EAAE7D,GAAG,CAAC6D;IAAmB,CAAC;EACrD,CAAC,CAAC;AACJ","ignoreList":[]}
|
|
@@ -15,14 +15,15 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import { convertMappingValue } from "../conversion/toMarketplace/convertMappingValue.js";
|
|
18
|
-
import { addNamespaceToActionDefinition, convertValidationRule, createDefaultParameterOrdering, createParameters, defineAction, getInterfaceParameterName, isPropertyParameter, kebab, MODIFY_INTERFACE_OBJECT_PARAMETER, validateActionParameters, validateParameterOrdering } from "./defineAction.js";
|
|
18
|
+
import { addNamespaceToActionDefinition, convertValidationRule, createDefaultParameterOrdering, createParameters, defineAction, getInterfaceParameterName, getNonNamespacedParameterName, isPropertyParameter, kebab, MODIFY_INTERFACE_OBJECT_PARAMETER, validateActionParameters, validateParameterOrdering } from "./defineAction.js";
|
|
19
19
|
import { getFlattenedInterfaceProperties } from "./interface/getFlattenedInterfaceProperties.js";
|
|
20
20
|
export function defineModifyInterfaceObjectAction(def) {
|
|
21
21
|
addNamespaceToActionDefinition(def);
|
|
22
22
|
const allProperties = getFlattenedInterfaceProperties(def.interfaceType);
|
|
23
23
|
validateActionParameters(def, Object.keys(allProperties), def.interfaceType.apiName);
|
|
24
|
-
const
|
|
25
|
-
const parameterNames = new Set(
|
|
24
|
+
const sptNames = Object.keys(allProperties).filter(apiName => isPropertyParameter(def, apiName, allProperties[apiName].sharedPropertyType.type));
|
|
25
|
+
const parameterNames = new Set(sptNames.map(apiName => getInterfaceParameterName(def, apiName)));
|
|
26
|
+
const propertyMap = Object.fromEntries(Object.entries(allProperties).map(([id, prop]) => [getInterfaceParameterName(def, id), prop.sharedPropertyType]));
|
|
26
27
|
Object.keys(def.parameterConfiguration ?? {}).forEach(param => parameterNames.add(getInterfaceParameterName(def, param)));
|
|
27
28
|
parameterNames.add(MODIFY_INTERFACE_OBJECT_PARAMETER);
|
|
28
29
|
const actionApiName = def.apiName ?? `modify-${kebab(def.interfaceType.apiName.split(".").pop() ?? def.interfaceType.apiName)}${def.objectType === undefined ? "" : `-${kebab(def.objectType.apiName.split(".").pop() ?? def.objectType.apiName)}`}`;
|
|
@@ -32,7 +33,7 @@ export function defineModifyInterfaceObjectAction(def) {
|
|
|
32
33
|
}
|
|
33
34
|
validateParameterOrdering(def.parameterOrdering, parameterNames, actionApiName);
|
|
34
35
|
}
|
|
35
|
-
const parameters = createParameters(def,
|
|
36
|
+
const parameters = createParameters(def, propertyMap, parameterNames, Object.fromEntries(Object.entries(allProperties).map(([id, prop]) => [id, prop.required])));
|
|
36
37
|
const mappings = Object.fromEntries(Object.entries(def.nonParameterMappings ?? {}).map(([id, value]) => [id, convertMappingValue(value)]));
|
|
37
38
|
return defineAction({
|
|
38
39
|
apiName: actionApiName,
|
|
@@ -50,15 +51,15 @@ export function defineModifyInterfaceObjectAction(def) {
|
|
|
50
51
|
modifyInterfaceRule: {
|
|
51
52
|
interfaceObjectToModifyParameter: "interfaceObjectToModifyParameter",
|
|
52
53
|
sharedPropertyValues: {
|
|
53
|
-
...Object.fromEntries(
|
|
54
|
+
...Object.fromEntries(sptNames.map(id => [id, {
|
|
54
55
|
type: "parameterId",
|
|
55
|
-
parameterId: id
|
|
56
|
+
parameterId: def.useNonNamespacedParameters ? getNonNamespacedParameterName(def, id) : id
|
|
56
57
|
}])),
|
|
57
58
|
...mappings
|
|
58
59
|
}
|
|
59
60
|
}
|
|
60
61
|
}],
|
|
61
|
-
parameterOrdering: def.parameterOrdering ?? createDefaultParameterOrdering(def,
|
|
62
|
+
parameterOrdering: def.parameterOrdering ?? createDefaultParameterOrdering(def, Array.from(parameterNames), parameters, MODIFY_INTERFACE_OBJECT_PARAMETER),
|
|
62
63
|
...(def.actionLevelValidation ? {
|
|
63
64
|
validation: convertValidationRule(def.actionLevelValidation, parameters)
|
|
64
65
|
} : {}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defineModifyInterfaceObjectAction.js","names":["convertMappingValue","addNamespaceToActionDefinition","convertValidationRule","createDefaultParameterOrdering","createParameters","defineAction","getInterfaceParameterName","isPropertyParameter","kebab","MODIFY_INTERFACE_OBJECT_PARAMETER","validateActionParameters","validateParameterOrdering","getFlattenedInterfaceProperties","defineModifyInterfaceObjectAction","def","allProperties","interfaceType","Object","keys","apiName","propertyParameters","filter","sharedPropertyType","type","parameterNames","Set","parameterConfiguration","forEach","param","add","actionApiName","split","pop","objectType","undefined","parameterOrdering","includes","unshift","parameters","fromEntries","entries","map","id","prop","required","mappings","nonParameterMappings","value","displayName","displayMetadata","status","entities","affectedInterfaceTypes","affectedObjectTypes","affectedLinkTypes","typeGroups","rules","modifyInterfaceRule","interfaceObjectToModifyParameter","sharedPropertyValues","parameterId","actionLevelValidation","validation","defaultFormat","enableLayoutSwitch","tableConfiguration","displayAndFormat","table","sections","section","submissionMetadata"],"sources":["defineModifyInterfaceObjectAction.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 { convertMappingValue } from \"../conversion/toMarketplace/convertMappingValue.js\";\nimport { type ActionType } from \"./action/ActionType.js\";\nimport type { InterfaceActionTypeUserDefinition } from \"./defineAction.js\";\nimport {\n addNamespaceToActionDefinition,\n convertValidationRule,\n createDefaultParameterOrdering,\n createParameters,\n defineAction,\n getInterfaceParameterName,\n isPropertyParameter,\n kebab,\n MODIFY_INTERFACE_OBJECT_PARAMETER,\n validateActionParameters,\n validateParameterOrdering,\n} from \"./defineAction.js\";\nimport { getFlattenedInterfaceProperties } from \"./interface/getFlattenedInterfaceProperties.js\";\n\nexport function defineModifyInterfaceObjectAction(\n def: InterfaceActionTypeUserDefinition,\n): ActionType {\n addNamespaceToActionDefinition(def);\n const allProperties = getFlattenedInterfaceProperties(def.interfaceType);\n validateActionParameters(\n def,\n Object.keys(allProperties),\n def.interfaceType.apiName,\n );\n const propertyParameters = Object.keys(allProperties).filter(apiName =>\n isPropertyParameter(\n def,\n apiName,\n allProperties[apiName].sharedPropertyType.type,\n )\n );\n const parameterNames = new Set(propertyParameters);\n Object.keys(def.parameterConfiguration ?? {}).forEach(param =>\n parameterNames.add(\n getInterfaceParameterName(def, param),\n )\n );\n parameterNames.add(MODIFY_INTERFACE_OBJECT_PARAMETER);\n const actionApiName = def.apiName ?? `modify-${\n kebab(\n def.interfaceType.apiName.split(\".\").pop() ?? def.interfaceType.apiName,\n )\n }${\n def.objectType === undefined\n ? \"\"\n : `-${\n kebab(\n def.objectType.apiName.split(\".\").pop() ?? def.objectType.apiName,\n )\n }`\n }`;\n if (def.parameterOrdering) {\n if (!def.parameterOrdering.includes(MODIFY_INTERFACE_OBJECT_PARAMETER)) {\n def.parameterOrdering.unshift(MODIFY_INTERFACE_OBJECT_PARAMETER);\n }\n validateParameterOrdering(\n def.parameterOrdering,\n parameterNames,\n actionApiName,\n );\n }\n const parameters = createParameters(\n def,\n Object.fromEntries(\n Object.entries(allProperties).map((\n [id, prop],\n ) => [id, prop.sharedPropertyType]),\n ),\n parameterNames,\n Object.fromEntries(\n Object.entries(allProperties).map(([id, prop]) => [id, prop.required]),\n ),\n );\n const mappings = Object.fromEntries(\n Object.entries(def.nonParameterMappings ?? {}).map((\n [id, value],\n ) => [id, convertMappingValue(value)]),\n );\n\n return defineAction({\n apiName: actionApiName,\n displayName: def.displayName\n ?? `Modify ${def.interfaceType.displayMetadata.displayName}`,\n parameters: parameters,\n status: def.status ?? (def.interfaceType.status.type !== \"deprecated\"\n ? def.interfaceType.status.type\n : def.interfaceType.status),\n entities: {\n affectedInterfaceTypes: [def.interfaceType.apiName],\n affectedObjectTypes: [],\n affectedLinkTypes: [],\n typeGroups: [],\n },\n rules: [\n {\n type: \"modifyInterfaceRule\",\n modifyInterfaceRule: {\n interfaceObjectToModifyParameter: \"interfaceObjectToModifyParameter\",\n sharedPropertyValues: {\n ...Object.fromEntries(\n propertyParameters.map(\n id => [id, { type: \"parameterId\", parameterId: id }],\n ),\n ),\n ...mappings,\n },\n },\n },\n ],\n parameterOrdering: def.parameterOrdering\n ?? createDefaultParameterOrdering(\n def,\n Object.keys(allProperties),\n parameters,\n MODIFY_INTERFACE_OBJECT_PARAMETER,\n ),\n ...(def.actionLevelValidation\n ? {\n validation: convertValidationRule(\n def.actionLevelValidation,\n parameters,\n ),\n }\n : {}),\n ...(def.defaultFormat && { defaultFormat: def.defaultFormat }),\n ...(def.enableLayoutSwitch\n && { enableLayoutSwitch: def.enableLayoutSwitch }),\n ...(def.tableConfiguration && {\n displayAndFormat: {\n table: def.tableConfiguration,\n },\n }),\n ...(def.sections\n && {\n sections: Object.fromEntries(\n def.sections.map(section => [section.id, section]),\n ),\n }),\n ...(def.submissionMetadata\n && { submissionMetadata: def.submissionMetadata }),\n });\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,mBAAmB,QAAQ,oDAAoD;AAGxF,SACEC,8BAA8B,EAC9BC,qBAAqB,EACrBC,8BAA8B,EAC9BC,gBAAgB,EAChBC,YAAY,EACZC,yBAAyB,EACzBC,mBAAmB,EACnBC,KAAK,EACLC,iCAAiC,EACjCC,wBAAwB,EACxBC,yBAAyB,QACpB,mBAAmB;AAC1B,SAASC,+BAA+B,QAAQ,gDAAgD;AAEhG,OAAO,SAASC,iCAAiCA,CAC/CC,GAAsC,EAC1B;EACZb,8BAA8B,CAACa,GAAG,CAAC;EACnC,MAAMC,aAAa,GAAGH,+BAA+B,CAACE,GAAG,CAACE,aAAa,CAAC;EACxEN,wBAAwB,CACtBI,GAAG,EACHG,MAAM,CAACC,IAAI,CAACH,aAAa,CAAC,EAC1BD,GAAG,CAACE,aAAa,CAACG,OACpB,CAAC;EACD,MAAMC,kBAAkB,GAAGH,MAAM,CAACC,IAAI,CAACH,aAAa,CAAC,CAACM,MAAM,CAACF,OAAO,IAClEZ,mBAAmB,CACjBO,GAAG,EACHK,OAAO,EACPJ,aAAa,CAACI,OAAO,CAAC,CAACG,kBAAkB,CAACC,IAC5C,CACF,CAAC;EACD,MAAMC,cAAc,GAAG,IAAIC,GAAG,CAACL,kBAAkB,CAAC;EAClDH,MAAM,CAACC,IAAI,CAACJ,GAAG,CAACY,sBAAsB,IAAI,CAAC,CAAC,CAAC,CAACC,OAAO,CAACC,KAAK,IACzDJ,cAAc,CAACK,GAAG,CAChBvB,yBAAyB,CAACQ,GAAG,EAAEc,KAAK,CACtC,CACF,CAAC;EACDJ,cAAc,CAACK,GAAG,CAACpB,iCAAiC,CAAC;EACrD,MAAMqB,aAAa,GAAGhB,GAAG,CAACK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,EAAE5D,qBAAqB,CAC/BY,GAAG,CAAC+C,qBAAqB,EACzBvB,UACF;IACF,CAAC,GACC,CAAC,CAAC,CAAC;IACP,IAAIxB,GAAG,CAACiD,aAAa,IAAI;MAAEA,aAAa,EAAEjD,GAAG,CAACiD;IAAc,CAAC,CAAC;IAC9D,IAAIjD,GAAG,CAACkD,kBAAkB,IACrB;MAAEA,kBAAkB,EAAElD,GAAG,CAACkD;IAAmB,CAAC,CAAC;IACpD,IAAIlD,GAAG,CAACmD,kBAAkB,IAAI;MAC5BC,gBAAgB,EAAE;QAChBC,KAAK,EAAErD,GAAG,CAACmD;MACb;IACF,CAAC,CAAC;IACF,IAAInD,GAAG,CAACsD,QAAQ,IACX;MACDA,QAAQ,EAAEnD,MAAM,CAACsB,WAAW,CAC1BzB,GAAG,CAACsD,QAAQ,CAAC3B,GAAG,CAAC4B,OAAO,IAAI,CAACA,OAAO,CAAC3B,EAAE,EAAE2B,OAAO,CAAC,CACnD;IACF,CAAC,CAAC;IACJ,IAAIvD,GAAG,CAACwD,kBAAkB,IACrB;MAAEA,kBAAkB,EAAExD,GAAG,CAACwD;IAAmB,CAAC;EACrD,CAAC,CAAC;AACJ","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"defineModifyInterfaceObjectAction.js","names":["convertMappingValue","addNamespaceToActionDefinition","convertValidationRule","createDefaultParameterOrdering","createParameters","defineAction","getInterfaceParameterName","getNonNamespacedParameterName","isPropertyParameter","kebab","MODIFY_INTERFACE_OBJECT_PARAMETER","validateActionParameters","validateParameterOrdering","getFlattenedInterfaceProperties","defineModifyInterfaceObjectAction","def","allProperties","interfaceType","Object","keys","apiName","sptNames","filter","sharedPropertyType","type","parameterNames","Set","map","propertyMap","fromEntries","entries","id","prop","parameterConfiguration","forEach","param","add","actionApiName","split","pop","objectType","undefined","parameterOrdering","includes","unshift","parameters","required","mappings","nonParameterMappings","value","displayName","displayMetadata","status","entities","affectedInterfaceTypes","affectedObjectTypes","affectedLinkTypes","typeGroups","rules","modifyInterfaceRule","interfaceObjectToModifyParameter","sharedPropertyValues","parameterId","useNonNamespacedParameters","Array","from","actionLevelValidation","validation","defaultFormat","enableLayoutSwitch","tableConfiguration","displayAndFormat","table","sections","section","submissionMetadata"],"sources":["defineModifyInterfaceObjectAction.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 { convertMappingValue } from \"../conversion/toMarketplace/convertMappingValue.js\";\nimport { type ActionType } from \"./action/ActionType.js\";\nimport type { InterfaceActionTypeUserDefinition } from \"./defineAction.js\";\nimport {\n addNamespaceToActionDefinition,\n convertValidationRule,\n createDefaultParameterOrdering,\n createParameters,\n defineAction,\n getInterfaceParameterName,\n getNonNamespacedParameterName,\n isPropertyParameter,\n kebab,\n MODIFY_INTERFACE_OBJECT_PARAMETER,\n validateActionParameters,\n validateParameterOrdering,\n} from \"./defineAction.js\";\nimport { getFlattenedInterfaceProperties } from \"./interface/getFlattenedInterfaceProperties.js\";\n\nexport function defineModifyInterfaceObjectAction(\n def: InterfaceActionTypeUserDefinition,\n): ActionType {\n addNamespaceToActionDefinition(def);\n const allProperties = getFlattenedInterfaceProperties(def.interfaceType);\n validateActionParameters(\n def,\n Object.keys(allProperties),\n def.interfaceType.apiName,\n );\n const sptNames = Object.keys(allProperties).filter(apiName =>\n isPropertyParameter(\n def,\n apiName,\n allProperties[apiName].sharedPropertyType.type,\n )\n );\n const parameterNames = new Set(\n sptNames.map(apiName => getInterfaceParameterName(def, apiName)),\n );\n const propertyMap = Object.fromEntries(\n Object.entries(allProperties).map((\n [id, prop],\n ) => [getInterfaceParameterName(def, id), prop.sharedPropertyType]),\n );\n\n Object.keys(def.parameterConfiguration ?? {}).forEach(param =>\n parameterNames.add(\n getInterfaceParameterName(def, param),\n )\n );\n parameterNames.add(MODIFY_INTERFACE_OBJECT_PARAMETER);\n const actionApiName = def.apiName ?? `modify-${\n kebab(\n def.interfaceType.apiName.split(\".\").pop() ?? def.interfaceType.apiName,\n )\n }${\n def.objectType === undefined\n ? \"\"\n : `-${\n kebab(\n def.objectType.apiName.split(\".\").pop() ?? def.objectType.apiName,\n )\n }`\n }`;\n if (def.parameterOrdering) {\n if (!def.parameterOrdering.includes(MODIFY_INTERFACE_OBJECT_PARAMETER)) {\n def.parameterOrdering.unshift(MODIFY_INTERFACE_OBJECT_PARAMETER);\n }\n validateParameterOrdering(\n def.parameterOrdering,\n parameterNames,\n actionApiName,\n );\n }\n const parameters = createParameters(\n def,\n propertyMap,\n parameterNames,\n Object.fromEntries(\n Object.entries(allProperties).map(([id, prop]) => [id, prop.required]),\n ),\n );\n const mappings = Object.fromEntries(\n Object.entries(def.nonParameterMappings ?? {}).map((\n [id, value],\n ) => [id, convertMappingValue(value)]),\n );\n\n return defineAction({\n apiName: actionApiName,\n displayName: def.displayName\n ?? `Modify ${def.interfaceType.displayMetadata.displayName}`,\n parameters: parameters,\n status: def.status ?? (def.interfaceType.status.type !== \"deprecated\"\n ? def.interfaceType.status.type\n : def.interfaceType.status),\n entities: {\n affectedInterfaceTypes: [def.interfaceType.apiName],\n affectedObjectTypes: [],\n affectedLinkTypes: [],\n typeGroups: [],\n },\n rules: [\n {\n type: \"modifyInterfaceRule\",\n modifyInterfaceRule: {\n interfaceObjectToModifyParameter: \"interfaceObjectToModifyParameter\",\n sharedPropertyValues: {\n ...Object.fromEntries(\n sptNames.map(\n id => [id, {\n type: \"parameterId\",\n parameterId: def.useNonNamespacedParameters\n ? getNonNamespacedParameterName(def, id)\n : id,\n }],\n ),\n ),\n ...mappings,\n },\n },\n },\n ],\n parameterOrdering: def.parameterOrdering\n ?? createDefaultParameterOrdering(\n def,\n Array.from(parameterNames),\n parameters,\n MODIFY_INTERFACE_OBJECT_PARAMETER,\n ),\n ...(def.actionLevelValidation\n ? {\n validation: convertValidationRule(\n def.actionLevelValidation,\n parameters,\n ),\n }\n : {}),\n ...(def.defaultFormat && { defaultFormat: def.defaultFormat }),\n ...(def.enableLayoutSwitch\n && { enableLayoutSwitch: def.enableLayoutSwitch }),\n ...(def.tableConfiguration && {\n displayAndFormat: {\n table: def.tableConfiguration,\n },\n }),\n ...(def.sections\n && {\n sections: Object.fromEntries(\n def.sections.map(section => [section.id, section]),\n ),\n }),\n ...(def.submissionMetadata\n && { submissionMetadata: def.submissionMetadata }),\n });\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,mBAAmB,QAAQ,oDAAoD;AAGxF,SACEC,8BAA8B,EAC9BC,qBAAqB,EACrBC,8BAA8B,EAC9BC,gBAAgB,EAChBC,YAAY,EACZC,yBAAyB,EACzBC,6BAA6B,EAC7BC,mBAAmB,EACnBC,KAAK,EACLC,iCAAiC,EACjCC,wBAAwB,EACxBC,yBAAyB,QACpB,mBAAmB;AAC1B,SAASC,+BAA+B,QAAQ,gDAAgD;AAEhG,OAAO,SAASC,iCAAiCA,CAC/CC,GAAsC,EAC1B;EACZd,8BAA8B,CAACc,GAAG,CAAC;EACnC,MAAMC,aAAa,GAAGH,+BAA+B,CAACE,GAAG,CAACE,aAAa,CAAC;EACxEN,wBAAwB,CACtBI,GAAG,EACHG,MAAM,CAACC,IAAI,CAACH,aAAa,CAAC,EAC1BD,GAAG,CAACE,aAAa,CAACG,OACpB,CAAC;EACD,MAAMC,QAAQ,GAAGH,MAAM,CAACC,IAAI,CAACH,aAAa,CAAC,CAACM,MAAM,CAACF,OAAO,IACxDZ,mBAAmB,CACjBO,GAAG,EACHK,OAAO,EACPJ,aAAa,CAACI,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AAG,CAAC4D,kBAAkB,IACrB;MAAEA,kBAAkB,EAAE5D,GAAG,CAAC4D;IAAmB,CAAC;EACrD,CAAC,CAAC;AACJ","ignoreList":[]}
|
|
@@ -85,7 +85,7 @@ export function defineObject(objectDef) {
|
|
|
85
85
|
const allFailedValidations = validations.concat(nonExistentInterfaceProperties).filter(val => val.type === "invalid");
|
|
86
86
|
!(allFailedValidations.length === 0) ? process.env.NODE_ENV !== "production" ? invariant(false, "\n" + allFailedValidations.map(formatValidationErrors).join("\n")) : invariant(false) : void 0;
|
|
87
87
|
});
|
|
88
|
-
const flattenedProperties = Object.entries(objectDef.properties ?? {}).map(([apiName, property]) => convertUserObjectPropertyType(
|
|
88
|
+
const flattenedProperties = Object.entries(objectDef.properties ?? {}).map(([apiName, property]) => convertUserObjectPropertyType(apiName, property));
|
|
89
89
|
const finalObject = {
|
|
90
90
|
...objectDef,
|
|
91
91
|
apiName: apiName,
|
|
@@ -129,7 +129,6 @@ export function convertToPluralDisplayName(s) {
|
|
|
129
129
|
}
|
|
130
130
|
function convertUserObjectPropertyType(apiName, property) {
|
|
131
131
|
// fill in missing fields to be used by actions
|
|
132
|
-
property.apiName = apiName;
|
|
133
132
|
property.displayName = property.displayName ?? uppercaseFirstLetter(apiName);
|
|
134
133
|
return {
|
|
135
134
|
...property,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defineObject.js","names":["invariant","getObject","OntologyEntityTypeEnum","addNamespaceIfNone","importedTypes","namespace","ontologyDefinition","updateOntology","getFlattenedInterfaceProperties","isExotic","ISO_8601_DURATION","ISO_8601_DATETIME","API_NAME_PATTERN","defineObject","objectDef","apiName","propertyApiNames","properties","Object","keys","OBJECT_TYPE","undefined","Error","test","process","env","NODE_ENV","includes","titlePropertyApiName","primaryKeyPropertyApiName","editOnly","retentionPeriods","datasources","filter","ds","type","map","retentionPeriod","forEach","baseDatasources","length","join","derivedDatasources","validateDerivedDatasource","status","activeProperties","entries","property","push","deadline","implementsInterfaces","interfaceImpl","allInterfaceProperties","implements","nonExistentInterfaceProperties","propertyMapping","val","interfaceProperty","interfaceProp","reason","interfaceToObjectProperties","fromEntries","mapping","mapsTo","validateProperty","sharedPropertyType","validateInterfaceImplProperty","validations","allFailedValidations","concat","formatValidationErrors","flattenedProperties","convertUserObjectPropertyType","finalObject","__type","error","spt","mappedObjectProp","object","objProp","JSON","stringify","uppercaseFirstLetter","s","charAt","toUpperCase","slice","convertToPluralDisplayName","endsWith","displayName","datasource","linkDefinition","link","linkApiName","linkType","LINK_TYPE","prop","isLinkedProperties","values","validateLinkedProperties","validateAggregations","foreignProperties","at","toMany","find","p","props","propName","agg","isCollectible","limit","isNumeric","isPrimitive","foreignProperty","array","typeType"],"sources":["defineObject.ts"],"sourcesContent":["/*\n * Copyright 2024 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 invariant from \"tiny-invariant\";\nimport { getObject } from \"../conversion/toMarketplace/convertLink.js\";\nimport { OntologyEntityTypeEnum } from \"./common/OntologyEntityTypeEnum.js\";\nimport {\n addNamespaceIfNone,\n importedTypes,\n namespace,\n ontologyDefinition,\n updateOntology,\n} from \"./defineOntology.js\";\nimport { getFlattenedInterfaceProperties } from \"./interface/getFlattenedInterfaceProperties.js\";\nimport type { InterfacePropertyType } from \"./interface/InterfacePropertyType.js\";\nimport type { ObjectPropertyType } from \"./object/ObjectPropertyType.js\";\nimport type { ObjectPropertyTypeUserDefinition } from \"./object/ObjectPropertyTypeUserDefinition.js\";\nimport type { ObjectType } from \"./object/ObjectType.js\";\nimport type {\n DerivedPropertyAggregation,\n ObjectTypeDatasourceDefinition_derived,\n ObjectTypeDatasourceDefinition_stream,\n} from \"./object/ObjectTypeDatasourceDefinition.js\";\nimport type { ObjectTypeDefinition } from \"./object/ObjectTypeDefinition.js\";\nimport type { PropertyTypeType } from \"./properties/PropertyTypeType.js\";\nimport { isExotic } from \"./properties/PropertyTypeType.js\";\nimport type { SharedPropertyType } from \"./properties/SharedPropertyType.js\";\n\n// From https://stackoverflow.com/a/79288714\nconst ISO_8601_DURATION =\n /^P(?!$)(?:(?:((?:\\d+Y)|(?:\\d+(?:\\.|,)\\d+Y$))?((?:\\d+M)|(?:\\d+(?:\\.|,)\\d+M$))?((?:\\d+D)|(?:\\d+(?:\\.|,)\\d+D$))?(T((?:\\d+H)|(?:\\d+(?:\\.|,)\\d+H$))?((?:\\d+M)|(?:\\d+(?:\\.|,)\\d+M$))?((?:\\d+S)|(?:\\d+(?:\\.|,)\\d+S$))?)?)|(?:\\d+(?:(?:\\.|,)\\d+)?W))$/;\n\n// ISO 8601 date and time format (YYYY-MM-DDThh:mm:ss.sssZ)\nconst ISO_8601_DATETIME =\n /^\\d{4}-\\d{2}-\\d{2}(T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(Z|[+-]\\d{2}:\\d{2})?)?$/;\n\nconst API_NAME_PATTERN = /^([a-zA-Z][a-zA-Z0-9\\\\-]*)$/;\n\nexport function defineObject(\n objectDef: ObjectTypeDefinition,\n): ObjectTypeDefinition {\n const apiName = namespace + objectDef.apiName;\n const propertyApiNames = objectDef.properties\n ? Object.keys(objectDef.properties)\n : [];\n if (\n ontologyDefinition[OntologyEntityTypeEnum.OBJECT_TYPE][apiName]\n !== undefined\n ) {\n throw new Error(\n `Object type with apiName ${objectDef.apiName} is already defined`,\n );\n }\n invariant(\n API_NAME_PATTERN.test(objectDef.apiName),\n `Invalid API name ${objectDef.apiName}. API names must match the regex ${API_NAME_PATTERN}.`,\n );\n invariant(\n propertyApiNames.includes(objectDef.titlePropertyApiName),\n `Title property ${objectDef.titlePropertyApiName} is not defined on object ${objectDef.apiName}`,\n );\n invariant(\n propertyApiNames.includes(objectDef.primaryKeyPropertyApiName),\n `Primary key property ${objectDef.primaryKeyPropertyApiName} does not exist on object ${objectDef.apiName}`,\n );\n\n invariant(\n !(objectDef.properties?.[objectDef.primaryKeyPropertyApiName]?.editOnly),\n `Primary key property ${objectDef.primaryKeyPropertyApiName} on object ${objectDef.apiName} cannot be edit-only`,\n );\n\n const retentionPeriods =\n ((objectDef.datasources ?? []).filter(ds =>\n ds.type === \"stream\"\n ) as ObjectTypeDatasourceDefinition_stream[]).map(ds => ds.retentionPeriod);\n retentionPeriods.forEach(retentionPeriod => {\n invariant(\n retentionPeriod === undefined || ISO_8601_DURATION.test(retentionPeriod),\n `Retention period \"${retentionPeriod}\" on object \"${objectDef.apiName}\" is not a valid ISO 8601 duration string`,\n );\n });\n\n const baseDatasources = (objectDef.datasources ?? []).filter(ds =>\n [\"dataset\", \"stream\", \"restrictedView\"].includes(ds.type)\n );\n invariant(\n baseDatasources.length <= 1,\n `Object ${objectDef.apiName} has more than one base datasource (got: [${\n baseDatasources.map(ds => ds.type).join(\", \")\n }])`,\n );\n const derivedDatasources = (objectDef.datasources ?? []).filter(ds =>\n ds.type === \"derived\"\n );\n if (derivedDatasources.length > 0) {\n derivedDatasources.forEach(ds => validateDerivedDatasource(objectDef, ds));\n }\n\n // Validate that if object status is experimental, no property can have a status of active\n if (objectDef.status === \"experimental\") {\n const activeProperties: string[] = [];\n Object.entries(objectDef.properties ?? {}).forEach(\n ([apiName, property]) => {\n if (property.status === \"active\") {\n activeProperties.push(apiName);\n }\n },\n );\n invariant(\n activeProperties.length === 0,\n `When object \"${objectDef.apiName}\" has experimental status, no properties can have \"active\" status, but found active properties: ${\n activeProperties.join(\", \")\n }`,\n );\n }\n\n // Validate deprecated status deadline is in ISO 8601 format\n if (\n objectDef.status && typeof objectDef.status === \"object\"\n && objectDef.status.type === \"deprecated\"\n ) {\n const deadline = objectDef.status.deadline;\n invariant(\n deadline !== undefined && ISO_8601_DATETIME.test(deadline),\n `Deprecated status deadline \"${deadline}\" on object \"${objectDef.apiName}\" is not a valid ISO 8601 datetime string`,\n );\n }\n invariant(\n !isExotic(objectDef.properties?.[objectDef.titlePropertyApiName]?.type),\n `Title property ${objectDef.titlePropertyApiName} must be a primitive type`,\n );\n invariant(\n !isExotic(\n objectDef.properties?.[objectDef.primaryKeyPropertyApiName]?.type,\n ),\n `Primary key property ${objectDef.primaryKeyPropertyApiName} can only be primitive types`,\n );\n\n objectDef.implementsInterfaces?.forEach(interfaceImpl => {\n const allInterfaceProperties = getFlattenedInterfaceProperties(\n interfaceImpl.implements,\n );\n const nonExistentInterfaceProperties: ValidationResult[] = interfaceImpl\n .propertyMapping.map(val => val.interfaceProperty).filter(\n interfaceProperty =>\n allInterfaceProperties[addNamespaceIfNone(interfaceProperty)]\n === undefined,\n ).map(interfaceProp => ({\n type: \"invalid\",\n reason:\n `Interface property ${interfaceProp} referenced in ${objectDef.apiName} object does not exist`,\n }));\n\n const interfaceToObjectProperties = Object.fromEntries(\n interfaceImpl.propertyMapping.map(\n mapping => [\n addNamespaceIfNone(mapping.interfaceProperty),\n mapping.mapsTo,\n ],\n ),\n );\n const validateProperty = (\n interfaceProp: [string, InterfacePropertyType],\n ): ValidationResult => {\n if (\n interfaceProp[1].sharedPropertyType.apiName\n in interfaceToObjectProperties\n ) {\n return validateInterfaceImplProperty(\n interfaceProp[1].sharedPropertyType,\n interfaceToObjectProperties[interfaceProp[0]],\n objectDef,\n );\n }\n return {\n type: \"invalid\",\n reason: `Interface property ${\n interfaceProp[1].sharedPropertyType.apiName\n } not implemented by ${objectDef.apiName} object definition`,\n };\n };\n const validations = Object.entries(\n getFlattenedInterfaceProperties(interfaceImpl.implements),\n ).map(validateProperty);\n const allFailedValidations = validations.concat(\n nonExistentInterfaceProperties,\n ).filter(val => val.type === \"invalid\");\n invariant(\n allFailedValidations.length === 0,\n \"\\n\" + allFailedValidations.map(formatValidationErrors).join(\"\\n\"),\n );\n });\n\n const flattenedProperties: Array<ObjectPropertyType> = Object.entries(\n objectDef.properties ?? {},\n ).map(([apiName, property]) =>\n convertUserObjectPropertyType(property.apiName ?? apiName, property)\n );\n\n const finalObject: ObjectType = {\n ...objectDef,\n apiName: apiName,\n __type: OntologyEntityTypeEnum.OBJECT_TYPE,\n properties: flattenedProperties,\n };\n updateOntology(finalObject);\n objectDef.apiName = apiName;\n return objectDef;\n}\n\ntype ValidationResult = { type: \"valid\" } | { type: \"invalid\"; reason: string };\n\nfunction formatValidationErrors(\n error: { type: \"invalid\"; reason: string },\n): string {\n return `Ontology Definition Error: ${error.reason}\\n`;\n}\n\n// Validate that the object and the interface property match up\nfunction validateInterfaceImplProperty(\n spt: SharedPropertyType,\n mappedObjectProp: string,\n object: ObjectTypeDefinition,\n): ValidationResult {\n const objProp = object.properties?.[mappedObjectProp];\n if (objProp === undefined) {\n return {\n type: \"invalid\",\n reason:\n `Object property mapped to interface does not exist. Object Property Mapped: ${mappedObjectProp}`,\n };\n }\n if (JSON.stringify(spt.type) !== JSON.stringify(objProp?.type)) {\n return {\n type: \"invalid\",\n reason:\n `Object property type does not match the interface property it is mapped to. Interface Property: ${spt.apiName}, objectProperty: ${mappedObjectProp}`,\n };\n }\n\n return { type: \"valid\" };\n}\n\nexport function uppercaseFirstLetter(s: string | undefined | null): string {\n return s === undefined || s == null\n ? \"\"\n : s.charAt(0).toUpperCase() + s.slice(1);\n}\n\n// TODO: edge cases\nexport function convertToPluralDisplayName(\n s: string | undefined | null,\n): string {\n return s === undefined || s == null\n ? \"\"\n : s.endsWith(\"s\")\n ? uppercaseFirstLetter(s)\n : uppercaseFirstLetter(s) + \"s\";\n}\n\nfunction convertUserObjectPropertyType(\n apiName: string,\n property: ObjectPropertyTypeUserDefinition,\n): ObjectPropertyType {\n // fill in missing fields to be used by actions\n property.apiName = apiName;\n property.displayName = property.displayName ?? uppercaseFirstLetter(apiName);\n return {\n ...property,\n apiName: apiName,\n displayName: property.displayName ?? uppercaseFirstLetter(apiName),\n type: property.type,\n };\n}\nfunction validateDerivedDatasource(\n objectDef: ObjectTypeDefinition,\n datasource: ObjectTypeDatasourceDefinition_derived,\n) {\n // there should be at least one link\n invariant(\n datasource.linkDefinition.length > 0,\n `Derived datasource for object '${objectDef.apiName}' must have at least one link.`,\n );\n\n // all of the links references should exist\n datasource.linkDefinition.forEach(link => {\n const linkApiName = link.linkType.apiName;\n invariant(\n ontologyDefinition[OntologyEntityTypeEnum.LINK_TYPE][linkApiName]\n !== undefined\n || importedTypes[OntologyEntityTypeEnum.LINK_TYPE][linkApiName]\n !== undefined,\n `Link type '${linkApiName}' used in derived datasource for object '${objectDef.apiName}' is not defined.`,\n );\n });\n\n // all of the properties references on the source object should exist\n Object.keys(datasource.propertyMapping).forEach(prop => {\n invariant(\n objectDef.properties?.[prop] !== undefined,\n `Property '${prop}' used in derived datasource for object '${objectDef.apiName}' is not defined.`,\n );\n });\n\n const isLinkedProperties =\n (typeof Object.values(datasource.propertyMapping)[0]) === \"string\";\n if (isLinkedProperties) {\n validateLinkedProperties(datasource, objectDef);\n } else {\n validateAggregations(datasource, objectDef);\n }\n}\n\nfunction validateLinkedProperties(\n datasource: ObjectTypeDatasourceDefinition_derived,\n objectDef: ObjectTypeDefinition,\n) {\n const foreignProperties = Object.values(\n datasource.propertyMapping,\n ) as string[];\n // the foreign property must exist in the final object in the link chain\n const finalObject =\n getObject(datasource.linkDefinition.at(-1)!.linkType.toMany.object).object;\n foreignProperties.forEach(prop => {\n invariant(\n finalObject.properties?.find(p => p.apiName === prop) !== undefined,\n `Property '${prop}' on object '${finalObject.apiName}' is not defined`,\n );\n });\n}\n\nfunction validateAggregations(\n datasource: ObjectTypeDatasourceDefinition_derived,\n objectDef: ObjectTypeDefinition,\n) {\n const props = datasource.propertyMapping as Record<\n string,\n DerivedPropertyAggregation\n >;\n\n Object.entries(props).forEach(([propName, agg]) => {\n // TODO(dpaquin): check that the property type matches the foreign property type,\n // for collectList/collectSet and maybe min/max too?\n const property = objectDef.properties![propName];\n switch (agg.type) {\n case \"collectList\":\n case \"collectSet\":\n // property's type is collectible\n invariant(\n isCollectible(property),\n `Property '${propName}' on object '${objectDef.apiName}' is not collectible`,\n );\n // limit <= 100\n invariant(\n agg.limit <= 100,\n `[Error] Limit for collection '${propName}' on object '${objectDef.apiName}' is greater than 100`,\n );\n break;\n case \"avg\":\n case \"sum\":\n // property's type is numeric\n invariant(\n isNumeric(property.type),\n `Property '${propName}' on object '${objectDef.apiName}' is not numeric`,\n );\n break;\n case \"min\":\n case \"max\":\n case \"approximateCardinality\":\n case \"exactCardinality\":\n // property's type is primitive\n invariant(\n isPrimitive(property.type),\n `Property '${propName}' on object '${objectDef.apiName}' is not primitive`,\n );\n break;\n default:\n break;\n }\n\n // if a foreign property is referenced, it must exist in the final object\n if (agg.type !== \"count\") {\n const foreignProperty = agg.property;\n const finalObject =\n getObject(datasource.linkDefinition.at(-1)!.linkType.toMany.object)\n .object;\n invariant(\n finalObject.properties?.find(p => p.apiName === foreignProperty)\n !== undefined,\n `Property '${foreignProperty}' on object '${finalObject.apiName}' is not defined`,\n );\n }\n });\n}\n\nfunction isCollectible(property: ObjectPropertyTypeUserDefinition): boolean {\n if (!(property.array ?? false)) {\n return false;\n }\n const typeType = typeof property.type === \"string\"\n ? property.type\n : property.type.type;\n return [\n \"boolean\",\n \"byte\",\n \"date\",\n \"double\",\n \"float\",\n \"geohash\",\n \"geoshape\",\n \"integer\",\n \"long\",\n \"mediareference\",\n \"short\",\n \"string\",\n \"struct\",\n \"timestamp\",\n ].includes(typeType);\n}\n\nfunction isNumeric(type: PropertyTypeType): boolean {\n const typeType = typeof type === \"string\" ? type : type.type;\n return [\n \"byte\",\n \"double\",\n \"float\",\n \"integer\",\n \"long\",\n \"short\",\n ].includes(typeType);\n}\n\nfunction isPrimitive(type: PropertyTypeType): boolean {\n const typeType = typeof type === \"string\" ? type : type.type;\n return [\n \"boolean\",\n \"byte\",\n \"date\",\n \"double\",\n \"float\",\n \"integer\",\n \"long\",\n \"short\",\n \"string\",\n \"timestamp\",\n ].includes(typeType);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,SAAS,MAAM,gBAAgB;AACtC,SAASC,SAAS,QAAQ,4CAA4C;AACtE,SAASC,sBAAsB,QAAQ,oCAAoC;AAC3E,SACEC,kBAAkB,EAClBC,aAAa,EACbC,SAAS,EACTC,kBAAkB,EAClBC,cAAc,QACT,qBAAqB;AAC5B,SAASC,+BAA+B,QAAQ,gDAAgD;AAYhG,SAASC,QAAQ,QAAQ,kCAAkC;AAG3D;AACA,MAAMC,iBAAiB,GACrB,+OAA+O;;AAEjP;AACA,MAAMC,iBAAiB,GACrB,sEAAsE;AAExE,MAAMC,gBAAgB,GAAG,6BAA6B;AAEtD,OAAO,SAASC,YAAYA,CAC1BC,SAA+B,EACT;EACtB,MAAMC,OAAO,GAAGV,SAAS,GAAGS,SAAS,CAACC,OAAO;EAC7C,MAAMC,gBAAgB,GAAGF,SAAS,CAACG,UAAU,GACzCC,MAAM,CAACC,IAAI,CAACL,SAAS,CAACG,UAAU,CAAC,GACjC,EAAE;EACN,IACEX,kBAAkB,CAACJ,sBAAsB,CAACkB,WAAW,CAAC,CAACL,OAAO,CAAC,KACzDM,SAAS,EACf;IACA,MAAM,IAAIC,KAAK,CACb,4BAA4BR,SAAS,CAACC,OAAO,qBAC/C,CAAC;EACH;EACA,CACEH,gBAAgB,CAACW,IAAI,CAACT,SAAS,CAACC,OAAO,CAAC,GAAAS,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAD1C1B,SAAS,QAEP,oBAAoBc,SAAS,CAACC,OAAO,oCAAoCH,gBAAgB,GAAG,IAF9FZ,SAAS;EAIT,CACEgB,gBAAgB,CAACW,QAAQ,CAACb,SAAS,CAACc,oBAAoB,CAAC,GAAAJ,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBA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OAAOhF,IAAI,KAAK,QAAQ,GAAGA,IAAI,GAAGA,IAAI,CAACA,IAAI;EAC5D,OAAO,CACL,MAAM,EACN,QAAQ,EACR,OAAO,EACP,SAAS,EACT,MAAM,EACN,OAAO,CACR,CAACR,QAAQ,CAACwF,QAAQ,CAAC;AACtB;AAEA,SAASH,WAAWA,CAAC7E,IAAsB,EAAW;EACpD,MAAMgF,QAAQ,GAAG,OAAOhF,IAAI,KAAK,QAAQ,GAAGA,IAAI,GAAGA,IAAI,CAACA,IAAI;EAC5D,OAAO,CACL,SAAS,EACT,MAAM,EACN,MAAM,EACN,QAAQ,EACR,OAAO,EACP,SAAS,EACT,MAAM,EACN,OAAO,EACP,QAAQ,EACR,WAAW,CACZ,CAACR,QAAQ,CAACwF,QAAQ,CAAC;AACtB","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"defineObject.js","names":["invariant","getObject","OntologyEntityTypeEnum","addNamespaceIfNone","importedTypes","namespace","ontologyDefinition","updateOntology","getFlattenedInterfaceProperties","isExotic","ISO_8601_DURATION","ISO_8601_DATETIME","API_NAME_PATTERN","defineObject","objectDef","apiName","propertyApiNames","properties","Object","keys","OBJECT_TYPE","undefined","Error","test","process","env","NODE_ENV","includes","titlePropertyApiName","primaryKeyPropertyApiName","editOnly","retentionPeriods","datasources","filter","ds","type","map","retentionPeriod","forEach","baseDatasources","length","join","derivedDatasources","validateDerivedDatasource","status","activeProperties","entries","property","push","deadline","implementsInterfaces","interfaceImpl","allInterfaceProperties","implements","nonExistentInterfaceProperties","propertyMapping","val","interfaceProperty","interfaceProp","reason","interfaceToObjectProperties","fromEntries","mapping","mapsTo","validateProperty","sharedPropertyType","validateInterfaceImplProperty","validations","allFailedValidations","concat","formatValidationErrors","flattenedProperties","convertUserObjectPropertyType","finalObject","__type","error","spt","mappedObjectProp","object","objProp","JSON","stringify","uppercaseFirstLetter","s","charAt","toUpperCase","slice","convertToPluralDisplayName","endsWith","displayName","datasource","linkDefinition","link","linkApiName","linkType","LINK_TYPE","prop","isLinkedProperties","values","validateLinkedProperties","validateAggregations","foreignProperties","at","toMany","find","p","props","propName","agg","isCollectible","limit","isNumeric","isPrimitive","foreignProperty","array","typeType"],"sources":["defineObject.ts"],"sourcesContent":["/*\n * Copyright 2024 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 invariant from \"tiny-invariant\";\nimport { getObject } from \"../conversion/toMarketplace/convertLink.js\";\nimport { OntologyEntityTypeEnum } from \"./common/OntologyEntityTypeEnum.js\";\nimport {\n addNamespaceIfNone,\n importedTypes,\n namespace,\n ontologyDefinition,\n updateOntology,\n} from \"./defineOntology.js\";\nimport { getFlattenedInterfaceProperties } from \"./interface/getFlattenedInterfaceProperties.js\";\nimport type { InterfacePropertyType } from \"./interface/InterfacePropertyType.js\";\nimport type { ObjectPropertyType } from \"./object/ObjectPropertyType.js\";\nimport type { ObjectPropertyTypeUserDefinition } from \"./object/ObjectPropertyTypeUserDefinition.js\";\nimport type { ObjectType } from \"./object/ObjectType.js\";\nimport type {\n DerivedPropertyAggregation,\n ObjectTypeDatasourceDefinition_derived,\n ObjectTypeDatasourceDefinition_stream,\n} from \"./object/ObjectTypeDatasourceDefinition.js\";\nimport type { ObjectTypeDefinition } from \"./object/ObjectTypeDefinition.js\";\nimport type { PropertyTypeType } from \"./properties/PropertyTypeType.js\";\nimport { isExotic } from \"./properties/PropertyTypeType.js\";\nimport type { SharedPropertyType } from \"./properties/SharedPropertyType.js\";\n\n// From https://stackoverflow.com/a/79288714\nconst ISO_8601_DURATION =\n /^P(?!$)(?:(?:((?:\\d+Y)|(?:\\d+(?:\\.|,)\\d+Y$))?((?:\\d+M)|(?:\\d+(?:\\.|,)\\d+M$))?((?:\\d+D)|(?:\\d+(?:\\.|,)\\d+D$))?(T((?:\\d+H)|(?:\\d+(?:\\.|,)\\d+H$))?((?:\\d+M)|(?:\\d+(?:\\.|,)\\d+M$))?((?:\\d+S)|(?:\\d+(?:\\.|,)\\d+S$))?)?)|(?:\\d+(?:(?:\\.|,)\\d+)?W))$/;\n\n// ISO 8601 date and time format (YYYY-MM-DDThh:mm:ss.sssZ)\nconst ISO_8601_DATETIME =\n /^\\d{4}-\\d{2}-\\d{2}(T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(Z|[+-]\\d{2}:\\d{2})?)?$/;\n\nconst API_NAME_PATTERN = /^([a-zA-Z][a-zA-Z0-9\\\\-]*)$/;\n\nexport function defineObject(\n objectDef: ObjectTypeDefinition,\n): ObjectTypeDefinition {\n const apiName = namespace + objectDef.apiName;\n const propertyApiNames = objectDef.properties\n ? Object.keys(objectDef.properties)\n : [];\n if (\n ontologyDefinition[OntologyEntityTypeEnum.OBJECT_TYPE][apiName]\n !== undefined\n ) {\n throw new Error(\n `Object type with apiName ${objectDef.apiName} is already defined`,\n );\n }\n invariant(\n API_NAME_PATTERN.test(objectDef.apiName),\n `Invalid API name ${objectDef.apiName}. API names must match the regex ${API_NAME_PATTERN}.`,\n );\n invariant(\n propertyApiNames.includes(objectDef.titlePropertyApiName),\n `Title property ${objectDef.titlePropertyApiName} is not defined on object ${objectDef.apiName}`,\n );\n invariant(\n propertyApiNames.includes(objectDef.primaryKeyPropertyApiName),\n `Primary key property ${objectDef.primaryKeyPropertyApiName} does not exist on object ${objectDef.apiName}`,\n );\n\n invariant(\n !(objectDef.properties?.[objectDef.primaryKeyPropertyApiName]?.editOnly),\n `Primary key property ${objectDef.primaryKeyPropertyApiName} on object ${objectDef.apiName} cannot be edit-only`,\n );\n\n const retentionPeriods =\n ((objectDef.datasources ?? []).filter(ds =>\n ds.type === \"stream\"\n ) as ObjectTypeDatasourceDefinition_stream[]).map(ds => ds.retentionPeriod);\n retentionPeriods.forEach(retentionPeriod => {\n invariant(\n retentionPeriod === undefined || ISO_8601_DURATION.test(retentionPeriod),\n `Retention period \"${retentionPeriod}\" on object \"${objectDef.apiName}\" is not a valid ISO 8601 duration string`,\n );\n });\n\n const baseDatasources = (objectDef.datasources ?? []).filter(ds =>\n [\"dataset\", \"stream\", \"restrictedView\"].includes(ds.type)\n );\n invariant(\n baseDatasources.length <= 1,\n `Object ${objectDef.apiName} has more than one base datasource (got: [${\n baseDatasources.map(ds => ds.type).join(\", \")\n }])`,\n );\n const derivedDatasources = (objectDef.datasources ?? []).filter(ds =>\n ds.type === \"derived\"\n );\n if (derivedDatasources.length > 0) {\n derivedDatasources.forEach(ds => validateDerivedDatasource(objectDef, ds));\n }\n\n // Validate that if object status is experimental, no property can have a status of active\n if (objectDef.status === \"experimental\") {\n const activeProperties: string[] = [];\n Object.entries(objectDef.properties ?? {}).forEach(\n ([apiName, property]) => {\n if (property.status === \"active\") {\n activeProperties.push(apiName);\n }\n },\n );\n invariant(\n activeProperties.length === 0,\n `When object \"${objectDef.apiName}\" has experimental status, no properties can have \"active\" status, but found active properties: ${\n activeProperties.join(\", \")\n }`,\n );\n }\n\n // Validate deprecated status deadline is in ISO 8601 format\n if (\n objectDef.status && typeof objectDef.status === \"object\"\n && objectDef.status.type === \"deprecated\"\n ) {\n const deadline = objectDef.status.deadline;\n invariant(\n deadline !== undefined && ISO_8601_DATETIME.test(deadline),\n `Deprecated status deadline \"${deadline}\" on object \"${objectDef.apiName}\" is not a valid ISO 8601 datetime string`,\n );\n }\n invariant(\n !isExotic(objectDef.properties?.[objectDef.titlePropertyApiName]?.type),\n `Title property ${objectDef.titlePropertyApiName} must be a primitive type`,\n );\n invariant(\n !isExotic(\n objectDef.properties?.[objectDef.primaryKeyPropertyApiName]?.type,\n ),\n `Primary key property ${objectDef.primaryKeyPropertyApiName} can only be primitive types`,\n );\n\n objectDef.implementsInterfaces?.forEach(interfaceImpl => {\n const allInterfaceProperties = getFlattenedInterfaceProperties(\n interfaceImpl.implements,\n );\n const nonExistentInterfaceProperties: ValidationResult[] = interfaceImpl\n .propertyMapping.map(val => val.interfaceProperty).filter(\n interfaceProperty =>\n allInterfaceProperties[addNamespaceIfNone(interfaceProperty)]\n === undefined,\n ).map(interfaceProp => ({\n type: \"invalid\",\n reason:\n `Interface property ${interfaceProp} referenced in ${objectDef.apiName} object does not exist`,\n }));\n\n const interfaceToObjectProperties = Object.fromEntries(\n interfaceImpl.propertyMapping.map(\n mapping => [\n addNamespaceIfNone(mapping.interfaceProperty),\n mapping.mapsTo,\n ],\n ),\n );\n const validateProperty = (\n interfaceProp: [string, InterfacePropertyType],\n ): ValidationResult => {\n if (\n interfaceProp[1].sharedPropertyType.apiName\n in interfaceToObjectProperties\n ) {\n return validateInterfaceImplProperty(\n interfaceProp[1].sharedPropertyType,\n interfaceToObjectProperties[interfaceProp[0]],\n objectDef,\n );\n }\n return {\n type: \"invalid\",\n reason: `Interface property ${\n interfaceProp[1].sharedPropertyType.apiName\n } not implemented by ${objectDef.apiName} object definition`,\n };\n };\n const validations = Object.entries(\n getFlattenedInterfaceProperties(interfaceImpl.implements),\n ).map(validateProperty);\n const allFailedValidations = validations.concat(\n nonExistentInterfaceProperties,\n ).filter(val => val.type === \"invalid\");\n invariant(\n allFailedValidations.length === 0,\n \"\\n\" + allFailedValidations.map(formatValidationErrors).join(\"\\n\"),\n );\n });\n\n const flattenedProperties: Array<ObjectPropertyType> = Object.entries(\n objectDef.properties ?? {},\n ).map(([apiName, property]) =>\n convertUserObjectPropertyType(apiName, property)\n );\n\n const finalObject: ObjectType = {\n ...objectDef,\n apiName: apiName,\n __type: OntologyEntityTypeEnum.OBJECT_TYPE,\n properties: flattenedProperties,\n };\n updateOntology(finalObject);\n objectDef.apiName = apiName;\n return objectDef;\n}\n\ntype ValidationResult = { type: \"valid\" } | { type: \"invalid\"; reason: string };\n\nfunction formatValidationErrors(\n error: { type: \"invalid\"; reason: string },\n): string {\n return `Ontology Definition Error: ${error.reason}\\n`;\n}\n\n// Validate that the object and the interface property match up\nfunction validateInterfaceImplProperty(\n spt: SharedPropertyType,\n mappedObjectProp: string,\n object: ObjectTypeDefinition,\n): ValidationResult {\n const objProp = object.properties?.[mappedObjectProp];\n if (objProp === undefined) {\n return {\n type: \"invalid\",\n reason:\n `Object property mapped to interface does not exist. Object Property Mapped: ${mappedObjectProp}`,\n };\n }\n if (JSON.stringify(spt.type) !== JSON.stringify(objProp?.type)) {\n return {\n type: \"invalid\",\n reason:\n `Object property type does not match the interface property it is mapped to. Interface Property: ${spt.apiName}, objectProperty: ${mappedObjectProp}`,\n };\n }\n\n return { type: \"valid\" };\n}\n\nexport function uppercaseFirstLetter(s: string | undefined | null): string {\n return s === undefined || s == null\n ? \"\"\n : s.charAt(0).toUpperCase() + s.slice(1);\n}\n\n// TODO: edge cases\nexport function convertToPluralDisplayName(\n s: string | undefined | null,\n): string {\n return s === undefined || s == null\n ? \"\"\n : s.endsWith(\"s\")\n ? uppercaseFirstLetter(s)\n : uppercaseFirstLetter(s) + \"s\";\n}\n\nfunction convertUserObjectPropertyType(\n apiName: string,\n property: ObjectPropertyTypeUserDefinition,\n): ObjectPropertyType {\n // fill in missing fields to be used by actions\n property.displayName = property.displayName ?? uppercaseFirstLetter(apiName);\n return {\n ...property,\n apiName: apiName,\n displayName: property.displayName ?? uppercaseFirstLetter(apiName),\n type: property.type,\n };\n}\nfunction validateDerivedDatasource(\n objectDef: ObjectTypeDefinition,\n datasource: ObjectTypeDatasourceDefinition_derived,\n) {\n // there should be at least one link\n invariant(\n datasource.linkDefinition.length > 0,\n `Derived datasource for object '${objectDef.apiName}' must have at least one link.`,\n );\n\n // all of the links references should exist\n datasource.linkDefinition.forEach(link => {\n const linkApiName = link.linkType.apiName;\n invariant(\n ontologyDefinition[OntologyEntityTypeEnum.LINK_TYPE][linkApiName]\n !== undefined\n || importedTypes[OntologyEntityTypeEnum.LINK_TYPE][linkApiName]\n !== undefined,\n `Link type '${linkApiName}' used in derived datasource for object '${objectDef.apiName}' is not defined.`,\n );\n });\n\n // all of the properties references on the source object should exist\n Object.keys(datasource.propertyMapping).forEach(prop => {\n invariant(\n objectDef.properties?.[prop] !== undefined,\n `Property '${prop}' used in derived datasource for object '${objectDef.apiName}' is not defined.`,\n );\n });\n\n const isLinkedProperties =\n (typeof Object.values(datasource.propertyMapping)[0]) === \"string\";\n if (isLinkedProperties) {\n validateLinkedProperties(datasource, objectDef);\n } else {\n validateAggregations(datasource, objectDef);\n }\n}\n\nfunction validateLinkedProperties(\n datasource: ObjectTypeDatasourceDefinition_derived,\n objectDef: ObjectTypeDefinition,\n) {\n const foreignProperties = Object.values(\n datasource.propertyMapping,\n ) as string[];\n // the foreign property must exist in the final object in the link chain\n const finalObject =\n getObject(datasource.linkDefinition.at(-1)!.linkType.toMany.object).object;\n foreignProperties.forEach(prop => {\n invariant(\n finalObject.properties?.find(p => p.apiName === prop) !== undefined,\n `Property '${prop}' on object '${finalObject.apiName}' is not defined`,\n );\n });\n}\n\nfunction validateAggregations(\n datasource: ObjectTypeDatasourceDefinition_derived,\n objectDef: ObjectTypeDefinition,\n) {\n const props = datasource.propertyMapping as Record<\n string,\n DerivedPropertyAggregation\n >;\n\n Object.entries(props).forEach(([propName, agg]) => {\n // TODO(dpaquin): check that the property type matches the foreign property type,\n // for collectList/collectSet and maybe min/max too?\n const property = objectDef.properties![propName];\n switch (agg.type) {\n case \"collectList\":\n case \"collectSet\":\n // property's type is collectible\n invariant(\n isCollectible(property),\n `Property '${propName}' on object '${objectDef.apiName}' is not collectible`,\n );\n // limit <= 100\n invariant(\n agg.limit <= 100,\n `[Error] Limit for collection '${propName}' on object '${objectDef.apiName}' is greater than 100`,\n );\n break;\n case \"avg\":\n case \"sum\":\n // property's type is numeric\n invariant(\n isNumeric(property.type),\n `Property '${propName}' on object '${objectDef.apiName}' is not numeric`,\n );\n break;\n case \"min\":\n case \"max\":\n case \"approximateCardinality\":\n case \"exactCardinality\":\n // property's type is primitive\n invariant(\n isPrimitive(property.type),\n `Property '${propName}' on object '${objectDef.apiName}' is not primitive`,\n );\n break;\n default:\n break;\n }\n\n // if a foreign property is referenced, it must exist in the final object\n if (agg.type !== \"count\") {\n const foreignProperty = agg.property;\n const finalObject =\n getObject(datasource.linkDefinition.at(-1)!.linkType.toMany.object)\n .object;\n invariant(\n finalObject.properties?.find(p => p.apiName === foreignProperty)\n !== undefined,\n `Property '${foreignProperty}' on object '${finalObject.apiName}' is not defined`,\n );\n }\n });\n}\n\nfunction isCollectible(property: ObjectPropertyTypeUserDefinition): boolean {\n if (!(property.array ?? false)) {\n return false;\n }\n const typeType = typeof property.type === \"string\"\n ? property.type\n : property.type.type;\n return [\n \"boolean\",\n \"byte\",\n \"date\",\n \"double\",\n \"float\",\n \"geohash\",\n \"geoshape\",\n \"integer\",\n \"long\",\n \"mediareference\",\n \"short\",\n \"string\",\n \"struct\",\n \"timestamp\",\n ].includes(typeType);\n}\n\nfunction isNumeric(type: PropertyTypeType): boolean {\n const typeType = typeof type === \"string\" ? type : type.type;\n return [\n \"byte\",\n \"double\",\n \"float\",\n \"integer\",\n \"long\",\n \"short\",\n ].includes(typeType);\n}\n\nfunction isPrimitive(type: PropertyTypeType): boolean {\n const typeType = typeof type === \"string\" ? type : type.type;\n return [\n \"boolean\",\n \"byte\",\n \"date\",\n \"double\",\n \"float\",\n \"integer\",\n \"long\",\n \"short\",\n \"string\",\n \"timestamp\",\n ].includes(typeType);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,SAAS,MAAM,gBAAgB;AACtC,SAASC,SAAS,QAAQ,4CAA4C;AACtE,SAASC,sBAAsB,QAAQ,oCAAoC;AAC3E,SACEC,kBAAkB,EAClBC,aAAa,EACbC,SAAS,EACTC,kBAAkB,EAClBC,cAAc,QACT,qBAAqB;AAC5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O,EACP,QAAQ,EACR,WAAW,CACZ,CAACR,QAAQ,CAACwF,QAAQ,CAAC;AACtB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObjectPropertyTypeUserDefinition.js","names":[],"sources":["ObjectPropertyTypeUserDefinition.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 { RequiredFields } from \"../../util/RequiredFields.js\";\nimport type { ObjectPropertyTypeInner } from \"./ObjectPropertyType.js\";\n\nexport type ObjectPropertyTypeUserDefinition = RequiredFields<\n
|
|
1
|
+
{"version":3,"file":"ObjectPropertyTypeUserDefinition.js","names":[],"sources":["ObjectPropertyTypeUserDefinition.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 { RequiredFields } from \"../../util/RequiredFields.js\";\nimport type { ObjectPropertyTypeInner } from \"./ObjectPropertyType.js\";\n\nexport type ObjectPropertyTypeUserDefinition = Omit<\n RequiredFields<\n Partial<ObjectPropertyTypeInner>,\n \"type\"\n >,\n \"apiName\"\n>;\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PropertyTypeType.js","names":["isPropertyTypeType","v","type","isExotic","undefined","includes","isStruct"],"sources":["PropertyTypeType.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 { StructFieldType } from \"@osdk/client.unstable\";\n\nexport type PropertyTypeType =\n | PropertyTypeTypePrimitive\n | PropertyTypeTypeExotic;\n\nexport type PropertyTypeTypePrimitive =\n | \"boolean\"\n | \"byte\"\n | \"date\"\n | \"decimal\"\n | \"double\"\n | \"float\"\n | \"integer\"\n | \"long\"\n | \"short\"\n | \"string\"\n | \"timestamp\";\n\nexport type PropertyTypeTypeExotic =\n | \"geopoint\"\n | \"geoshape\"\n | \"mediaReference\"\n | \"geotimeSeries\"\n | PropertyTypeTypeMarking\n | PropertyTypeTypeStruct\n | PropertyTypeTypeString;\n\ntype PropertyTypeTypeMarking = {\n type: \"marking\";\n markingType: \"MANDATORY\" | \"CBAC\";\n markingInputGroupName: string;\n};\n\nexport type PropertyTypeTypeStruct = {\n type: \"struct\";\n structDefinition: {\n [api_name: string]:\n | StructPropertyType\n | Exclude<PropertyTypeTypesWithoutStruct, PropertyTypeTypeMarking>;\n };\n};\n\ntype PropertyTypeTypeString = {\n type: \"string\";\n isLongText
|
|
1
|
+
{"version":3,"file":"PropertyTypeType.js","names":["isPropertyTypeType","v","type","isExotic","undefined","includes","isStruct"],"sources":["PropertyTypeType.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 { StructFieldType } from \"@osdk/client.unstable\";\n\nexport type PropertyTypeType =\n | PropertyTypeTypePrimitive\n | PropertyTypeTypeExotic;\n\nexport type PropertyTypeTypePrimitive =\n | \"boolean\"\n | \"byte\"\n | \"date\"\n | \"decimal\"\n | \"double\"\n | \"float\"\n | \"integer\"\n | \"long\"\n | \"short\"\n | \"string\"\n | \"timestamp\";\n\nexport type PropertyTypeTypeExotic =\n | \"geopoint\"\n | \"geoshape\"\n | \"mediaReference\"\n | \"geotimeSeries\"\n | PropertyTypeTypeMarking\n | PropertyTypeTypeStruct\n | PropertyTypeTypeString\n | PropertyTypeTypeDecimal;\n\ntype PropertyTypeTypeMarking = {\n type: \"marking\";\n markingType: \"MANDATORY\" | \"CBAC\";\n markingInputGroupName: string;\n};\n\nexport type PropertyTypeTypeStruct = {\n type: \"struct\";\n structDefinition: {\n [api_name: string]:\n | StructPropertyType\n | Exclude<PropertyTypeTypesWithoutStruct, PropertyTypeTypeMarking>;\n };\n};\n\ntype PropertyTypeTypeString = {\n type: \"string\";\n isLongText?: boolean;\n supportsEfficientLeadingWildcard?: boolean;\n supportsExactMatching?: boolean;\n supportsFullTextRegex?: boolean;\n enableAsciiFolding?: boolean;\n};\n\ntype PropertyTypeTypeDecimal = {\n type: \"decimal\";\n precision?: number;\n scale?: number;\n};\n\nexport type PropertyTypeTypesWithoutStruct = Exclude<\n PropertyTypeType,\n PropertyTypeTypeStruct\n>;\nexport function isPropertyTypeType(\n v: PropertyTypeType,\n): v is PropertyTypeType {\n return v === \"boolean\" || v === \"byte\"\n || v === \"date\" || v === \"decimal\" || v === \"double\"\n || v === \"float\" || v === \"geopoint\" || v === \"geoshape\"\n || v === \"integer\" || v === \"long\"\n || (typeof v === \"object\" && v.type === \"marking\")\n || v === \"short\" || v === \"string\"\n || v === \"timestamp\";\n}\nexport function isExotic(\n type: PropertyTypeType | undefined,\n): type is PropertyTypeTypeExotic {\n if (type === undefined) {\n return false;\n }\n if (typeof type === \"string\") {\n return [\"geopoint\", \"geoshape\", \"mediaReference\", \"geotimeSeries\"].includes(\n type,\n );\n } else if (typeof type === \"object\" && type != null) {\n return type.type === \"marking\" || type.type === \"struct\";\n }\n return false;\n}\nexport function isStruct(\n type: PropertyTypeType,\n): type is PropertyTypeTypeStruct {\n return typeof type === \"object\" && type.type === \"struct\";\n}\n\ntype Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>;\n\nexport interface StructPropertyType extends\n Optional<\n Omit<\n StructFieldType,\n \"fieldType\" | \"structFieldRid\" | \"apiName\"\n >,\n \"typeClasses\" | \"aliases\"\n >\n{\n fieldType: PropertyTypeTypesWithoutStruct;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAiEA,OAAO,SAASA,kBAAkBA,CAChCC,CAAmB,EACI;EACvB,OAAOA,CAAC,KAAK,SAAS,IAAIA,CAAC,KAAK,MAAM,IACjCA,CAAC,KAAK,MAAM,IAAIA,CAAC,KAAK,SAAS,IAAIA,CAAC,KAAK,QAAQ,IACjDA,CAAC,KAAK,OAAO,IAAIA,CAAC,KAAK,UAAU,IAAIA,CAAC,KAAK,UAAU,IACrDA,CAAC,KAAK,SAAS,IAAIA,CAAC,KAAK,MAAM,IAC9B,OAAOA,CAAC,KAAK,QAAQ,IAAIA,CAAC,CAACC,IAAI,KAAK,SAAU,IAC/CD,CAAC,KAAK,OAAO,IAAIA,CAAC,KAAK,QAAQ,IAC/BA,CAAC,KAAK,WAAW;AACxB;AACA,OAAO,SAASE,QAAQA,CACtBD,IAAkC,EACF;EAChC,IAAIA,IAAI,KAAKE,SAAS,EAAE;IACtB,OAAO,KAAK;EACd;EACA,IAAI,OAAOF,IAAI,KAAK,QAAQ,EAAE;IAC5B,OAAO,CAAC,UAAU,EAAE,UAAU,EAAE,gBAAgB,EAAE,eAAe,CAAC,CAACG,QAAQ,CACzEH,IACF,CAAC;EACH,CAAC,MAAM,IAAI,OAAOA,IAAI,KAAK,QAAQ,IAAIA,IAAI,IAAI,IAAI,EAAE;IACnD,OAAOA,IAAI,CAACA,IAAI,KAAK,SAAS,IAAIA,IAAI,CAACA,IAAI,KAAK,QAAQ;EAC1D;EACA,OAAO,KAAK;AACd;AACA,OAAO,SAASI,QAAQA,CACtBJ,IAAsB,EACU;EAChC,OAAO,OAAOA,IAAI,KAAK,QAAQ,IAAIA,IAAI,CAACA,IAAI,KAAK,QAAQ;AAC3D","ignoreList":[]}
|