@osdk/generator-converters 2.4.0-beta.9 → 2.4.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.
Files changed (27) hide show
  1. package/CHANGELOG.md +94 -0
  2. package/build/browser/__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.js +8 -4
  3. package/build/browser/__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.js.map +1 -1
  4. package/build/browser/__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.test.js +72 -0
  5. package/build/browser/__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.test.js.map +1 -0
  6. package/build/browser/wireObjectTypeFullMetadataToSdkObjectMetadata.js +3 -3
  7. package/build/browser/wireObjectTypeFullMetadataToSdkObjectMetadata.js.map +1 -1
  8. package/build/browser/wireObjectTypeFullMetadataToSdkObjectMetadata.test.js +136 -0
  9. package/build/browser/wireObjectTypeFullMetadataToSdkObjectMetadata.test.js.map +1 -1
  10. package/build/browser/wireQueryDataTypeToQueryDataTypeDefinition.js +12 -2
  11. package/build/browser/wireQueryDataTypeToQueryDataTypeDefinition.js.map +1 -1
  12. package/build/cjs/index.cjs +23 -9
  13. package/build/cjs/index.cjs.map +1 -1
  14. package/build/esm/__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.js +8 -4
  15. package/build/esm/__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.js.map +1 -1
  16. package/build/esm/__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.test.js +72 -0
  17. package/build/esm/__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.test.js.map +1 -0
  18. package/build/esm/wireObjectTypeFullMetadataToSdkObjectMetadata.js +3 -3
  19. package/build/esm/wireObjectTypeFullMetadataToSdkObjectMetadata.js.map +1 -1
  20. package/build/esm/wireObjectTypeFullMetadataToSdkObjectMetadata.test.js +136 -0
  21. package/build/esm/wireObjectTypeFullMetadataToSdkObjectMetadata.test.js.map +1 -1
  22. package/build/esm/wireQueryDataTypeToQueryDataTypeDefinition.js +12 -2
  23. package/build/esm/wireQueryDataTypeToQueryDataTypeDefinition.js.map +1 -1
  24. package/build/types/__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.test.d.ts +1 -0
  25. package/build/types/__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.test.d.ts.map +1 -0
  26. package/build/types/wireObjectTypeFullMetadataToSdkObjectMetadata.d.ts.map +1 -1
  27. package/package.json +4 -4
@@ -108,12 +108,16 @@ function __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(interfaceType, v2,
108
108
  apiName: interfaceType.apiName,
109
109
  displayName: interfaceType.displayName,
110
110
  description: interfaceType.description,
111
- implements: interfaceType.allExtendsInterfaces ?? interfaceType.extendsInterfaces,
111
+ implements: interfaceType.allExtendsInterfaces ? [...interfaceType.allExtendsInterfaces].sort((a, b) => a.localeCompare(b)) : interfaceType.extendsInterfaces ? [...interfaceType.extendsInterfaces].sort((a, b) => a.localeCompare(b)) : void 0,
112
112
  properties: Object.fromEntries(Object.entries(interfaceType.allProperties ?? interfaceType.properties).map(([key, value]) => {
113
113
  return [key, wirePropertyV2ToSdkPropertyDefinition(value, true, log)];
114
- }).filter(([key, value]) => value != null)),
115
- links: {},
116
- implementedBy: interfaceType.implementedByObjectTypes
114
+ }).filter(([_, value]) => value != null)),
115
+ links: Object.fromEntries(Object.entries(interfaceType.allLinks ?? interfaceType.links ?? {}).map(([linkApiName, linkType]) => [linkApiName, {
116
+ multiplicity: linkType.cardinality === "MANY",
117
+ targetTypeApiName: linkType.linkedEntityApiName.apiName,
118
+ targetType: linkType.linkedEntityApiName.type === "objectTypeApiName" ? "object" : "interface"
119
+ }])),
120
+ implementedBy: interfaceType.implementedByObjectTypes ? [...interfaceType.implementedByObjectTypes].sort((a, b) => a.localeCompare(b)) : interfaceType.implementedByObjectTypes
117
121
  };
118
122
  }
119
123
 
