@osdk/generator-converters 2.22.0 → 2.23.0-main-9fb5afb7955ddffd2b9a89d03d6c2ca3528e371c
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 +8 -0
- package/build/browser/GeneratorError.js +30 -0
- package/build/browser/GeneratorError.js.map +1 -0
- package/build/browser/index.js +1 -0
- package/build/browser/index.js.map +1 -1
- package/build/browser/wireActionTypeV2ToSdkActionMetadata.js +4 -1
- package/build/browser/wireActionTypeV2ToSdkActionMetadata.js.map +1 -1
- package/build/browser/wireObjectTypeFullMetadataToSdkObjectMetadata.js +5 -1
- package/build/browser/wireObjectTypeFullMetadataToSdkObjectMetadata.js.map +1 -1
- package/build/cjs/index.cjs +18 -2
- package/build/cjs/index.cjs.map +1 -1
- package/build/cjs/index.d.cts +12 -1
- package/build/esm/GeneratorError.js +30 -0
- package/build/esm/GeneratorError.js.map +1 -0
- package/build/esm/index.js +1 -0
- package/build/esm/index.js.map +1 -1
- package/build/esm/wireActionTypeV2ToSdkActionMetadata.js +4 -1
- package/build/esm/wireActionTypeV2ToSdkActionMetadata.js.map +1 -1
- package/build/esm/wireObjectTypeFullMetadataToSdkObjectMetadata.js +5 -1
- package/build/esm/wireObjectTypeFullMetadataToSdkObjectMetadata.js.map +1 -1
- package/build/types/GeneratorError.d.ts +10 -0
- package/build/types/GeneratorError.d.ts.map +1 -0
- package/build/types/index.d.ts +1 -0
- package/build/types/index.d.ts.map +1 -1
- package/build/types/wireActionTypeV2ToSdkActionMetadata.d.ts.map +1 -1
- package/build/types/wireObjectTypeFullMetadataToSdkObjectMetadata.d.ts.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @osdk/generator-converters
|
|
2
2
|
|
|
3
|
+
## 2.23.0-main-9fb5afb7955ddffd2b9a89d03d6c2ca3528e371c
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 9fb5afb: Emit structured `service.1` JSON logs to stdout for log forwarders, with timing for ontology metadata loading and OSDK package generation phases. Reads `JOB_ID` and `TRACE_ID` from env and threads them into every record's params for cross-process correlation. The previous human-readable console output (via consola) has been removed; the CLI now exits with a non-zero status code on failure.
|
|
8
|
+
- Updated dependencies [198f219]
|
|
9
|
+
- @osdk/api@2.23.0-main-9fb5afb7955ddffd2b9a89d03d6c2ca3528e371c
|
|
10
|
+
|
|
3
11
|
## 2.22.0
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026 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
|
+
/**
|
|
18
|
+
* An error thrown during SDK generation whose message is safe to log directly.
|
|
19
|
+
* User-controlled data (API names, display names, etc.) goes in `unsafeParams`;
|
|
20
|
+
* safe diagnostic context (RIDs, counts, type identifiers) goes in `params`.
|
|
21
|
+
*/
|
|
22
|
+
export class GeneratorError extends Error {
|
|
23
|
+
constructor(message, unsafeParams, params) {
|
|
24
|
+
super(message);
|
|
25
|
+
this.name = "GeneratorError";
|
|
26
|
+
this.unsafeParams = unsafeParams;
|
|
27
|
+
this.params = params;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=GeneratorError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GeneratorError.js","names":["GeneratorError","Error","constructor","message","unsafeParams","params","name"],"sources":["GeneratorError.ts"],"sourcesContent":["/*\n * Copyright 2026 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\n/**\n * An error thrown during SDK generation whose message is safe to log directly.\n * User-controlled data (API names, display names, etc.) goes in `unsafeParams`;\n * safe diagnostic context (RIDs, counts, type identifiers) goes in `params`.\n */\nexport class GeneratorError extends Error {\n readonly params?: Record<string, unknown>;\n readonly unsafeParams?: Record<string, unknown>;\n\n constructor(\n message: string,\n unsafeParams?: Record<string, unknown>,\n params?: Record<string, unknown>,\n ) {\n super(message);\n this.name = \"GeneratorError\";\n this.unsafeParams = unsafeParams;\n this.params = params;\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,cAAc,SAASC,KAAK,CAAC;EAIxCC,WAAWA,CACTC,OAAe,EACfC,YAAsC,EACtCC,MAAgC,EAChC;IACA,KAAK,CAACF,OAAO,CAAC;IACd,IAAI,CAACG,IAAI,GAAG,gBAAgB;IAC5B,IAAI,CAACF,YAAY,GAAGA,YAAY;IAChC,IAAI,CAACC,MAAM,GAAGA,MAAM;EACtB;AACF","ignoreList":[]}
|
package/build/browser/index.js
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
+
export { GeneratorError } from "./GeneratorError.js";
|
|
17
18
|
export { wireActionTypeV2ToSdkActionMetadata } from "./wireActionTypeV2ToSdkActionMetadata.js";
|
|
18
19
|
export { __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition, wireInterfaceTypeV2ToSdkObjectDefinition } from "./wireInterfaceTypeV2ToSdkObjectDefinition.js";
|
|
19
20
|
export { wireObjectTypeFullMetadataToSdkObjectMetadata } from "./wireObjectTypeFullMetadataToSdkObjectMetadata.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["wireActionTypeV2ToSdkActionMetadata","__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition","wireInterfaceTypeV2ToSdkObjectDefinition","wireObjectTypeFullMetadataToSdkObjectMetadata","wirePropertyV2ToSdkPropertyDefinition","wireQueryDataTypeToQueryDataTypeDefinition","wireQueryTypeV2ToSdkQueryMetadata","wireQueryParameterV2ToQueryParameterDefinition","wireQueryTypeV2ToSdkQueryDefinitionNoParams"],"sources":["index.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\nexport { wireActionTypeV2ToSdkActionMetadata } from \"./wireActionTypeV2ToSdkActionMetadata.js\";\nexport {\n __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition,\n wireInterfaceTypeV2ToSdkObjectDefinition,\n} from \"./wireInterfaceTypeV2ToSdkObjectDefinition.js\";\nexport { wireObjectTypeFullMetadataToSdkObjectMetadata } from \"./wireObjectTypeFullMetadataToSdkObjectMetadata.js\";\nexport { wirePropertyV2ToSdkPropertyDefinition } from \"./wirePropertyV2ToSdkPropertyDefinition.js\";\nexport { wireQueryDataTypeToQueryDataTypeDefinition } from \"./wireQueryDataTypeToQueryDataTypeDefinition.js\";\nexport { wireQueryTypeV2ToSdkQueryMetadata } from \"./wireQueryTypeV2ToSdkQueryMetadata.js\";\nexport { wireQueryParameterV2ToQueryParameterDefinition } from \"./wireQueryTypeV2ToSdkQueryMetadata.js\";\nexport { wireQueryTypeV2ToSdkQueryDefinitionNoParams } from \"./wireQueryTypeV2ToSdkQueryMetadata.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,mCAAmC,QAAQ,0CAA0C;AAC9F,SACEC,mDAAmD,EACnDC,wCAAwC,QACnC,+CAA+C;AACtD,SAASC,6CAA6C,QAAQ,oDAAoD;AAClH,SAASC,qCAAqC,QAAQ,4CAA4C;AAClG,SAASC,0CAA0C,QAAQ,iDAAiD;AAC5G,SAASC,iCAAiC,QAAQ,wCAAwC;AAC1F,SAASC,8CAA8C,QAAQ,wCAAwC;AACvG,SAASC,2CAA2C,QAAQ,wCAAwC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["GeneratorError","wireActionTypeV2ToSdkActionMetadata","__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition","wireInterfaceTypeV2ToSdkObjectDefinition","wireObjectTypeFullMetadataToSdkObjectMetadata","wirePropertyV2ToSdkPropertyDefinition","wireQueryDataTypeToQueryDataTypeDefinition","wireQueryTypeV2ToSdkQueryMetadata","wireQueryParameterV2ToQueryParameterDefinition","wireQueryTypeV2ToSdkQueryDefinitionNoParams"],"sources":["index.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\nexport { GeneratorError } from \"./GeneratorError.js\";\nexport { wireActionTypeV2ToSdkActionMetadata } from \"./wireActionTypeV2ToSdkActionMetadata.js\";\nexport {\n __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition,\n wireInterfaceTypeV2ToSdkObjectDefinition,\n} from \"./wireInterfaceTypeV2ToSdkObjectDefinition.js\";\nexport { wireObjectTypeFullMetadataToSdkObjectMetadata } from \"./wireObjectTypeFullMetadataToSdkObjectMetadata.js\";\nexport { wirePropertyV2ToSdkPropertyDefinition } from \"./wirePropertyV2ToSdkPropertyDefinition.js\";\nexport { wireQueryDataTypeToQueryDataTypeDefinition } from \"./wireQueryDataTypeToQueryDataTypeDefinition.js\";\nexport { wireQueryTypeV2ToSdkQueryMetadata } from \"./wireQueryTypeV2ToSdkQueryMetadata.js\";\nexport { wireQueryParameterV2ToQueryParameterDefinition } from \"./wireQueryTypeV2ToSdkQueryMetadata.js\";\nexport { wireQueryTypeV2ToSdkQueryDefinitionNoParams } from \"./wireQueryTypeV2ToSdkQueryMetadata.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,cAAc,QAAQ,qBAAqB;AACpD,SAASC,mCAAmC,QAAQ,0CAA0C;AAC9F,SACEC,mDAAmD,EACnDC,wCAAwC,QACnC,+CAA+C;AACtD,SAASC,6CAA6C,QAAQ,oDAAoD;AAClH,SAASC,qCAAqC,QAAQ,4CAA4C;AAClG,SAASC,0CAA0C,QAAQ,iDAAiD;AAC5G,SAASC,iCAAiC,QAAQ,wCAAwC;AAC1F,SAASC,8CAA8C,QAAQ,wCAAwC;AACvG,SAASC,2CAA2C,QAAQ,wCAAwC","ignoreList":[]}
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
+
import { GeneratorError } from "./GeneratorError.js";
|
|
17
18
|
import { getModifiedEntityTypes } from "./getEditedEntities.js";
|
|
18
19
|
import { ensureStringEnumSupportedOrUndefined, supportedReleaseStatus } from "./wireObjectTypeFullMetadataToSdkObjectMetadata.js";
|
|
19
20
|
export function wireActionTypeV2ToSdkActionMetadata(input, unsanitizedApiName) {
|
|
@@ -81,7 +82,9 @@ function actionPropertyToSdkPropertyDefinition(parameterType) {
|
|
|
81
82
|
}, {})
|
|
82
83
|
};
|
|
83
84
|
default:
|
|
84
|
-
throw new
|
|
85
|
+
throw new GeneratorError("Unsupported action parameter type", {
|
|
86
|
+
parameterType: JSON.stringify(parameterType)
|
|
87
|
+
});
|
|
85
88
|
}
|
|
86
89
|
}
|
|
87
90
|
function createModifiedEntities(addedObjects, modifiedObjects) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wireActionTypeV2ToSdkActionMetadata.js","names":["getModifiedEntityTypes","ensureStringEnumSupportedOrUndefined","supportedReleaseStatus","wireActionTypeV2ToSdkActionMetadata","input","unsanitizedApiName","modifiedEntityTypes","type","apiName","parameters","Object","fromEntries","entries","sort","a","b","localeCompare","map","key","value","wireActionParameterV2ToSdkParameterDefinition","displayName","description","modifiedEntities","createModifiedEntities","addedObjects","modifiedObjects","rid","status","multiplicity","dataType","actionPropertyToSdkPropertyDefinition","subType","nullable","required","parameterType","objectSet","objectTypeApiName","object","interface","interfaceTypeApiName","struct","fields","reduce","structMap","structField","name","fieldType","
|
|
1
|
+
{"version":3,"file":"wireActionTypeV2ToSdkActionMetadata.js","names":["GeneratorError","getModifiedEntityTypes","ensureStringEnumSupportedOrUndefined","supportedReleaseStatus","wireActionTypeV2ToSdkActionMetadata","input","unsanitizedApiName","modifiedEntityTypes","type","apiName","parameters","Object","fromEntries","entries","sort","a","b","localeCompare","map","key","value","wireActionParameterV2ToSdkParameterDefinition","displayName","description","modifiedEntities","createModifiedEntities","addedObjects","modifiedObjects","rid","status","multiplicity","dataType","actionPropertyToSdkPropertyDefinition","subType","nullable","required","parameterType","objectSet","objectTypeApiName","object","interface","interfaceTypeApiName","struct","fields","reduce","structMap","structField","name","fieldType","JSON","stringify","entities","created","modified"],"sources":["wireActionTypeV2ToSdkActionMetadata.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 { ActionMetadata } from \"@osdk/api\";\nimport type {\n ActionParameterType,\n ActionParameterV2,\n ActionTypeV2,\n} from \"@osdk/foundry.ontologies\";\nimport { GeneratorError } from \"./GeneratorError.js\";\nimport { getModifiedEntityTypes } from \"./getEditedEntities.js\";\nimport {\n ensureStringEnumSupportedOrUndefined,\n supportedReleaseStatus,\n} from \"./wireObjectTypeFullMetadataToSdkObjectMetadata.js\";\n\nexport function wireActionTypeV2ToSdkActionMetadata(\n input: ActionTypeV2,\n unsanitizedApiName?: string,\n): ActionMetadata {\n const modifiedEntityTypes = getModifiedEntityTypes(input);\n return {\n type: \"action\",\n apiName: input.apiName,\n unsanitizedApiName: unsanitizedApiName ?? input.apiName,\n parameters: Object.fromEntries(\n Object.entries(input.parameters).sort(\n ([a], [b]) => a.localeCompare(b),\n ).map((\n [key, value],\n ) => [key, wireActionParameterV2ToSdkParameterDefinition(value)]),\n ),\n displayName: input.displayName,\n description: input.description,\n modifiedEntities: createModifiedEntities(\n modifiedEntityTypes.addedObjects,\n modifiedEntityTypes.modifiedObjects,\n ),\n rid: input.rid,\n status: ensureStringEnumSupportedOrUndefined(\n input.status,\n supportedReleaseStatus,\n ),\n };\n}\n\nfunction wireActionParameterV2ToSdkParameterDefinition(\n value: ActionParameterV2,\n): ActionMetadata.Parameter<any> {\n return {\n multiplicity: value.dataType.type === \"array\",\n type: actionPropertyToSdkPropertyDefinition(\n value.dataType.type === \"array\" ? value.dataType.subType : value.dataType,\n ),\n nullable: !value.required,\n description: value.description,\n };\n}\n\nfunction actionPropertyToSdkPropertyDefinition(\n parameterType: ActionParameterType,\n): ActionMetadata.Parameter[\"type\"] {\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 { type: \"objectSet\", objectSet: parameterType.objectTypeApiName! };\n case \"object\":\n return { type: \"object\", object: parameterType.objectTypeApiName };\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(\n (\n structMap: Record<\n string,\n ActionMetadata.DataType.BaseActionParameterTypes\n >,\n structField,\n ) => {\n structMap[structField.name] = actionPropertyToSdkPropertyDefinition(\n structField.fieldType as ActionParameterType,\n ) as ActionMetadata.DataType.BaseActionParameterTypes;\n return structMap;\n },\n {},\n ),\n };\n default:\n throw new GeneratorError(\"Unsupported action parameter type\", {\n parameterType: JSON.stringify(parameterType),\n });\n }\n}\n\nfunction createModifiedEntities<K extends string>(\n addedObjects: Set<K>,\n modifiedObjects: Set<K>,\n): ActionMetadata[\"modifiedEntities\"] {\n const entities = {} as Record<\n K,\n {\n created: boolean;\n modified: boolean;\n }\n >;\n\n for (const key of addedObjects) {\n entities[key] = { created: true, modified: false };\n }\n\n for (const key of modifiedObjects) {\n if (entities[key]) {\n entities[key].modified = true;\n } else {\n entities[key] = { created: false, modified: true };\n }\n }\n\n return entities;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAQA,SAASA,cAAc,QAAQ,qBAAqB;AACpD,SAASC,sBAAsB,QAAQ,wBAAwB;AAC/D,SACEC,oCAAoC,EACpCC,sBAAsB,QACjB,oDAAoD;AAE3D,OAAO,SAASC,mCAAmCA,CACjDC,KAAmB,EACnBC,kBAA2B,EACX;EAChB,MAAMC,mBAAmB,GAAGN,sBAAsB,CAACI,KAAK,CAAC;EACzD,OAAO;IACLG,IAAI,EAAE,QAAQ;IACdC,OAAO,EAAEJ,KAAK,CAACI,OAAO;IACtBH,kBAAkB,EAAEA,kBAAkB,IAAID,KAAK,CAACI,OAAO;IACvDC,UAAU,EAAEC,MAAM,CAACC,WAAW,CAC5BD,MAAM,CAACE,OAAO,CAACR,KAAK,CAACK,UAAU,CAAC,CAACI,IAAI,CACnC,CAAC,CAACC,CAAC,CAAC,EAAE,CAACC,CAAC,CAAC,KAAKD,CAAC,CAACE,aAAa,CAACD,CAAC,CACjC,CAAC,CAACE,GAAG,CAAC,CACJ,CAACC,GAAG,EAAEC,KAAK,CAAC,KACT,CAACD,GAAG,EAAEE,6CAA6C,CAACD,KAAK,CAAC,CAAC,CAClE,CAAC;IACDE,WAAW,EAAEjB,KAAK,CAACiB,WAAW;IAC9BC,WAAW,EAAElB,KAAK,CAACkB,WAAW;IAC9BC,gBAAgB,EAAEC,sBAAsB,CACtClB,mBAAmB,CAACmB,YAAY,EAChCnB,mBAAmB,CAACoB,eACtB,CAAC;IACDC,GAAG,EAAEvB,KAAK,CAACuB,GAAG;IACdC,MAAM,EAAE3B,oCAAoC,CAC1CG,KAAK,CAACwB,MAAM,EACZ1B,sBACF;EACF,C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,SAGC,EACDC,WAAW,KACR;UACHD,SAAS,CAACC,WAAW,CAACC,IAAI,CAAC,GAAGf,qCAAqC,CACjEc,WAAW,CAACE,SACd,CAAqD;UACrD,OAAOH,SAAS;QAClB,CAAC,EACD,CAAC,CACH;MACF,CAAC;IACH;MACE,MAAM,IAAI7C,cAAc,CAAC,mCAAmC,EAAE;QAC5DoC,aAAa,EAAEa,IAAI,CAACC,SAAS,CAACd,aAAa;MAC7C,CAAC,CAAC;EACN;AACF;AAEA,SAASX,sBAAsBA,CAC7BC,YAAoB,EACpBC,eAAuB,EACa;EACpC,MAAMwB,QAAQ,GAAG,CAAC,CAMjB;EAED,KAAK,MAAMhC,GAAG,IAAIO,YAAY,EAAE;IAC9ByB,QAAQ,CAAChC,GAAG,CAAC,GAAG;MAAEiC,OAAO,EAAE,IAAI;MAAEC,QAAQ,EAAE;IAAM,CAAC;EACpD;EAEA,KAAK,MAAMlC,GAAG,IAAIQ,eAAe,EAAE;IACjC,IAAIwB,QAAQ,CAAChC,GAAG,CAAC,EAAE;MACjBgC,QAAQ,CAAChC,GAAG,CAAC,CAACkC,QAAQ,GAAG,IAAI;IAC/B,CAAC,MAAM;MACLF,QAAQ,CAAChC,GAAG,CAAC,GAAG;QAAEiC,OAAO,EAAE,KAAK;QAAEC,QAAQ,EAAE;MAAK,CAAC;IACpD;EACF;EAEA,OAAOF,QAAQ;AACjB","ignoreList":[]}
|
|
@@ -14,11 +14,15 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
+
import { GeneratorError } from "./GeneratorError.js";
|
|
17
18
|
import { wirePropertyV2ToSdkPrimaryKeyTypeDefinition } from "./wirePropertyV2ToSdkPrimaryKeyTypeDefinition.js";
|
|
18
19
|
import { wirePropertyV2ToSdkPropertyDefinition } from "./wirePropertyV2ToSdkPropertyDefinition.js";
|
|
19
20
|
export function wireObjectTypeFullMetadataToSdkObjectMetadata(objectTypeWithLink, v2, log) {
|
|
20
21
|
if (objectTypeWithLink.objectType.properties[objectTypeWithLink.objectType.primaryKey] === undefined) {
|
|
21
|
-
throw new
|
|
22
|
+
throw new GeneratorError("Primary key not found in object type", {
|
|
23
|
+
primaryKey: objectTypeWithLink.objectType.primaryKey,
|
|
24
|
+
objectTypeApiName: objectTypeWithLink.objectType.apiName
|
|
25
|
+
});
|
|
22
26
|
}
|
|
23
27
|
|
|
24
28
|
// saved ontology.json files may not have this implementsInterfaces2 so we need to handle
|
|
@@ -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","sort","a","b","localeCompare","map","interfaceApiName","impl","propertiesV2","keys","length","propMap","iptApiName","implementation","type","propertyApiName","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","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).sort(\n ([a], [b]) => a.localeCompare(b),\n ).map(\n ([interfaceApiName, impl]) => {\n // prefer V2 if available and non-empty\n if (\n impl.propertiesV2\n && Object.keys(impl.propertiesV2).length > 0\n ) {\n const propMap: Record<string, string> = {};\n for (\n const [iptApiName, implementation] of Object.entries(\n impl.propertiesV2,\n )\n ) {\n if (implementation.type === \"localPropertyImplementation\") {\n propMap[iptApiName] = implementation.propertyApiName;\n }\n }\n return [interfaceApiName, propMap];\n }\n // fall back to V1\n return [interfaceApiName, impl.properties];\n },\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 .sort(([a], [b]) => (a as string).localeCompare(b as string)),\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,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,IAAI,CAC3D,CAAC,CAACC,CAAC,CAAC,EAAE,CAACC,CAAC,CAAC,KAAKD,CAAC,CAACE,aAAa,CAACD,CAAC,CACjC,CAAC,CAACE,GAAG,CACH,CAAC,C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AS;IACb6C,aAAa,EAAEnD,kBAAkB,CAACG,UAAU,CAACgD,aAAa;IAC1DC,WAAW,EAAEpD,kBAAkB,CAACG,UAAU,CAACiD,WAAW;IACtDC,iBAAiB,EAAErD,kBAAkB,CAACG,UAAU,CAACkD,iBAAiB;IAClEC,MAAM,EAAEC,oCAAoC,CAC1CvD,kBAAkB,CAACG,UAAU,CAACmD,MAAM,EACpCE,sBACF,CAAC;IACDC,GAAG,EAAEzD,kBAAkB,CAACG,UAAU,CAACsD,GAAG;IACtCC,UAAU,EAAEH,oCAAoC,CAC9CvD,kBAAkB,CAACG,UAAU,CAACuD,UAAU,EACxCC,6BACF;EACF,CAAC;AACH;AAEA,SAASZ,WAAWA,CAClB/B,CAA0B,EACsC;EAChE,OAAQA,CAAC,GACLJ,MAAM,CAACC,WAAW,CAACD,MAAM,CAACE,OAAO,CAACE,CAAC,CAAC,CAACG,GAAG,CAAC,CAAC,CAACyC,CAAC,EAAEC,CAAC,CAAC,KAAK,CAACA,CAAC,EAAED,CAAC,CAAC,CAAC,CAAC,GAC7DtD,SAAS;AAEf;AAEA,OAAO,MAAM2C,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,GAAGnC,SAAS;AACrE","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"wireObjectTypeFullMetadataToSdkObjectMetadata.js","names":["GeneratorError","wirePropertyV2ToSdkPrimaryKeyTypeDefinition","wirePropertyV2ToSdkPropertyDefinition","wireObjectTypeFullMetadataToSdkObjectMetadata","objectTypeWithLink","v2","log","objectType","properties","primaryKey","undefined","objectTypeApiName","apiName","implementsInterfaces2","implementsInterfaces","Error","interfaceMap","Object","fromEntries","entries","sort","a","b","localeCompare","map","interfaceApiName","impl","propertiesV2","keys","length","propMap","iptApiName","implementation","type","propertyApiName","description","primaryKeyApiName","primaryKeyType","links","linkTypes","linkType","multiplicity","cardinality","targetType","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 { GeneratorError } from \"./GeneratorError.js\";\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 GeneratorError(\"Primary key not found in object type\", {\n primaryKey: objectTypeWithLink.objectType.primaryKey,\n objectTypeApiName: 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).sort(\n ([a], [b]) => a.localeCompare(b),\n ).map(\n ([interfaceApiName, impl]) => {\n // prefer V2 if available and non-empty\n if (\n impl.propertiesV2\n && Object.keys(impl.propertiesV2).length > 0\n ) {\n const propMap: Record<string, string> = {};\n for (\n const [iptApiName, implementation] of Object.entries(\n impl.propertiesV2,\n )\n ) {\n if (implementation.type === \"localPropertyImplementation\") {\n propMap[iptApiName] = implementation.propertyApiName;\n }\n }\n return [interfaceApiName, propMap];\n }\n // fall back to V1\n return [interfaceApiName, impl.properties];\n },\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 .sort(([a], [b]) => (a as string).localeCompare(b as string)),\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;A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AEH,oCAAoC,CAC9CvD,kBAAkB,CAACG,UAAU,CAACuD,UAAU,EACxCC,6BACF;EACF,CAAC;AACH;AAEA,SAASZ,WAAWA,CAClB9B,CAA0B,EACsC;EAChE,OAAQA,CAAC,GACLJ,MAAM,CAACC,WAAW,CAACD,MAAM,CAACE,OAAO,CAACE,CAAC,CAAC,CAACG,GAAG,CAAC,CAAC,CAACwC,CAAC,EAAEC,CAAC,CAAC,KAAK,CAACA,CAAC,EAAED,CAAC,CAAC,CAAC,CAAC,GAC7DtD,SAAS;AAEf;AAEA,OAAO,MAAM2C,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,GAAGnC,SAAS;AACrE","ignoreList":[]}
|
package/build/cjs/index.cjs
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
// src/GeneratorError.ts
|
|
4
|
+
var GeneratorError = class extends Error {
|
|
5
|
+
constructor(message, unsafeParams, params) {
|
|
6
|
+
super(message);
|
|
7
|
+
this.name = "GeneratorError";
|
|
8
|
+
this.unsafeParams = unsafeParams;
|
|
9
|
+
this.params = params;
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
|
|
3
13
|
// src/getEditedEntities.ts
|
|
4
14
|
function getModifiedEntityTypes(action) {
|
|
5
15
|
const addedObjects = /* @__PURE__ */ new Set();
|
|
@@ -423,7 +433,10 @@ function objectPropertyTypeToSdkPropertyDefinition(propertyType, log) {
|
|
|
423
433
|
// src/wireObjectTypeFullMetadataToSdkObjectMetadata.ts
|
|
424
434
|
function wireObjectTypeFullMetadataToSdkObjectMetadata(objectTypeWithLink, v2, log) {
|
|
425
435
|
if (objectTypeWithLink.objectType.properties[objectTypeWithLink.objectType.primaryKey] === void 0) {
|
|
426
|
-
throw new
|
|
436
|
+
throw new GeneratorError("Primary key not found in object type", {
|
|
437
|
+
primaryKey: objectTypeWithLink.objectType.primaryKey,
|
|
438
|
+
objectTypeApiName: objectTypeWithLink.objectType.apiName
|
|
439
|
+
});
|
|
427
440
|
}
|
|
428
441
|
if (objectTypeWithLink.implementsInterfaces2 == null && objectTypeWithLink.implementsInterfaces != null) {
|
|
429
442
|
throw new Error("Your ontology.json file is missing the implementsInterfaces2 field. Please regenerate it.");
|
|
@@ -541,7 +554,9 @@ function actionPropertyToSdkPropertyDefinition(parameterType) {
|
|
|
541
554
|
}, {})
|
|
542
555
|
};
|
|
543
556
|
default:
|
|
544
|
-
throw new
|
|
557
|
+
throw new GeneratorError("Unsupported action parameter type", {
|
|
558
|
+
parameterType: JSON.stringify(parameterType)
|
|
559
|
+
});
|
|
545
560
|
}
|
|
546
561
|
}
|
|
547
562
|
function createModifiedEntities(addedObjects, modifiedObjects) {
|
|
@@ -791,6 +806,7 @@ function wireQueryParameterV2ToQueryParameterDefinition(parameter) {
|
|
|
791
806
|
};
|
|
792
807
|
}
|
|
793
808
|
|
|
809
|
+
exports.GeneratorError = GeneratorError;
|
|
794
810
|
exports.__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition = wireInterfaceTypeV2ToSdkObjectDefinition;
|
|
795
811
|
exports.wireActionTypeV2ToSdkActionMetadata = wireActionTypeV2ToSdkActionMetadata;
|
|
796
812
|
exports.wireInterfaceTypeV2ToSdkObjectDefinition = wireInterfaceTypeV2ToSdkObjectDefinition;
|
package/build/cjs/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/getEditedEntities.ts","../../src/wirePropertyV2ToSdkPrimaryKeyTypeDefinition.ts","../../src/valueFormatting/convertBooleanValueFormattingRule.ts","../../src/valueFormatting/commonValueFormattingUtils.ts","../../src/valueFormatting/convertDateAndTimestampValueFormattingRule.ts","../../src/valueFormatting/convertKnownTypeValueFormattingRule.ts","../../src/valueFormatting/convertNumberValueFormattingRule.ts","../../src/wirePropertyFormattingToSdkFormatting.ts","../../src/wirePropertyV2ToSdkPropertyDefinition.ts","../../src/wireObjectTypeFullMetadataToSdkObjectMetadata.ts","../../src/wireActionTypeV2ToSdkActionMetadata.ts","../../src/wireInterfaceTypeV2ToSdkObjectDefinition.ts","../../src/isNullableQueryDataType.ts","../../src/wireQueryDataTypeToQueryDataTypeDefinition.ts","../../src/wireQueryTypeV2ToSdkQueryMetadata.ts"],"names":[],"mappings":";;;AAgBO,SAAS,uBAAuB,MAAA,EAAQ;AAC7C,EAAA,MAAM,YAAA,uBAAmB,GAAA,EAAI;AAC7B,EAAA,MAAM,eAAA,uBAAsB,GAAA,EAAI;AAChC,EAAA,KAAA,MAAW,SAAA,IAAa,OAAO,UAAA,EAAY;AACzC,IAAA,QAAQ,UAAU,IAAA;AAAM,MACtB,KAAK,cAAA;AACH,QAAA,YAAA,CAAa,GAAA,CAAI,UAAU,iBAAiB,CAAA;AAC5C,QAAA;AAAA,MACF,KAAK,cAAA;AACH,QAAA,eAAA,CAAgB,GAAA,CAAI,UAAU,iBAAiB,CAAA;AAC/C,QAAA;AASU;AACd,EACF;AACA,EAAA,OAAO;AAAA,IACL,YAAA;AAAA,IACA;AAAA,GACF;AACF;;;AC1BO,SAAS,4CAA4C,KAAA,EAAO;AACjE,EAAA,QAAQ,KAAA,CAAM,SAAS,IAAA;AAAM,IAC3B,KAAK,SAAA;AAAA,IACL,KAAK,QAAA;AAAA,IACL,KAAK,QAAA;AAAA,IACL,KAAK,MAAA;AAAA,IACL,KAAK,MAAA;AAAA,IACL,KAAK,OAAA;AAAA,IACL,KAAK,WAAA,EACH;AACE,MAAA,OAAO,MAAM,QAA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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 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 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\nexport function convertBooleanFormattingRule(wireFormatting) {\n return {\n type: \"boolean\",\n valueIfTrue: wireFormatting.valueIfTrue,\n valueIfFalse: wireFormatting.valueIfFalse\n };\n}","/*\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\nexport function convertPropertyTypeReferenceOrStringConstant(value) {\n switch (value.type) {\n case \"constant\":\n return {\n type: \"constant\",\n value: value.value\n };\n case \"propertyType\":\n return {\n type: \"propertyType\",\n propertyApiName: value.propertyApiName\n };\n default:\n value;\n throw new Error(`Unknown property reference type: ${value.type}`);\n }\n}","/*\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 { convertPropertyTypeReferenceOrStringConstant } from \"./commonValueFormattingUtils.js\";\nexport function convertDateFormattingRule(wireFormatting) {\n return {\n type: \"date\",\n format: convertDatetimeFormat(wireFormatting.format)\n };\n}\nexport function convertTimestampFormattingRule(wireFormatting) {\n return {\n type: \"timestamp\",\n format: convertDatetimeFormat(wireFormatting.format),\n displayTimezone: convertDatetimeTimezone(wireFormatting.displayTimezone)\n };\n}\nfunction convertDatetimeFormat(wireFormat) {\n switch (wireFormat.type) {\n case \"stringFormat\":\n return {\n type: \"stringFormat\",\n pattern: wireFormat.pattern\n };\n case \"localizedFormat\":\n return {\n type: \"localizedFormat\",\n format: wireFormat.format\n };\n default:\n wireFormat;\n throw new Error(`Unknown datetime format type: ${wireFormat.type}`);\n }\n}\nfunction convertDatetimeTimezone(wireTimezone) {\n switch (wireTimezone.type) {\n case \"static\":\n return {\n type: \"static\",\n zoneId: convertPropertyTypeReferenceOrStringConstant(wireTimezone.zoneId)\n };\n case \"user\":\n return {\n type: \"user\"\n };\n default:\n wireTimezone;\n throw new Error(`Unknown timezone type: ${wireTimezone.type}`);\n }\n}","/*\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\nexport function convertKnownTypeFormattingRule(wireFormatting) {\n switch (wireFormatting.knownType) {\n case \"ARTIFACT_GID\":\n return {\n type: \"knownType\",\n knownType: \"ARTIFACT_GID\"\n };\n case \"RESOURCE_RID\":\n return {\n type: \"knownType\",\n knownType: \"RESOURCE_RID\"\n };\n case \"USER_OR_GROUP_ID\":\n return {\n type: \"knownType\",\n knownType: \"USER_OR_GROUP_ID\"\n };\n default:\n wireFormatting.knownType;\n return undefined;\n }\n}","/*\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 { convertPropertyTypeReferenceOrStringConstant } from \"./commonValueFormattingUtils.js\";\nexport function convertNumberFormattingRule(wireFormatting) {\n const numberType = convertNumberFormattingType(wireFormatting.numberType);\n if (!numberType) {\n return undefined;\n }\n return {\n type: \"number\",\n numberType\n };\n}\nfunction convertNumberFormatOptions(wireOptions) {\n return {\n useGrouping: wireOptions.useGrouping,\n convertNegativeToParenthesis: wireOptions.convertNegativeToParenthesis,\n minimumIntegerDigits: wireOptions.minimumIntegerDigits,\n minimumFractionDigits: wireOptions.minimumFractionDigits,\n maximumFractionDigits: wireOptions.maximumFractionDigits,\n minimumSignificantDigits: wireOptions.minimumSignificantDigits,\n maximumSignificantDigits: wireOptions.maximumSignificantDigits,\n notation: wireOptions.notation,\n roundingMode: wireOptions.roundingMode\n };\n}\nfunction convertDurationFormatStyle(formatStyle) {\n switch (formatStyle.type) {\n case \"humanReadable\":\n return {\n type: \"humanReadable\",\n showFullUnits: formatStyle.showFullUnits\n };\n case \"timecode\":\n return {\n type: \"timecode\"\n };\n default:\n formatStyle;\n throw new Error(`Unknown duration format style: ${formatStyle.type}`);\n }\n}\nfunction convertNumberFormattingType(wireNumberType) {\n switch (wireNumberType.type) {\n case \"standard\":\n return {\n type: \"standard\",\n baseFormatOptions: convertNumberFormatOptions(wireNumberType.baseFormatOptions)\n };\n case \"fixedValues\":\n return {\n type: \"fixedValues\",\n values: wireNumberType.values\n };\n case \"currency\":\n {\n return {\n type: \"currency\",\n baseFormatOptions: convertNumberFormatOptions(wireNumberType.baseFormatOptions),\n style: wireNumberType.style,\n currencyCode: convertPropertyTypeReferenceOrStringConstant(wireNumberType.currencyCode)\n };\n }\n case \"standardUnit\":\n {\n return {\n type: \"standardUnit\",\n baseFormatOptions: convertNumberFormatOptions(wireNumberType.baseFormatOptions),\n unit: convertPropertyTypeReferenceOrStringConstant(wireNumberType.unit)\n };\n }\n case \"customUnit\":\n {\n return {\n type: \"customUnit\",\n baseFormatOptions: convertNumberFormatOptions(wireNumberType.baseFormatOptions),\n unit: convertPropertyTypeReferenceOrStringConstant(wireNumberType.unit)\n };\n }\n case \"affix\":\n {\n return {\n type: \"affix\",\n baseFormatOptions: convertNumberFormatOptions(wireNumberType.baseFormatOptions),\n affix: {\n prefix: wireNumberType.affix?.prefix != null ? convertPropertyTypeReferenceOrStringConstant(wireNumberType.affix.prefix) : undefined,\n postfix: wireNumberType.affix?.postfix != null ? convertPropertyTypeReferenceOrStringConstant(wireNumberType.affix.postfix) : undefined\n }\n };\n }\n case \"duration\":\n {\n return {\n type: \"duration\",\n formatStyle: convertDurationFormatStyle(wireNumberType.formatStyle),\n precision: wireNumberType.precision,\n baseValue: wireNumberType.baseValue\n };\n }\n case \"scale\":\n {\n return {\n type: \"scale\",\n scaleType: wireNumberType.scaleType,\n baseFormatOptions: convertNumberFormatOptions(wireNumberType.baseFormatOptions)\n };\n }\n case \"ratio\":\n {\n return {\n type: \"ratio\",\n ratioType: wireNumberType.ratioType,\n baseFormatOptions: convertNumberFormatOptions(wireNumberType.baseFormatOptions)\n };\n }\n default:\n wireNumberType;\n throw new Error(`Unknown number format type: ${wireNumberType.type}`);\n }\n}","/*\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 { convertBooleanFormattingRule } from \"./valueFormatting/convertBooleanValueFormattingRule.js\";\nimport { convertDateFormattingRule, convertTimestampFormattingRule } from \"./valueFormatting/convertDateAndTimestampValueFormattingRule.js\";\nimport { convertKnownTypeFormattingRule } from \"./valueFormatting/convertKnownTypeValueFormattingRule.js\";\nimport { convertNumberFormattingRule } from \"./valueFormatting/convertNumberValueFormattingRule.js\";\n\n/**\n * Converts a PropertyValueFormattingRule from the ontologies format to the SDK format\n */\nexport function wirePropertyFormattingToSdkFormatting(wireFormatting, log) {\n try {\n return convertPropertyFormattingInternal(wireFormatting);\n } catch (error) {\n log?.info(`Failed to convert property formatting rule: ${error}`);\n return undefined;\n }\n}\nfunction convertPropertyFormattingInternal(wireFormatting) {\n switch (wireFormatting.type) {\n case \"date\":\n return convertDateFormattingRule(wireFormatting);\n case \"timestamp\":\n return convertTimestampFormattingRule(wireFormatting);\n case \"boolean\":\n return convertBooleanFormattingRule(wireFormatting);\n case \"knownType\":\n return convertKnownTypeFormattingRule(wireFormatting);\n case \"number\":\n return convertNumberFormattingRule(wireFormatting);\n default:\n wireFormatting;\n throw new Error(`Unknown formatting type: ${wireFormatting.type}`);\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 { wirePropertyFormattingToSdkFormatting } from \"./wirePropertyFormattingToSdkFormatting.js\";\n\n/**\n * Extracts main value metadata from a struct property type.\n * Returns the fields array that comprise the main value.\n */\nfunction extractMainValue(dataType) {\n if (dataType.type === \"struct\" && dataType.mainValue) {\n const fields = dataType.mainValue.fields;\n if (fields && fields.length > 0) {\n return {\n fields\n };\n }\n }\n return undefined;\n}\n\n/**\n * Checks if an array property type has reducers.\n */\nfunction hasReducers(dataType) {\n return dataType.type === \"array\" && dataType.reducers != null && dataType.reducers.length > 0;\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 \"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 valueTypeApiName: input.valueTypeApiName,\n valueFormatting: input.valueFormatting != null ? wirePropertyFormattingToSdkFormatting(input.valueFormatting, log) : undefined\n };\n case \"struct\":\n {\n const mainValue = extractMainValue(input.dataType);\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 valueTypeApiName: input.valueTypeApiName,\n valueFormatting: input.valueFormatting != null ? wirePropertyFormattingToSdkFormatting(input.valueFormatting, log) : undefined,\n mainValue\n };\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 valueTypeApiName: input.valueTypeApiName,\n valueFormatting: input.valueFormatting != null ? wirePropertyFormattingToSdkFormatting(input.valueFormatting, log) : undefined,\n hasReducers: hasReducers(input.dataType)\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 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).sort(([a], [b]) => a.localeCompare(b)).map(([interfaceApiName, impl]) => {\n // prefer V2 if available and non-empty\n if (impl.propertiesV2 && Object.keys(impl.propertiesV2).length > 0) {\n const propMap = {};\n for (const [iptApiName, implementation] of Object.entries(impl.propertiesV2)) {\n if (implementation.type === \"localPropertyImplementation\") {\n propMap[iptApiName] = implementation.propertyApiName;\n }\n }\n return [interfaceApiName, propMap];\n }\n // fall back to V1\n return [interfaceApiName, impl.properties];\n })) : {};\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).sort(([a], [b]) => a.localeCompare(b))),\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, unsanitizedApiName) {\n const modifiedEntityTypes = getModifiedEntityTypes(input);\n return {\n type: \"action\",\n apiName: input.apiName,\n unsanitizedApiName: unsanitizedApiName ?? input.apiName,\n parameters: Object.fromEntries(Object.entries(input.parameters).sort(([a], [b]) => a.localeCompare(b)).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 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 { wireInterfaceTypeV2ToSdkObjectDefinition as __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition };\nexport function 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(\n // prefer V2 if available and non-empty, otherwise fall back to V1\n interfaceType.allPropertiesV2 && Object.keys(interfaceType.allPropertiesV2).length > 0 ? interfaceType.allPropertiesV2 : interfaceType.allProperties ?? interfaceType.properties).map(([key, value]) => {\n return [key, wirePropertyV2ToSdkPropertyDefinition(value, true, log)];\n }).filter(([_, value]) => value != null).sort(([a], [b]) => a.localeCompare(b))),\n links: Object.fromEntries(Object.entries(interfaceType.allLinks ?? interfaceType.links ?? {}).sort(([a], [b]) => a.localeCompare(b)).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 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 case \"mediaReference\":\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 array: wireQueryDataTypeToQueryDataTypeDefinition(input.subType),\n type: \"array\",\n nullable: isNullableQueryDataType(input.subType)\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.type === \"array\") {\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 \"typeReference\":\n return {\n type: \"typeReference\",\n typeId: input.typeId,\n nullable: false\n };\n case \"null\":\n case \"unsupported\":\n case \"void\":\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).sort(([a], [b]) => a.localeCompare(b)).map(([name, parameter]) => [name, wireQueryParameterV2ToQueryParameterDefinition(parameter)])),\n output: wireQueryDataTypeToQueryDataTypeDefinition(input.output),\n rid: input.rid,\n typeReferences: input.typeReferences && Object.keys(input.typeReferences).length > 0 ? Object.fromEntries(Object.entries(input.typeReferences).map(([typeId, dataType]) => [typeId, wireQueryDataTypeToQueryDataTypeDefinition(dataType)])) : undefined\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/GeneratorError.ts","../../src/getEditedEntities.ts","../../src/wirePropertyV2ToSdkPrimaryKeyTypeDefinition.ts","../../src/valueFormatting/convertBooleanValueFormattingRule.ts","../../src/valueFormatting/commonValueFormattingUtils.ts","../../src/valueFormatting/convertDateAndTimestampValueFormattingRule.ts","../../src/valueFormatting/convertKnownTypeValueFormattingRule.ts","../../src/valueFormatting/convertNumberValueFormattingRule.ts","../../src/wirePropertyFormattingToSdkFormatting.ts","../../src/wirePropertyV2ToSdkPropertyDefinition.ts","../../src/wireObjectTypeFullMetadataToSdkObjectMetadata.ts","../../src/wireActionTypeV2ToSdkActionMetadata.ts","../../src/wireInterfaceTypeV2ToSdkObjectDefinition.ts","../../src/isNullableQueryDataType.ts","../../src/wireQueryDataTypeToQueryDataTypeDefinition.ts","../../src/wireQueryTypeV2ToSdkQueryMetadata.ts"],"names":[],"mappings":";;;AAqBO,IAAM,cAAA,GAAN,cAA6B,KAAA,CAAM;AAAA,EACxC,WAAA,CAAY,OAAA,EAAS,YAAA,EAAc,MAAA,EAAQ;AACzC,IAAA,KAAA,CAAM,OAAO,CAAA;AACb,IAAA,IAAA,CAAK,IAAA,GAAO,gBAAA;AACZ,IAAA,IAAA,CAAK,YAAA,GAAe,YAAA;AACpB,IAAA,IAAA,CAAK,MAAA,GAAS,MAAA;AAAA,EAChB;AACF;;;ACZO,SAAS,uBAAuB,MAAA,EAAQ;AAC7C,EAAA,MAAM,YAAA,uBAAmB,GAAA,EAAI;AAC7B,EAAA,MAAM,eAAA,uBAAsB,GAAA,EAAI;AAChC,EAAA,KAAA,MAAW,SAAA,IAAa,OAAO,UAAA,EAAY;AACzC,IAAA,QAAQ,UAAU,IAAA;AAAM,MACtB,KAAK,cAAA;AACH,QAAA,YAAA,CAAa,GAAA,CAAI,UAAU,iBAAiB,CAAA;AAC5C,QAAA;AAAA,MACF,K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AAC,CAAA,GAAI;AAAA,GAChP;AACF;AACO,SAAS,4CAA4C,KAAA,EAAO;AACjE,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,OAAA;AAAA,IACN,SAAS,KAAA,CAAM,OAAA;AAAA,IACf,aAAa,KAAA,CAAM,WAAA;AAAA,IACnB,aAAa,KAAA,CAAM,WAAA;AAAA,IACnB,SAAS,KAAA,CAAM,OAAA;AAAA,IACf,KAAK,KAAA,CAAM;AAAA,GACb;AACF;AACO,SAAS,+CAA+C,SAAA,EAAW;AACxE,EAAA,OAAO;AAAA,IACL,aAAa,SAAA,CAAU,WAAA;AAAA,IACvB,GAAG,0CAAA,CAA2C,SAAA,CAAU,QAAQ;AAAA,GAClE;AACF","file":"index.cjs","sourcesContent":["/*\n * Copyright 2026 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\n/**\n * An error thrown during SDK generation whose message is safe to log directly.\n * User-controlled data (API names, display names, etc.) goes in `unsafeParams`;\n * safe diagnostic context (RIDs, counts, type identifiers) goes in `params`.\n */\nexport class GeneratorError extends Error {\n constructor(message, unsafeParams, params) {\n super(message);\n this.name = \"GeneratorError\";\n this.unsafeParams = unsafeParams;\n this.params = params;\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 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\nexport function convertBooleanFormattingRule(wireFormatting) {\n return {\n type: \"boolean\",\n valueIfTrue: wireFormatting.valueIfTrue,\n valueIfFalse: wireFormatting.valueIfFalse\n };\n}","/*\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\nexport function convertPropertyTypeReferenceOrStringConstant(value) {\n switch (value.type) {\n case \"constant\":\n return {\n type: \"constant\",\n value: value.value\n };\n case \"propertyType\":\n return {\n type: \"propertyType\",\n propertyApiName: value.propertyApiName\n };\n default:\n value;\n throw new Error(`Unknown property reference type: ${value.type}`);\n }\n}","/*\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 { convertPropertyTypeReferenceOrStringConstant } from \"./commonValueFormattingUtils.js\";\nexport function convertDateFormattingRule(wireFormatting) {\n return {\n type: \"date\",\n format: convertDatetimeFormat(wireFormatting.format)\n };\n}\nexport function convertTimestampFormattingRule(wireFormatting) {\n return {\n type: \"timestamp\",\n format: convertDatetimeFormat(wireFormatting.format),\n displayTimezone: convertDatetimeTimezone(wireFormatting.displayTimezone)\n };\n}\nfunction convertDatetimeFormat(wireFormat) {\n switch (wireFormat.type) {\n case \"stringFormat\":\n return {\n type: \"stringFormat\",\n pattern: wireFormat.pattern\n };\n case \"localizedFormat\":\n return {\n type: \"localizedFormat\",\n format: wireFormat.format\n };\n default:\n wireFormat;\n throw new Error(`Unknown datetime format type: ${wireFormat.type}`);\n }\n}\nfunction convertDatetimeTimezone(wireTimezone) {\n switch (wireTimezone.type) {\n case \"static\":\n return {\n type: \"static\",\n zoneId: convertPropertyTypeReferenceOrStringConstant(wireTimezone.zoneId)\n };\n case \"user\":\n return {\n type: \"user\"\n };\n default:\n wireTimezone;\n throw new Error(`Unknown timezone type: ${wireTimezone.type}`);\n }\n}","/*\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\nexport function convertKnownTypeFormattingRule(wireFormatting) {\n switch (wireFormatting.knownType) {\n case \"ARTIFACT_GID\":\n return {\n type: \"knownType\",\n knownType: \"ARTIFACT_GID\"\n };\n case \"RESOURCE_RID\":\n return {\n type: \"knownType\",\n knownType: \"RESOURCE_RID\"\n };\n case \"USER_OR_GROUP_ID\":\n return {\n type: \"knownType\",\n knownType: \"USER_OR_GROUP_ID\"\n };\n default:\n wireFormatting.knownType;\n return undefined;\n }\n}","/*\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 { convertPropertyTypeReferenceOrStringConstant } from \"./commonValueFormattingUtils.js\";\nexport function convertNumberFormattingRule(wireFormatting) {\n const numberType = convertNumberFormattingType(wireFormatting.numberType);\n if (!numberType) {\n return undefined;\n }\n return {\n type: \"number\",\n numberType\n };\n}\nfunction convertNumberFormatOptions(wireOptions) {\n return {\n useGrouping: wireOptions.useGrouping,\n convertNegativeToParenthesis: wireOptions.convertNegativeToParenthesis,\n minimumIntegerDigits: wireOptions.minimumIntegerDigits,\n minimumFractionDigits: wireOptions.minimumFractionDigits,\n maximumFractionDigits: wireOptions.maximumFractionDigits,\n minimumSignificantDigits: wireOptions.minimumSignificantDigits,\n maximumSignificantDigits: wireOptions.maximumSignificantDigits,\n notation: wireOptions.notation,\n roundingMode: wireOptions.roundingMode\n };\n}\nfunction convertDurationFormatStyle(formatStyle) {\n switch (formatStyle.type) {\n case \"humanReadable\":\n return {\n type: \"humanReadable\",\n showFullUnits: formatStyle.showFullUnits\n };\n case \"timecode\":\n return {\n type: \"timecode\"\n };\n default:\n formatStyle;\n throw new Error(`Unknown duration format style: ${formatStyle.type}`);\n }\n}\nfunction convertNumberFormattingType(wireNumberType) {\n switch (wireNumberType.type) {\n case \"standard\":\n return {\n type: \"standard\",\n baseFormatOptions: convertNumberFormatOptions(wireNumberType.baseFormatOptions)\n };\n case \"fixedValues\":\n return {\n type: \"fixedValues\",\n values: wireNumberType.values\n };\n case \"currency\":\n {\n return {\n type: \"currency\",\n baseFormatOptions: convertNumberFormatOptions(wireNumberType.baseFormatOptions),\n style: wireNumberType.style,\n currencyCode: convertPropertyTypeReferenceOrStringConstant(wireNumberType.currencyCode)\n };\n }\n case \"standardUnit\":\n {\n return {\n type: \"standardUnit\",\n baseFormatOptions: convertNumberFormatOptions(wireNumberType.baseFormatOptions),\n unit: convertPropertyTypeReferenceOrStringConstant(wireNumberType.unit)\n };\n }\n case \"customUnit\":\n {\n return {\n type: \"customUnit\",\n baseFormatOptions: convertNumberFormatOptions(wireNumberType.baseFormatOptions),\n unit: convertPropertyTypeReferenceOrStringConstant(wireNumberType.unit)\n };\n }\n case \"affix\":\n {\n return {\n type: \"affix\",\n baseFormatOptions: convertNumberFormatOptions(wireNumberType.baseFormatOptions),\n affix: {\n prefix: wireNumberType.affix?.prefix != null ? convertPropertyTypeReferenceOrStringConstant(wireNumberType.affix.prefix) : undefined,\n postfix: wireNumberType.affix?.postfix != null ? convertPropertyTypeReferenceOrStringConstant(wireNumberType.affix.postfix) : undefined\n }\n };\n }\n case \"duration\":\n {\n return {\n type: \"duration\",\n formatStyle: convertDurationFormatStyle(wireNumberType.formatStyle),\n precision: wireNumberType.precision,\n baseValue: wireNumberType.baseValue\n };\n }\n case \"scale\":\n {\n return {\n type: \"scale\",\n scaleType: wireNumberType.scaleType,\n baseFormatOptions: convertNumberFormatOptions(wireNumberType.baseFormatOptions)\n };\n }\n case \"ratio\":\n {\n return {\n type: \"ratio\",\n ratioType: wireNumberType.ratioType,\n baseFormatOptions: convertNumberFormatOptions(wireNumberType.baseFormatOptions)\n };\n }\n default:\n wireNumberType;\n throw new Error(`Unknown number format type: ${wireNumberType.type}`);\n }\n}","/*\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 { convertBooleanFormattingRule } from \"./valueFormatting/convertBooleanValueFormattingRule.js\";\nimport { convertDateFormattingRule, convertTimestampFormattingRule } from \"./valueFormatting/convertDateAndTimestampValueFormattingRule.js\";\nimport { convertKnownTypeFormattingRule } from \"./valueFormatting/convertKnownTypeValueFormattingRule.js\";\nimport { convertNumberFormattingRule } from \"./valueFormatting/convertNumberValueFormattingRule.js\";\n\n/**\n * Converts a PropertyValueFormattingRule from the ontologies format to the SDK format\n */\nexport function wirePropertyFormattingToSdkFormatting(wireFormatting, log) {\n try {\n return convertPropertyFormattingInternal(wireFormatting);\n } catch (error) {\n log?.info(`Failed to convert property formatting rule: ${error}`);\n return undefined;\n }\n}\nfunction convertPropertyFormattingInternal(wireFormatting) {\n switch (wireFormatting.type) {\n case \"date\":\n return convertDateFormattingRule(wireFormatting);\n case \"timestamp\":\n return convertTimestampFormattingRule(wireFormatting);\n case \"boolean\":\n return convertBooleanFormattingRule(wireFormatting);\n case \"knownType\":\n return convertKnownTypeFormattingRule(wireFormatting);\n case \"number\":\n return convertNumberFormattingRule(wireFormatting);\n default:\n wireFormatting;\n throw new Error(`Unknown formatting type: ${wireFormatting.type}`);\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 { wirePropertyFormattingToSdkFormatting } from \"./wirePropertyFormattingToSdkFormatting.js\";\n\n/**\n * Extracts main value metadata from a struct property type.\n * Returns the fields array that comprise the main value.\n */\nfunction extractMainValue(dataType) {\n if (dataType.type === \"struct\" && dataType.mainValue) {\n const fields = dataType.mainValue.fields;\n if (fields && fields.length > 0) {\n return {\n fields\n };\n }\n }\n return undefined;\n}\n\n/**\n * Checks if an array property type has reducers.\n */\nfunction hasReducers(dataType) {\n return dataType.type === \"array\" && dataType.reducers != null && dataType.reducers.length > 0;\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 \"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 valueTypeApiName: input.valueTypeApiName,\n valueFormatting: input.valueFormatting != null ? wirePropertyFormattingToSdkFormatting(input.valueFormatting, log) : undefined\n };\n case \"struct\":\n {\n const mainValue = extractMainValue(input.dataType);\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 valueTypeApiName: input.valueTypeApiName,\n valueFormatting: input.valueFormatting != null ? wirePropertyFormattingToSdkFormatting(input.valueFormatting, log) : undefined,\n mainValue\n };\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 valueTypeApiName: input.valueTypeApiName,\n valueFormatting: input.valueFormatting != null ? wirePropertyFormattingToSdkFormatting(input.valueFormatting, log) : undefined,\n hasReducers: hasReducers(input.dataType)\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 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 { GeneratorError } from \"./GeneratorError.js\";\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 GeneratorError(\"Primary key not found in object type\", {\n primaryKey: objectTypeWithLink.objectType.primaryKey,\n objectTypeApiName: objectTypeWithLink.objectType.apiName\n });\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).sort(([a], [b]) => a.localeCompare(b)).map(([interfaceApiName, impl]) => {\n // prefer V2 if available and non-empty\n if (impl.propertiesV2 && Object.keys(impl.propertiesV2).length > 0) {\n const propMap = {};\n for (const [iptApiName, implementation] of Object.entries(impl.propertiesV2)) {\n if (implementation.type === \"localPropertyImplementation\") {\n propMap[iptApiName] = implementation.propertyApiName;\n }\n }\n return [interfaceApiName, propMap];\n }\n // fall back to V1\n return [interfaceApiName, impl.properties];\n })) : {};\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).sort(([a], [b]) => a.localeCompare(b))),\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 { GeneratorError } from \"./GeneratorError.js\";\nimport { getModifiedEntityTypes } from \"./getEditedEntities.js\";\nimport { ensureStringEnumSupportedOrUndefined, supportedReleaseStatus } from \"./wireObjectTypeFullMetadataToSdkObjectMetadata.js\";\nexport function wireActionTypeV2ToSdkActionMetadata(input, unsanitizedApiName) {\n const modifiedEntityTypes = getModifiedEntityTypes(input);\n return {\n type: \"action\",\n apiName: input.apiName,\n unsanitizedApiName: unsanitizedApiName ?? input.apiName,\n parameters: Object.fromEntries(Object.entries(input.parameters).sort(([a], [b]) => a.localeCompare(b)).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 GeneratorError(\"Unsupported action parameter type\", {\n parameterType: JSON.stringify(parameterType)\n });\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 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 { wireInterfaceTypeV2ToSdkObjectDefinition as __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition };\nexport function 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(\n // prefer V2 if available and non-empty, otherwise fall back to V1\n interfaceType.allPropertiesV2 && Object.keys(interfaceType.allPropertiesV2).length > 0 ? interfaceType.allPropertiesV2 : interfaceType.allProperties ?? interfaceType.properties).map(([key, value]) => {\n return [key, wirePropertyV2ToSdkPropertyDefinition(value, true, log)];\n }).filter(([_, value]) => value != null).sort(([a], [b]) => a.localeCompare(b))),\n links: Object.fromEntries(Object.entries(interfaceType.allLinks ?? interfaceType.links ?? {}).sort(([a], [b]) => a.localeCompare(b)).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 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 case \"mediaReference\":\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 array: wireQueryDataTypeToQueryDataTypeDefinition(input.subType),\n type: \"array\",\n nullable: isNullableQueryDataType(input.subType)\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.type === \"array\") {\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 \"typeReference\":\n return {\n type: \"typeReference\",\n typeId: input.typeId,\n nullable: false\n };\n case \"null\":\n case \"unsupported\":\n case \"void\":\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).sort(([a], [b]) => a.localeCompare(b)).map(([name, parameter]) => [name, wireQueryParameterV2ToQueryParameterDefinition(parameter)])),\n output: wireQueryDataTypeToQueryDataTypeDefinition(input.output),\n rid: input.rid,\n typeReferences: input.typeReferences && Object.keys(input.typeReferences).length > 0 ? Object.fromEntries(Object.entries(input.typeReferences).map(([typeId, dataType]) => [typeId, wireQueryDataTypeToQueryDataTypeDefinition(dataType)])) : undefined\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}"]}
|
package/build/cjs/index.d.cts
CHANGED
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
import { ActionMetadata, InterfaceMetadata, ObjectMetadata, QueryDataTypeDefinition, QueryParameterDefinition, QueryMetadata } from '@osdk/api';
|
|
2
2
|
import { ActionTypeV2, InterfaceType, ObjectTypeFullMetadata, PropertyApiName, PropertyV2, SharedPropertyType, ResolvedInterfacePropertyType, QueryDataType, QueryParameterV2, QueryTypeV2 } from '@osdk/foundry.ontologies';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* An error thrown during SDK generation whose message is safe to log directly.
|
|
6
|
+
* User-controlled data (API names, display names, etc.) goes in `unsafeParams`;
|
|
7
|
+
* safe diagnostic context (RIDs, counts, type identifiers) goes in `params`.
|
|
8
|
+
*/
|
|
9
|
+
declare class GeneratorError extends Error {
|
|
10
|
+
readonly params?: Record<string, unknown>;
|
|
11
|
+
readonly unsafeParams?: Record<string, unknown>;
|
|
12
|
+
constructor(message: string, unsafeParams?: Record<string, unknown>, params?: Record<string, unknown>);
|
|
13
|
+
}
|
|
14
|
+
|
|
4
15
|
declare function wireActionTypeV2ToSdkActionMetadata(input: ActionTypeV2, unsanitizedApiName?: string): ActionMetadata;
|
|
5
16
|
|
|
6
17
|
declare function wireInterfaceTypeV2ToSdkObjectDefinition(interfaceType: InterfaceType, v2: boolean, log?: {
|
|
@@ -36,4 +47,4 @@ declare function wireQueryTypeV2ToSdkQueryDefinitionNoParams(input: QueryTypeV2)
|
|
|
36
47
|
};
|
|
37
48
|
declare function wireQueryParameterV2ToQueryParameterDefinition(parameter: QueryParameterV2): QueryParameterDefinition<any>;
|
|
38
49
|
|
|
39
|
-
export { wireInterfaceTypeV2ToSdkObjectDefinition as __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition, wireActionTypeV2ToSdkActionMetadata, wireInterfaceTypeV2ToSdkObjectDefinition, wireObjectTypeFullMetadataToSdkObjectMetadata, wirePropertyV2ToSdkPropertyDefinition, wireQueryDataTypeToQueryDataTypeDefinition, wireQueryParameterV2ToQueryParameterDefinition, wireQueryTypeV2ToSdkQueryDefinitionNoParams, wireQueryTypeV2ToSdkQueryMetadata };
|
|
50
|
+
export { GeneratorError, wireInterfaceTypeV2ToSdkObjectDefinition as __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition, wireActionTypeV2ToSdkActionMetadata, wireInterfaceTypeV2ToSdkObjectDefinition, wireObjectTypeFullMetadataToSdkObjectMetadata, wirePropertyV2ToSdkPropertyDefinition, wireQueryDataTypeToQueryDataTypeDefinition, wireQueryParameterV2ToQueryParameterDefinition, wireQueryTypeV2ToSdkQueryDefinitionNoParams, wireQueryTypeV2ToSdkQueryMetadata };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026 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
|
+
/**
|
|
18
|
+
* An error thrown during SDK generation whose message is safe to log directly.
|
|
19
|
+
* User-controlled data (API names, display names, etc.) goes in `unsafeParams`;
|
|
20
|
+
* safe diagnostic context (RIDs, counts, type identifiers) goes in `params`.
|
|
21
|
+
*/
|
|
22
|
+
export class GeneratorError extends Error {
|
|
23
|
+
constructor(message, unsafeParams, params) {
|
|
24
|
+
super(message);
|
|
25
|
+
this.name = "GeneratorError";
|
|
26
|
+
this.unsafeParams = unsafeParams;
|
|
27
|
+
this.params = params;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=GeneratorError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GeneratorError.js","names":["GeneratorError","Error","constructor","message","unsafeParams","params","name"],"sources":["GeneratorError.ts"],"sourcesContent":["/*\n * Copyright 2026 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\n/**\n * An error thrown during SDK generation whose message is safe to log directly.\n * User-controlled data (API names, display names, etc.) goes in `unsafeParams`;\n * safe diagnostic context (RIDs, counts, type identifiers) goes in `params`.\n */\nexport class GeneratorError extends Error {\n readonly params?: Record<string, unknown>;\n readonly unsafeParams?: Record<string, unknown>;\n\n constructor(\n message: string,\n unsafeParams?: Record<string, unknown>,\n params?: Record<string, unknown>,\n ) {\n super(message);\n this.name = \"GeneratorError\";\n this.unsafeParams = unsafeParams;\n this.params = params;\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,cAAc,SAASC,KAAK,CAAC;EAIxCC,WAAWA,CACTC,OAAe,EACfC,YAAsC,EACtCC,MAAgC,EAChC;IACA,KAAK,CAACF,OAAO,CAAC;IACd,IAAI,CAACG,IAAI,GAAG,gBAAgB;IAC5B,IAAI,CAACF,YAAY,GAAGA,YAAY;IAChC,IAAI,CAACC,MAAM,GAAGA,MAAM;EACtB;AACF","ignoreList":[]}
|
package/build/esm/index.js
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
+
export { GeneratorError } from "./GeneratorError.js";
|
|
17
18
|
export { wireActionTypeV2ToSdkActionMetadata } from "./wireActionTypeV2ToSdkActionMetadata.js";
|
|
18
19
|
export { __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition, wireInterfaceTypeV2ToSdkObjectDefinition } from "./wireInterfaceTypeV2ToSdkObjectDefinition.js";
|
|
19
20
|
export { wireObjectTypeFullMetadataToSdkObjectMetadata } from "./wireObjectTypeFullMetadataToSdkObjectMetadata.js";
|
package/build/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["wireActionTypeV2ToSdkActionMetadata","__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition","wireInterfaceTypeV2ToSdkObjectDefinition","wireObjectTypeFullMetadataToSdkObjectMetadata","wirePropertyV2ToSdkPropertyDefinition","wireQueryDataTypeToQueryDataTypeDefinition","wireQueryTypeV2ToSdkQueryMetadata","wireQueryParameterV2ToQueryParameterDefinition","wireQueryTypeV2ToSdkQueryDefinitionNoParams"],"sources":["index.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\nexport { wireActionTypeV2ToSdkActionMetadata } from \"./wireActionTypeV2ToSdkActionMetadata.js\";\nexport {\n __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition,\n wireInterfaceTypeV2ToSdkObjectDefinition,\n} from \"./wireInterfaceTypeV2ToSdkObjectDefinition.js\";\nexport { wireObjectTypeFullMetadataToSdkObjectMetadata } from \"./wireObjectTypeFullMetadataToSdkObjectMetadata.js\";\nexport { wirePropertyV2ToSdkPropertyDefinition } from \"./wirePropertyV2ToSdkPropertyDefinition.js\";\nexport { wireQueryDataTypeToQueryDataTypeDefinition } from \"./wireQueryDataTypeToQueryDataTypeDefinition.js\";\nexport { wireQueryTypeV2ToSdkQueryMetadata } from \"./wireQueryTypeV2ToSdkQueryMetadata.js\";\nexport { wireQueryParameterV2ToQueryParameterDefinition } from \"./wireQueryTypeV2ToSdkQueryMetadata.js\";\nexport { wireQueryTypeV2ToSdkQueryDefinitionNoParams } from \"./wireQueryTypeV2ToSdkQueryMetadata.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,mCAAmC,QAAQ,0CAA0C;AAC9F,SACEC,mDAAmD,EACnDC,wCAAwC,QACnC,+CAA+C;AACtD,SAASC,6CAA6C,QAAQ,oDAAoD;AAClH,SAASC,qCAAqC,QAAQ,4CAA4C;AAClG,SAASC,0CAA0C,QAAQ,iDAAiD;AAC5G,SAASC,iCAAiC,QAAQ,wCAAwC;AAC1F,SAASC,8CAA8C,QAAQ,wCAAwC;AACvG,SAASC,2CAA2C,QAAQ,wCAAwC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["GeneratorError","wireActionTypeV2ToSdkActionMetadata","__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition","wireInterfaceTypeV2ToSdkObjectDefinition","wireObjectTypeFullMetadataToSdkObjectMetadata","wirePropertyV2ToSdkPropertyDefinition","wireQueryDataTypeToQueryDataTypeDefinition","wireQueryTypeV2ToSdkQueryMetadata","wireQueryParameterV2ToQueryParameterDefinition","wireQueryTypeV2ToSdkQueryDefinitionNoParams"],"sources":["index.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\nexport { GeneratorError } from \"./GeneratorError.js\";\nexport { wireActionTypeV2ToSdkActionMetadata } from \"./wireActionTypeV2ToSdkActionMetadata.js\";\nexport {\n __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition,\n wireInterfaceTypeV2ToSdkObjectDefinition,\n} from \"./wireInterfaceTypeV2ToSdkObjectDefinition.js\";\nexport { wireObjectTypeFullMetadataToSdkObjectMetadata } from \"./wireObjectTypeFullMetadataToSdkObjectMetadata.js\";\nexport { wirePropertyV2ToSdkPropertyDefinition } from \"./wirePropertyV2ToSdkPropertyDefinition.js\";\nexport { wireQueryDataTypeToQueryDataTypeDefinition } from \"./wireQueryDataTypeToQueryDataTypeDefinition.js\";\nexport { wireQueryTypeV2ToSdkQueryMetadata } from \"./wireQueryTypeV2ToSdkQueryMetadata.js\";\nexport { wireQueryParameterV2ToQueryParameterDefinition } from \"./wireQueryTypeV2ToSdkQueryMetadata.js\";\nexport { wireQueryTypeV2ToSdkQueryDefinitionNoParams } from \"./wireQueryTypeV2ToSdkQueryMetadata.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,cAAc,QAAQ,qBAAqB;AACpD,SAASC,mCAAmC,QAAQ,0CAA0C;AAC9F,SACEC,mDAAmD,EACnDC,wCAAwC,QACnC,+CAA+C;AACtD,SAASC,6CAA6C,QAAQ,oDAAoD;AAClH,SAASC,qCAAqC,QAAQ,4CAA4C;AAClG,SAASC,0CAA0C,QAAQ,iDAAiD;AAC5G,SAASC,iCAAiC,QAAQ,wCAAwC;AAC1F,SAASC,8CAA8C,QAAQ,wCAAwC;AACvG,SAASC,2CAA2C,QAAQ,wCAAwC","ignoreList":[]}
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
+
import { GeneratorError } from "./GeneratorError.js";
|
|
17
18
|
import { getModifiedEntityTypes } from "./getEditedEntities.js";
|
|
18
19
|
import { ensureStringEnumSupportedOrUndefined, supportedReleaseStatus } from "./wireObjectTypeFullMetadataToSdkObjectMetadata.js";
|
|
19
20
|
export function wireActionTypeV2ToSdkActionMetadata(input, unsanitizedApiName) {
|
|
@@ -81,7 +82,9 @@ function actionPropertyToSdkPropertyDefinition(parameterType) {
|
|
|
81
82
|
}, {})
|
|
82
83
|
};
|
|
83
84
|
default:
|
|
84
|
-
throw new
|
|
85
|
+
throw new GeneratorError("Unsupported action parameter type", {
|
|
86
|
+
parameterType: JSON.stringify(parameterType)
|
|
87
|
+
});
|
|
85
88
|
}
|
|
86
89
|
}
|
|
87
90
|
function createModifiedEntities(addedObjects, modifiedObjects) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wireActionTypeV2ToSdkActionMetadata.js","names":["getModifiedEntityTypes","ensureStringEnumSupportedOrUndefined","supportedReleaseStatus","wireActionTypeV2ToSdkActionMetadata","input","unsanitizedApiName","modifiedEntityTypes","type","apiName","parameters","Object","fromEntries","entries","sort","a","b","localeCompare","map","key","value","wireActionParameterV2ToSdkParameterDefinition","displayName","description","modifiedEntities","createModifiedEntities","addedObjects","modifiedObjects","rid","status","multiplicity","dataType","actionPropertyToSdkPropertyDefinition","subType","nullable","required","parameterType","objectSet","objectTypeApiName","object","interface","interfaceTypeApiName","struct","fields","reduce","structMap","structField","name","fieldType","
|
|
1
|
+
{"version":3,"file":"wireActionTypeV2ToSdkActionMetadata.js","names":["GeneratorError","getModifiedEntityTypes","ensureStringEnumSupportedOrUndefined","supportedReleaseStatus","wireActionTypeV2ToSdkActionMetadata","input","unsanitizedApiName","modifiedEntityTypes","type","apiName","parameters","Object","fromEntries","entries","sort","a","b","localeCompare","map","key","value","wireActionParameterV2ToSdkParameterDefinition","displayName","description","modifiedEntities","createModifiedEntities","addedObjects","modifiedObjects","rid","status","multiplicity","dataType","actionPropertyToSdkPropertyDefinition","subType","nullable","required","parameterType","objectSet","objectTypeApiName","object","interface","interfaceTypeApiName","struct","fields","reduce","structMap","structField","name","fieldType","JSON","stringify","entities","created","modified"],"sources":["wireActionTypeV2ToSdkActionMetadata.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 { ActionMetadata } from \"@osdk/api\";\nimport type {\n ActionParameterType,\n ActionParameterV2,\n ActionTypeV2,\n} from \"@osdk/foundry.ontologies\";\nimport { GeneratorError } from \"./GeneratorError.js\";\nimport { getModifiedEntityTypes } from \"./getEditedEntities.js\";\nimport {\n ensureStringEnumSupportedOrUndefined,\n supportedReleaseStatus,\n} from \"./wireObjectTypeFullMetadataToSdkObjectMetadata.js\";\n\nexport function wireActionTypeV2ToSdkActionMetadata(\n input: ActionTypeV2,\n unsanitizedApiName?: string,\n): ActionMetadata {\n const modifiedEntityTypes = getModifiedEntityTypes(input);\n return {\n type: \"action\",\n apiName: input.apiName,\n unsanitizedApiName: unsanitizedApiName ?? input.apiName,\n parameters: Object.fromEntries(\n Object.entries(input.parameters).sort(\n ([a], [b]) => a.localeCompare(b),\n ).map((\n [key, value],\n ) => [key, wireActionParameterV2ToSdkParameterDefinition(value)]),\n ),\n displayName: input.displayName,\n description: input.description,\n modifiedEntities: createModifiedEntities(\n modifiedEntityTypes.addedObjects,\n modifiedEntityTypes.modifiedObjects,\n ),\n rid: input.rid,\n status: ensureStringEnumSupportedOrUndefined(\n input.status,\n supportedReleaseStatus,\n ),\n };\n}\n\nfunction wireActionParameterV2ToSdkParameterDefinition(\n value: ActionParameterV2,\n): ActionMetadata.Parameter<any> {\n return {\n multiplicity: value.dataType.type === \"array\",\n type: actionPropertyToSdkPropertyDefinition(\n value.dataType.type === \"array\" ? value.dataType.subType : value.dataType,\n ),\n nullable: !value.required,\n description: value.description,\n };\n}\n\nfunction actionPropertyToSdkPropertyDefinition(\n parameterType: ActionParameterType,\n): ActionMetadata.Parameter[\"type\"] {\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 { type: \"objectSet\", objectSet: parameterType.objectTypeApiName! };\n case \"object\":\n return { type: \"object\", object: parameterType.objectTypeApiName };\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(\n (\n structMap: Record<\n string,\n ActionMetadata.DataType.BaseActionParameterTypes\n >,\n structField,\n ) => {\n structMap[structField.name] = actionPropertyToSdkPropertyDefinition(\n structField.fieldType as ActionParameterType,\n ) as ActionMetadata.DataType.BaseActionParameterTypes;\n return structMap;\n },\n {},\n ),\n };\n default:\n throw new GeneratorError(\"Unsupported action parameter type\", {\n parameterType: JSON.stringify(parameterType),\n });\n }\n}\n\nfunction createModifiedEntities<K extends string>(\n addedObjects: Set<K>,\n modifiedObjects: Set<K>,\n): ActionMetadata[\"modifiedEntities\"] {\n const entities = {} as Record<\n K,\n {\n created: boolean;\n modified: boolean;\n }\n >;\n\n for (const key of addedObjects) {\n entities[key] = { created: true, modified: false };\n }\n\n for (const key of modifiedObjects) {\n if (entities[key]) {\n entities[key].modified = true;\n } else {\n entities[key] = { created: false, modified: true };\n }\n }\n\n return entities;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAQA,SAASA,cAAc,QAAQ,qBAAqB;AACpD,SAASC,sBAAsB,QAAQ,wBAAwB;AAC/D,SACEC,oCAAoC,EACpCC,sBAAsB,QACjB,oDAAoD;AAE3D,OAAO,SAASC,mCAAmCA,CACjDC,KAAmB,EACnBC,kBAA2B,EACX;EAChB,MAAMC,mBAAmB,GAAGN,sBAAsB,CAACI,KAAK,CAAC;EACzD,OAAO;IACLG,IAAI,EAAE,QAAQ;IACdC,OAAO,EAAEJ,KAAK,CAACI,OAAO;IACtBH,kBAAkB,EAAEA,kBAAkB,IAAID,KAAK,CAACI,OAAO;IACvDC,UAAU,EAAEC,MAAM,CAACC,WAAW,CAC5BD,MAAM,CAACE,OAAO,CAACR,KAAK,CAACK,UAAU,CAAC,CAACI,IAAI,CACnC,CAAC,CAACC,CAAC,CAAC,EAAE,CAACC,CAAC,CAAC,KAAKD,CAAC,CAACE,aAAa,CAACD,CAAC,CACjC,CAAC,CAACE,GAAG,CAAC,CACJ,CAACC,GAAG,EAAEC,KAAK,CAAC,KACT,CAACD,GAAG,EAAEE,6CAA6C,CAACD,KAAK,CAAC,CAAC,CAClE,CAAC;IACDE,WAAW,EAAEjB,KAAK,CAACiB,WAAW;IAC9BC,WAAW,EAAElB,KAAK,CAACkB,WAAW;IAC9BC,gBAAgB,EAAEC,sBAAsB,CACtClB,mBAAmB,CAACmB,YAAY,EAChCnB,mBAAmB,CAACoB,eACtB,CAAC;IACDC,GAAG,EAAEvB,KAAK,CAACuB,GAAG;IACdC,MAAM,EAAE3B,oCAAoC,CAC1CG,KAAK,CAACwB,MAAM,EACZ1B,sBACF;E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CACEC,SAGC,EACDC,WAAW,KACR;UACHD,SAAS,CAACC,WAAW,CAACC,IAAI,CAAC,GAAGf,qCAAqC,CACjEc,WAAW,CAACE,SACd,CAAqD;UACrD,OAAOH,SAAS;QAClB,CAAC,EACD,CAAC,CACH;MACF,CAAC;IACH;MACE,MAAM,IAAI7C,cAAc,CAAC,mCAAmC,EAAE;QAC5DoC,aAAa,EAAEa,IAAI,CAACC,SAAS,CAACd,aAAa;MAC7C,CAAC,CAAC;EACN;AACF;AAEA,SAASX,sBAAsBA,CAC7BC,YAAoB,EACpBC,eAAuB,EACa;EACpC,MAAMwB,QAAQ,GAAG,CAAC,CAMjB;EAED,KAAK,MAAMhC,GAAG,IAAIO,YAAY,EAAE;IAC9ByB,QAAQ,CAAChC,GAAG,CAAC,GAAG;MAAEiC,OAAO,EAAE,IAAI;MAAEC,QAAQ,EAAE;IAAM,CAAC;EACpD;EAEA,KAAK,MAAMlC,GAAG,IAAIQ,eAAe,EAAE;IACjC,IAAIwB,QAAQ,CAAChC,GAAG,CAAC,EAAE;MACjBgC,QAAQ,CAAChC,GAAG,CAAC,CAACkC,QAAQ,GAAG,IAAI;IAC/B,CAAC,MAAM;MACLF,QAAQ,CAAChC,GAAG,CAAC,GAAG;QAAEiC,OAAO,EAAE,KAAK;QAAEC,QAAQ,EAAE;MAAK,CAAC;IACpD;EACF;EAEA,OAAOF,QAAQ;AACjB","ignoreList":[]}
|
|
@@ -14,11 +14,15 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
+
import { GeneratorError } from "./GeneratorError.js";
|
|
17
18
|
import { wirePropertyV2ToSdkPrimaryKeyTypeDefinition } from "./wirePropertyV2ToSdkPrimaryKeyTypeDefinition.js";
|
|
18
19
|
import { wirePropertyV2ToSdkPropertyDefinition } from "./wirePropertyV2ToSdkPropertyDefinition.js";
|
|
19
20
|
export function wireObjectTypeFullMetadataToSdkObjectMetadata(objectTypeWithLink, v2, log) {
|
|
20
21
|
if (objectTypeWithLink.objectType.properties[objectTypeWithLink.objectType.primaryKey] === undefined) {
|
|
21
|
-
throw new
|
|
22
|
+
throw new GeneratorError("Primary key not found in object type", {
|
|
23
|
+
primaryKey: objectTypeWithLink.objectType.primaryKey,
|
|
24
|
+
objectTypeApiName: objectTypeWithLink.objectType.apiName
|
|
25
|
+
});
|
|
22
26
|
}
|
|
23
27
|
|
|
24
28
|
// saved ontology.json files may not have this implementsInterfaces2 so we need to handle
|
|
@@ -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","sort","a","b","localeCompare","map","interfaceApiName","impl","propertiesV2","keys","length","propMap","iptApiName","implementation","type","propertyApiName","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","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).sort(\n ([a], [b]) => a.localeCompare(b),\n ).map(\n ([interfaceApiName, impl]) => {\n // prefer V2 if available and non-empty\n if (\n impl.propertiesV2\n && Object.keys(impl.propertiesV2).length > 0\n ) {\n const propMap: Record<string, string> = {};\n for (\n const [iptApiName, implementation] of Object.entries(\n impl.propertiesV2,\n )\n ) {\n if (implementation.type === \"localPropertyImplementation\") {\n propMap[iptApiName] = implementation.propertyApiName;\n }\n }\n return [interfaceApiName, propMap];\n }\n // fall back to V1\n return [interfaceApiName, impl.properties];\n },\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 .sort(([a], [b]) => (a as string).localeCompare(b as string)),\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,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,IAAI,CAC3D,CAAC,CAACC,CAAC,CAAC,EAAE,CAACC,CAAC,CAAC,KAAKD,CAAC,CAACE,aAAa,CAACD,CAAC,CACjC,CAAC,CAACE,GAAG,CACH,CA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C,SAAS;IACb6C,aAAa,EAAEnD,kBAAkB,CAACG,UAAU,CAACgD,aAAa;IAC1DC,WAAW,EAAEpD,kBAAkB,CAACG,UAAU,CAACiD,WAAW;IACtDC,iBAAiB,EAAErD,kBAAkB,CAACG,UAAU,CAACkD,iBAAiB;IAClEC,MAAM,EAAEC,oCAAoC,CAC1CvD,kBAAkB,CAACG,UAAU,CAACmD,MAAM,EACpCE,sBACF,CAAC;IACDC,GAAG,EAAEzD,kBAAkB,CAACG,UAAU,CAACsD,GAAG;IACtCC,UAAU,EAAEH,oCAAoC,CAC9CvD,kBAAkB,CAACG,UAAU,CAACuD,UAAU,EACxCC,6BACF;EACF,CAAC;AACH;AAEA,SAASZ,WAAWA,CAClB/B,CAA0B,EACsC;EAChE,OAAQA,CAAC,GACLJ,MAAM,CAACC,WAAW,CAACD,MAAM,CAACE,OAAO,CAACE,CAAC,CAAC,CAACG,GAAG,CAAC,CAAC,CAACyC,CAAC,EAAEC,CAAC,CAAC,KAAK,CAACA,CAAC,EAAED,CAAC,CAAC,CAAC,CAAC,GAC7DtD,SAAS;AAEf;AAEA,OAAO,MAAM2C,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,GAAGnC,SAAS;AACrE","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"wireObjectTypeFullMetadataToSdkObjectMetadata.js","names":["GeneratorError","wirePropertyV2ToSdkPrimaryKeyTypeDefinition","wirePropertyV2ToSdkPropertyDefinition","wireObjectTypeFullMetadataToSdkObjectMetadata","objectTypeWithLink","v2","log","objectType","properties","primaryKey","undefined","objectTypeApiName","apiName","implementsInterfaces2","implementsInterfaces","Error","interfaceMap","Object","fromEntries","entries","sort","a","b","localeCompare","map","interfaceApiName","impl","propertiesV2","keys","length","propMap","iptApiName","implementation","type","propertyApiName","description","primaryKeyApiName","primaryKeyType","links","linkTypes","linkType","multiplicity","cardinality","targetType","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 { GeneratorError } from \"./GeneratorError.js\";\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 GeneratorError(\"Primary key not found in object type\", {\n primaryKey: objectTypeWithLink.objectType.primaryKey,\n objectTypeApiName: 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).sort(\n ([a], [b]) => a.localeCompare(b),\n ).map(\n ([interfaceApiName, impl]) => {\n // prefer V2 if available and non-empty\n if (\n impl.propertiesV2\n && Object.keys(impl.propertiesV2).length > 0\n ) {\n const propMap: Record<string, string> = {};\n for (\n const [iptApiName, implementation] of Object.entries(\n impl.propertiesV2,\n )\n ) {\n if (implementation.type === \"localPropertyImplementation\") {\n propMap[iptApiName] = implementation.propertyApiName;\n }\n }\n return [interfaceApiName, propMap];\n }\n // fall back to V1\n return [interfaceApiName, impl.properties];\n },\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 .sort(([a], [b]) => (a as string).localeCompare(b as string)),\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;A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U,EAAEH,oCAAoC,CAC9CvD,kBAAkB,CAACG,UAAU,CAACuD,UAAU,EACxCC,6BACF;EACF,CAAC;AACH;AAEA,SAASZ,WAAWA,CAClB9B,CAA0B,EACsC;EAChE,OAAQA,CAAC,GACLJ,MAAM,CAACC,WAAW,CAACD,MAAM,CAACE,OAAO,CAACE,CAAC,CAAC,CAACG,GAAG,CAAC,CAAC,CAACwC,CAAC,EAAEC,CAAC,CAAC,KAAK,CAACA,CAAC,EAAED,CAAC,CAAC,CAAC,CAAC,GAC7DtD,SAAS;AAEf;AAEA,OAAO,MAAM2C,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,GAAGnC,SAAS;AACrE","ignoreList":[]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An error thrown during SDK generation whose message is safe to log directly.
|
|
3
|
+
* User-controlled data (API names, display names, etc.) goes in `unsafeParams`;
|
|
4
|
+
* safe diagnostic context (RIDs, counts, type identifiers) goes in `params`.
|
|
5
|
+
*/
|
|
6
|
+
export declare class GeneratorError extends Error {
|
|
7
|
+
readonly params?: Record<string, unknown>;
|
|
8
|
+
readonly unsafeParams?: Record<string, unknown>;
|
|
9
|
+
constructor(message: string, unsafeParams?: Record<string, unknown>, params?: Record<string, unknown>);
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;AAqBA,OAAO,cAAM,uBAAuB,MAAM;CACxC,SAAS,SAAS;CAClB,SAAS,eAAe;CAExB,YACEA,iBACAC,eAAe,yBACfC,SAAS;AAOZ","names":["message: string","unsafeParams?: Record<string, unknown>","params?: Record<string, unknown>"],"sources":["../../src/GeneratorError.ts"],"version":3,"file":"GeneratorError.d.ts"}
|
package/build/types/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { GeneratorError } from "./GeneratorError.js";
|
|
1
2
|
export { wireActionTypeV2ToSdkActionMetadata } from "./wireActionTypeV2ToSdkActionMetadata.js";
|
|
2
3
|
export { __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition, wireInterfaceTypeV2ToSdkObjectDefinition } from "./wireInterfaceTypeV2ToSdkObjectDefinition.js";
|
|
3
4
|
export { wireObjectTypeFullMetadataToSdkObjectMetadata } from "./wireObjectTypeFullMetadataToSdkObjectMetadata.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAgBA,SAAS,2CAA2C;AACpD,SACE,qDACA,gDACK;AACP,SAAS,qDAAqD;AAC9D,SAAS,6CAA6C;AACtD,SAAS,kDAAkD;AAC3D,SAAS,yCAAyC;AAClD,SAAS,sDAAsD;AAC/D,SAAS,mDAAmD","names":[],"sources":["../../src/index.ts"],"version":3,"file":"index.d.ts"}
|
|
1
|
+
{"mappings":"AAgBA,SAAS,sBAAsB;AAC/B,SAAS,2CAA2C;AACpD,SACE,qDACA,gDACK;AACP,SAAS,qDAAqD;AAC9D,SAAS,6CAA6C;AACtD,SAAS,kDAAkD;AAC3D,SAAS,yCAAyC;AAClD,SAAS,sDAAsD;AAC/D,SAAS,mDAAmD","names":[],"sources":["../../src/index.ts"],"version":3,"file":"index.d.ts"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAgBA,cAAc,sBAAsB,WAAY;AAChD,cAGE,oBACK,0BAA2B;
|
|
1
|
+
{"mappings":"AAgBA,cAAc,sBAAsB,WAAY;AAChD,cAGE,oBACK,0BAA2B;AAQlC,OAAO,iBAAS,oCACdA,OAAO,cACPC,8BACC","names":["input: ActionTypeV2","unsanitizedApiName?: string"],"sources":["../../src/wireActionTypeV2ToSdkActionMetadata.ts"],"version":3,"file":"wireActionTypeV2ToSdkActionMetadata.d.ts"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAgBA,cAAc,sBAAsB,WAAY;AAChD,cACE,wBACA,iBACA,kBACK,0BAA2B;
|
|
1
|
+
{"mappings":"AAgBA,cAAc,sBAAsB,WAAY;AAChD,cACE,wBACA,iBACA,kBACK,0BAA2B;AAKlC,OAAO,iBAAS,8CACdA,oBAAoB,yBAAyB;CAC3C,YAAY;EACV,YAAY,OAAO,iBAAiB,aAAa;GAAE;EAAoB;CACxE;AACF,GACDC,aACAC,MAAM;CAAE,OAAOC;AAAsB,IACpC;AAyHH,OAAO,cAAM,8BAAsB;AAEnC,OAAO,cAAM,kCACX,UACA,gBACA,cACA;AAGF,OAAO,cAAM,yCACX,UACA,aACA;AAGF,OAAO,iBAAS,qCAAqC,kBACnDC,OAAO,eACPC,qCACC","names":["objectTypeWithLink: ObjectTypeFullMetadata & {\n objectType: {\n properties: Record<PropertyApiName, PropertyV2 & { nullable?: boolean }>;\n };\n }","v2: boolean","log?: { info: (msg: string) => void }","msg: string","value: T | undefined","supportedValues: readonly string[]"],"sources":["../../src/wireObjectTypeFullMetadataToSdkObjectMetadata.ts"],"version":3,"file":"wireObjectTypeFullMetadataToSdkObjectMetadata.d.ts"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@osdk/generator-converters",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.23.0-main-9fb5afb7955ddffd2b9a89d03d6c2ca3528e371c",
|
|
4
4
|
"description": "",
|
|
5
5
|
"access": "public",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -30,14 +30,14 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@osdk/foundry.ontologies": "2.57.0",
|
|
33
|
-
"@osdk/api": "~2.
|
|
33
|
+
"@osdk/api": "~2.23.0-main-9fb5afb7955ddffd2b9a89d03d6c2ca3528e371c"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"ts-expect": "^1.3.0",
|
|
37
37
|
"typescript": "~5.5.4",
|
|
38
38
|
"vitest": "^3.2.4",
|
|
39
|
-
"@osdk/monorepo.
|
|
40
|
-
"@osdk/monorepo.
|
|
39
|
+
"@osdk/monorepo.api-extractor": "~0.7.0",
|
|
40
|
+
"@osdk/monorepo.tsconfig": "~0.7.0"
|
|
41
41
|
},
|
|
42
42
|
"publishConfig": {
|
|
43
43
|
"access": "public"
|