@osdk/generator 2.7.1 → 2.8.0-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +63 -85
- package/build/browser/util/test/TodoWireOntology.js +20 -10
- package/build/browser/util/test/TodoWireOntology.js.map +1 -1
- package/build/browser/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.js +2 -1
- package/build/browser/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.js.map +1 -1
- package/build/browser/v2.0/generateClientSdkVersionTwoPointZero.test.js +32 -14
- package/build/browser/v2.0/generateClientSdkVersionTwoPointZero.test.js.map +1 -1
- package/build/browser/v2.0/generateMetadata.js +4 -1
- package/build/browser/v2.0/generateMetadata.js.map +1 -1
- package/build/browser/v2.0/generatePerQueryDataFiles.js +3 -3
- package/build/browser/v2.0/generatePerQueryDataFiles.js.map +1 -1
- package/build/browser/v2.0/getDescriptionIfPresent.js +4 -1
- package/build/browser/v2.0/getDescriptionIfPresent.js.map +1 -1
- package/build/cjs/index.cjs +10 -5
- package/build/cjs/index.cjs.map +1 -1
- package/build/esm/util/test/TodoWireOntology.js +20 -10
- package/build/esm/util/test/TodoWireOntology.js.map +1 -1
- package/build/esm/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.js +2 -1
- package/build/esm/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.js.map +1 -1
- package/build/esm/v2.0/generateClientSdkVersionTwoPointZero.test.js +32 -14
- package/build/esm/v2.0/generateClientSdkVersionTwoPointZero.test.js.map +1 -1
- package/build/esm/v2.0/generateMetadata.js +4 -1
- package/build/esm/v2.0/generateMetadata.js.map +1 -1
- package/build/esm/v2.0/generatePerQueryDataFiles.js +3 -3
- package/build/esm/v2.0/generatePerQueryDataFiles.js.map +1 -1
- package/build/esm/v2.0/getDescriptionIfPresent.js +4 -1
- package/build/esm/v2.0/getDescriptionIfPresent.js.map +1 -1
- package/package.json +6 -6
|
@@ -18,7 +18,7 @@ import path from "path";
|
|
|
18
18
|
import { formatTs } from "../util/test/formatTs.js";
|
|
19
19
|
|
|
20
20
|
// BEGIN: THIS IS GENERATED CODE. DO NOT EDIT.
|
|
21
|
-
const ExpectedOsdkVersion = "2.
|
|
21
|
+
const ExpectedOsdkVersion = "2.8.0";
|
|
22
22
|
// END: THIS IS GENERATED CODE. DO NOT EDIT.
|
|
23
23
|
|
|
24
24
|
export async function generateOntologyMetadataFile({
|
|
@@ -33,6 +33,9 @@ export async function generateOntologyMetadataFile({
|
|
|
33
33
|
${ontologyApiNamespace == null ? `
|
|
34
34
|
export const $ontologyRid = "${ontology.ontology.rid}";
|
|
35
35
|
` : ""}
|
|
36
|
+
${ontology.raw.branch != null ? `
|
|
37
|
+
export const $branch = "${ontology.raw.branch.rid}";
|
|
38
|
+
` : ""}
|
|
36
39
|
`));
|
|
37
40
|
}
|
|
38
41
|
//# sourceMappingURL=generateMetadata.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateMetadata.js","names":["path","formatTs","ExpectedOsdkVersion","generateOntologyMetadataFile","fs","outDir","ontology","ontologyApiNamespace","userAgent","writeFile","join","rid"],"sources":["generateMetadata.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 path from \"path\";\nimport type { GenerateContext } from \"../GenerateContext/GenerateContext.js\";\nimport { formatTs } from \"../util/test/formatTs.js\";\n\n// BEGIN: THIS IS GENERATED CODE. DO NOT EDIT.\nconst ExpectedOsdkVersion = \"2.
|
|
1
|
+
{"version":3,"file":"generateMetadata.js","names":["path","formatTs","ExpectedOsdkVersion","generateOntologyMetadataFile","fs","outDir","ontology","ontologyApiNamespace","userAgent","writeFile","join","rid","raw","branch"],"sources":["generateMetadata.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 path from \"path\";\nimport type { GenerateContext } from \"../GenerateContext/GenerateContext.js\";\nimport { formatTs } from \"../util/test/formatTs.js\";\n\n// BEGIN: THIS IS GENERATED CODE. DO NOT EDIT.\nconst ExpectedOsdkVersion = \"2.8.0\";\n// END: THIS IS GENERATED CODE. DO NOT EDIT.\n\nexport async function generateOntologyMetadataFile(\n { fs, outDir, ontology, ontologyApiNamespace }: GenerateContext,\n userAgent: string,\n): Promise<void> {\n await fs.writeFile(\n path.join(outDir, \"OntologyMetadata.ts\"),\n await formatTs(\n `\n export type $ExpectedClientVersion = \"${ExpectedOsdkVersion}\";\n export const $osdkMetadata = { extraUserAgent: \"${userAgent}\" };\n ${\n ontologyApiNamespace == null\n ? `\n export const $ontologyRid = \"${ontology.ontology.rid}\";\n `\n : \"\"\n }\n ${\n ontology.raw.branch != null\n ? `\n export const $branch = \"${ontology.raw.branch.rid}\";\n `\n : \"\"\n }\n `,\n ),\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,IAAI,MAAM,MAAM;AAEvB,SAASC,QAAQ,QAAQ,0BAA0B;;AAEnD;AACA,MAAMC,mBAAmB,GAAG,OAAO;AACnC;;AAEA,OAAO,eAAeC,4BAA4BA,CAChD;EAAEC,EAAE;EAAEC,MAAM;EAAEC,QAAQ;EAAEC;AAAsC,CAAC,EAC/DC,SAAiB,EACF;EACf,MAAMJ,EAAE,CAACK,SAAS,CAChBT,IAAI,CAACU,IAAI,CAACL,MAAM,EAAE,qBAAqB,CAAC,EACxC,MAAMJ,QAAQ,CACZ;AACN,8CAA8CC,mBAAmB;AACjE,wDAAwDM,SAAS;AACjE,QACQD,oBAAoB,IAAI,IAAI,GACxB;AACZ,uCAAuCD,QAAQ,CAACA,QAAQ,CAACK,GAAG;AAC5D,SAAS,GACG,EAAE;AACd,SAEQL,QAAQ,CAACM,GAAG,CAACC,MAAM,IAAI,IAAI,GACvB;AACZ,kCAAkCP,QAAQ,CAACM,GAAG,CAACC,MAAM,CAACF,GAAG;AACzD,SAAS,GACG,EAAE;AACd,OAEI,CACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -89,8 +89,8 @@ async function generateV2QueryFile(fs, outDir, relOutDir, query, importExt, onto
|
|
|
89
89
|
}), "Result")}
|
|
90
90
|
`}
|
|
91
91
|
}
|
|
92
|
-
|
|
93
|
-
|
|
92
|
+
|
|
93
|
+
${getDescriptionIfPresent(query.description)}
|
|
94
94
|
export interface ${query.shortApiName} extends QueryDefinition<
|
|
95
95
|
${query.shortApiName}.Signature
|
|
96
96
|
>, VersionBound<$ExpectedClientVersion>{
|
|
@@ -114,7 +114,7 @@ async function generateV2QueryFile(fs, outDir, relOutDir, query, importExt, onto
|
|
|
114
114
|
osdkMetadata: typeof $osdkMetadata;
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
-
|
|
117
|
+
${getDescriptionIfPresent(query.description)}
|
|
118
118
|
export const ${query.shortApiName}: ${query.definitionIdentifier} = {
|
|
119
119
|
${stringify(baseProps, {
|
|
120
120
|
"description": () => undefined,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generatePerQueryDataFiles.js","names":["wireQueryDataTypeToQueryDataTypeDefinition","wireQueryParameterV2ToQueryParameterDefinition","paramToDef","wireQueryTypeV2ToSdkQueryDefinitionNoParams","path","getInterfaceTypeApiNamesFromQuery","getObjectImports","getObjectTypeApiNamesFromQuery","deleteUndefineds","stringify","formatTs","getDescriptionIfPresent","generatePerQueryDataFilesV2","fs","outDir","rootOutDir","ontology","fixedVersionQueryTypes","importExt","forInternalUse","relOutDir","join","mkdir","recursive","Promise","all","Object","values","queryTypes","map","query","generateV2QueryFile","writeFile","shortApiName","getImportPathRelTo","keys","length","relFilePath","objectTypes","interfaceTypes","interfaceAndObjectTypes","Set","o","requireObjectType","requireInterfaceType","importObjects","baseProps","raw","outputBase","output","isUsingFixedVersion","includes","fullApiName","description","parameters","paramsIdentifier","*","parameter","formatter","apiName","q","queryParamJsDoc","nullable","getQueryParamType","type","dataType","parameterDefsForType","getLineFor__OsdkTargetType","undefined","displayName","rid","definitionIdentifier","valueFormatter","qdt","objectTypeApiName","getImportedDefinitionIdentifier","param","ret","enhancedOntology","input","isMapKey","paramType","array","JSON","struct","p","twoDimensionalAggregation","keyType","keySubtype","valueType","threeDimensionalAggregation","object","interface","objectSet","set","union","u"],"sources":["generatePerQueryDataFiles.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 { QueryParameterDefinition } from \"@osdk/api\";\nimport type { QueryDataType } from \"@osdk/foundry.ontologies\";\nimport {\n wireQueryDataTypeToQueryDataTypeDefinition,\n wireQueryParameterV2ToQueryParameterDefinition as paramToDef,\n wireQueryTypeV2ToSdkQueryDefinitionNoParams,\n} from \"@osdk/generator-converters\";\nimport path from \"node:path\";\nimport type { EnhancedOntologyDefinition } from \"../GenerateContext/EnhancedOntologyDefinition.js\";\nimport type { EnhancedQuery } from \"../GenerateContext/EnhancedQuery.js\";\nimport type { GenerateContext } from \"../GenerateContext/GenerateContext.js\";\nimport type { MinimalFs } from \"../MinimalFs.js\";\nimport { getInterfaceTypeApiNamesFromQuery } from \"../shared/getInterfaceTypeApiNamesFromQuery.js\";\nimport { getObjectImports } from \"../shared/getObjectImports.js\";\nimport { getObjectTypeApiNamesFromQuery } from \"../shared/getObjectTypeApiNamesFromQuery.js\";\nimport { deleteUndefineds } from \"../util/deleteUndefineds.js\";\nimport { stringify } from \"../util/stringify.js\";\nimport { formatTs } from \"../util/test/formatTs.js\";\nimport { getDescriptionIfPresent } from \"./getDescriptionIfPresent.js\";\n\nexport async function generatePerQueryDataFilesV2(\n {\n fs,\n outDir: rootOutDir,\n ontology,\n fixedVersionQueryTypes,\n importExt = \"\",\n forInternalUse = false,\n }: Pick<\n GenerateContext,\n | \"fs\"\n | \"outDir\"\n | \"importExt\"\n | \"ontology\"\n | \"forInternalUse\"\n | \"fixedVersionQueryTypes\"\n >,\n v2: boolean,\n): Promise<void> {\n const relOutDir = path.join(\".\", \"ontology\", \"queries\");\n const outDir = path.join(rootOutDir, \"ontology\", \"queries\");\n await fs.mkdir(outDir, { recursive: true });\n await Promise.all(\n Object.values(ontology.queryTypes).map(async query => {\n await generateV2QueryFile(\n fs,\n outDir,\n relOutDir,\n query,\n importExt,\n ontology,\n forInternalUse,\n fixedVersionQueryTypes,\n );\n }),\n );\n\n const indexFilePath = `${outDir}.ts`;\n await fs.writeFile(\n indexFilePath,\n await formatTs(`\n ${\n Object.values(ontology.queryTypes).map(query =>\n `export {${query.shortApiName}} from \"${\n query.getImportPathRelTo(relOutDir)\n }\";`\n )\n .join(\"\\n\")\n }\n ${Object.keys(ontology.queryTypes).length === 0 ? \"export {};\" : \"\"}\n `),\n );\n}\n\nasync function generateV2QueryFile(\n fs: MinimalFs,\n outDir: string,\n relOutDir: string,\n query: EnhancedQuery,\n importExt: string,\n ontology: EnhancedOntologyDefinition,\n forInternalUse: boolean,\n fixedVersionQueryTypes: string[],\n) {\n const relFilePath = path.join(relOutDir, `${query.shortApiName}.ts`);\n const objectTypes = getObjectTypeApiNamesFromQuery(query);\n const interfaceTypes = getInterfaceTypeApiNamesFromQuery(query);\n const interfaceAndObjectTypes = new Set(\n [\n ...objectTypes.map(o => ontology.requireObjectType(o)),\n ...interfaceTypes.map(o => ontology.requireInterfaceType(o)),\n ],\n );\n\n const importObjects = getObjectImports(\n interfaceAndObjectTypes,\n \"\",\n relFilePath,\n true,\n );\n\n const baseProps = deleteUndefineds(\n wireQueryTypeV2ToSdkQueryDefinitionNoParams(query.raw),\n );\n\n const outputBase = deleteUndefineds(\n wireQueryDataTypeToQueryDataTypeDefinition(query.output),\n );\n\n const isUsingFixedVersion = fixedVersionQueryTypes.includes(\n query.fullApiName,\n );\n\n await fs.writeFile(\n path.join(outDir, `${query.shortApiName}.ts`),\n await formatTs(`\n import type { ObjectSpecifier, QueryDefinition, QueryParam, QueryResult, VersionBound} from \"${\n forInternalUse ? \"@osdk/api\" : \"@osdk/client\"\n }\";\n import type { $ExpectedClientVersion } from \"../../OntologyMetadata${importExt}\";\n import { $osdkMetadata} from \"../../OntologyMetadata${importExt}\";\n ${importObjects}\n\n export namespace ${query.shortApiName} {\n export interface Signature {\n ${getDescriptionIfPresent(query.description)}\n (${\n Object.keys(query.parameters).length > 0\n ? `query: ${query.paramsIdentifier}`\n : \"\"\n }): Promise<${query.shortApiName}.ReturnType>\n }\n\n ${\n Object.keys(query.parameters).length > 0\n ? `\n export interface Parameters {\n ${\n stringify(query.parameters, {\n \"*\": (parameter, formatter, apiName) => {\n const q = paramToDef(parameter);\n return [\n `\n ${\n queryParamJsDoc(paramToDef(parameter), { apiName })\n }readonly \"${apiName}\"${q.nullable ? \"?\" : \"\"}`,\n getQueryParamType(ontology, q, \"Param\"),\n ];\n },\n })\n }\n }`\n : \"\"\n }\n\n ${\n query.output.type === \"struct\"\n ? `\n export interface ReturnType \n ${\n getQueryParamType(\n ontology,\n paramToDef({ dataType: query.output }),\n \"Result\",\n )\n }\n `\n : `\n export type ReturnType = ${\n getQueryParamType(\n ontology,\n paramToDef({ dataType: query.output }),\n \"Result\",\n )\n }\n `\n }\n }\n \n \n export interface ${query.shortApiName} extends QueryDefinition<\n ${query.shortApiName}.Signature\n >, VersionBound<$ExpectedClientVersion>{\n __DefinitionMetadata?: {\n ${stringify(baseProps)}\n isFixedVersion: ${isUsingFixedVersion};\n parameters: {\n ${parameterDefsForType(ontology, query)}\n };\n output: {\n ${stringify(outputBase)},\n ${getLineFor__OsdkTargetType(ontology, query.output)}\n };\n signature: ${query.shortApiName}.Signature;\n }, \n ${\n stringify(baseProps, {\n \"description\": () => undefined,\n \"displayName\": () => undefined,\n \"rid\": () => undefined,\n })\n }, \n osdkMetadata: typeof $osdkMetadata;\n }\n\n\n export const ${query.shortApiName}: ${query.definitionIdentifier} = {\n ${\n stringify(baseProps, {\n \"description\": () => undefined,\n \"displayName\": () => undefined,\n \"rid\": () => undefined,\n })\n },\n isFixedVersion: ${isUsingFixedVersion},\n osdkMetadata: $osdkMetadata\n };\n `),\n );\n}\n\nfunction parameterDefsForType(\n ontology: EnhancedOntologyDefinition,\n query: EnhancedQuery,\n) {\n return stringify(query.parameters, {\n \"*\": (parameter, valueFormatter, apiName) => [\n `${queryParamJsDoc(paramToDef(parameter), { apiName })} \"${apiName}\"`,\n ` {\n ${stringify(deleteUndefineds(paramToDef(parameter)))},\n ${getLineFor__OsdkTargetType(ontology, parameter.dataType)}\n }`,\n ],\n });\n}\n\nfunction getLineFor__OsdkTargetType(\n ontology: EnhancedOntologyDefinition,\n qdt: QueryDataType,\n) {\n if (qdt.type === \"object\" || qdt.type === \"objectSet\") {\n return `__OsdkTargetType?: ${\n ontology.requireObjectType(\n qdt.objectTypeApiName!,\n ).getImportedDefinitionIdentifier(true)\n }`;\n }\n return \"\";\n}\n\nexport function queryParamJsDoc(\n param: QueryParameterDefinition<any>,\n { apiName }: { apiName: string },\n): string {\n let ret = `/**\\n`;\n\n if (param.description) {\n if (param.description) {\n ret += ` * description: ${param.description}\\n`;\n }\n } else {\n ret += ` * (no ontology metadata)\\n`;\n }\n\n ret += ` */\\n`;\n return ret;\n}\n\nexport function getQueryParamType(\n enhancedOntology: EnhancedOntologyDefinition,\n input: QueryParameterDefinition,\n type: \"Param\" | \"Result\",\n isMapKey = false,\n): string {\n let paramType = `unknown /* ${input.type} */`;\n\n switch (input.type) {\n case \"array\":\n paramType = `${type === \"Param\" ? \"Readonly\" : \"\"}Array<${\n getQueryParamType(enhancedOntology, input.array, type)\n }>`;\n break;\n case \"date\":\n paramType = `Query${type}.PrimitiveType<${JSON.stringify(\"datetime\")}>`;\n break;\n\n case \"attachment\":\n case \"boolean\":\n case \"double\":\n case \"float\":\n case \"integer\":\n case \"long\":\n case \"string\":\n case \"timestamp\":\n paramType = `Query${type}.PrimitiveType<${JSON.stringify(input.type)}>`;\n break;\n case \"struct\":\n paramType = `{\n ${\n stringify(input.struct, {\n \"*\": (p, formatter, apiName) => {\n return [\n `\n ${type === \"Param\" ? \"readonly \" : \"\"}\"${apiName}\"${\n p.nullable ? \"?\" : \"\"\n }`,\n getQueryParamType(enhancedOntology, p, type),\n ];\n },\n })\n }\n }`;\n break;\n case \"twoDimensionalAggregation\":\n paramType = `Query${type}.TwoDimensionalAggregationType<${\n input.twoDimensionalAggregation.keyType === \"range\"\n ? `Query${type}.RangeKey<\"${input.twoDimensionalAggregation.keySubtype}\">`\n : `\"${input.twoDimensionalAggregation.keyType}\"`\n }, \"${input.twoDimensionalAggregation.valueType}\">`;\n break;\n\n case \"threeDimensionalAggregation\":\n paramType = `Query${type}.ThreeDimensionalAggregationType<${\n input.threeDimensionalAggregation.keyType === \"range\"\n ? `Query${type}.RangeKey<\"${input.threeDimensionalAggregation.keySubtype}\">`\n : `\"${input.threeDimensionalAggregation.keyType}\"`\n },${\n input.threeDimensionalAggregation.valueType.keyType === \"range\"\n ? `Query${type}.RangeKey<\"${input.threeDimensionalAggregation.valueType.keySubtype}\">`\n : `\"${input.threeDimensionalAggregation.valueType.keyType}\"`\n }, \n \"${input.threeDimensionalAggregation.valueType.valueType}\">`;\n break;\n case \"object\":\n if (isMapKey) {\n paramType = `ObjectSpecifier<${\n enhancedOntology.requireObjectType(input.object)\n .getImportedDefinitionIdentifier(true)\n }>`;\n break;\n }\n paramType = `Query${type}.ObjectType<${\n enhancedOntology.requireObjectType(input.object)\n .getImportedDefinitionIdentifier(true)\n }>`;\n break;\n case \"interface\":\n paramType = `Query${type}.InterfaceType<${\n enhancedOntology.requireInterfaceType(input.interface)\n .getImportedDefinitionIdentifier(true)\n }>`;\n break;\n\n case \"objectSet\":\n paramType = `Query${type}.ObjectSetType<${\n enhancedOntology.requireObjectType(input.objectSet)\n .getImportedDefinitionIdentifier(true)\n }>`;\n break;\n\n case \"interfaceObjectSet\":\n paramType = `Query${type}.ObjectSetType<${\n enhancedOntology.requireInterfaceType(input.objectSet)\n .getImportedDefinitionIdentifier(true)\n }>`;\n break;\n\n case \"set\":\n paramType = `${type === \"Param\" ? \"Readonly\" : \"\"}Set<${\n getQueryParamType(enhancedOntology, input.set, type)\n }>`;\n break;\n\n case \"union\":\n paramType = input.union.map((u) =>\n getQueryParamType(enhancedOntology, u, type)\n ).join(\" | \");\n break;\n\n case \"map\":\n paramType = `Partial<Record<${\n getQueryParamType(enhancedOntology, input.keyType, type, true)\n }, ${getQueryParamType(enhancedOntology, input.valueType, type)}>>`;\n }\n\n return paramType;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,SACEA,0CAA0C,EAC1CC,8CAA8C,IAAIC,UAAU,EAC5DC,2CAA2C,QACtC,4BAA4B;A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EAAEC,KAAK,CAACe,GAAG,EAAE9B,IAAI,CAAC,GACnD;MACH;IAEF,KAAK,OAAO;MACViB,SAAS,GAAGF,KAAK,CAACgB,KAAK,CAAClE,GAAG,CAAEmE,CAAC,IAC5BjC,iBAAiB,CAACe,gBAAgB,EAAEkB,CAAC,EAAEhC,IAAI,CAC7C,CAAC,CAAC3C,IAAI,CAAC,KAAK,CAAC;MACb;IAEF,KAAK,KAAK;MACR4D,SAAS,GAAG,kBACVlB,iBAAiB,CAACe,gBAAgB,EAAEC,KAAK,CAACQ,OAAO,EAAEvB,IAAI,EAAE,IAAI,CAAC,KAC3DD,iBAAiB,CAACe,gBAAgB,EAAEC,KAAK,CAACU,SAAS,EAAEzB,IAAI,CAAC,IAAI;EACvE;EAEA,OAAOiB,SAAS;AAClB","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"generatePerQueryDataFiles.js","names":["wireQueryDataTypeToQueryDataTypeDefinition","wireQueryParameterV2ToQueryParameterDefinition","paramToDef","wireQueryTypeV2ToSdkQueryDefinitionNoParams","path","getInterfaceTypeApiNamesFromQuery","getObjectImports","getObjectTypeApiNamesFromQuery","deleteUndefineds","stringify","formatTs","getDescriptionIfPresent","generatePerQueryDataFilesV2","fs","outDir","rootOutDir","ontology","fixedVersionQueryTypes","importExt","forInternalUse","relOutDir","join","mkdir","recursive","Promise","all","Object","values","queryTypes","map","query","generateV2QueryFile","writeFile","shortApiName","getImportPathRelTo","keys","length","relFilePath","objectTypes","interfaceTypes","interfaceAndObjectTypes","Set","o","requireObjectType","requireInterfaceType","importObjects","baseProps","raw","outputBase","output","isUsingFixedVersion","includes","fullApiName","description","parameters","paramsIdentifier","*","parameter","formatter","apiName","q","queryParamJsDoc","nullable","getQueryParamType","type","dataType","parameterDefsForType","getLineFor__OsdkTargetType","undefined","displayName","rid","definitionIdentifier","valueFormatter","qdt","objectTypeApiName","getImportedDefinitionIdentifier","param","ret","enhancedOntology","input","isMapKey","paramType","array","JSON","struct","p","twoDimensionalAggregation","keyType","keySubtype","valueType","threeDimensionalAggregation","object","interface","objectSet","set","union","u"],"sources":["generatePerQueryDataFiles.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 { QueryParameterDefinition } from \"@osdk/api\";\nimport type { QueryDataType } from \"@osdk/foundry.ontologies\";\nimport {\n wireQueryDataTypeToQueryDataTypeDefinition,\n wireQueryParameterV2ToQueryParameterDefinition as paramToDef,\n wireQueryTypeV2ToSdkQueryDefinitionNoParams,\n} from \"@osdk/generator-converters\";\nimport path from \"node:path\";\nimport type { EnhancedOntologyDefinition } from \"../GenerateContext/EnhancedOntologyDefinition.js\";\nimport type { EnhancedQuery } from \"../GenerateContext/EnhancedQuery.js\";\nimport type { GenerateContext } from \"../GenerateContext/GenerateContext.js\";\nimport type { MinimalFs } from \"../MinimalFs.js\";\nimport { getInterfaceTypeApiNamesFromQuery } from \"../shared/getInterfaceTypeApiNamesFromQuery.js\";\nimport { getObjectImports } from \"../shared/getObjectImports.js\";\nimport { getObjectTypeApiNamesFromQuery } from \"../shared/getObjectTypeApiNamesFromQuery.js\";\nimport { deleteUndefineds } from \"../util/deleteUndefineds.js\";\nimport { stringify } from \"../util/stringify.js\";\nimport { formatTs } from \"../util/test/formatTs.js\";\nimport { getDescriptionIfPresent } from \"./getDescriptionIfPresent.js\";\n\nexport async function generatePerQueryDataFilesV2(\n {\n fs,\n outDir: rootOutDir,\n ontology,\n fixedVersionQueryTypes,\n importExt = \"\",\n forInternalUse = false,\n }: Pick<\n GenerateContext,\n | \"fs\"\n | \"outDir\"\n | \"importExt\"\n | \"ontology\"\n | \"forInternalUse\"\n | \"fixedVersionQueryTypes\"\n >,\n v2: boolean,\n): Promise<void> {\n const relOutDir = path.join(\".\", \"ontology\", \"queries\");\n const outDir = path.join(rootOutDir, \"ontology\", \"queries\");\n await fs.mkdir(outDir, { recursive: true });\n await Promise.all(\n Object.values(ontology.queryTypes).map(async query => {\n await generateV2QueryFile(\n fs,\n outDir,\n relOutDir,\n query,\n importExt,\n ontology,\n forInternalUse,\n fixedVersionQueryTypes,\n );\n }),\n );\n\n const indexFilePath = `${outDir}.ts`;\n await fs.writeFile(\n indexFilePath,\n await formatTs(`\n ${\n Object.values(ontology.queryTypes).map(query =>\n `export {${query.shortApiName}} from \"${\n query.getImportPathRelTo(relOutDir)\n }\";`\n )\n .join(\"\\n\")\n }\n ${Object.keys(ontology.queryTypes).length === 0 ? \"export {};\" : \"\"}\n `),\n );\n}\n\nasync function generateV2QueryFile(\n fs: MinimalFs,\n outDir: string,\n relOutDir: string,\n query: EnhancedQuery,\n importExt: string,\n ontology: EnhancedOntologyDefinition,\n forInternalUse: boolean,\n fixedVersionQueryTypes: string[],\n) {\n const relFilePath = path.join(relOutDir, `${query.shortApiName}.ts`);\n const objectTypes = getObjectTypeApiNamesFromQuery(query);\n const interfaceTypes = getInterfaceTypeApiNamesFromQuery(query);\n const interfaceAndObjectTypes = new Set(\n [\n ...objectTypes.map(o => ontology.requireObjectType(o)),\n ...interfaceTypes.map(o => ontology.requireInterfaceType(o)),\n ],\n );\n\n const importObjects = getObjectImports(\n interfaceAndObjectTypes,\n \"\",\n relFilePath,\n true,\n );\n\n const baseProps = deleteUndefineds(\n wireQueryTypeV2ToSdkQueryDefinitionNoParams(query.raw),\n );\n\n const outputBase = deleteUndefineds(\n wireQueryDataTypeToQueryDataTypeDefinition(query.output),\n );\n\n const isUsingFixedVersion = fixedVersionQueryTypes.includes(\n query.fullApiName,\n );\n\n await fs.writeFile(\n path.join(outDir, `${query.shortApiName}.ts`),\n await formatTs(`\n import type { ObjectSpecifier, QueryDefinition, QueryParam, QueryResult, VersionBound} from \"${\n forInternalUse ? \"@osdk/api\" : \"@osdk/client\"\n }\";\n import type { $ExpectedClientVersion } from \"../../OntologyMetadata${importExt}\";\n import { $osdkMetadata} from \"../../OntologyMetadata${importExt}\";\n ${importObjects}\n\n export namespace ${query.shortApiName} {\n export interface Signature {\n ${getDescriptionIfPresent(query.description)}\n (${\n Object.keys(query.parameters).length > 0\n ? `query: ${query.paramsIdentifier}`\n : \"\"\n }): Promise<${query.shortApiName}.ReturnType>\n }\n\n ${\n Object.keys(query.parameters).length > 0\n ? `\n export interface Parameters {\n ${\n stringify(query.parameters, {\n \"*\": (parameter, formatter, apiName) => {\n const q = paramToDef(parameter);\n return [\n `\n ${\n queryParamJsDoc(paramToDef(parameter), { apiName })\n }readonly \"${apiName}\"${q.nullable ? \"?\" : \"\"}`,\n getQueryParamType(ontology, q, \"Param\"),\n ];\n },\n })\n }\n }`\n : \"\"\n }\n\n ${\n query.output.type === \"struct\"\n ? `\n export interface ReturnType \n ${\n getQueryParamType(\n ontology,\n paramToDef({ dataType: query.output }),\n \"Result\",\n )\n }\n `\n : `\n export type ReturnType = ${\n getQueryParamType(\n ontology,\n paramToDef({ dataType: query.output }),\n \"Result\",\n )\n }\n `\n }\n }\n\n ${getDescriptionIfPresent(query.description)}\n export interface ${query.shortApiName} extends QueryDefinition<\n ${query.shortApiName}.Signature\n >, VersionBound<$ExpectedClientVersion>{\n __DefinitionMetadata?: {\n ${stringify(baseProps)}\n isFixedVersion: ${isUsingFixedVersion};\n parameters: {\n ${parameterDefsForType(ontology, query)}\n };\n output: {\n ${stringify(outputBase)},\n ${getLineFor__OsdkTargetType(ontology, query.output)}\n };\n signature: ${query.shortApiName}.Signature;\n }, \n ${\n stringify(baseProps, {\n \"description\": () => undefined,\n \"displayName\": () => undefined,\n \"rid\": () => undefined,\n })\n }, \n osdkMetadata: typeof $osdkMetadata;\n }\n\n ${getDescriptionIfPresent(query.description)}\n export const ${query.shortApiName}: ${query.definitionIdentifier} = {\n ${\n stringify(baseProps, {\n \"description\": () => undefined,\n \"displayName\": () => undefined,\n \"rid\": () => undefined,\n })\n },\n isFixedVersion: ${isUsingFixedVersion},\n osdkMetadata: $osdkMetadata\n };\n `),\n );\n}\n\nfunction parameterDefsForType(\n ontology: EnhancedOntologyDefinition,\n query: EnhancedQuery,\n) {\n return stringify(query.parameters, {\n \"*\": (parameter, valueFormatter, apiName) => [\n `${queryParamJsDoc(paramToDef(parameter), { apiName })} \"${apiName}\"`,\n ` {\n ${stringify(deleteUndefineds(paramToDef(parameter)))},\n ${getLineFor__OsdkTargetType(ontology, parameter.dataType)}\n }`,\n ],\n });\n}\n\nfunction getLineFor__OsdkTargetType(\n ontology: EnhancedOntologyDefinition,\n qdt: QueryDataType,\n) {\n if (qdt.type === \"object\" || qdt.type === \"objectSet\") {\n return `__OsdkTargetType?: ${\n ontology.requireObjectType(\n qdt.objectTypeApiName!,\n ).getImportedDefinitionIdentifier(true)\n }`;\n }\n return \"\";\n}\n\nexport function queryParamJsDoc(\n param: QueryParameterDefinition<any>,\n { apiName }: { apiName: string },\n): string {\n let ret = `/**\\n`;\n\n if (param.description) {\n if (param.description) {\n ret += ` * description: ${param.description}\\n`;\n }\n } else {\n ret += ` * (no ontology metadata)\\n`;\n }\n\n ret += ` */\\n`;\n return ret;\n}\n\nexport function getQueryParamType(\n enhancedOntology: EnhancedOntologyDefinition,\n input: QueryParameterDefinition,\n type: \"Param\" | \"Result\",\n isMapKey = false,\n): string {\n let paramType = `unknown /* ${input.type} */`;\n\n switch (input.type) {\n case \"array\":\n paramType = `${type === \"Param\" ? \"Readonly\" : \"\"}Array<${\n getQueryParamType(enhancedOntology, input.array, type)\n }>`;\n break;\n case \"date\":\n paramType = `Query${type}.PrimitiveType<${JSON.stringify(\"datetime\")}>`;\n break;\n\n case \"attachment\":\n case \"boolean\":\n case \"double\":\n case \"float\":\n case \"integer\":\n case \"long\":\n case \"string\":\n case \"timestamp\":\n paramType = `Query${type}.PrimitiveType<${JSON.stringify(input.type)}>`;\n break;\n case \"struct\":\n paramType = `{\n ${\n stringify(input.struct, {\n \"*\": (p, formatter, apiName) => {\n return [\n `\n ${type === \"Param\" ? \"readonly \" : \"\"}\"${apiName}\"${\n p.nullable ? \"?\" : \"\"\n }`,\n getQueryParamType(enhancedOntology, p, type),\n ];\n },\n })\n }\n }`;\n break;\n case \"twoDimensionalAggregation\":\n paramType = `Query${type}.TwoDimensionalAggregationType<${\n input.twoDimensionalAggregation.keyType === \"range\"\n ? `Query${type}.RangeKey<\"${input.twoDimensionalAggregation.keySubtype}\">`\n : `\"${input.twoDimensionalAggregation.keyType}\"`\n }, \"${input.twoDimensionalAggregation.valueType}\">`;\n break;\n\n case \"threeDimensionalAggregation\":\n paramType = `Query${type}.ThreeDimensionalAggregationType<${\n input.threeDimensionalAggregation.keyType === \"range\"\n ? `Query${type}.RangeKey<\"${input.threeDimensionalAggregation.keySubtype}\">`\n : `\"${input.threeDimensionalAggregation.keyType}\"`\n },${\n input.threeDimensionalAggregation.valueType.keyType === \"range\"\n ? `Query${type}.RangeKey<\"${input.threeDimensionalAggregation.valueType.keySubtype}\">`\n : `\"${input.threeDimensionalAggregation.valueType.keyType}\"`\n }, \n \"${input.threeDimensionalAggregation.valueType.valueType}\">`;\n break;\n case \"object\":\n if (isMapKey) {\n paramType = `ObjectSpecifier<${\n enhancedOntology.requireObjectType(input.object)\n .getImportedDefinitionIdentifier(true)\n }>`;\n break;\n }\n paramType = `Query${type}.ObjectType<${\n enhancedOntology.requireObjectType(input.object)\n .getImportedDefinitionIdentifier(true)\n }>`;\n break;\n case \"interface\":\n paramType = `Query${type}.InterfaceType<${\n enhancedOntology.requireInterfaceType(input.interface)\n .getImportedDefinitionIdentifier(true)\n }>`;\n break;\n\n case \"objectSet\":\n paramType = `Query${type}.ObjectSetType<${\n enhancedOntology.requireObjectType(input.objectSet)\n .getImportedDefinitionIdentifier(true)\n }>`;\n break;\n\n case \"interfaceObjectSet\":\n paramType = `Query${type}.ObjectSetType<${\n enhancedOntology.requireInterfaceType(input.objectSet)\n .getImportedDefinitionIdentifier(true)\n }>`;\n break;\n\n case \"set\":\n paramType = `${type === \"Param\" ? \"Readonly\" : \"\"}Set<${\n getQueryParamType(enhancedOntology, input.set, type)\n }>`;\n break;\n\n case \"union\":\n paramType = input.union.map((u) =>\n getQueryParamType(enhancedOntology, u, type)\n ).join(\" | \");\n break;\n\n case \"map\":\n paramType = `Partial<Record<${\n getQueryParamType(enhancedOntology, input.keyType, type, true)\n }, ${getQueryParamType(enhancedOntology, input.valueType, type)}>>`;\n }\n\n return paramType;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,SACEA,0CAA0C,EAC1CC,8CAA8C,IAAIC,UAAU,EAC5DC,2CAA2C,QACtC,4BAA4B;AACnC,OAAOC,IAAI,MAAM,WAAW;AAK5B,SAASC,iCAAiC,QAAQ,gDAAgD;AAClG,SAASC,gBAAgB,QAAQ,+BAA+B;AAChE,SAASC,8BAA8B,QAAQ,6CAA6C;AAC5F,SAASC,gBAAgB,QAAQ,6BAA6B;AAC9D,SAASC,SAAS,QAAQ,sBAAsB;AAChD,SAASC,QAAQ,QAAQ,0BAA0B;AACnD,SAASC,uBAAuB,QAAQ,8BAA8B;AAEtE,OAAO,eAAeC,2BAA2BA,CAC/C;EACEC,EAAE;EACFC,MAAM,EAAEC,UAAU;EAClBC,QAAQ;EACRC,sBAAsB;EACtBC,SAAS,GAAG,EAAE;EACdC,cAAc,GAAG;AASnB,CAAC,EAEc;EACf,MAAMC,SAAS,GAAGhB,IAAI,CAACiB,IAAI,CAAC,GAAG,EAAE,UAAU,EAAE,SAAS,CAAC;EACvD,MAAMP,MAAM,GAAGV,IAAI,CAACiB,IAAI,CAACN,UAAU,EAAE,UAAU,EAAE,SAAS,CAAC;EAC3D,MAAMF,EAAE,CAACS,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
17
17
|
export function getDescriptionIfPresent(description, includeNewline) {
|
|
18
18
|
if (description) {
|
|
19
|
+
// Preserve line breaks in multi-line descriptions
|
|
20
|
+
const lines = description.split("\n");
|
|
21
|
+
const formattedLines = lines.map(line => ` * ${line}`).join("\n");
|
|
19
22
|
return `/**
|
|
20
|
-
|
|
23
|
+
${formattedLines}
|
|
21
24
|
*/${includeNewline ? "\n" : ""}`;
|
|
22
25
|
}
|
|
23
26
|
return "";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getDescriptionIfPresent.js","names":["getDescriptionIfPresent","description","includeNewline"],"sources":["getDescriptionIfPresent.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\nexport function getDescriptionIfPresent(\n description?: string,\n includeNewline?: boolean,\n): string {\n if (description) {\n
|
|
1
|
+
{"version":3,"file":"getDescriptionIfPresent.js","names":["getDescriptionIfPresent","description","includeNewline","lines","split","formattedLines","map","line","join"],"sources":["getDescriptionIfPresent.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\nexport function getDescriptionIfPresent(\n description?: string,\n includeNewline?: boolean,\n): string {\n if (description) {\n // Preserve line breaks in multi-line descriptions\n const lines = description.split(\"\\n\");\n const formattedLines = lines.map(line => ` * ${line}`).join(\"\\n\");\n return `/**\n${formattedLines}\n */${includeNewline ? \"\\n\" : \"\"}`;\n }\n return \"\";\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,SAASA,uBAAuBA,CACrCC,WAAoB,EACpBC,cAAwB,EAChB;EACR,IAAID,WAAW,EAAE;IACf;IACA,MAAME,KAAK,GAAGF,WAAW,CAACG,KAAK,CAAC,IAAI,CAAC;IACrC,MAAMC,cAAc,GAAGF,KAAK,CAACG,GAAG,CAACC,IAAI,IAAI,MAAMA,IAAI,EAAE,CAAC,CAACC,IAAI,CAAC,IAAI,CAAC;IACjE,OAAO;AACX,EAAEH,cAAc;AAChB,KAAKH,cAAc,GAAG,IAAI,GAAG,EAAE,EAAE;EAC/B;EACA,OAAO,EAAE;AACX","ignoreList":[]}
|
package/build/cjs/index.cjs
CHANGED
|
@@ -287,7 +287,7 @@ function formatTs(contents) {
|
|
|
287
287
|
}
|
|
288
288
|
|
|
289
289
|
// src/v2.0/generateMetadata.ts
|
|
290
|
-
var ExpectedOsdkVersion = "2.
|
|
290
|
+
var ExpectedOsdkVersion = "2.8.0";
|
|
291
291
|
async function generateOntologyMetadataFile({
|
|
292
292
|
fs: fs2,
|
|
293
293
|
outDir,
|
|
@@ -300,6 +300,9 @@ async function generateOntologyMetadataFile({
|
|
|
300
300
|
${ontologyApiNamespace == null ? `
|
|
301
301
|
export const $ontologyRid = "${ontology.ontology.rid}";
|
|
302
302
|
` : ""}
|
|
303
|
+
${ontology.raw.branch != null ? `
|
|
304
|
+
export const $branch = "${ontology.raw.branch.rid}";
|
|
305
|
+
` : ""}
|
|
303
306
|
`));
|
|
304
307
|
}
|
|
305
308
|
|
|
@@ -354,8 +357,10 @@ function stringUnionFrom(values) {
|
|
|
354
357
|
// src/v2.0/getDescriptionIfPresent.ts
|
|
355
358
|
function getDescriptionIfPresent(description, includeNewline) {
|
|
356
359
|
if (description) {
|
|
360
|
+
const lines = description.split("\n");
|
|
361
|
+
const formattedLines = lines.map((line) => ` * ${line}`).join("\n");
|
|
357
362
|
return `/**
|
|
358
|
-
|
|
363
|
+
${formattedLines}
|
|
359
364
|
*/${""}`;
|
|
360
365
|
}
|
|
361
366
|
return "";
|
|
@@ -1265,8 +1270,8 @@ async function generateV2QueryFile(fs2, outDir, relOutDir, query, importExt, ont
|
|
|
1265
1270
|
}), "Result")}
|
|
1266
1271
|
`}
|
|
1267
1272
|
}
|
|
1268
|
-
|
|
1269
|
-
|
|
1273
|
+
|
|
1274
|
+
${getDescriptionIfPresent(query.description)}
|
|
1270
1275
|
export interface ${query.shortApiName} extends QueryDefinition<
|
|
1271
1276
|
${query.shortApiName}.Signature
|
|
1272
1277
|
>, VersionBound<$ExpectedClientVersion>{
|
|
@@ -1290,7 +1295,7 @@ async function generateV2QueryFile(fs2, outDir, relOutDir, query, importExt, ont
|
|
|
1290
1295
|
osdkMetadata: typeof $osdkMetadata;
|
|
1291
1296
|
}
|
|
1292
1297
|
|
|
1293
|
-
|
|
1298
|
+
${getDescriptionIfPresent(query.description)}
|
|
1294
1299
|
export const ${query.shortApiName}: ${query.definitionIdentifier} = {
|
|
1295
1300
|
${stringify(baseProps, {
|
|
1296
1301
|
"description": () => void 0,
|