@osdk/maker 0.16.0-beta.1 → 0.16.0-beta.11
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 +118 -0
- package/README.md +18 -1
- package/build/browser/api/cloneDefinition.js +36 -0
- package/build/browser/api/cloneDefinition.js.map +1 -0
- package/build/browser/api/code-snippets/createCodeSnippets.js +1 -1
- package/build/browser/api/code-snippets/createCodeSnippets.js.map +1 -1
- package/build/browser/api/defineAction.js +9 -1
- package/build/browser/api/defineAction.js.map +1 -1
- package/build/browser/api/defineCreateInterfaceObjectAction.js +3 -1
- package/build/browser/api/defineCreateInterfaceObjectAction.js.map +1 -1
- package/build/browser/api/defineCreateObjectAction.js +3 -1
- package/build/browser/api/defineCreateObjectAction.js.map +1 -1
- package/build/browser/api/defineCreateOrModifyObjectAction.js +3 -1
- package/build/browser/api/defineCreateOrModifyObjectAction.js.map +1 -1
- package/build/browser/api/defineDeleteInterfaceObjectAction.js +3 -1
- package/build/browser/api/defineDeleteInterfaceObjectAction.js.map +1 -1
- package/build/browser/api/defineDeleteObjectAction.js +3 -1
- package/build/browser/api/defineDeleteObjectAction.js.map +1 -1
- package/build/browser/api/defineFunction.js +62 -0
- package/build/browser/api/defineFunction.js.map +1 -0
- package/build/browser/api/defineInterface.js +6 -1
- package/build/browser/api/defineInterface.js.map +1 -1
- package/build/browser/api/defineInterfaceLinkConstraint.js +6 -2
- package/build/browser/api/defineInterfaceLinkConstraint.js.map +1 -1
- package/build/browser/api/defineLink.js +6 -1
- package/build/browser/api/defineLink.js.map +1 -1
- package/build/browser/api/defineModifyInterfaceObjectAction.js +3 -1
- package/build/browser/api/defineModifyInterfaceObjectAction.js.map +1 -1
- package/build/browser/api/defineModifyObjectAction.js +3 -1
- package/build/browser/api/defineModifyObjectAction.js.map +1 -1
- package/build/browser/api/defineObject.js +38 -12
- package/build/browser/api/defineObject.js.map +1 -1
- package/build/browser/api/defineOntology.js +29 -0
- package/build/browser/api/defineOntology.js.map +1 -1
- package/build/browser/api/defineSpt.js +3 -1
- package/build/browser/api/defineSpt.js.map +1 -1
- package/build/browser/api/defineValueType.js +3 -1
- package/build/browser/api/defineValueType.js.map +1 -1
- package/build/browser/api/interface/InterfaceType.js.map +1 -1
- package/build/browser/api/object/ObjectPropertyType.js.map +1 -1
- package/build/browser/api/object/ObjectType.js.map +1 -1
- package/build/browser/api/object/ObjectTypeDatasourceDefinition.js.map +1 -1
- package/build/browser/api/object/ObjectTypeDefinition.js.map +1 -1
- package/build/browser/api/properties/PropertyTypeType.js.map +1 -1
- package/build/browser/api/properties/ReducerType.js +2 -0
- package/build/browser/api/properties/ReducerType.js.map +1 -0
- package/build/browser/api/properties/SharedPropertyType.js.map +1 -1
- package/build/browser/cli/main.js +1 -1
- package/build/browser/cli/main.js.map +1 -1
- package/build/browser/conversion/toMarketplace/convertDatasourceDefinition.js +17 -6
- package/build/browser/conversion/toMarketplace/convertDatasourceDefinition.js.map +1 -1
- package/build/browser/conversion/toMarketplace/convertInterface.js +2 -1
- package/build/browser/conversion/toMarketplace/convertInterface.js.map +1 -1
- package/build/browser/conversion/toMarketplace/convertMainValue.js +36 -0
- package/build/browser/conversion/toMarketplace/convertMainValue.js.map +1 -0
- package/build/browser/conversion/toMarketplace/convertObjectPropertyType.js +4 -3
- package/build/browser/conversion/toMarketplace/convertObjectPropertyType.js.map +1 -1
- package/build/browser/conversion/toMarketplace/convertReducers.js +53 -0
- package/build/browser/conversion/toMarketplace/convertReducers.js.map +1 -0
- package/build/browser/conversion/toMarketplace/convertSpt.js +5 -3
- package/build/browser/conversion/toMarketplace/convertSpt.js.map +1 -1
- package/build/browser/conversion/toMarketplace/propertyTypeTypeToOntologyIrType.js +4 -2
- package/build/browser/conversion/toMarketplace/propertyTypeTypeToOntologyIrType.js.map +1 -1
- package/build/browser/index.js +5 -2
- package/build/browser/index.js.map +1 -1
- package/build/browser/util/ApiNameValidator.js +26 -0
- package/build/browser/util/ApiNameValidator.js.map +1 -0
- package/build/cjs/index.cjs +288 -108
- package/build/cjs/index.cjs.map +1 -1
- package/build/cjs/index.d.cts +216 -164
- package/build/esm/api/cloneDefinition.js +36 -0
- package/build/esm/api/cloneDefinition.js.map +1 -0
- package/build/esm/api/code-snippets/createCodeSnippets.js +1 -1
- package/build/esm/api/code-snippets/createCodeSnippets.js.map +1 -1
- package/build/esm/api/defineAction.js +9 -1
- package/build/esm/api/defineAction.js.map +1 -1
- package/build/esm/api/defineCreateInterfaceObjectAction.js +3 -1
- package/build/esm/api/defineCreateInterfaceObjectAction.js.map +1 -1
- package/build/esm/api/defineCreateObjectAction.js +3 -1
- package/build/esm/api/defineCreateObjectAction.js.map +1 -1
- package/build/esm/api/defineCreateOrModifyObjectAction.js +3 -1
- package/build/esm/api/defineCreateOrModifyObjectAction.js.map +1 -1
- package/build/esm/api/defineDeleteInterfaceObjectAction.js +3 -1
- package/build/esm/api/defineDeleteInterfaceObjectAction.js.map +1 -1
- package/build/esm/api/defineDeleteObjectAction.js +3 -1
- package/build/esm/api/defineDeleteObjectAction.js.map +1 -1
- package/build/esm/api/defineFunction.js +62 -0
- package/build/esm/api/defineFunction.js.map +1 -0
- package/build/esm/api/defineInterface.js +6 -1
- package/build/esm/api/defineInterface.js.map +1 -1
- package/build/esm/api/defineInterfaceLinkConstraint.js +6 -2
- package/build/esm/api/defineInterfaceLinkConstraint.js.map +1 -1
- package/build/esm/api/defineLink.js +6 -1
- package/build/esm/api/defineLink.js.map +1 -1
- package/build/esm/api/defineModifyInterfaceObjectAction.js +3 -1
- package/build/esm/api/defineModifyInterfaceObjectAction.js.map +1 -1
- package/build/esm/api/defineModifyObjectAction.js +3 -1
- package/build/esm/api/defineModifyObjectAction.js.map +1 -1
- package/build/esm/api/defineObject.js +38 -12
- package/build/esm/api/defineObject.js.map +1 -1
- package/build/esm/api/defineOntology.js +29 -0
- package/build/esm/api/defineOntology.js.map +1 -1
- package/build/esm/api/defineSpt.js +3 -1
- package/build/esm/api/defineSpt.js.map +1 -1
- package/build/esm/api/defineValueType.js +3 -1
- package/build/esm/api/defineValueType.js.map +1 -1
- package/build/esm/api/interface/InterfaceType.js.map +1 -1
- package/build/esm/api/object/ObjectPropertyType.js.map +1 -1
- package/build/esm/api/object/ObjectType.js.map +1 -1
- package/build/esm/api/object/ObjectTypeDatasourceDefinition.js.map +1 -1
- package/build/esm/api/object/ObjectTypeDefinition.js.map +1 -1
- package/build/esm/api/properties/PropertyTypeType.js.map +1 -1
- package/build/esm/api/properties/ReducerType.js +2 -0
- package/build/esm/api/properties/ReducerType.js.map +1 -0
- package/build/esm/api/properties/SharedPropertyType.js.map +1 -1
- package/build/esm/cli/main.js +1 -1
- package/build/esm/cli/main.js.map +1 -1
- package/build/esm/conversion/toMarketplace/convertDatasourceDefinition.js +17 -6
- package/build/esm/conversion/toMarketplace/convertDatasourceDefinition.js.map +1 -1
- package/build/esm/conversion/toMarketplace/convertInterface.js +2 -1
- package/build/esm/conversion/toMarketplace/convertInterface.js.map +1 -1
- package/build/esm/conversion/toMarketplace/convertMainValue.js +36 -0
- package/build/esm/conversion/toMarketplace/convertMainValue.js.map +1 -0
- package/build/esm/conversion/toMarketplace/convertObjectPropertyType.js +4 -3
- package/build/esm/conversion/toMarketplace/convertObjectPropertyType.js.map +1 -1
- package/build/esm/conversion/toMarketplace/convertReducers.js +53 -0
- package/build/esm/conversion/toMarketplace/convertReducers.js.map +1 -0
- package/build/esm/conversion/toMarketplace/convertSpt.js +5 -3
- package/build/esm/conversion/toMarketplace/convertSpt.js.map +1 -1
- package/build/esm/conversion/toMarketplace/propertyTypeTypeToOntologyIrType.js +4 -2
- package/build/esm/conversion/toMarketplace/propertyTypeTypeToOntologyIrType.js.map +1 -1
- package/build/esm/index.js +5 -2
- package/build/esm/index.js.map +1 -1
- package/build/esm/util/ApiNameValidator.js +26 -0
- package/build/esm/util/ApiNameValidator.js.map +1 -0
- package/build/types/api/cloneDefinition.d.ts +9 -0
- package/build/types/api/cloneDefinition.d.ts.map +1 -0
- package/build/types/api/defineAction.d.ts +1 -1
- package/build/types/api/defineAction.d.ts.map +1 -1
- package/build/types/api/defineCreateInterfaceObjectAction.d.ts +1 -1
- package/build/types/api/defineCreateInterfaceObjectAction.d.ts.map +1 -1
- package/build/types/api/defineCreateObjectAction.d.ts +1 -1
- package/build/types/api/defineCreateObjectAction.d.ts.map +1 -1
- package/build/types/api/defineCreateOrModifyObjectAction.d.ts +1 -1
- package/build/types/api/defineCreateOrModifyObjectAction.d.ts.map +1 -1
- package/build/types/api/defineDeleteInterfaceObjectAction.d.ts +1 -1
- package/build/types/api/defineDeleteInterfaceObjectAction.d.ts.map +1 -1
- package/build/types/api/defineDeleteObjectAction.d.ts +1 -1
- package/build/types/api/defineDeleteObjectAction.d.ts.map +1 -1
- package/build/types/api/defineFunction.d.ts +19 -0
- package/build/types/api/defineFunction.d.ts.map +1 -0
- package/build/types/api/defineInterface.d.ts +1 -1
- package/build/types/api/defineInterface.d.ts.map +1 -1
- package/build/types/api/defineInterfaceLinkConstraint.d.ts +1 -1
- package/build/types/api/defineInterfaceLinkConstraint.d.ts.map +1 -1
- package/build/types/api/defineLink.d.ts +1 -1
- package/build/types/api/defineLink.d.ts.map +1 -1
- package/build/types/api/defineModifyInterfaceObjectAction.d.ts +1 -1
- package/build/types/api/defineModifyInterfaceObjectAction.d.ts.map +1 -1
- package/build/types/api/defineModifyObjectAction.d.ts +1 -1
- package/build/types/api/defineModifyObjectAction.d.ts.map +1 -1
- package/build/types/api/defineObject.d.ts +1 -1
- package/build/types/api/defineObject.d.ts.map +1 -1
- package/build/types/api/defineOntology.d.ts +5 -0
- package/build/types/api/defineOntology.d.ts.map +1 -1
- package/build/types/api/defineSpt.d.ts +3 -1
- package/build/types/api/defineSpt.d.ts.map +1 -1
- package/build/types/api/defineValueType.d.ts +1 -1
- package/build/types/api/defineValueType.d.ts.map +1 -1
- package/build/types/api/interface/InterfaceType.d.ts +1 -1
- package/build/types/api/interface/InterfaceType.d.ts.map +1 -1
- package/build/types/api/object/ObjectPropertyType.d.ts +2 -0
- package/build/types/api/object/ObjectPropertyType.d.ts.map +1 -1
- package/build/types/api/object/ObjectType.d.ts +1 -0
- package/build/types/api/object/ObjectType.d.ts.map +1 -1
- package/build/types/api/object/ObjectTypeDatasourceDefinition.d.ts +10 -3
- package/build/types/api/object/ObjectTypeDatasourceDefinition.d.ts.map +1 -1
- package/build/types/api/object/ObjectTypeDefinition.d.ts +1 -0
- package/build/types/api/object/ObjectTypeDefinition.d.ts.map +1 -1
- package/build/types/api/properties/PropertyTypeType.d.ts +4 -0
- package/build/types/api/properties/PropertyTypeType.d.ts.map +1 -1
- package/build/types/api/properties/ReducerType.d.ts +4 -0
- package/build/types/api/properties/ReducerType.d.ts.map +1 -0
- package/build/types/api/properties/SharedPropertyType.d.ts +2 -0
- package/build/types/api/properties/SharedPropertyType.d.ts.map +1 -1
- package/build/types/conversion/toMarketplace/convertDatasourceDefinition.d.ts.map +1 -1
- package/build/types/conversion/toMarketplace/convertMainValue.d.ts +4 -0
- package/build/types/conversion/toMarketplace/convertMainValue.d.ts.map +1 -0
- package/build/types/conversion/toMarketplace/convertObjectPropertyType.d.ts.map +1 -1
- package/build/types/conversion/toMarketplace/convertReducers.d.ts +6 -0
- package/build/types/conversion/toMarketplace/convertReducers.d.ts.map +1 -0
- package/build/types/conversion/toMarketplace/convertSpt.d.ts +1 -1
- package/build/types/conversion/toMarketplace/convertSpt.d.ts.map +1 -1
- package/build/types/conversion/toMarketplace/propertyTypeTypeToOntologyIrType.d.ts +2 -1
- package/build/types/conversion/toMarketplace/propertyTypeTypeToOntologyIrType.d.ts.map +1 -1
- package/build/types/index.d.ts +14 -6
- package/build/types/index.d.ts.map +1 -1
- package/build/types/util/ApiNameValidator.d.ts +4 -0
- package/build/types/util/ApiNameValidator.d.ts.map +1 -0
- package/package.json +4 -3
- package/build/browser/api/test/actions.test.js +0 -14397
- package/build/browser/api/test/actions.test.js.map +0 -1
- package/build/browser/api/test/interfaces.test.js +0 -1189
- package/build/browser/api/test/interfaces.test.js.map +0 -1
- package/build/browser/api/test/links.test.js +0 -2019
- package/build/browser/api/test/links.test.js.map +0 -1
- package/build/browser/api/test/markingconstraint.test.js +0 -134
- package/build/browser/api/test/markingconstraint.test.js.map +0 -1
- package/build/browser/api/test/misc.test.js +0 -1315
- package/build/browser/api/test/misc.test.js.map +0 -1
- package/build/browser/api/test/objectStatus.test.js +0 -160
- package/build/browser/api/test/objectStatus.test.js.map +0 -1
- package/build/browser/api/test/objects.test.js +0 -3856
- package/build/browser/api/test/objects.test.js.map +0 -1
- package/build/browser/api/test/spt.test.js +0 -722
- package/build/browser/api/test/spt.test.js.map +0 -1
- package/build/browser/api/test/valueTypes.test.js +0 -307
- package/build/browser/api/test/valueTypes.test.js.map +0 -1
- package/build/esm/api/test/actions.test.js +0 -14397
- package/build/esm/api/test/actions.test.js.map +0 -1
- package/build/esm/api/test/interfaces.test.js +0 -1189
- package/build/esm/api/test/interfaces.test.js.map +0 -1
- package/build/esm/api/test/links.test.js +0 -2019
- package/build/esm/api/test/links.test.js.map +0 -1
- package/build/esm/api/test/markingconstraint.test.js +0 -134
- package/build/esm/api/test/markingconstraint.test.js.map +0 -1
- package/build/esm/api/test/misc.test.js +0 -1315
- package/build/esm/api/test/misc.test.js.map +0 -1
- package/build/esm/api/test/objectStatus.test.js +0 -160
- package/build/esm/api/test/objectStatus.test.js.map +0 -1
- package/build/esm/api/test/objects.test.js +0 -3856
- package/build/esm/api/test/objects.test.js.map +0 -1
- package/build/esm/api/test/spt.test.js +0 -722
- package/build/esm/api/test/spt.test.js.map +0 -1
- package/build/esm/api/test/valueTypes.test.js +0 -307
- package/build/esm/api/test/valueTypes.test.js.map +0 -1
- package/build/types/api/test/actions.test.d.ts +0 -1
- package/build/types/api/test/actions.test.d.ts.map +0 -1
- package/build/types/api/test/interfaces.test.d.ts +0 -1
- package/build/types/api/test/interfaces.test.d.ts.map +0 -1
- package/build/types/api/test/links.test.d.ts +0 -1
- package/build/types/api/test/links.test.d.ts.map +0 -1
- package/build/types/api/test/markingconstraint.test.d.ts +0 -1
- package/build/types/api/test/markingconstraint.test.d.ts.map +0 -1
- package/build/types/api/test/misc.test.d.ts +0 -1
- package/build/types/api/test/misc.test.d.ts.map +0 -1
- package/build/types/api/test/objectStatus.test.d.ts +0 -1
- package/build/types/api/test/objectStatus.test.d.ts.map +0 -1
- package/build/types/api/test/objects.test.d.ts +0 -1
- package/build/types/api/test/objects.test.d.ts.map +0 -1
- package/build/types/api/test/spt.test.d.ts +0 -1
- package/build/types/api/test/spt.test.d.ts.map +0 -1
- package/build/types/api/test/valueTypes.test.d.ts +0 -1
- package/build/types/api/test/valueTypes.test.d.ts.map +0 -1
|
@@ -0,0 +1,53 @@
|
|
|
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
|
+
import invariant from "tiny-invariant";
|
|
18
|
+
import { isStruct } from "../../api/properties/PropertyTypeType.js";
|
|
19
|
+
export function convertReducers(type, apiName, reducers, sharedPropertyType) {
|
|
20
|
+
reducers?.forEach(reducer => {
|
|
21
|
+
if (reducer.structField) {
|
|
22
|
+
!(isStruct(type) && Object.keys(type.structDefinition).includes(reducer.structField)) ? process.env.NODE_ENV !== "production" ? invariant(false, `Reducer structField ${reducer.structField} does not exist in struct definition`) : invariant(false) : void 0;
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
if (sharedPropertyType) {
|
|
26
|
+
return mapReducers(sharedPropertyType.apiName, sharedPropertyType.reducers);
|
|
27
|
+
} else {
|
|
28
|
+
return mapReducers(apiName, reducers);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
export function mapReducers(apiName, reducers) {
|
|
32
|
+
return reducers?.map(reducer => {
|
|
33
|
+
switch (reducer.direction) {
|
|
34
|
+
case "ascending":
|
|
35
|
+
return {
|
|
36
|
+
direction: "ASCENDING_NULLS_LAST",
|
|
37
|
+
structApiName: reducer.structField ? apiName : undefined,
|
|
38
|
+
fieldApiName: reducer.structField
|
|
39
|
+
};
|
|
40
|
+
case "descending":
|
|
41
|
+
return {
|
|
42
|
+
direction: "DESCENDING_NULLS_LAST",
|
|
43
|
+
structApiName: reducer.structField ? apiName : undefined,
|
|
44
|
+
fieldApiName: reducer.structField
|
|
45
|
+
};
|
|
46
|
+
default:
|
|
47
|
+
{
|
|
48
|
+
throw new Error(`Unsupported reducer direction: ${reducer.direction}`);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}) ?? [];
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=convertReducers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convertReducers.js","names":["invariant","isStruct","convertReducers","type","apiName","reducers","sharedPropertyType","forEach","reducer","structField","Object","keys","structDefinition","includes","process","env","NODE_ENV","mapReducers","map","direction","structApiName","undefined","fieldApiName","Error"],"sources":["convertReducers.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\nimport type { OntologyIrArrayPropertyTypeReducer } from \"@osdk/client.unstable\";\nimport invariant from \"tiny-invariant\";\nimport type {\n PropertyTypeType,\n} from \"../../api/properties/PropertyTypeType.js\";\nimport { isStruct } from \"../../api/properties/PropertyTypeType.js\";\nimport type { ReducerType } from \"../../api/properties/ReducerType.js\";\nimport type { SharedPropertyType } from \"../../api/properties/SharedPropertyType.js\";\n\nexport function convertReducers(\n type: PropertyTypeType,\n apiName: string,\n reducers?: Array<ReducerType>,\n sharedPropertyType?: SharedPropertyType,\n): Array<OntologyIrArrayPropertyTypeReducer> {\n reducers?.forEach(reducer => {\n if (reducer.structField) {\n invariant(\n isStruct(type)\n && Object.keys(type.structDefinition).includes(reducer.structField),\n `Reducer structField ${reducer.structField} does not exist in struct definition`,\n );\n }\n });\n if (sharedPropertyType) {\n return mapReducers(sharedPropertyType.apiName, sharedPropertyType.reducers);\n } else {\n return mapReducers(apiName, reducers);\n }\n}\n\nexport function mapReducers(\n apiName: string,\n reducers?: Array<ReducerType>,\n): Array<OntologyIrArrayPropertyTypeReducer> {\n return reducers?.map(reducer => {\n switch (reducer.direction) {\n case \"ascending\":\n return {\n direction: \"ASCENDING_NULLS_LAST\",\n structApiName: reducer.structField ? apiName : undefined,\n fieldApiName: reducer.structField,\n };\n case \"descending\":\n return {\n direction: \"DESCENDING_NULLS_LAST\",\n structApiName: reducer.structField ? apiName : undefined,\n fieldApiName: reducer.structField,\n };\n default: {\n throw new Error(`Unsupported reducer direction: ${reducer.direction}`);\n }\n }\n }) ?? [];\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,OAAOA,SAAS,MAAM,gBAAgB;AAItC,SAASC,QAAQ,QAAQ,0CAA0C;AAInE,OAAO,SAASC,eAAeA,CAC7BC,IAAsB,EACtBC,OAAe,EAC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
|
|
16
16
|
|
|
17
17
|
import { convertNullabilityToDataConstraint } from "./convertNullabilityToDataConstraint.js";
|
|
18
|
+
import { convertReducers } from "./convertReducers.js";
|
|
18
19
|
import { propertyTypeTypeToOntologyIrType } from "./propertyTypeTypeToOntologyIrType.js";
|
|
19
20
|
export function convertSpt({
|
|
20
21
|
type,
|
|
21
22
|
array,
|
|
23
|
+
reducers,
|
|
22
24
|
description,
|
|
23
25
|
apiName,
|
|
24
26
|
displayName,
|
|
@@ -44,10 +46,10 @@ export function convertSpt({
|
|
|
44
46
|
type: array ? {
|
|
45
47
|
type: "array",
|
|
46
48
|
array: {
|
|
47
|
-
subtype: propertyTypeTypeToOntologyIrType(type),
|
|
48
|
-
reducers:
|
|
49
|
+
subtype: propertyTypeTypeToOntologyIrType(type, apiName),
|
|
50
|
+
reducers: convertReducers(type, apiName, reducers)
|
|
49
51
|
}
|
|
50
|
-
} : propertyTypeTypeToOntologyIrType(type),
|
|
52
|
+
} : propertyTypeTypeToOntologyIrType(type, apiName),
|
|
51
53
|
aliases: aliases ?? [],
|
|
52
54
|
baseFormatter,
|
|
53
55
|
dataConstraints: dataConstraint,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convertSpt.js","names":["convertNullabilityToDataConstraint","propertyTypeTypeToOntologyIrType","convertSpt","type","array","description","apiName","displayName","visibility","gothamMapping","typeClasses","aliases","valueType","nullability","baseFormatter","dataConstraint","displayMetadata","subtype","
|
|
1
|
+
{"version":3,"file":"convertSpt.js","names":["convertNullabilityToDataConstraint","convertReducers","propertyTypeTypeToOntologyIrType","convertSpt","type","array","reducers","description","apiName","displayName","visibility","gothamMapping","typeClasses","aliases","valueType","nullability","baseFormatter","dataConstraint","displayMetadata","subtype","dataConstraints","indexedForSearch","undefined","version","packageNamespace"],"sources":["convertSpt.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { OntologyIrSharedPropertyType } from \"@osdk/client.unstable\";\nimport type { SharedPropertyType } from \"../../api/properties/SharedPropertyType.js\";\nimport { convertNullabilityToDataConstraint } from \"./convertNullabilityToDataConstraint.js\";\nimport { convertReducers } from \"./convertReducers.js\";\nimport { propertyTypeTypeToOntologyIrType } from \"./propertyTypeTypeToOntologyIrType.js\";\n\nexport function convertSpt(\n {\n type,\n array,\n reducers,\n description,\n apiName,\n displayName,\n visibility,\n gothamMapping,\n typeClasses,\n aliases,\n valueType,\n nullability,\n baseFormatter,\n }: SharedPropertyType,\n): OntologyIrSharedPropertyType {\n const dataConstraint:\n | OntologyIrSharedPropertyType[\"dataConstraints\"]\n | undefined = convertNullabilityToDataConstraint({ type, nullability });\n return {\n apiName,\n displayMetadata: {\n displayName: displayName ?? apiName,\n visibility: visibility ?? \"NORMAL\",\n description,\n },\n type: array\n ? {\n type: \"array\" as const,\n array: {\n subtype: propertyTypeTypeToOntologyIrType(type, apiName),\n reducers: convertReducers(type, apiName, reducers),\n },\n }\n : propertyTypeTypeToOntologyIrType(type, apiName),\n aliases: aliases ?? [],\n baseFormatter,\n dataConstraints: dataConstraint,\n gothamMapping: gothamMapping,\n indexedForSearch: true,\n typeClasses: typeClasses ?? [],\n valueType: valueType === undefined ? undefined : {\n apiName: valueType.apiName,\n version: valueType.version,\n packageNamespace: valueType.packageNamespace,\n displayMetadata: valueType.displayMetadata,\n },\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,SAASA,kCAAkC,QAAQ,yCAAyC;AAC5F,SAASC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17
|
import { distributeTypeHelper } from "../toConjure/distributeTypeHelper.js";
|
|
18
|
-
|
|
18
|
+
import { convertMainValue } from "./convertMainValue.js";
|
|
19
|
+
export function propertyTypeTypeToOntologyIrType(type, apiName, sharedPropertyType) {
|
|
19
20
|
switch (true) {
|
|
20
21
|
case typeof type === "object" && type.type === "marking":
|
|
21
22
|
return {
|
|
@@ -72,7 +73,8 @@ export function propertyTypeTypeToOntologyIrType(type) {
|
|
|
72
73
|
return {
|
|
73
74
|
type: "struct",
|
|
74
75
|
struct: {
|
|
75
|
-
structFields
|
|
76
|
+
structFields: structFields,
|
|
77
|
+
mainValue: convertMainValue(type, apiName, sharedPropertyType)
|
|
76
78
|
}
|
|
77
79
|
};
|
|
78
80
|
case typeof type === "object" && type.type === "string":
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"propertyTypeTypeToOntologyIrType.js","names":["distributeTypeHelper","propertyTypeTypeToOntologyIrType","type","marking","markingType","structFields","Array","key","structDefinition","fieldTypeDefinition","field","
|
|
1
|
+
{"version":3,"file":"propertyTypeTypeToOntologyIrType.js","names":["distributeTypeHelper","convertMainValue","propertyTypeTypeToOntologyIrType","type","apiName","sharedPropertyType","marking","markingType","structFields","Array","key","structDefinition","fieldTypeDefinition","field","displayMetadata","displayName","description","undefined","typeClasses","aliases","fieldType","push","struct","mainValue","analyzerOverride","enableAsciiFolding","isLongText","supportsEfficientLeadingWildcard","supportsExactMatching","supportsFullTextRegex","precision","scale","geohash","mediaReference","geotimeSeriesReference","attachment","Error","JSON","stringify"],"sources":["propertyTypeTypeToOntologyIrType.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n OntologyIrStructFieldType,\n OntologyIrType,\n} from \"@osdk/client.unstable\";\nimport type { PropertyTypeType } from \"../../api/properties/PropertyTypeType.js\";\nimport type { SharedPropertyType } from \"../../api/properties/SharedPropertyType.js\";\nimport { distributeTypeHelper } from \"../toConjure/distributeTypeHelper.js\";\nimport { convertMainValue } from \"./convertMainValue.js\";\n\nexport function propertyTypeTypeToOntologyIrType(\n type: PropertyTypeType,\n apiName?: string,\n sharedPropertyType?: SharedPropertyType,\n): OntologyIrType {\n switch (true) {\n case (typeof type === \"object\" && type.type === \"marking\"):\n return {\n \"type\": \"marking\",\n marking: { markingType: type.markingType },\n };\n\n case (typeof type === \"object\" && type.type === \"struct\"):\n const structFields: Array<OntologyIrStructFieldType> = new Array();\n for (const key in type.structDefinition) {\n const fieldTypeDefinition = type.structDefinition[key];\n let field: OntologyIrStructFieldType;\n if (typeof fieldTypeDefinition === \"string\") {\n field = {\n apiName: key,\n displayMetadata: { displayName: key, description: undefined },\n typeClasses: [],\n aliases: [],\n fieldType: propertyTypeTypeToOntologyIrType(fieldTypeDefinition),\n };\n } else {\n // If it is a full form type definition then process it as such\n if (\"fieldType\" in fieldTypeDefinition) {\n field = {\n ...fieldTypeDefinition,\n apiName: key,\n fieldType: propertyTypeTypeToOntologyIrType(\n fieldTypeDefinition.fieldType,\n ),\n displayMetadata: fieldTypeDefinition.displayMetadata\n ?? { displayName: key, description: undefined },\n typeClasses: fieldTypeDefinition.typeClasses ?? [],\n aliases: fieldTypeDefinition.aliases ?? [],\n };\n } else {\n field = {\n apiName: key,\n displayMetadata: { displayName: key, description: undefined },\n typeClasses: [],\n aliases: [],\n fieldType: propertyTypeTypeToOntologyIrType(fieldTypeDefinition),\n };\n }\n }\n\n structFields.push(field);\n }\n\n return {\n type: \"struct\",\n struct: {\n structFields: structFields,\n mainValue: convertMainValue(type, apiName, sharedPropertyType),\n },\n };\n\n case (typeof type === \"object\" && type.type === \"string\"):\n return {\n \"type\": \"string\",\n \"string\": {\n analyzerOverride: undefined,\n enableAsciiFolding: type.enableAsciiFolding,\n isLongText: type.isLongText ?? false,\n supportsEfficientLeadingWildcard:\n type.supportsEfficientLeadingWildcard ?? false,\n supportsExactMatching: type.supportsExactMatching ?? true,\n supportsFullTextRegex: type.supportsFullTextRegex,\n },\n };\n\n case (typeof type === \"object\" && type.type === \"decimal\"):\n return {\n \"type\": \"decimal\",\n \"decimal\": {\n precision: type.precision,\n scale: type.scale,\n },\n };\n\n case (type === \"geopoint\"):\n return { type: \"geohash\", geohash: {} };\n\n case (type === \"decimal\"):\n return { type, [type]: { precision: undefined, scale: undefined } };\n\n case (type === \"string\"):\n return {\n type,\n [type]: {\n analyzerOverride: undefined,\n enableAsciiFolding: undefined,\n isLongText: false,\n supportsEfficientLeadingWildcard: false,\n supportsExactMatching: true,\n },\n };\n\n case (type === \"mediaReference\"):\n return {\n type: type,\n mediaReference: {},\n };\n\n case (type === \"geotimeSeries\"):\n return {\n type: \"geotimeSeriesReference\",\n geotimeSeriesReference: {},\n };\n case (type === \"attachment\"):\n return {\n type: \"attachment\",\n attachment: {},\n };\n\n default:\n // use helper function to distribute `type` properly\n if (typeof type === \"object\") {\n throw new Error(`Unhandled exotic type: ${JSON.stringify(type)}`);\n }\n return distributeTypeHelper(type);\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAQA,SAASA,oBAAoB,QAAQ,sCAAsC;AAC3E,SAASC,gBAAgB,QAAQ,uBAAuB;AAExD,OAAO,SAASC,gCAAgCA,CAC9CC,IAAsB,EACtBC,OAAgB,EAChBC,kBAAuC,EACvB;EAChB,QAAQ,IAAI;IACV,KAAM,OAAOF,IAAI,KAAK,QAAQ,IAAIA,IAAI,CAACA,IAAI,KAAK,SAAS;MACvD,OAAO;QACL,MAAM,EAAE,SA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Q;MACrB,OAAO;QACLA,IAAI;QACJ,CAACA,IAAI,GAAG;UACNqB,gBAAgB,EAAEP,SAAS;UAC3BQ,kBAAkB,EAAER,SAAS;UAC7BS,UAAU,EAAE,KAAK;UACjBC,gCAAgC,EAAE,KAAK;UACvCC,qBAAqB,EAAE;QACzB;MACF,CAAC;IAEH,KAAMzB,IAAI,KAAK,gBAAgB;MAC7B,OAAO;QACLA,IAAI,EAAEA,IAAI;QACV8B,cAAc,EAAE,CAAC;MACnB,CAAC;IAEH,KAAM9B,IAAI,KAAK,eAAe;MAC5B,OAAO;QACLA,IAAI,EAAE,wBAAwB;QAC9B+B,sBAAsB,EAAE,CAAC;MAC3B,CAAC;IACH,KAAM/B,IAAI,KAAK,YAAY;MACzB,OAAO;QACLA,IAAI,EAAE,YAAY;QAClBgC,UAAU,EAAE,CAAC;MACf,CAAC;IAEH;MACE;MACA,IAAI,OAAOhC,IAAI,KAAK,QAAQ,EAAE;QAC5B,MAAM,IAAIiC,KAAK,CAAC,0BAA0BC,IAAI,CAACC,SAAS,CAACnC,IAAI,CAAC,EAAE,CAAC;MACnE;MACA,OAAOH,oBAAoB,CAACG,IAAI,CAAC;EACrC;AACF","ignoreList":[]}
|
package/build/browser/index.js
CHANGED
|
@@ -28,12 +28,15 @@ export { defineInterfaceLinkConstraint } from "./api/defineInterfaceLinkConstrai
|
|
|
28
28
|
export { defineLink } from "./api/defineLink.js";
|
|
29
29
|
export { defineModifyInterfaceObjectAction } from "./api/defineModifyInterfaceObjectAction.js";
|
|
30
30
|
export { defineModifyObjectAction } from "./api/defineModifyObjectAction.js";
|
|
31
|
-
export { convertToPluralDisplayName, defineObject, uppercaseFirstLetter as convertToDisplayName } from "./api/defineObject.js";
|
|
32
|
-
export { addNamespaceIfNone, defineOntology, dumpOntologyFullMetadata } from "./api/defineOntology.js";
|
|
31
|
+
export { convertToPluralDisplayName, defineObject, uppercaseFirstLetter, uppercaseFirstLetter as convertToDisplayName } from "./api/defineObject.js";
|
|
32
|
+
export { addNamespaceIfNone, cleanAndValidateLinkTypeId, convertObjectStatus, defineOntology, dumpOntologyFullMetadata, extractNamespace, getImportedTypes, getNamespace, getOntologyDefinition, initializeOntologyState, withoutNamespace } from "./api/defineOntology.js";
|
|
33
33
|
export { defineSharedPropertyType } from "./api/defineSpt.js";
|
|
34
34
|
export { defineValueType } from "./api/defineValueType.js";
|
|
35
35
|
export { importOntologyEntity } from "./api/importOntologyEntity.js";
|
|
36
36
|
export { importSharedPropertyType } from "./api/importSharedPropertyType.js";
|
|
37
|
+
export { isInterfaceSharedPropertyType } from "./api/interface/InterfacePropertyType.js";
|
|
38
|
+
export { isExotic } from "./api/properties/PropertyTypeType.js";
|
|
39
|
+
export { defaultTypeClasses, getPropertyTypeName, hasRenderHints, shouldBeIndexedForSearch, shouldNotHaveRenderHints } from "./api/propertyConversionUtils.js";
|
|
37
40
|
export { wrapWithProxy } from "./api/wrapWithProxy.js";
|
|
38
41
|
export { propertyTypeTypeToOntologyIrType as convertType } from "./conversion/toMarketplace/propertyTypeTypeToOntologyIrType.js";
|
|
39
42
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["default","addDependency","OntologyEntityTypeEnum","CREATE_INTERFACE_OBJECT_PARAMETER","CREATE_OR_MODIFY_OBJECT_PARAMETER","defineAction","DELETE_OBJECT_PARAMETER","MODIFY_INTERFACE_OBJECT_PARAMETER","MODIFY_OBJECT_PARAMETER","defineCreateInterfaceObjectAction","defineCreateObjectAction","defineCreateOrModifyObjectAction","defineDeleteInterfaceObjectAction","defineDeleteObjectAction","defineInterface","defineInterfaceLinkConstraint","defineLink","defineModifyInterfaceObjectAction","defineModifyObjectAction","convertToPluralDisplayName","defineObject","uppercaseFirstLetter","convertToDisplayName","addNamespaceIfNone","defineOntology","dumpOntologyFullMetadata","defineSharedPropertyType","defineValueType","importOntologyEntity","importSharedPropertyType","wrapWithProxy","propertyTypeTypeToOntologyIrType","convertType"],"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 { default as default } from \"./cli/main.js\";\n\nexport type {
|
|
1
|
+
{"version":3,"file":"index.js","names":["default","addDependency","OntologyEntityTypeEnum","CREATE_INTERFACE_OBJECT_PARAMETER","CREATE_OR_MODIFY_OBJECT_PARAMETER","defineAction","DELETE_OBJECT_PARAMETER","MODIFY_INTERFACE_OBJECT_PARAMETER","MODIFY_OBJECT_PARAMETER","defineCreateInterfaceObjectAction","defineCreateObjectAction","defineCreateOrModifyObjectAction","defineDeleteInterfaceObjectAction","defineDeleteObjectAction","defineInterface","defineInterfaceLinkConstraint","defineLink","defineModifyInterfaceObjectAction","defineModifyObjectAction","convertToPluralDisplayName","defineObject","uppercaseFirstLetter","convertToDisplayName","addNamespaceIfNone","cleanAndValidateLinkTypeId","convertObjectStatus","defineOntology","dumpOntologyFullMetadata","extractNamespace","getImportedTypes","getNamespace","getOntologyDefinition","initializeOntologyState","withoutNamespace","defineSharedPropertyType","defineValueType","importOntologyEntity","importSharedPropertyType","isInterfaceSharedPropertyType","isExotic","defaultTypeClasses","getPropertyTypeName","hasRenderHints","shouldBeIndexedForSearch","shouldNotHaveRenderHints","wrapWithProxy","propertyTypeTypeToOntologyIrType","convertType"],"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 { default as default } from \"./cli/main.js\";\n\nexport type {\n ActionParameter,\n ActionParameterValidation,\n} from \"./api/action/ActionParameter.js\";\nexport type {\n ActionParameterAllowedValues,\n} from \"./api/action/ActionParameterAllowedValues.js\";\nexport type { ActionParameterConditionalOverride } from \"./api/action/ActionParameterConditionalOverride.js\";\nexport type {\n ActionParameterConfiguration,\n ActionParameterRequirementConstraint,\n} from \"./api/action/ActionParameterConfiguration.js\";\nexport type { ActionSection } from \"./api/action/ActionSection.js\";\nexport type { ActionType } from \"./api/action/ActionType.js\";\nexport type { ConditionDefinition } from \"./api/action/ConditionDefinition.js\";\nexport type {\n CurrentTimeMappingValue,\n CurrentUserMappingValue,\n CustomMapping,\n MappingValue,\n UuidMappingValue,\n} from \"./api/action/MappingValue.js\";\nexport type { SectionConditionalOverride } from \"./api/action/SectionConditionalOverride.js\";\nexport type { SubmissionMetadata } from \"./api/action/SubmissionMetadata.js\";\nexport { addDependency } from \"./api/addDependency.js\";\nexport type { OntologyDefinition } from \"./api/common/OntologyDefinition.js\";\nexport { OntologyEntityTypeEnum } from \"./api/common/OntologyEntityTypeEnum.js\";\nexport {\n CREATE_INTERFACE_OBJECT_PARAMETER,\n CREATE_OR_MODIFY_OBJECT_PARAMETER,\n defineAction,\n DELETE_OBJECT_PARAMETER,\n MODIFY_INTERFACE_OBJECT_PARAMETER,\n MODIFY_OBJECT_PARAMETER,\n} from \"./api/defineAction.js\";\nexport { defineCreateInterfaceObjectAction } from \"./api/defineCreateInterfaceObjectAction.js\";\nexport { defineCreateObjectAction } from \"./api/defineCreateObjectAction.js\";\nexport { defineCreateOrModifyObjectAction } from \"./api/defineCreateOrModifyObjectAction.js\";\nexport { defineDeleteInterfaceObjectAction } from \"./api/defineDeleteInterfaceObjectAction.js\";\nexport { defineDeleteObjectAction } from \"./api/defineDeleteObjectAction.js\";\nexport { defineInterface } from \"./api/defineInterface.js\";\nexport { defineInterfaceLinkConstraint } from \"./api/defineInterfaceLinkConstraint.js\";\nexport { defineLink } from \"./api/defineLink.js\";\nexport { defineModifyInterfaceObjectAction } from \"./api/defineModifyInterfaceObjectAction.js\";\nexport { defineModifyObjectAction } from \"./api/defineModifyObjectAction.js\";\nexport {\n convertToPluralDisplayName,\n defineObject,\n uppercaseFirstLetter,\n uppercaseFirstLetter as convertToDisplayName,\n} from \"./api/defineObject.js\";\nexport {\n addNamespaceIfNone,\n cleanAndValidateLinkTypeId,\n convertObjectStatus,\n defineOntology,\n dumpOntologyFullMetadata,\n extractNamespace,\n getImportedTypes,\n getNamespace,\n getOntologyDefinition,\n initializeOntologyState,\n withoutNamespace,\n} from \"./api/defineOntology.js\";\nexport { defineSharedPropertyType } from \"./api/defineSpt.js\";\nexport { defineValueType } from \"./api/defineValueType.js\";\nexport { importOntologyEntity } from \"./api/importOntologyEntity.js\";\nexport { importSharedPropertyType } from \"./api/importSharedPropertyType.js\";\nexport type {\n InterfaceDefinedProperty,\n InterfacePropertyType,\n} from \"./api/interface/InterfacePropertyType.js\";\nexport { isInterfaceSharedPropertyType } from \"./api/interface/InterfacePropertyType.js\";\nexport type { InterfaceType } from \"./api/interface/InterfaceType.js\";\nexport type {\n LinkType,\n OneToManyLinkTypeDefinition,\n UserLinkTypeStatus,\n} from \"./api/links/LinkType.js\";\nexport type { ObjectPropertyType } from \"./api/object/ObjectPropertyType.js\";\nexport type { ObjectType } from \"./api/object/ObjectType.js\";\nexport type {\n DerivedPropertyAggregation,\n ObjectTypeDatasourceDefinition_dataset,\n ObjectTypeDatasourceDefinition_derived,\n ObjectTypeDatasourceDefinition_direct,\n} from \"./api/object/ObjectTypeDatasourceDefinition.js\";\nexport type { ObjectTypeDefinition } from \"./api/object/ObjectTypeDefinition.js\";\nexport type { SecurityConditionDefinition } from \"./api/object/SecurityCondition.js\";\nexport type { Nullability } from \"./api/properties/Nullability.js\";\nexport type { PropertyTypeType } from \"./api/properties/PropertyTypeType.js\";\nexport { isExotic } from \"./api/properties/PropertyTypeType.js\";\nexport type { SharedPropertyType } from \"./api/properties/SharedPropertyType.js\";\nexport {\n defaultTypeClasses,\n getPropertyTypeName,\n hasRenderHints,\n shouldBeIndexedForSearch,\n shouldNotHaveRenderHints,\n} from \"./api/propertyConversionUtils.js\";\nexport type { ValueTypeDefinitionVersion } from \"./api/values/ValueTypeDefinitionVersion.js\";\nexport { wrapWithProxy } from \"./api/wrapWithProxy.js\";\nexport { propertyTypeTypeToOntologyIrType as convertType } from \"./conversion/toMarketplace/propertyTypeTypeToOntologyIrType.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,OAAkB,QAAQ,eAAe;AA0BlD,SAASC,aAAa,QAAQ,wBAAwB;AAEtD,SAASC,sBAAsB,QAAQ,wCAAwC;AAC/E,SACEC,iCAAiC,EACjCC,iCAAiC,EACjCC,YAAY,EACZC,uBAAuB,EACvBC,iCAAiC,EACjCC,uBAAuB,QAClB,uBAAuB;AAC9B,SAASC,iCAAiC,QAAQ,4CAA4C;AAC9F,SAASC,wBAAwB,QAAQ,mCAAmC;AAC5E,SAASC,gCAAgC,QAAQ,2CAA2C;AAC5F,SAASC,iCAAiC,QAAQ,4CAA4C;AAC9F,SAASC,wBAAwB,QAAQ,mCAAmC;AAC5E,SAASC,eAAe,QAAQ,0BAA0B;AAC1D,SAASC,6BAA6B,QAAQ,wCAAwC;AACtF,SAASC,UAAU,QAAQ,qBAAqB;AAChD,SAASC,iCAAiC,QAAQ,4CAA4C;AAC9F,SAASC,wBAAwB,QAAQ,mCAAmC;AAC5E,SACEC,0BAA0B,EAC1BC,YAAY,EACZC,oBAAoB,EACpBA,oBAAoB,IAAIC,oBAAoB,QACvC,uBAAuB;AAC9B,SACEC,kBAAkB,EAClBC,0BAA0B,EAC1BC,mBAAmB,EACnBC,cAAc,EACdC,wBAAwB,EACxBC,gBAAgB,EAChBC,gBAAgB,EAChBC,YAAY,EACZC,qBAAqB,EACrBC,uBAAuB,EACvBC,gBAAgB,QACX,yBAAyB;AAChC,SAASC,wBAAwB,QAAQ,oBAAoB;AAC7D,SAASC,eAAe,QAAQ,0BAA0B;AAC1D,SAASC,oBAAoB,QAAQ,+BAA+B;AACpE,SAASC,wBAAwB,QAAQ,mCAAmC;AAK5E,SAASC,6BAA6B,QAAQ,0CAA0C;AAmBxF,SAASC,QAAQ,QAAQ,sCAAsC;AAE/D,SACEC,kBAAkB,EAClBC,mBAAmB,EACnBC,cAAc,EACdC,wBAAwB,EACxBC,wBAAwB,QACnB,kCAAkC;AAEzC,SAASC,aAAa,QAAQ,wBAAwB;AACtD,SAASC,gCAAgC,IAAIC,WAAW,QAAQ,gEAAgE","ignoreList":[]}
|
|
@@ -0,0 +1,26 @@
|
|
|
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
|
+
const RESERVED_KEYWORDS = new Set(["ontology", "object", "property", "link", "relation", "rid", "primarykey", "typeid", "ontologyobject"]);
|
|
18
|
+
export const OBJECT_API_NAME_PATTERN = /^[a-zA-Z][a-zA-Z0-9]{0,99}$/;
|
|
19
|
+
export const API_NAME_PATTERN = /^[a-zA-Z][a-zA-Z0-9_]{0,99}$/;
|
|
20
|
+
export function isValidApiName(apiName) {
|
|
21
|
+
return API_NAME_PATTERN.test(apiName) && !RESERVED_KEYWORDS.has(apiName.toLowerCase());
|
|
22
|
+
}
|
|
23
|
+
export function isValidObjectApiName(apiName) {
|
|
24
|
+
return OBJECT_API_NAME_PATTERN.test(apiName) && !RESERVED_KEYWORDS.has(apiName.toLowerCase());
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=ApiNameValidator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ApiNameValidator.js","names":["RESERVED_KEYWORDS","Set","OBJECT_API_NAME_PATTERN","API_NAME_PATTERN","isValidApiName","apiName","test","has","toLowerCase","isValidObjectApiName"],"sources":["ApiNameValidator.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\nconst RESERVED_KEYWORDS = new Set([\n \"ontology\",\n \"object\",\n \"property\",\n \"link\",\n \"relation\",\n \"rid\",\n \"primarykey\",\n \"typeid\",\n \"ontologyobject\",\n]);\nexport const OBJECT_API_NAME_PATTERN: RegExp = /^[a-zA-Z][a-zA-Z0-9]{0,99}$/;\nexport const API_NAME_PATTERN: RegExp = /^[a-zA-Z][a-zA-Z0-9_]{0,99}$/;\n\nexport function isValidApiName(apiName: string): boolean {\n return API_NAME_PATTERN.test(apiName)\n && !RESERVED_KEYWORDS.has(apiName.toLowerCase());\n}\n\nexport function isValidObjectApiName(apiName: string): boolean {\n return OBJECT_API_NAME_PATTERN.test(apiName)\n && !RESERVED_KEYWORDS.has(apiName.toLowerCase());\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMA,iBAAiB,GAAG,IAAIC,GAAG,CAAC,CAChC,UAAU,EACV,QAAQ,EACR,UAAU,EACV,MAAM,EACN,UAAU,EACV,KAAK,EACL,YAAY,EACZ,QAAQ,EACR,gBAAgB,CACjB,CAAC;AACF,OAAO,MAAMC,uBAA+B,GAAG,6BAA6B;AAC5E,OAAO,MAAMC,gBAAwB,GAAG,8BAA8B;AAEtE,OAAO,SAASC,cAAcA,CAACC,OAAe,EAAW;EACvD,OAAOF,gBAAgB,CAACG,IAAI,CAACD,OAAO,CAAC,IAChC,CAACL,iBAAiB,CAACO,GAAG,CAACF,OAAO,CAACG,WAAW,CAAC,CAAC,CAAC;AACpD;AAEA,OAAO,SAASC,oBAAoBA,CAACJ,OAAe,EAAW;EAC7D,OAAOH,uBAAuB,CAACI,IAAI,CAACD,OAAO,CAAC,IACvC,CAACL,iBAAiB,CAACO,GAAG,CAACF,OAAO,CAACG,WAAW,CAAC,CAAC,CAAC;AACpD","ignoreList":[]}
|