@@ -188,14 +192,14 @@ function wireObjectTypeFullMetadataToSdkObjectMetadata(objectTypeWithLink, v2, l
188
192
  description: objectTypeWithLink.objectType.description,
189
193
  primaryKeyApiName: objectTypeWithLink.objectType.primaryKey,
190
194
  primaryKeyType: wirePropertyV2ToSdkPrimaryKeyTypeDefinition(objectTypeWithLink.objectType.properties[objectTypeWithLink.objectType.primaryKey]),
191
- links: Object.fromEntries(objectTypeWithLink.linkTypes.map((linkType) => {
195
+ links: Object.fromEntries([...objectTypeWithLink.linkTypes].sort((a, b) => a.apiName.localeCompare(b.apiName)).map((linkType) => {
192
196
  return [linkType.apiName, {
193
197
  multiplicity: linkType.cardinality === "MANY",
194
198
  targetType: linkType.objectTypeApiName
195
199
  }];
196
200
  })),
197
- properties: Object.fromEntries(Object.entries(objectTypeWithLink.objectType.properties).map(([key, value]) => [key, wirePropertyV2ToSdkPropertyDefinition(value, !(v2 && objectTypeWithLink.objectType.primaryKey === key), log)]).filter(([key, value]) => value != null)),
198
- implements: objectTypeWithLink.implementsInterfaces,
201
+ properties: Object.fromEntries(Object.entries(objectTypeWithLink.objectType.properties).map(([key, value]) => [key, wirePropertyV2ToSdkPropertyDefinition(value, !(v2 && objectTypeWithLink.objectType.primaryKey === key), log)]).filter(([_, value]) => value != null)),
202
+ implements: objectTypeWithLink.implementsInterfaces ? [...objectTypeWithLink.implementsInterfaces].sort((a, b) => a.localeCompare(b)) : objectTypeWithLink.implementsInterfaces,
199
203
  interfaceMap,
200
204
  inverseInterfaceMap: Object.fromEntries(Object.entries(interfaceMap).map(([interfaceApiName, props]) => [interfaceApiName, invertProps(props)])),
201
205
  icon: supportedIconTypes.includes(objectTypeWithLink.objectType.icon.type) ? objectTypeWithLink.objectType.icon : void 0,
@@ -345,6 +349,18 @@ function wireQueryDataTypeToQueryDataTypeDefinition(input) {
345
349
  objectSet: input.objectTypeApiName,
346
350
  nullable: false
347
351
  };
352
+ case "interfaceObject":
353
+ return {
354
+ type: "interface",
355
+ interface: input.interfaceTypeApiName,
356
+ nullable: false
357
+ };
358
+ case "interfaceObjectSet":
359
+ return {
360
+ type: "interfaceObjectSet",
361
+ objectSet: input.interfaceTypeApiName,
362
+ nullable: false
363
+ };
348
364
  case "array":
349
365
  return {
350
366
  ...wireQueryDataTypeToQueryDataTypeDefinition(input.subType),
@@ -412,8 +428,6 @@ function wireQueryDataTypeToQueryDataTypeDefinition(input) {
412
428
  };
413
429
  case "null":
414
430
  case "unsupported":
415
- case "interfaceObject":
416
- case "interfaceObjectSet":
417
431
  throw new Error(`Unable to process query because the server indicated an unsupported QueryDataType.type: ${input.type}. Please check that your query is using supported types.`);
418
432
  default:
419
433
  throw new Error(`Unsupported QueryDataType.type ${input.type}`);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/wirePropertyV2ToSdkPropertyDefinition.ts","../../src/__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.ts","../../src/getEditedEntities.ts","../../src/wirePropertyV2ToSdkPrimaryKeyTypeDefinition.ts","../../src/wireObjectTypeFullMetadataToSdkObjectMetadata.ts","../../src/wireActionTypeV2ToSdkActionMetadata.ts","../../src/isNullableQueryDataType.ts","../../src/wireQueryDataTypeToQueryDataTypeDefinition.ts","../../src/wireQueryTypeV2ToSdkQueryMetadata.ts"],"names":[],"mappings":";;;AAgBO,SAAS,qCAAsC,CAAA,KAAA,EAAO,UAAa,GAAA,IAAA,EAAM,GAAK,EAAA;AACnF,EAAA,MAAM,iBAAoB,GAAA,yCAAA,CAA0C,KAAM,CAAA,QAAA,EAAU,GAAG,CAAA;AACvF,EAAA,IAAI,qBAAqB,IAAM,EAAA;AAC7B,IAAO,OAAA,MAAA;AAAA;AAET,EAAQ,QAAA,KAAA,CAAM,SAAS,IAAM;AAAA,IAC3B,KAAK,SAAA;AAAA,IACL,KAAK,QAAA;AAAA,IACL,KAAK,MAAA;AAAA,IACL,KAAK,SAAA;AAAA,IACL,KAAK,QAAA;AAAA,IACL,KAAK,OAAA;AAAA,IACL,KAAK,MAAA;AAAA,IAC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K,KAAM,CAAA;AAAA,GACb;AACF;AACO,SAAS,4CAA4C,KAAO,EAAA;AACjE,EAAO,OAAA;AAAA,IACL,IAAM,EAAA,OAAA;AAAA,IACN,SAAS,KAAM,CAAA,OAAA;AAAA,IACf,aAAa,KAAM,CAAA,WAAA;AAAA,IACnB,aAAa,KAAM,CAAA,WAAA;AAAA,IACnB,SAAS,KAAM,CAAA,OAAA;AAAA,IACf,KAAK,KAAM,CAAA;AAAA,GACb;AACF;AACO,SAAS,+CAA+C,SAAW,EAAA;AACxE,EAAO,OAAA;AAAA,IACL,aAAa,SAAU,CAAA,WAAA;AAAA,IACvB,GAAG,0CAA2C,CAAA,SAAA,CAAU,QAAQ;AAAA,GAClE;AACF","file":"index.cjs","sourcesContent":["/*\n * Copyright 2023 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\nexport function wirePropertyV2ToSdkPropertyDefinition(input, isNullable = true, log) {\n const sdkPropDefinition = objectPropertyTypeToSdkPropertyDefinition(input.dataType, log);\n if (sdkPropDefinition == null) {\n return undefined;\n }\n switch (input.dataType.type) {\n case \"integer\":\n case \"string\":\n case \"byte\":\n case \"decimal\":\n case \"double\":\n case \"float\":\n case \"long\":\n case \"short\":\n case \"boolean\":\n case \"date\":\n case \"attachment\":\n case \"mediaReference\":\n case \"geopoint\":\n case \"geoshape\":\n case \"timestamp\":\n case \"timeseries\":\n case \"marking\":\n case \"geotimeSeriesReference\":\n case \"struct\":\n case \"vector\":\n return {\n displayName: input.displayName,\n multiplicity: false,\n description: input.description,\n type: sdkPropDefinition,\n nullable: input.nullable == null ? isNullable : input.nullable\n };\n case \"array\":\n {\n return {\n displayName: input.displayName,\n multiplicity: true,\n description: input.description,\n type: sdkPropDefinition,\n nullable: true\n };\n }\n case \"cipherText\":\n {\n log?.info(`${JSON.stringify(input.dataType.type)} is not a supported dataType`);\n return undefined;\n }\n default:\n const _ = input.dataType;\n log?.info(`${JSON.stringify(input.dataType)} is not a supported dataType`);\n return undefined;\n }\n}\nfunction objectPropertyTypeToSdkPropertyDefinition(propertyType, log) {\n switch (propertyType.type) {\n case \"integer\":\n case \"string\":\n case \"byte\":\n case \"decimal\":\n case \"double\":\n case \"float\":\n case \"long\":\n case \"short\":\n case \"boolean\":\n case \"attachment\":\n case \"geopoint\":\n case \"geoshape\":\n case \"timestamp\":\n case \"marking\":\n case \"geotimeSeriesReference\":\n case \"mediaReference\":\n case \"vector\":\n return propertyType.type;\n case \"date\":\n return \"datetime\";\n case \"array\":\n return objectPropertyTypeToSdkPropertyDefinition(propertyType.subType);\n case \"timeseries\":\n if (propertyType.itemType?.type === \"string\") {\n return \"stringTimeseries\";\n } else if (propertyType.itemType?.type === \"double\") {\n return \"numericTimeseries\";\n } else return \"sensorTimeseries\";\n case \"struct\":\n {\n return propertyType.structFieldTypes.reduce((structMap, structField) => {\n structMap[structField.apiName] = objectPropertyTypeToSdkPropertyDefinition(structField.dataType);\n return structMap;\n }, {});\n }\n case \"cipherText\":\n {\n log?.info(`${JSON.stringify(propertyType.type)} is not a supported propertyType`);\n return undefined;\n }\n default:\n {\n const _ = propertyType;\n log?.info(`${JSON.stringify(propertyType)} is not a supported propertyType`);\n return undefined;\n }\n }\n}","/*\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 { wirePropertyV2ToSdkPropertyDefinition } from \"./wirePropertyV2ToSdkPropertyDefinition.js\";\nexport function __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(interfaceType, v2, log) {\n return {\n type: \"interface\",\n rid: interfaceType.rid,\n apiName: interfaceType.apiName,\n displayName: interfaceType.displayName,\n description: interfaceType.description,\n implements: interfaceType.allExtendsInterfaces ?? interfaceType.extendsInterfaces,\n properties: Object.fromEntries(Object.entries(interfaceType.allProperties ?? interfaceType.properties).map(([key, value]) => {\n return [key, wirePropertyV2ToSdkPropertyDefinition(value, true, log)];\n }).filter(([key, value]) => value != null)),\n links: {},\n implementedBy: interfaceType.implementedByObjectTypes\n };\n}","/*\n * Copyright 2023 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\nexport function getModifiedEntityTypes(action) {\n const addedObjects = new Set();\n const modifiedObjects = new Set();\n for (const operation of action.operations) {\n switch (operation.type) {\n case \"createObject\":\n addedObjects.add(operation.objectTypeApiName);\n break;\n case \"modifyObject\":\n modifiedObjects.add(operation.objectTypeApiName);\n break;\n case \"deleteObject\":\n case \"createLink\":\n case \"deleteLink\":\n case \"createInterfaceObject\":\n case \"modifyInterfaceObject\":\n case \"deleteInterfaceObject\":\n break;\n default:\n const _ = operation;\n }\n }\n return {\n addedObjects,\n modifiedObjects\n };\n}","/*\n * Copyright 2023 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\nexport function wirePropertyV2ToSdkPrimaryKeyTypeDefinition(input) {\n switch (input.dataType.type) {\n case \"integer\":\n case \"double\":\n case \"string\":\n case \"byte\":\n case \"long\":\n case \"short\":\n case \"timestamp\":\n {\n return input.dataType.type;\n }\n case \"date\":\n {\n return \"datetime\";\n }\n case \"boolean\":\n case \"geopoint\":\n case \"geoshape\":\n case \"decimal\":\n case \"attachment\":\n case \"timeseries\":\n case \"array\":\n case \"marking\":\n case \"float\":\n case \"geotimeSeriesReference\":\n case \"mediaReference\":\n case \"struct\":\n case \"cipherText\":\n case \"vector\":\n throw new Error(`Primary key of type ${input.dataType.type} is not supported`);\n default:\n const _ = input.dataType;\n throw new Error(`Unknown type encountered for primaryKey: ${input.dataType}`);\n }\n}","/*\n * Copyright 2023 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 { wirePropertyV2ToSdkPrimaryKeyTypeDefinition } from \"./wirePropertyV2ToSdkPrimaryKeyTypeDefinition.js\";\nimport { wirePropertyV2ToSdkPropertyDefinition } from \"./wirePropertyV2ToSdkPropertyDefinition.js\";\nexport function wireObjectTypeFullMetadataToSdkObjectMetadata(objectTypeWithLink, v2, log) {\n if (objectTypeWithLink.objectType.properties[objectTypeWithLink.objectType.primaryKey] === undefined) {\n throw new Error(`Primary key ${objectTypeWithLink.objectType.primaryKey} not found in ${objectTypeWithLink.objectType.apiName}`);\n }\n\n // saved ontology.json files may not have this implementsInterfaces2 so we need to handle\n if (objectTypeWithLink.implementsInterfaces2 == null && objectTypeWithLink.implementsInterfaces != null) {\n throw new Error(\"Your ontology.json file is missing the implementsInterfaces2 field. Please regenerate it.\");\n }\n const interfaceMap = objectTypeWithLink.implementsInterfaces2 ? Object.fromEntries(Object.entries(objectTypeWithLink.implementsInterfaces2).map(([interfaceApiName, impl]) => [interfaceApiName, impl.properties])) : {};\n return {\n type: \"object\",\n apiName: objectTypeWithLink.objectType.apiName,\n description: objectTypeWithLink.objectType.description,\n primaryKeyApiName: objectTypeWithLink.objectType.primaryKey,\n primaryKeyType: wirePropertyV2ToSdkPrimaryKeyTypeDefinition(objectTypeWithLink.objectType.properties[objectTypeWithLink.objectType.primaryKey]),\n links: Object.fromEntries(objectTypeWithLink.linkTypes.map(linkType => {\n return [linkType.apiName, {\n multiplicity: linkType.cardinality === \"MANY\",\n targetType: linkType.objectTypeApiName\n }];\n })),\n properties: Object.fromEntries(Object.entries(objectTypeWithLink.objectType.properties).map(([key, value]) => [key, wirePropertyV2ToSdkPropertyDefinition(value, !(v2 && objectTypeWithLink.objectType.primaryKey === key), log)]).filter(([key, value]) => value != null)),\n implements: objectTypeWithLink.implementsInterfaces,\n interfaceMap,\n inverseInterfaceMap: Object.fromEntries(Object.entries(interfaceMap).map(([interfaceApiName, props]) => [interfaceApiName, invertProps(props)])),\n icon: supportedIconTypes.includes(objectTypeWithLink.objectType.icon.type) ? objectTypeWithLink.objectType.icon : undefined,\n titleProperty: objectTypeWithLink.objectType.titleProperty,\n displayName: objectTypeWithLink.objectType.displayName,\n pluralDisplayName: objectTypeWithLink.objectType.pluralDisplayName,\n status: ensureStringEnumSupportedOrUndefined(objectTypeWithLink.objectType.status, supportedReleaseStatus),\n rid: objectTypeWithLink.objectType.rid,\n visibility: ensureStringEnumSupportedOrUndefined(objectTypeWithLink.objectType.visibility, supportedObjectTypeVisibility)\n };\n}\nfunction invertProps(a) {\n return a ? Object.fromEntries(Object.entries(a).map(([k, v]) => [v, k])) : undefined;\n}\nexport const supportedIconTypes = [\"blueprint\"];\nexport const supportedReleaseStatus = [\"ACTIVE\", \"EXPERIMENTAL\", \"DEPRECATED\", \"ENDORSED\"];\nexport const supportedObjectTypeVisibility = [\"NORMAL\", \"PROMINENT\", \"HIDDEN\"];\nexport function ensureStringEnumSupportedOrUndefined(value, supportedValues) {\n return value && supportedValues.includes(value) ? value : undefined;\n}","/*\n * Copyright 2023 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 { getModifiedEntityTypes } from \"./getEditedEntities.js\";\nimport { ensureStringEnumSupportedOrUndefined, supportedReleaseStatus } from \"./wireObjectTypeFullMetadataToSdkObjectMetadata.js\";\nexport function wireActionTypeV2ToSdkActionMetadata(input) {\n const modifiedEntityTypes = getModifiedEntityTypes(input);\n return {\n type: \"action\",\n apiName: input.apiName,\n parameters: Object.fromEntries(Object.entries(input.parameters).map(([key, value]) => [key, wireActionParameterV2ToSdkParameterDefinition(value)])),\n displayName: input.displayName,\n description: input.description,\n modifiedEntities: createModifiedEntities(modifiedEntityTypes.addedObjects, modifiedEntityTypes.modifiedObjects),\n rid: input.rid,\n status: ensureStringEnumSupportedOrUndefined(input.status, supportedReleaseStatus)\n };\n}\nfunction wireActionParameterV2ToSdkParameterDefinition(value) {\n return {\n multiplicity: value.dataType.type === \"array\",\n type: actionPropertyToSdkPropertyDefinition(value.dataType.type === \"array\" ? value.dataType.subType : value.dataType),\n nullable: !value.required,\n description: value.description\n };\n}\nfunction actionPropertyToSdkPropertyDefinition(parameterType) {\n switch (parameterType.type) {\n case \"string\":\n case \"boolean\":\n case \"attachment\":\n case \"double\":\n case \"integer\":\n case \"long\":\n case \"timestamp\":\n case \"mediaReference\":\n case \"marking\":\n case \"objectType\":\n case \"geohash\":\n case \"geoshape\":\n return parameterType.type;\n case \"date\":\n return \"datetime\";\n case \"objectSet\":\n return {\n type: \"objectSet\",\n objectSet: parameterType.objectTypeApiName\n };\n case \"object\":\n return {\n type: \"object\",\n object: parameterType.objectTypeApiName\n };\n case \"array\":\n return actionPropertyToSdkPropertyDefinition(parameterType.subType);\n case \"interfaceObject\":\n return {\n type: \"interface\",\n interface: parameterType.interfaceTypeApiName\n };\n case \"struct\":\n return {\n type: \"struct\",\n struct: parameterType.fields.reduce((structMap, structField) => {\n structMap[structField.name] = actionPropertyToSdkPropertyDefinition(structField.fieldType);\n return structMap;\n }, {})\n };\n default:\n throw new Error(`Unsupported action parameter type: ${JSON.stringify(parameterType)}`);\n }\n}\nfunction createModifiedEntities(addedObjects, modifiedObjects) {\n const entities = {};\n for (const key of addedObjects) {\n entities[key] = {\n created: true,\n modified: false\n };\n }\n for (const key of modifiedObjects) {\n if (entities[key]) {\n entities[key].modified = true;\n } else {\n entities[key] = {\n created: false,\n modified: true\n };\n }\n }\n return entities;\n}","/*\n * Copyright 2023 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\nexport function isNullableQueryDataType(input) {\n if (input.type === \"null\") {\n return true;\n }\n if (input.type === \"union\") {\n return input.unionTypes.some(t => isNullableQueryDataType(t));\n }\n return false;\n}","/*\n * Copyright 2023 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 { isNullableQueryDataType } from \"./isNullableQueryDataType.js\";\nexport function wireQueryDataTypeToQueryDataTypeDefinition(input) {\n switch (input.type) {\n case \"double\":\n case \"float\":\n case \"integer\":\n case \"long\":\n case \"attachment\":\n case \"boolean\":\n case \"date\":\n case \"string\":\n case \"timestamp\":\n return {\n type: input.type,\n nullable: false\n };\n case \"object\":\n return {\n type: \"object\",\n object: input.objectTypeApiName,\n nullable: false\n };\n case \"objectSet\":\n return {\n type: \"objectSet\",\n objectSet: input.objectTypeApiName,\n nullable: false\n };\n case \"array\":\n return {\n ...wireQueryDataTypeToQueryDataTypeDefinition(input.subType),\n multiplicity: true\n };\n case \"set\":\n return {\n type: \"set\",\n set: wireQueryDataTypeToQueryDataTypeDefinition(input.subType),\n nullable: false\n };\n case \"union\":\n const allowNulls = isNullableQueryDataType(input);\n\n // special case for a union where one half is nullable to skip the union step and just allow nulls directly\n if (allowNulls && input.unionTypes.length === 2) {\n const nonNull = input.unionTypes.find(t => t.type != null);\n if (nonNull) {\n return {\n ...wireQueryDataTypeToQueryDataTypeDefinition(nonNull),\n nullable: true\n };\n }\n }\n return {\n type: \"union\",\n union: input.unionTypes.reduce((acc, t) => {\n if (t.type === \"null\") {\n return acc;\n }\n acc.push(wireQueryDataTypeToQueryDataTypeDefinition(t));\n return acc;\n }, []),\n nullable: allowNulls\n };\n case \"struct\":\n return {\n type: \"struct\",\n struct: Object.fromEntries(input.fields.map(f => [f.name, wireQueryDataTypeToQueryDataTypeDefinition(f.fieldType)])),\n nullable: false\n };\n case \"twoDimensionalAggregation\":\n return {\n type: \"twoDimensionalAggregation\",\n twoDimensionalAggregation: get2DQueryAggregationProps(input),\n nullable: false\n };\n case \"threeDimensionalAggregation\":\n return {\n type: \"threeDimensionalAggregation\",\n threeDimensionalAggregation: get3DQueryAggregationProps(input),\n nullable: false\n };\n case \"entrySet\":\n const keyType = wireQueryDataTypeToQueryDataTypeDefinition(input.keyType);\n if (!validMapKeyTypes.includes(keyType.type)) {\n throw new Error(\"Map types with a key type of \" + keyType.type + \" are not supported\" + validMapKeyTypes.toString());\n }\n if (keyType.multiplicity === true) {\n throw new Error(\"Map types cannot have keys as arrays\");\n }\n return {\n type: \"map\",\n nullable: false,\n keyType,\n valueType: wireQueryDataTypeToQueryDataTypeDefinition(input.valueType)\n };\n case \"null\":\n case \"unsupported\":\n case \"interfaceObject\":\n case \"interfaceObjectSet\":\n throw new Error(`Unable to process query because the server indicated an unsupported QueryDataType.type: ${input.type}. Please check that your query is using supported types.`);\n default:\n const _ = input;\n throw new Error(`Unsupported QueryDataType.type ${input.type}`);\n }\n}\nfunction get2DQueryAggregationProps(input) {\n if (input.keyType.type === \"range\") {\n return {\n keyType: input.keyType.type,\n keySubtype: input.keyType.subType.type,\n valueType: input.valueType.type\n };\n } else {\n if (guardInvalidKeyTypes(input.keyType)) {\n return {\n keyType: input.keyType.type,\n valueType: input.valueType.type\n };\n }\n throw new Error(`Cannot create 2D aggregation with ${input.keyType.type} as its type`);\n }\n}\nfunction get3DQueryAggregationProps(input) {\n if (input.keyType.type === \"range\") {\n return {\n keyType: input.keyType.type,\n keySubtype: input.keyType.subType.type,\n valueType: get2DQueryAggregationProps(input.valueType)\n };\n } else {\n if (guardInvalidKeyTypes(input.keyType)) {\n return {\n keyType: input.keyType.type,\n valueType: get2DQueryAggregationProps(input.valueType)\n };\n }\n throw new Error(`Cannot create 3D aggregation with ${input.keyType.type} as its type`);\n }\n}\n\n/**\n * Guard against aggregation key types that are allowed by the backend types but are illegal to actually use\n */\nfunction guardInvalidKeyTypes(key) {\n return key.type === \"string\" || key.type === \"boolean\";\n}\n\n/**\n * The set of all valid key types for maps. This includes all types that are represented by strings or numbers in the OSDK, and Ontology Objects.\n */\nconst validMapKeyTypes = [\"string\", \"object\", \"double\", \"float\", \"integer\", \"long\", \"date\", \"timestamp\", \"byte\", \"datetime\", \"decimal\", \"marking\", \"short\", \"objectType\"];","/*\n * Copyright 2023 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 { wireQueryDataTypeToQueryDataTypeDefinition } from \"./wireQueryDataTypeToQueryDataTypeDefinition.js\";\nexport function wireQueryTypeV2ToSdkQueryMetadata(input) {\n return {\n type: \"query\",\n apiName: input.apiName,\n description: input.description,\n displayName: input.displayName,\n version: input.version,\n parameters: Object.fromEntries(Object.entries(input.parameters).map(([name, parameter]) => [name, wireQueryParameterV2ToQueryParameterDefinition(parameter)])),\n output: wireQueryDataTypeToQueryDataTypeDefinition(input.output),\n rid: input.rid\n };\n}\nexport function wireQueryTypeV2ToSdkQueryDefinitionNoParams(input) {\n return {\n type: \"query\",\n apiName: input.apiName,\n description: input.description,\n displayName: input.displayName,\n version: input.version,\n rid: input.rid\n };\n}\nexport function wireQueryParameterV2ToQueryParameterDefinition(parameter) {\n return {\n description: parameter.description,\n ...wireQueryDataTypeToQueryDataTypeDefinition(parameter.dataType)\n };\n}"]}
1
+ {"version":3,"sources":["../../src/wirePropertyV2ToSdkPropertyDefinition.ts","../../src/__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.ts","../../src/getEditedEntities.ts","../../src/wirePropertyV2ToSdkPrimaryKeyTypeDefinition.ts","../../src/wireObjectTypeFullMetadataToSdkObjectMetadata.ts","../../src/wireActionTypeV2ToSdkActionMetadata.ts","../../src/isNullableQueryDataType.ts","../../src/wireQueryDataTypeToQueryDataTypeDefinition.ts","../../src/wireQueryTypeV2ToSdkQueryMetadata.ts"],"names":[],"mappings":";;;AAgBO,SAAS,qCAAsC,CAAA,KAAA,EAAO,UAAa,GAAA,IAAA,EAAM,GAAK,EAAA;AACnF,EAAA,MAAM,iBAAoB,GAAA,yCAAA,CAA0C,KAAM,CAAA,QAAA,EAAU,GAAG,CAAA;AACvF,EAAA,IAAI,qBAAqB,IAAM,EAAA;AAC7B,IAAO,OAAA,MAAA;AAAA;AAET,EAAQ,QAAA,KAAA,CAAM,SAAS,IAAM;AAAA,IAC3B,KAAK,SAAA;AAAA,IACL,KAAK,QAAA;AAAA,IACL,KAAK,MAAA;AAAA,IACL,KAAK,SAAA;AAAA,IACL,KAAK,QAAA;AAAA,IACL,KAAK,OAAA;AAAA,IACL,KAAK,MAAA;AAAA,IACL,KAAK,OAAA;AAAA,IACL,KAAK,SAAA;AAAA,IACL,KAAK,MAAA;AAAA,IACL,KAAK,YAAA;AAAA,IACL,KAAK,gBAAA;AAAA,IACL,KAAK,UAAA;AAAA,IACL,KAAK,UAAA;AAAA,IACL,KAAK,WAAA;AAAA,IACL,KAAK,YAAA;AAAA,IACL,KAAK,SAAA;AAAA,IACL,KAAK,wBAAA;AAAA,IACL,KAAK,QAAA;AAAA,IACL,KAAK,QAAA;AACH,MAAO,OAAA;AAAA,QACL,aAAa,KAAM,CAAA,WAAA;AAAA,QACnB,YAAc,EAAA,KAAA;AAAA,QACd,aAAa,KAAM,CAAA,WAAA;AAAA,QACnB,IAAM,EAAA,iBAAA;AAAA,QACN,QAAU,EAAA,KAAA,CAAM,QAAY,IAAA,IAAA,GAAO,aAAa,KAAM,CAAA;AAAA,OACxD;AAAA,I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 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\nexport function wirePropertyV2ToSdkPropertyDefinition(input, isNullable = true, log) {\n const sdkPropDefinition = objectPropertyTypeToSdkPropertyDefinition(input.dataType, log);\n if (sdkPropDefinition == null) {\n return undefined;\n }\n switch (input.dataType.type) {\n case \"integer\":\n case \"string\":\n case \"byte\":\n case \"decimal\":\n case \"double\":\n case \"float\":\n case \"long\":\n case \"short\":\n case \"boolean\":\n case \"date\":\n case \"attachment\":\n case \"mediaReference\":\n case \"geopoint\":\n case \"geoshape\":\n case \"timestamp\":\n case \"timeseries\":\n case \"marking\":\n case \"geotimeSeriesReference\":\n case \"struct\":\n case \"vector\":\n return {\n displayName: input.displayName,\n multiplicity: false,\n description: input.description,\n type: sdkPropDefinition,\n nullable: input.nullable == null ? isNullable : input.nullable\n };\n case \"array\":\n {\n return {\n displayName: input.displayName,\n multiplicity: true,\n description: input.description,\n type: sdkPropDefinition,\n nullable: true\n };\n }\n case \"cipherText\":\n {\n log?.info(`${JSON.stringify(input.dataType.type)} is not a supported dataType`);\n return undefined;\n }\n default:\n const _ = input.dataType;\n log?.info(`${JSON.stringify(input.dataType)} is not a supported dataType`);\n return undefined;\n }\n}\nfunction objectPropertyTypeToSdkPropertyDefinition(propertyType, log) {\n switch (propertyType.type) {\n case \"integer\":\n case \"string\":\n case \"byte\":\n case \"decimal\":\n case \"double\":\n case \"float\":\n case \"long\":\n case \"short\":\n case \"boolean\":\n case \"attachment\":\n case \"geopoint\":\n case \"geoshape\":\n case \"timestamp\":\n case \"marking\":\n case \"geotimeSeriesReference\":\n case \"mediaReference\":\n case \"vector\":\n return propertyType.type;\n case \"date\":\n return \"datetime\";\n case \"array\":\n return objectPropertyTypeToSdkPropertyDefinition(propertyType.subType);\n case \"timeseries\":\n if (propertyType.itemType?.type === \"string\") {\n return \"stringTimeseries\";\n } else if (propertyType.itemType?.type === \"double\") {\n return \"numericTimeseries\";\n } else return \"sensorTimeseries\";\n case \"struct\":\n {\n return propertyType.structFieldTypes.reduce((structMap, structField) => {\n structMap[structField.apiName] = objectPropertyTypeToSdkPropertyDefinition(structField.dataType);\n return structMap;\n }, {});\n }\n case \"cipherText\":\n {\n log?.info(`${JSON.stringify(propertyType.type)} is not a supported propertyType`);\n return undefined;\n }\n default:\n {\n const _ = propertyType;\n log?.info(`${JSON.stringify(propertyType)} is not a supported propertyType`);\n return undefined;\n }\n }\n}","/*\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 { wirePropertyV2ToSdkPropertyDefinition } from \"./wirePropertyV2ToSdkPropertyDefinition.js\";\nexport function __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(interfaceType, v2, log) {\n return {\n type: \"interface\",\n rid: interfaceType.rid,\n apiName: interfaceType.apiName,\n displayName: interfaceType.displayName,\n description: interfaceType.description,\n implements: interfaceType.allExtendsInterfaces ? [...interfaceType.allExtendsInterfaces].sort((a, b) => a.localeCompare(b)) : interfaceType.extendsInterfaces ? [...interfaceType.extendsInterfaces].sort((a, b) => a.localeCompare(b)) : undefined,\n properties: Object.fromEntries(Object.entries(interfaceType.allProperties ?? interfaceType.properties).map(([key, value]) => {\n return [key, wirePropertyV2ToSdkPropertyDefinition(value, true, log)];\n }).filter(([_, value]) => value != null)),\n links: Object.fromEntries(Object.entries(interfaceType.allLinks ?? interfaceType.links ?? {}).map(([linkApiName, linkType]) => [linkApiName, {\n multiplicity: linkType.cardinality === \"MANY\",\n targetTypeApiName: linkType.linkedEntityApiName.apiName,\n targetType: linkType.linkedEntityApiName.type === \"objectTypeApiName\" ? \"object\" : \"interface\"\n }])),\n implementedBy: interfaceType.implementedByObjectTypes ? [...interfaceType.implementedByObjectTypes].sort((a, b) => a.localeCompare(b)) : interfaceType.implementedByObjectTypes\n };\n}","/*\n * Copyright 2023 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\nexport function getModifiedEntityTypes(action) {\n const addedObjects = new Set();\n const modifiedObjects = new Set();\n for (const operation of action.operations) {\n switch (operation.type) {\n case \"createObject\":\n addedObjects.add(operation.objectTypeApiName);\n break;\n case \"modifyObject\":\n modifiedObjects.add(operation.objectTypeApiName);\n break;\n case \"deleteObject\":\n case \"createLink\":\n case \"deleteLink\":\n case \"createInterfaceObject\":\n case \"modifyInterfaceObject\":\n case \"deleteInterfaceObject\":\n break;\n default:\n const _ = operation;\n }\n }\n return {\n addedObjects,\n modifiedObjects\n };\n}","/*\n * Copyright 2023 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\nexport function wirePropertyV2ToSdkPrimaryKeyTypeDefinition(input) {\n switch (input.dataType.type) {\n case \"integer\":\n case \"double\":\n case \"string\":\n case \"byte\":\n case \"long\":\n case \"short\":\n case \"timestamp\":\n {\n return input.dataType.type;\n }\n case \"date\":\n {\n return \"datetime\";\n }\n case \"boolean\":\n case \"geopoint\":\n case \"geoshape\":\n case \"decimal\":\n case \"attachment\":\n case \"timeseries\":\n case \"array\":\n case \"marking\":\n case \"float\":\n case \"geotimeSeriesReference\":\n case \"mediaReference\":\n case \"struct\":\n case \"cipherText\":\n case \"vector\":\n throw new Error(`Primary key of type ${input.dataType.type} is not supported`);\n default:\n const _ = input.dataType;\n throw new Error(`Unknown type encountered for primaryKey: ${input.dataType}`);\n }\n}","/*\n * Copyright 2023 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 { wirePropertyV2ToSdkPrimaryKeyTypeDefinition } from \"./wirePropertyV2ToSdkPrimaryKeyTypeDefinition.js\";\nimport { wirePropertyV2ToSdkPropertyDefinition } from \"./wirePropertyV2ToSdkPropertyDefinition.js\";\nexport function wireObjectTypeFullMetadataToSdkObjectMetadata(objectTypeWithLink, v2, log) {\n if (objectTypeWithLink.objectType.properties[objectTypeWithLink.objectType.primaryKey] === undefined) {\n throw new Error(`Primary key ${objectTypeWithLink.objectType.primaryKey} not found in ${objectTypeWithLink.objectType.apiName}`);\n }\n\n // saved ontology.json files may not have this implementsInterfaces2 so we need to handle\n if (objectTypeWithLink.implementsInterfaces2 == null && objectTypeWithLink.implementsInterfaces != null) {\n throw new Error(\"Your ontology.json file is missing the implementsInterfaces2 field. Please regenerate it.\");\n }\n const interfaceMap = objectTypeWithLink.implementsInterfaces2 ? Object.fromEntries(Object.entries(objectTypeWithLink.implementsInterfaces2).map(([interfaceApiName, impl]) => [interfaceApiName, impl.properties])) : {};\n return {\n type: \"object\",\n apiName: objectTypeWithLink.objectType.apiName,\n description: objectTypeWithLink.objectType.description,\n primaryKeyApiName: objectTypeWithLink.objectType.primaryKey,\n primaryKeyType: wirePropertyV2ToSdkPrimaryKeyTypeDefinition(objectTypeWithLink.objectType.properties[objectTypeWithLink.objectType.primaryKey]),\n links: Object.fromEntries([...objectTypeWithLink.linkTypes].sort((a, b) => a.apiName.localeCompare(b.apiName)).map(linkType => {\n return [linkType.apiName, {\n multiplicity: linkType.cardinality === \"MANY\",\n targetType: linkType.objectTypeApiName\n }];\n })),\n properties: Object.fromEntries(Object.entries(objectTypeWithLink.objectType.properties).map(([key, value]) => [key, wirePropertyV2ToSdkPropertyDefinition(value, !(v2 && objectTypeWithLink.objectType.primaryKey === key), log)]).filter(([_, value]) => value != null)),\n implements: objectTypeWithLink.implementsInterfaces ? [...objectTypeWithLink.implementsInterfaces].sort((a, b) => a.localeCompare(b)) : objectTypeWithLink.implementsInterfaces,\n interfaceMap,\n inverseInterfaceMap: Object.fromEntries(Object.entries(interfaceMap).map(([interfaceApiName, props]) => [interfaceApiName, invertProps(props)])),\n icon: supportedIconTypes.includes(objectTypeWithLink.objectType.icon.type) ? objectTypeWithLink.objectType.icon : undefined,\n titleProperty: objectTypeWithLink.objectType.titleProperty,\n displayName: objectTypeWithLink.objectType.displayName,\n pluralDisplayName: objectTypeWithLink.objectType.pluralDisplayName,\n status: ensureStringEnumSupportedOrUndefined(objectTypeWithLink.objectType.status, supportedReleaseStatus),\n rid: objectTypeWithLink.objectType.rid,\n visibility: ensureStringEnumSupportedOrUndefined(objectTypeWithLink.objectType.visibility, supportedObjectTypeVisibility)\n };\n}\nfunction invertProps(a) {\n return a ? Object.fromEntries(Object.entries(a).map(([k, v]) => [v, k])) : undefined;\n}\nexport const supportedIconTypes = [\"blueprint\"];\nexport const supportedReleaseStatus = [\"ACTIVE\", \"EXPERIMENTAL\", \"DEPRECATED\", \"ENDORSED\"];\nexport const supportedObjectTypeVisibility = [\"NORMAL\", \"PROMINENT\", \"HIDDEN\"];\nexport function ensureStringEnumSupportedOrUndefined(value, supportedValues) {\n return value && supportedValues.includes(value) ? value : undefined;\n}","/*\n * Copyright 2023 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 { getModifiedEntityTypes } from \"./getEditedEntities.js\";\nimport { ensureStringEnumSupportedOrUndefined, supportedReleaseStatus } from \"./wireObjectTypeFullMetadataToSdkObjectMetadata.js\";\nexport function wireActionTypeV2ToSdkActionMetadata(input) {\n const modifiedEntityTypes = getModifiedEntityTypes(input);\n return {\n type: \"action\",\n apiName: input.apiName,\n parameters: Object.fromEntries(Object.entries(input.parameters).map(([key, value]) => [key, wireActionParameterV2ToSdkParameterDefinition(value)])),\n displayName: input.displayName,\n description: input.description,\n modifiedEntities: createModifiedEntities(modifiedEntityTypes.addedObjects, modifiedEntityTypes.modifiedObjects),\n rid: input.rid,\n status: ensureStringEnumSupportedOrUndefined(input.status, supportedReleaseStatus)\n };\n}\nfunction wireActionParameterV2ToSdkParameterDefinition(value) {\n return {\n multiplicity: value.dataType.type === \"array\",\n type: actionPropertyToSdkPropertyDefinition(value.dataType.type === \"array\" ? value.dataType.subType : value.dataType),\n nullable: !value.required,\n description: value.description\n };\n}\nfunction actionPropertyToSdkPropertyDefinition(parameterType) {\n switch (parameterType.type) {\n case \"string\":\n case \"boolean\":\n case \"attachment\":\n case \"double\":\n case \"integer\":\n case \"long\":\n case \"timestamp\":\n case \"mediaReference\":\n case \"marking\":\n case \"objectType\":\n case \"geohash\":\n case \"geoshape\":\n return parameterType.type;\n case \"date\":\n return \"datetime\";\n case \"objectSet\":\n return {\n type: \"objectSet\",\n objectSet: parameterType.objectTypeApiName\n };\n case \"object\":\n return {\n type: \"object\",\n object: parameterType.objectTypeApiName\n };\n case \"array\":\n return actionPropertyToSdkPropertyDefinition(parameterType.subType);\n case \"interfaceObject\":\n return {\n type: \"interface\",\n interface: parameterType.interfaceTypeApiName\n };\n case \"struct\":\n return {\n type: \"struct\",\n struct: parameterType.fields.reduce((structMap, structField) => {\n structMap[structField.name] = actionPropertyToSdkPropertyDefinition(structField.fieldType);\n return structMap;\n }, {})\n };\n default:\n throw new Error(`Unsupported action parameter type: ${JSON.stringify(parameterType)}`);\n }\n}\nfunction createModifiedEntities(addedObjects, modifiedObjects) {\n const entities = {};\n for (const key of addedObjects) {\n entities[key] = {\n created: true,\n modified: false\n };\n }\n for (const key of modifiedObjects) {\n if (entities[key]) {\n entities[key].modified = true;\n } else {\n entities[key] = {\n created: false,\n modified: true\n };\n }\n }\n return entities;\n}","/*\n * Copyright 2023 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\nexport function isNullableQueryDataType(input) {\n if (input.type === \"null\") {\n return true;\n }\n if (input.type === \"union\") {\n return input.unionTypes.some(t => isNullableQueryDataType(t));\n }\n return false;\n}","/*\n * Copyright 2023 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 { isNullableQueryDataType } from \"./isNullableQueryDataType.js\";\nexport function wireQueryDataTypeToQueryDataTypeDefinition(input) {\n switch (input.type) {\n case \"double\":\n case \"float\":\n case \"integer\":\n case \"long\":\n case \"attachment\":\n case \"boolean\":\n case \"date\":\n case \"string\":\n case \"timestamp\":\n return {\n type: input.type,\n nullable: false\n };\n case \"object\":\n return {\n type: \"object\",\n object: input.objectTypeApiName,\n nullable: false\n };\n case \"objectSet\":\n return {\n type: \"objectSet\",\n objectSet: input.objectTypeApiName,\n nullable: false\n };\n case \"interfaceObject\":\n return {\n type: \"interface\",\n interface: input.interfaceTypeApiName,\n nullable: false\n };\n case \"interfaceObjectSet\":\n return {\n type: \"interfaceObjectSet\",\n objectSet: input.interfaceTypeApiName,\n nullable: false\n };\n case \"array\":\n return {\n ...wireQueryDataTypeToQueryDataTypeDefinition(input.subType),\n multiplicity: true\n };\n case \"set\":\n return {\n type: \"set\",\n set: wireQueryDataTypeToQueryDataTypeDefinition(input.subType),\n nullable: false\n };\n case \"union\":\n const allowNulls = isNullableQueryDataType(input);\n\n // special case for a union where one half is nullable to skip the union step and just allow nulls directly\n if (allowNulls && input.unionTypes.length === 2) {\n const nonNull = input.unionTypes.find(t => t.type != null);\n if (nonNull) {\n return {\n ...wireQueryDataTypeToQueryDataTypeDefinition(nonNull),\n nullable: true\n };\n }\n }\n return {\n type: \"union\",\n union: input.unionTypes.reduce((acc, t) => {\n if (t.type === \"null\") {\n return acc;\n }\n acc.push(wireQueryDataTypeToQueryDataTypeDefinition(t));\n return acc;\n }, []),\n nullable: allowNulls\n };\n case \"struct\":\n return {\n type: \"struct\",\n struct: Object.fromEntries(input.fields.map(f => [f.name, wireQueryDataTypeToQueryDataTypeDefinition(f.fieldType)])),\n nullable: false\n };\n case \"twoDimensionalAggregation\":\n return {\n type: \"twoDimensionalAggregation\",\n twoDimensionalAggregation: get2DQueryAggregationProps(input),\n nullable: false\n };\n case \"threeDimensionalAggregation\":\n return {\n type: \"threeDimensionalAggregation\",\n threeDimensionalAggregation: get3DQueryAggregationProps(input),\n nullable: false\n };\n case \"entrySet\":\n const keyType = wireQueryDataTypeToQueryDataTypeDefinition(input.keyType);\n if (!validMapKeyTypes.includes(keyType.type)) {\n throw new Error(\"Map types with a key type of \" + keyType.type + \" are not supported\" + validMapKeyTypes.toString());\n }\n if (keyType.multiplicity === true) {\n throw new Error(\"Map types cannot have keys as arrays\");\n }\n return {\n type: \"map\",\n nullable: false,\n keyType,\n valueType: wireQueryDataTypeToQueryDataTypeDefinition(input.valueType)\n };\n case \"null\":\n case \"unsupported\":\n throw new Error(`Unable to process query because the server indicated an unsupported QueryDataType.type: ${input.type}. Please check that your query is using supported types.`);\n default:\n const _ = input;\n throw new Error(`Unsupported QueryDataType.type ${input.type}`);\n }\n}\nfunction get2DQueryAggregationProps(input) {\n if (input.keyType.type === \"range\") {\n return {\n keyType: input.keyType.type,\n keySubtype: input.keyType.subType.type,\n valueType: input.valueType.type\n };\n } else {\n if (guardInvalidKeyTypes(input.keyType)) {\n return {\n keyType: input.keyType.type,\n valueType: input.valueType.type\n };\n }\n throw new Error(`Cannot create 2D aggregation with ${input.keyType.type} as its type`);\n }\n}\nfunction get3DQueryAggregationProps(input) {\n if (input.keyType.type === \"range\") {\n return {\n keyType: input.keyType.type,\n keySubtype: input.keyType.subType.type,\n valueType: get2DQueryAggregationProps(input.valueType)\n };\n } else {\n if (guardInvalidKeyTypes(input.keyType)) {\n return {\n keyType: input.keyType.type,\n valueType: get2DQueryAggregationProps(input.valueType)\n };\n }\n throw new Error(`Cannot create 3D aggregation with ${input.keyType.type} as its type`);\n }\n}\n\n/**\n * Guard against aggregation key types that are allowed by the backend types but are illegal to actually use\n */\nfunction guardInvalidKeyTypes(key) {\n return key.type === \"string\" || key.type === \"boolean\";\n}\n\n/**\n * The set of all valid key types for maps. This includes all types that are represented by strings or numbers in the OSDK, and Ontology Objects.\n */\nconst validMapKeyTypes = [\"string\", \"object\", \"double\", \"float\", \"integer\", \"long\", \"date\", \"timestamp\", \"byte\", \"datetime\", \"decimal\", \"marking\", \"short\", \"objectType\"];","/*\n * Copyright 2023 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 { wireQueryDataTypeToQueryDataTypeDefinition } from \"./wireQueryDataTypeToQueryDataTypeDefinition.js\";\nexport function wireQueryTypeV2ToSdkQueryMetadata(input) {\n return {\n type: \"query\",\n apiName: input.apiName,\n description: input.description,\n displayName: input.displayName,\n version: input.version,\n parameters: Object.fromEntries(Object.entries(input.parameters).map(([name, parameter]) => [name, wireQueryParameterV2ToQueryParameterDefinition(parameter)])),\n output: wireQueryDataTypeToQueryDataTypeDefinition(input.output),\n rid: input.rid\n };\n}\nexport function wireQueryTypeV2ToSdkQueryDefinitionNoParams(input) {\n return {\n type: \"query\",\n apiName: input.apiName,\n description: input.description,\n displayName: input.displayName,\n version: input.version,\n rid: input.rid\n };\n}\nexport function wireQueryParameterV2ToQueryParameterDefinition(parameter) {\n return {\n description: parameter.description,\n ...wireQueryDataTypeToQueryDataTypeDefinition(parameter.dataType)\n };\n}"]}
@@ -22,12 +22,16 @@ export function __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(interfaceTyp
22
22
  apiName: interfaceType.apiName,
23
23
  displayName: interfaceType.displayName,
24
24
  description: interfaceType.description,
25
- implements: interfaceType.allExtendsInterfaces ?? interfaceType.extendsInterfaces,
25
+ implements: interfaceType.allExtendsInterfaces ? [...interfaceType.allExtendsInterfaces].sort((a, b) => a.localeCompare(b)) : interfaceType.extendsInterfaces ? [...interfaceType.extendsInterfaces].sort((a, b) => a.localeCompare(b)) : undefined,
26
26
  properties: Object.fromEntries(Object.entries(interfaceType.allProperties ?? interfaceType.properties).map(([key, value]) => {
27
27
  return [key, wirePropertyV2ToSdkPropertyDefinition(value, true, log)];
28
- }).filter(([key, value]) => value != null)),
29
- links: {},
30
- implementedBy: interfaceType.implementedByObjectTypes
28
+ }).filter(([_, value]) => value != null)),
29
+ links: Object.fromEntries(Object.entries(interfaceType.allLinks ?? interfaceType.links ?? {}).map(([linkApiName, linkType]) => [linkApiName, {
30
+ multiplicity: linkType.cardinality === "MANY",
31
+ targetTypeApiName: linkType.linkedEntityApiName.apiName,
32
+ targetType: linkType.linkedEntityApiName.type === "objectTypeApiName" ? "object" : "interface"
33
+ }])),
34
+ implementedBy: interfaceType.implementedByObjectTypes ? [...interfaceType.implementedByObjectTypes].sort((a, b) => a.localeCompare(b)) : interfaceType.implementedByObjectTypes
31
35
  };
32
36
  }
33
37
  //# sourceMappingURL=__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.js","names":["wirePropertyV2ToSdkPropertyDefinition","__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition","interfaceType","v2","log","type","rid","apiName","displayName","description","implements","allExtendsInterfaces","extendsInterfaces","properties","Object","fromEntries","entries","allProperties","map","key","value","filter","links","implementedBy","implementedByObjectTypes"],"sources":["__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.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 type { InterfaceMetadata } from \"@osdk/api\";\nimport type { InterfaceType } from \"@osdk/foundry.ontologies\";\nimport { wirePropertyV2ToSdkPropertyDefinition } from \"./wirePropertyV2ToSdkPropertyDefinition.js\";\n\nexport function __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(\n interfaceType: InterfaceType,\n v2: boolean,\n log?: { info: (msg: string) => void },\n): InterfaceMetadata {\n return {\n type: \"interface\",\n rid: interfaceType.rid,\n apiName: interfaceType.apiName,\n displayName: interfaceType.displayName,\n description: interfaceType.description,\n implements: interfaceType.allExtendsInterfaces\n ?? interfaceType.extendsInterfaces,\n properties: Object.fromEntries(\n Object.entries(interfaceType.allProperties ?? interfaceType.properties)\n .map((\n [key, value],\n ) => {\n return [\n key,\n wirePropertyV2ToSdkPropertyDefinition(\n value,\n true,\n log,\n ),\n ];\n }).filter(([key, value]) => value != null),\n ),\n links: {},\n implementedBy: interfaceType.implementedByObjectTypes,\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,SAASA,qCAAqC,QAAQ,4CAA4C;AAElG,OAAO,SAASC,mDAAmDA,CACjEC,aAA4B,EAC5BC,EAAW,EACXC,GAAqC,EAClB;EACnB,OAAO;IACLC,IAAI,EAAE,WAAW;IACjBC,GAAG,EAAEJ,aAAa,CAACI,GAAG;IACtBC,OAAO,EAAEL,aAAa,CAACK,OAAO;IAC9BC,WAAW,EAAEN,aAAa,CAACM,WAAW;IACtCC,WAAW,EAAEP,aAAa,CAACO,WAAW;IACtCC,UAAU,EAAER,aAAa,CAACS,oBAAoB,IACzCT,aAAa,CAACU,iBAAiB;IACpCC,UAAU,EAAEC,MAAM,CAACC,WAAW,CAC5BD,MAAM,CAACE,OAAO,CAACd,aAAa,CAACe,aAAa,IAAIf,aAAa,CAACW,UAAU,CAAC,CACpEK,GAAG,CAAC,CACH,CAACC,GAAG,EAAEC,KAAK,CAAC,KACT;MACH,OAAO,CACLD,GAAG,EACHnB,qCAAqC,CACnCoB,KAAK,EACL,IAAI,EACJhB,GACF,CAAC,CACF;IACH,CAAC,CAAC,CAACiB,MAAM,CAAC,CAAC,CAACF,GAAG,EAAEC,KAAK,CAAC,KAAKA,KAAK,IAAI,IAAI,CAC7C,CAAC;IACDE,KAAK,EAAE,CAAC,CAAC;IACTC,aAAa,EAAErB,aAAa,CAACsB;EAC/B,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"file":"__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.js","names":["wirePropertyV2ToSdkPropertyDefinition","__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition","interfaceType","v2","log","type","rid","apiName","displayName","description","implements","allExtendsInterfaces","sort","a","b","localeCompare","extendsInterfaces","undefined","properties","Object","fromEntries","entries","allProperties","map","key","value","filter","_","links","allLinks","linkApiName","linkType","multiplicity","cardinality","targetTypeApiName","linkedEntityApiName","targetType","implementedBy","implementedByObjectTypes"],"sources":["__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.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 type { InterfaceMetadata } from \"@osdk/api\";\nimport type { InterfaceType } from \"@osdk/foundry.ontologies\";\nimport { wirePropertyV2ToSdkPropertyDefinition } from \"./wirePropertyV2ToSdkPropertyDefinition.js\";\n\nexport function __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(\n interfaceType: InterfaceType,\n v2: boolean,\n log?: { info: (msg: string) => void },\n): InterfaceMetadata {\n return {\n type: \"interface\",\n rid: interfaceType.rid,\n apiName: interfaceType.apiName,\n displayName: interfaceType.displayName,\n description: interfaceType.description,\n implements: interfaceType.allExtendsInterfaces\n ? [...interfaceType.allExtendsInterfaces].sort((a, b) =>\n a.localeCompare(b)\n )\n : interfaceType.extendsInterfaces\n ? [...interfaceType.extendsInterfaces].sort((a, b) => a.localeCompare(b))\n : undefined,\n properties: Object.fromEntries(\n Object.entries(interfaceType.allProperties ?? interfaceType.properties)\n .map((\n [key, value],\n ) => {\n return [\n key,\n wirePropertyV2ToSdkPropertyDefinition(\n value,\n true,\n log,\n ),\n ];\n }).filter(([_, value]) => value != null),\n ),\n links: Object.fromEntries(\n Object.entries(interfaceType.allLinks ?? interfaceType.links ?? {}).map(\n (\n [linkApiName, linkType],\n ) => [linkApiName, {\n multiplicity: linkType.cardinality === \"MANY\",\n targetTypeApiName: linkType.linkedEntityApiName.apiName,\n targetType: linkType.linkedEntityApiName.type === \"objectTypeApiName\"\n ? \"object\"\n : \"interface\",\n }],\n ),\n ),\n implementedBy: interfaceType.implementedByObjectTypes\n ? [...interfaceType.implementedByObjectTypes].sort((a, b) =>\n a.localeCompare(b)\n )\n : interfaceType.implementedByObjectTypes,\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,SAASA,qCAAqC,QAAQ,4CAA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EAAE;MACjBE,YAAY,EAAED,QAAQ,CAACE,WAAW,KAAK,MAAM;MAC7CC,iBAAiB,EAAEH,QAAQ,CAACI,mBAAmB,CAAC5B,OAAO;MACvD6B,UAAU,EAAEL,QAAQ,CAACI,mBAAmB,CAAC9B,IAAI,KAAK,mBAAmB,GACjE,QAAQ,GACR;IACN,CAAC,CACH,CACF,CAAC;IACDgC,aAAa,EAAEnC,aAAa,CAACoC,wBAAwB,GACjD,CAAC,GAAGpC,aAAa,CAACoC,wBAAwB,CAAC,CAAC1B,IAAI,CAAC,CAACC,CAAC,EAAEC,CAAC,KACtDD,CAAC,CAACE,aAAa,CAACD,CAAC,CACnB,CAAC,GACCZ,aAAa,CAACoC;EACpB,CAAC;AACH","ignoreList":[]}
@@ -0,0 +1,72 @@
1
+ /*
2
+ * Copyright 2024 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 { __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition } from "./__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.js";
19
+ describe("__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition", () => {
20
+ it("sorts the implements array for stable output", () => {
21
+ const result = __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition({
22
+ apiName: "TestInterface",
23
+ rid: "testRid",
24
+ displayName: "Test Interface",
25
+ description: "A test interface",
26
+ properties: {},
27
+ allProperties: {},
28
+ extendsInterfaces: ["ParentZ", "ParentA", "ParentC"],
29
+ allExtendsInterfaces: ["ParentZ", "ParentA", "ParentC"],
30
+ implementedByObjectTypes: [],
31
+ links: {},
32
+ allLinks: {}
33
+ }, true);
34
+ expect(result.implements).toEqual(["ParentA", "ParentC", "ParentZ"]);
35
+ });
36
+ it("sorts the implementedBy array for stable output", () => {
37
+ const result = __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition({
38
+ apiName: "TestInterface",
39
+ rid: "testRid",
40
+ displayName: "Test Interface",
41
+ description: "A test interface",
42
+ properties: {},
43
+ allProperties: {},
44
+ extendsInterfaces: [],
45
+ allExtendsInterfaces: [],
46
+ implementedByObjectTypes: ["ObjectZ", "ObjectA", "ObjectC"],
47
+ links: {},
48
+ allLinks: {}
49
+ }, true);
50
+ expect(result.implementedBy).toEqual(["ObjectA", "ObjectC", "ObjectZ"]);
51
+ });
52
+ it("preserves empty arrays", () => {
53
+ const result = __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition({
54
+ apiName: "TestInterface",
55
+ rid: "testRid",
56
+ displayName: "Test Interface",
57
+ description: "A test interface",
58
+ properties: {},
59
+ allProperties: {},
60
+ extendsInterfaces: [],
61
+ allExtendsInterfaces: [],
62
+ implementedByObjectTypes: [],
63
+ links: {},
64
+ allLinks: {}
65
+ }, true);
66
+
67
+ // Empty arrays should remain as empty arrays
68
+ expect(result.implements).toEqual([]);
69
+ expect(result.implementedBy).toEqual([]);
70
+ });
71
+ });
72
+ //# sourceMappingURL=__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.test.js","names":["describe","expect","it","__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition","result","apiName","rid","displayName","description","properties","allProperties","extendsInterfaces","allExtendsInterfaces","implementedByObjectTypes","links","allLinks","implements","toEqual","implementedBy"],"sources":["__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.test.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 { describe, expect, it } from \"vitest\";\nimport { __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition } from \"./__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.js\";\n\ndescribe(\"__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition\", () => {\n it(\"sorts the implements array for stable output\", () => {\n const result = __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition({\n apiName: \"TestInterface\",\n rid: \"testRid\",\n displayName: \"Test Interface\",\n description: \"A test interface\",\n properties: {},\n allProperties: {},\n extendsInterfaces: [\"ParentZ\", \"ParentA\", \"ParentC\"],\n allExtendsInterfaces: [\"ParentZ\", \"ParentA\", \"ParentC\"],\n implementedByObjectTypes: [],\n links: {},\n allLinks: {},\n }, true);\n\n expect(result.implements).toEqual([\"ParentA\", \"ParentC\", \"ParentZ\"]);\n });\n\n it(\"sorts the implementedBy array for stable output\", () => {\n const result = __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition({\n apiName: \"TestInterface\",\n rid: \"testRid\",\n displayName: \"Test Interface\",\n description: \"A test interface\",\n properties: {},\n allProperties: {},\n extendsInterfaces: [],\n allExtendsInterfaces: [],\n implementedByObjectTypes: [\"ObjectZ\", \"ObjectA\", \"ObjectC\"],\n links: {},\n allLinks: {},\n }, true);\n\n expect(result.implementedBy).toEqual([\"ObjectA\", \"ObjectC\", \"ObjectZ\"]);\n });\n\n it(\"preserves empty arrays\", () => {\n const result = __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition({\n apiName: \"TestInterface\",\n rid: \"testRid\",\n displayName: \"Test Interface\",\n description: \"A test interface\",\n properties: {},\n allProperties: {},\n extendsInterfaces: [],\n allExtendsInterfaces: [],\n implementedByObjectTypes: [],\n links: {},\n allLinks: {},\n }, true);\n\n // Empty arrays should remain as empty arrays\n expect(result.implements).toEqual([]);\n expect(result.implementedBy).toEqual([]);\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AAC7C,SAASC,mDAAmD,QAAQ,0DAA0D;AAE9HH,QAAQ,CAAC,qDAAqD,EAAE,MAAM;EACpEE,EAAE,CAAC,8CAA8C,EAAE,MAAM;IACvD,MAAME,MAAM,GAAGD,mDAAmD,CAAC;MACjEE,OAAO,EAAE,eAAe;MACxBC,GAAG,EAAE,SAAS;MACdC,WAAW,EAAE,gBAAgB;MAC7BC,WAAW,EAAE,kBAAkB;MAC/BC,UAAU,EAAE,CAAC,CAAC;MACdC,aAAa,EAAE,CAAC,CAAC;MACjBC,iBAAiB,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC;MACpDC,oBAAoB,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC;MACvDC,wBAAwB,EAAE,EAAE;MAC5BC,KAAK,EAAE,CAAC,CAAC;MACTC,QAAQ,EAAE,CAAC;IACb,CAAC,EAAE,IAAI,CAAC;IAERd,MAAM,CAACG,MAAM,CAACY,UAAU,CAAC,CAACC,OAAO,CAAC,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;EACtE,CAAC,CAAC;EAEFf,EAAE,CAAC,iDAAiD,EAAE,MAAM;IAC1D,MAAME,MAAM,GAAGD,mDAAmD,CAAC;MACjEE,OAAO,EAAE,eAAe;MACxBC,GAAG,EAAE,SAAS;MACdC,WAAW,EAAE,gBAAgB;MAC7BC,WAAW,EAAE,kBAAkB;MAC/BC,UAAU,EAAE,CAAC,CAAC;MACdC,aAAa,EAAE,CAAC,CAAC;MACjBC,iBAAiB,EAAE,EAAE;MACrBC,oBAAoB,EAAE,EAAE;MACxBC,wBAAwB,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC;MAC3DC,KAAK,EAAE,CAAC,CAAC;MACTC,QAAQ,EAAE,CAAC;IACb,CAAC,EAAE,IAAI,CAAC;IAERd,MAAM,CAACG,MAAM,CAACc,aAAa,CAAC,CAACD,OAAO,CAAC,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;EACzE,CAAC,CAAC;EAEFf,EAAE,CAAC,wBAAwB,EAAE,MAAM;IACjC,MAAME,MAAM,GAAGD,mDAAmD,CAAC;MACjEE,OAAO,EAAE,eAAe;MACxBC,GAAG,EAAE,SAAS;MACdC,WAAW,EAAE,gBAAgB;MAC7BC,WAAW,EAAE,kBAAkB;MAC/BC,UAAU,EAAE,CAAC,CAAC;MACdC,aAAa,EAAE,CAAC,CAAC;MACjBC,iBAAiB,EAAE,EAAE;MACrBC,oBAAoB,EAAE,EAAE;MACxBC,wBAAwB,EAAE,EAAE;MAC5BC,KAAK,EAAE,CAAC,CAAC;MACTC,QAAQ,EAAE,CAAC;IACb,CAAC,EAAE,IAAI,CAAC;;IAER;IACAd,MAAM,CAACG,MAAM,CAACY,UAAU,CAAC,CAACC,OAAO,CAAC,EAAE,CAAC;IACrChB,MAAM,CAACG,MAAM,CAACc,aAAa,CAAC,CAACD,OAAO,CAAC,EAAE,CAAC;EAC1C,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -32,14 +32,14 @@ export function wireObjectTypeFullMetadataToSdkObjectMetadata(objectTypeWithLink
32
32
  description: objectTypeWithLink.objectType.description,
33
33
  primaryKeyApiName: objectTypeWithLink.objectType.primaryKey,
34
34
  primaryKeyType: wirePropertyV2ToSdkPrimaryKeyTypeDefinition(objectTypeWithLink.objectType.properties[objectTypeWithLink.objectType.primaryKey]),
35
- links: Object.fromEntries(objectTypeWithLink.linkTypes.map(linkType => {
35
+ links: Object.fromEntries([...objectTypeWithLink.linkTypes].sort((a, b) => a.apiName.localeCompare(b.apiName)).map(linkType => {
36
36
  return [linkType.apiName, {
37
37
  multiplicity: linkType.cardinality === "MANY",
38
38
  targetType: linkType.objectTypeApiName
39
39
  }];
40
40
  })),
41
- properties: Object.fromEntries(Object.entries(objectTypeWithLink.objectType.properties).map(([key, value]) => [key, wirePropertyV2ToSdkPropertyDefinition(value, !(v2 && objectTypeWithLink.objectType.primaryKey === key), log)]).filter(([key, value]) => value != null)),
42
- implements: objectTypeWithLink.implementsInterfaces,
41
+ properties: Object.fromEntries(Object.entries(objectTypeWithLink.objectType.properties).map(([key, value]) => [key, wirePropertyV2ToSdkPropertyDefinition(value, !(v2 && objectTypeWithLink.objectType.primaryKey === key), log)]).filter(([_, value]) => value != null)),
42
+ implements: objectTypeWithLink.implementsInterfaces ? [...objectTypeWithLink.implementsInterfaces].sort((a, b) => a.localeCompare(b)) : objectTypeWithLink.implementsInterfaces,
43
43
  interfaceMap,
44
44
  inverseInterfaceMap: Object.fromEntries(Object.entries(interfaceMap).map(([interfaceApiName, props]) => [interfaceApiName, invertProps(props)])),
45
45
  icon: supportedIconTypes.includes(objectTypeWithLink.objectType.icon.type) ? objectTypeWithLink.objectType.icon : undefined,
@@ -1 +1 @@
1
- {"version":3,"file":"wireObjectTypeFullMetadataToSdkObjectMetadata.js","names":["wirePropertyV2ToSdkPrimaryKeyTypeDefinition","wirePropertyV2ToSdkPropertyDefinition","wireObjectTypeFullMetadataToSdkObjectMetadata","objectTypeWithLink","v2","log","objectType","properties","primaryKey","undefined","Error","apiName","implementsInterfaces2","implementsInterfaces","interfaceMap","Object","fromEntries","entries","map","interfaceApiName","impl","type","description","primaryKeyApiName","primaryKeyType","links","linkTypes","linkType","multiplicity","cardinality","targetType","objectTypeApiName","key","value","filter","implements","inverseInterfaceMap","props","invertProps","icon","supportedIconTypes","includes","titleProperty","displayName","pluralDisplayName","status","ensureStringEnumSupportedOrUndefined","supportedReleaseStatus","rid","visibility","supportedObjectTypeVisibility","a","k","v","supportedValues"],"sources":["wireObjectTypeFullMetadataToSdkObjectMetadata.ts"],"sourcesContent":["/*\n * Copyright 2023 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 { ObjectMetadata } from \"@osdk/api\";\nimport type {\n ObjectTypeFullMetadata,\n PropertyApiName,\n PropertyV2,\n} from \"@osdk/foundry.ontologies\";\nimport { wirePropertyV2ToSdkPrimaryKeyTypeDefinition } from \"./wirePropertyV2ToSdkPrimaryKeyTypeDefinition.js\";\nimport { wirePropertyV2ToSdkPropertyDefinition } from \"./wirePropertyV2ToSdkPropertyDefinition.js\";\n\nexport function wireObjectTypeFullMetadataToSdkObjectMetadata(\n objectTypeWithLink: ObjectTypeFullMetadata & {\n objectType: {\n properties: Record<PropertyApiName, PropertyV2 & { nullable?: boolean }>;\n };\n },\n v2: boolean,\n log?: { info: (msg: string) => void },\n): ObjectMetadata {\n if (\n objectTypeWithLink.objectType\n .properties[objectTypeWithLink.objectType.primaryKey] === undefined\n ) {\n throw new Error(\n `Primary key ${objectTypeWithLink.objectType.primaryKey} not found in ${objectTypeWithLink.objectType.apiName}`,\n );\n }\n\n // saved ontology.json files may not have this implementsInterfaces2 so we need to handle\n if (\n objectTypeWithLink.implementsInterfaces2 == null\n && objectTypeWithLink.implementsInterfaces != null\n ) {\n throw new Error(\n \"Your ontology.json file is missing the implementsInterfaces2 field. Please regenerate it.\",\n );\n }\n\n const interfaceMap = objectTypeWithLink.implementsInterfaces2\n ? Object.fromEntries(\n Object.entries(objectTypeWithLink.implementsInterfaces2).map(\n ([interfaceApiName, impl]) => [interfaceApiName, impl.properties],\n ),\n )\n : {};\n\n return {\n type: \"object\",\n apiName: objectTypeWithLink.objectType.apiName,\n description: objectTypeWithLink.objectType.description,\n primaryKeyApiName: objectTypeWithLink.objectType.primaryKey,\n primaryKeyType: wirePropertyV2ToSdkPrimaryKeyTypeDefinition(\n objectTypeWithLink.objectType\n .properties[objectTypeWithLink.objectType.primaryKey],\n ),\n links: Object.fromEntries(objectTypeWithLink.linkTypes.map(linkType => {\n return [linkType.apiName, {\n multiplicity: linkType.cardinality === \"MANY\",\n targetType: linkType.objectTypeApiName,\n }];\n })),\n properties: Object.fromEntries(\n Object.entries(objectTypeWithLink.objectType.properties).map((\n [key, value],\n ) => [\n key,\n wirePropertyV2ToSdkPropertyDefinition(\n value,\n !(v2 && objectTypeWithLink.objectType.primaryKey === key),\n log,\n ),\n ]).filter(([key, value]) => value != null),\n ),\n implements: objectTypeWithLink.implementsInterfaces as string[],\n interfaceMap,\n inverseInterfaceMap: Object.fromEntries(\n Object.entries(interfaceMap).map((\n [interfaceApiName, props],\n ) => [interfaceApiName, invertProps(props)]),\n ),\n icon: supportedIconTypes.includes(objectTypeWithLink.objectType.icon.type)\n ? objectTypeWithLink.objectType.icon\n : undefined,\n titleProperty: objectTypeWithLink.objectType.titleProperty,\n displayName: objectTypeWithLink.objectType.displayName,\n pluralDisplayName: objectTypeWithLink.objectType.pluralDisplayName,\n status: ensureStringEnumSupportedOrUndefined(\n objectTypeWithLink.objectType.status,\n supportedReleaseStatus,\n ),\n rid: objectTypeWithLink.objectType.rid,\n visibility: ensureStringEnumSupportedOrUndefined(\n objectTypeWithLink.objectType.visibility,\n supportedObjectTypeVisibility,\n ),\n };\n}\n\nfunction invertProps(\n a?: Record<string, string>,\n): typeof a extends undefined ? typeof a : Record<string, string> {\n return (a\n ? Object.fromEntries(Object.entries(a).map(([k, v]) => [v, k]))\n : undefined) as typeof a extends undefined ? typeof a\n : Record<string, string>;\n}\n\nexport const supportedIconTypes = [\"blueprint\"] as const;\n\nexport const supportedReleaseStatus = [\n \"ACTIVE\",\n \"EXPERIMENTAL\",\n \"DEPRECATED\",\n \"ENDORSED\",\n] as const;\n\nexport const supportedObjectTypeVisibility = [\n \"NORMAL\",\n \"PROMINENT\",\n \"HIDDEN\",\n] as const;\n\nexport function ensureStringEnumSupportedOrUndefined<T extends string>(\n value: T | undefined,\n supportedValues: readonly string[],\n): T | undefined {\n return value && supportedValues.includes(value) ? value : undefined;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAQA,SAASA,2CAA2C,QAAQ,kDAAkD;AAC9G,SAASC,qCAAqC,QAAQ,4CAA4C;AAElG,OAAO,SAASC,6CAA6CA,CAC3DC,kBAIC,EACDC,EAAW,EACXC,GAAqC,EACrB;EAChB,IACEF,kBAAkB,CAACG,UAAU,CAC1BC,UAAU,CAACJ,kBAAkB,CAACG,UAAU,CAACE,UAAU,CAAC,KAAKC,SAAS,EACrE;IACA,MAAM,IAAIC,KAAK,CACb,eAAeP,kBAAkB,CAACG,UAAU,CAACE,UAAU,iBAAiBL,kBAAkB,CAACG,UAAU,CAACK,OAAO,EAC/G,CAAC;EACH;;EAEA;EACA,IACER,kBAAkB,CAACS,qBAAqB,IAAI,IAAI,IAC7CT,kBAAkB,CAACU,oBAAoB,IAAI,IAAI,EAClD;IACA,MAAM,IAAIH,KAAK,CACb,2FACF,CAAC;EACH;EAEA,MAAMI,YAAY,GAAGX,kBAAkB,CAACS,qBAAqB,GACzDG,MAAM,CAACC,WAAW,CAClBD,MAAM,CAACE,OAAO,CAACd,kBAAkB,CAACS,qBAAqB,CAAC,CAACM,GAAG,CAC1D,CAAC,CAACC,gBAAgB,EAAEC,IA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AAoB,EACpBqB,eAAkC,EACnB;EACf,OAAOrB,KAAK,IAAIqB,eAAe,CAACb,QAAQ,CAACR,KAAK,CAAC,GAAGA,KAAK,GAAGxB,SAAS;AACrE","ignoreList":[]}
1
+ {"version":3,"file":"wireObjectTypeFullMetadataToSdkObjectMetadata.js","names":["wirePropertyV2ToSdkPrimaryKeyTypeDefinition","wirePropertyV2ToSdkPropertyDefinition","wireObjectTypeFullMetadataToSdkObjectMetadata","objectTypeWithLink","v2","log","objectType","properties","primaryKey","undefined","Error","apiName","implementsInterfaces2","implementsInterfaces","interfaceMap","Object","fromEntries","entries","map","interfaceApiName","impl","type","description","primaryKeyApiName","primaryKeyType","links","linkTypes","sort","a","b","localeCompare","linkType","multiplicity","cardinality","targetType","objectTypeApiName","key","value","filter","_","implements","inverseInterfaceMap","props","invertProps","icon","supportedIconTypes","includes","titleProperty","displayName","pluralDisplayName","status","ensureStringEnumSupportedOrUndefined","supportedReleaseStatus","rid","visibility","supportedObjectTypeVisibility","k","v","supportedValues"],"sources":["wireObjectTypeFullMetadataToSdkObjectMetadata.ts"],"sourcesContent":["/*\n * Copyright 2023 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 { ObjectMetadata } from \"@osdk/api\";\nimport type {\n ObjectTypeFullMetadata,\n PropertyApiName,\n PropertyV2,\n} from \"@osdk/foundry.ontologies\";\nimport { wirePropertyV2ToSdkPrimaryKeyTypeDefinition } from \"./wirePropertyV2ToSdkPrimaryKeyTypeDefinition.js\";\nimport { wirePropertyV2ToSdkPropertyDefinition } from \"./wirePropertyV2ToSdkPropertyDefinition.js\";\n\nexport function wireObjectTypeFullMetadataToSdkObjectMetadata(\n objectTypeWithLink: ObjectTypeFullMetadata & {\n objectType: {\n properties: Record<PropertyApiName, PropertyV2 & { nullable?: boolean }>;\n };\n },\n v2: boolean,\n log?: { info: (msg: string) => void },\n): ObjectMetadata {\n if (\n objectTypeWithLink.objectType\n .properties[objectTypeWithLink.objectType.primaryKey] === undefined\n ) {\n throw new Error(\n `Primary key ${objectTypeWithLink.objectType.primaryKey} not found in ${objectTypeWithLink.objectType.apiName}`,\n );\n }\n\n // saved ontology.json files may not have this implementsInterfaces2 so we need to handle\n if (\n objectTypeWithLink.implementsInterfaces2 == null\n && objectTypeWithLink.implementsInterfaces != null\n ) {\n throw new Error(\n \"Your ontology.json file is missing the implementsInterfaces2 field. Please regenerate it.\",\n );\n }\n\n const interfaceMap = objectTypeWithLink.implementsInterfaces2\n ? Object.fromEntries(\n Object.entries(objectTypeWithLink.implementsInterfaces2).map(\n ([interfaceApiName, impl]) => [interfaceApiName, impl.properties],\n ),\n )\n : {};\n\n return {\n type: \"object\",\n apiName: objectTypeWithLink.objectType.apiName,\n description: objectTypeWithLink.objectType.description,\n primaryKeyApiName: objectTypeWithLink.objectType.primaryKey,\n primaryKeyType: wirePropertyV2ToSdkPrimaryKeyTypeDefinition(\n objectTypeWithLink.objectType\n .properties[objectTypeWithLink.objectType.primaryKey],\n ),\n links: Object.fromEntries(\n [...objectTypeWithLink.linkTypes].sort((a, b) =>\n a.apiName.localeCompare(b.apiName)\n ).map(linkType => {\n return [linkType.apiName, {\n multiplicity: linkType.cardinality === \"MANY\",\n targetType: linkType.objectTypeApiName,\n }];\n }),\n ),\n properties: Object.fromEntries(\n Object.entries(objectTypeWithLink.objectType.properties).map((\n [key, value],\n ) => [\n key,\n wirePropertyV2ToSdkPropertyDefinition(\n value,\n !(v2 && objectTypeWithLink.objectType.primaryKey === key),\n log,\n ),\n ]).filter(([_, value]) => value != null),\n ),\n implements: objectTypeWithLink.implementsInterfaces\n ? [...objectTypeWithLink.implementsInterfaces].sort((a, b) =>\n a.localeCompare(b)\n )\n : objectTypeWithLink.implementsInterfaces,\n interfaceMap,\n inverseInterfaceMap: Object.fromEntries(\n Object.entries(interfaceMap).map((\n [interfaceApiName, props],\n ) => [interfaceApiName, invertProps(props)]),\n ),\n icon: supportedIconTypes.includes(objectTypeWithLink.objectType.icon.type)\n ? objectTypeWithLink.objectType.icon\n : undefined,\n titleProperty: objectTypeWithLink.objectType.titleProperty,\n displayName: objectTypeWithLink.objectType.displayName,\n pluralDisplayName: objectTypeWithLink.objectType.pluralDisplayName,\n status: ensureStringEnumSupportedOrUndefined(\n objectTypeWithLink.objectType.status,\n supportedReleaseStatus,\n ),\n rid: objectTypeWithLink.objectType.rid,\n visibility: ensureStringEnumSupportedOrUndefined(\n objectTypeWithLink.objectType.visibility,\n supportedObjectTypeVisibility,\n ),\n };\n}\n\nfunction invertProps(\n a?: Record<string, string>,\n): typeof a extends undefined ? typeof a : Record<string, string> {\n return (a\n ? Object.fromEntries(Object.entries(a).map(([k, v]) => [v, k]))\n : undefined) as typeof a extends undefined ? typeof a\n : Record<string, string>;\n}\n\nexport const supportedIconTypes = [\"blueprint\"] as const;\n\nexport const supportedReleaseStatus = [\n \"ACTIVE\",\n \"EXPERIMENTAL\",\n \"DEPRECATED\",\n \"ENDORSED\",\n] as const;\n\nexport const supportedObjectTypeVisibility = [\n \"NORMAL\",\n \"PROMINENT\",\n \"HIDDEN\",\n] as const;\n\nexport function ensureStringEnumSupportedOrUndefined<T extends string>(\n value: T | undefined,\n supportedValues: readonly string[],\n): T | undefined {\n return value && supportedValues.includes(value) ? value : undefined;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAQA,SAASA,2CAA2C,QAAQ,kDAAkD;AAC9G,SAASC,qCAAqC,QAAQ,4CAA4C;AAElG,OAAO,SAASC,6CAA6CA,CAC3DC,kBAIC,EACDC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E5C,kBAAkB,CAACG,UAAU,CAACyC,aAAa;IAC1DC,WAAW,EAAE7C,kBAAkB,CAACG,UAAU,CAAC0C,WAAW;IACtDC,iBAAiB,EAAE9C,kBAAkB,CAACG,UAAU,CAAC2C,iBAAiB;IAClEC,MAAM,EAAEC,oCAAoC,CAC1ChD,kBAAkB,CAACG,UAAU,CAAC4C,MAAM,EACpCE,sBACF,CAAC;IACDC,GAAG,EAAElD,kBAAkB,CAACG,UAAU,CAAC+C,GAAG;IACtCC,UAAU,EAAEH,oCAAoC,CAC9ChD,kBAAkB,CAACG,UAAU,CAACgD,UAAU,EACxCC,6BACF;EACF,CAAC;AACH;AAEA,SAASZ,WAAWA,CAClBf,CAA0B,EACsC;EAChE,OAAQA,CAAC,GACLb,MAAM,CAACC,WAAW,CAACD,MAAM,CAACE,OAAO,CAACW,CAAC,CAAC,CAACV,GAAG,CAAC,CAAC,CAACsC,CAAC,EAAEC,CAAC,CAAC,KAAK,CAACA,CAAC,EAAED,CAAC,CAAC,CAAC,CAAC,GAC7D/C,SAAS;AAEf;AAEA,OAAO,MAAMoC,kBAAkB,GAAG,CAAC,WAAW,CAAU;AAExD,OAAO,MAAMO,sBAAsB,GAAG,CACpC,QAAQ,EACR,cAAc,EACd,YAAY,EACZ,UAAU,CACF;AAEV,OAAO,MAAMG,6BAA6B,GAAG,CAC3C,QAAQ,EACR,WAAW,EACX,QAAQ,CACA;AAEV,OAAO,SAASJ,oCAAoCA,CAClDd,KAAoB,EACpBqB,eAAkC,EACnB;EACf,OAAOrB,KAAK,IAAIqB,eAAe,CAACZ,QAAQ,CAACT,KAAK,CAAC,GAAGA,KAAK,GAAG5B,SAAS;AACrE","ignoreList":[]}
@@ -123,5 +123,141 @@ describe(wireObjectTypeFullMetadataToSdkObjectMetadata, () => {
123
123
  expect(result.visibility).toBeUndefined();
124
124
  expect(result.icon).toBeUndefined();
125
125
  });
126
+ it("sorts the implements array for stable output", () => {
127
+ const result = wireObjectTypeFullMetadataToSdkObjectMetadata({
128
+ implementsInterfaces: ["InterfaceZ", "InterfaceA", "InterfaceC"],
129
+ implementsInterfaces2: {
130
+ "InterfaceZ": {
131
+ properties: {}
132
+ },
133
+ "InterfaceA": {
134
+ properties: {}
135
+ },
136
+ "InterfaceC": {
137
+ properties: {}
138
+ }
139
+ },
140
+ linkTypes: [],
141
+ objectType: {
142
+ apiName: "apiName",
143
+ description: "description",
144
+ displayName: "displayName",
145
+ pluralDisplayName: "displayNames",
146
+ icon: {
147
+ type: "blueprint",
148
+ name: "blueprint",
149
+ color: "blue"
150
+ },
151
+ primaryKey: "primaryKey",
152
+ properties: {
153
+ primaryKey: {
154
+ dataType: {
155
+ type: "string"
156
+ },
157
+ "rid": "rid"
158
+ }
159
+ },
160
+ rid: "rid",
161
+ status: "ACTIVE",
162
+ titleProperty: "primaryKey"
163
+ },
164
+ sharedPropertyTypeMapping: {}
165
+ }, true);
166
+
167
+ // Check that the array is sorted alphabetically
168
+ expect(result.implements).toEqual(["InterfaceA", "InterfaceC", "InterfaceZ"]);
169
+ });
170
+ it("sorts the linkTypes array for stable output", () => {
171
+ const result = wireObjectTypeFullMetadataToSdkObjectMetadata({
172
+ implementsInterfaces: [],
173
+ implementsInterfaces2: {},
174
+ linkTypes: [{
175
+ apiName: "linkZ",
176
+ cardinality: "ONE",
177
+ objectTypeApiName: "TargetZ",
178
+ displayName: "LinkZ",
179
+ status: "ACTIVE",
180
+ linkTypeRid: "ridZ"
181
+ }, {
182
+ apiName: "linkA",
183
+ cardinality: "MANY",
184
+ objectTypeApiName: "TargetA",
185
+ displayName: "LinkA",
186
+ status: "ACTIVE",
187
+ linkTypeRid: "ridA"
188
+ }, {
189
+ apiName: "linkC",
190
+ cardinality: "ONE",
191
+ objectTypeApiName: "TargetC",
192
+ displayName: "LinkC",
193
+ status: "ACTIVE",
194
+ linkTypeRid: "ridC"
195
+ }],
196
+ objectType: {
197
+ apiName: "apiName",
198
+ description: "description",
199
+ displayName: "displayName",
200
+ pluralDisplayName: "displayNames",
201
+ icon: {
202
+ type: "blueprint",
203
+ name: "blueprint",
204
+ color: "blue"
205
+ },
206
+ primaryKey: "primaryKey",
207
+ properties: {
208
+ primaryKey: {
209
+ dataType: {
210
+ type: "string"
211
+ },
212
+ "rid": "rid"
213
+ }
214
+ },
215
+ rid: "rid",
216
+ status: "ACTIVE",
217
+ titleProperty: "primaryKey"
218
+ },
219
+ sharedPropertyTypeMapping: {}
220
+ }, true);
221
+
222
+ // Get the link keys in the order they appear in the result
223
+ const linkKeys = Object.keys(result.links);
224
+
225
+ // Check that the links are sorted alphabetically by apiName
226
+ expect(linkKeys).toEqual(["linkA", "linkC", "linkZ"]);
227
+ });
228
+ it("preserves empty arrays", () => {
229
+ const result = wireObjectTypeFullMetadataToSdkObjectMetadata({
230
+ implementsInterfaces: [],
231
+ implementsInterfaces2: {},
232
+ linkTypes: [],
233
+ objectType: {
234
+ apiName: "apiName",
235
+ description: "description",
236
+ displayName: "displayName",
237
+ pluralDisplayName: "displayNames",
238
+ icon: {
239
+ type: "blueprint",
240
+ name: "blueprint",
241
+ color: "blue"
242
+ },
243
+ primaryKey: "primaryKey",
244
+ properties: {
245
+ primaryKey: {
246
+ dataType: {
247
+ type: "string"
248
+ },
249
+ "rid": "rid"
250
+ }
251
+ },
252
+ rid: "rid",
253
+ status: "ACTIVE",
254
+ titleProperty: "primaryKey"
255
+ },
256
+ sharedPropertyTypeMapping: {}
257
+ }, true);
258
+
259
+ // Check that empty array is preserved
260
+ expect(result.implements).toEqual([]);
261
+ });
126
262
  });
127
263
  //# sourceMappingURL=wireObjectTypeFullMetadataToSdkObjectMetadata.test.js.map