@osdk/generator 2.8.0-beta.2 → 2.8.0-beta.21
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 +153 -0
- package/build/browser/shared/getInterfaceTypesFromQueryDataType.js +3 -0
- package/build/browser/shared/getInterfaceTypesFromQueryDataType.js.map +1 -1
- package/build/browser/shared/getObjectTypesFromQueryDataType.js +3 -0
- package/build/browser/shared/getObjectTypesFromQueryDataType.js.map +1 -1
- package/build/browser/util/test/TodoWireOntology.js +20 -10
- package/build/browser/util/test/TodoWireOntology.js.map +1 -1
- package/build/browser/v2.0/generatePerQueryDataFiles.js +10 -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 +19 -4
- package/build/cjs/index.cjs.map +1 -1
- package/build/esm/shared/getInterfaceTypesFromQueryDataType.js +3 -0
- package/build/esm/shared/getInterfaceTypesFromQueryDataType.js.map +1 -1
- package/build/esm/shared/getObjectTypesFromQueryDataType.js +3 -0
- package/build/esm/shared/getObjectTypesFromQueryDataType.js.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/generatePerQueryDataFiles.js +10 -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 +4 -4
- package/build/browser/generateClientSdkPackage.test.js +0 -68
- package/build/browser/generateClientSdkPackage.test.js.map +0 -1
- package/build/browser/shared/apiNamespaces/startsWithApiNamespace.test.js +0 -47
- package/build/browser/shared/apiNamespaces/startsWithApiNamespace.test.js.map +0 -1
- package/build/browser/shared/sanitizeMetadata.test.js +0 -46
- package/build/browser/shared/sanitizeMetadata.test.js.map +0 -1
- package/build/browser/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.js +0 -472
- package/build/browser/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.js.map +0 -1
- package/build/browser/v2.0/generateClientSdkVersionTwoPointZero.test.js +0 -2603
- package/build/browser/v2.0/generateClientSdkVersionTwoPointZero.test.js.map +0 -1
- package/build/browser/v2.0/generatePerActionDataFiles.test.js +0 -64
- package/build/browser/v2.0/generatePerActionDataFiles.test.js.map +0 -1
- package/build/browser/v2.0/generatePerQueryDataFiles.test.js +0 -519
- package/build/browser/v2.0/generatePerQueryDataFiles.test.js.map +0 -1
- package/build/esm/generateClientSdkPackage.test.js +0 -68
- package/build/esm/generateClientSdkPackage.test.js.map +0 -1
- package/build/esm/shared/apiNamespaces/startsWithApiNamespace.test.js +0 -47
- package/build/esm/shared/apiNamespaces/startsWithApiNamespace.test.js.map +0 -1
- package/build/esm/shared/sanitizeMetadata.test.js +0 -46
- package/build/esm/shared/sanitizeMetadata.test.js.map +0 -1
- package/build/esm/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.js +0 -472
- package/build/esm/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.js.map +0 -1
- package/build/esm/v2.0/generateClientSdkVersionTwoPointZero.test.js +0 -2603
- package/build/esm/v2.0/generateClientSdkVersionTwoPointZero.test.js.map +0 -1
- package/build/esm/v2.0/generatePerActionDataFiles.test.js +0 -64
- package/build/esm/v2.0/generatePerActionDataFiles.test.js.map +0 -1
- package/build/esm/v2.0/generatePerQueryDataFiles.test.js +0 -519
- package/build/esm/v2.0/generatePerQueryDataFiles.test.js.map +0 -1
- package/build/types/generateClientSdkPackage.test.d.ts +0 -1
- package/build/types/generateClientSdkPackage.test.d.ts.map +0 -1
- package/build/types/shared/apiNamespaces/startsWithApiNamespace.test.d.ts +0 -1
- package/build/types/shared/apiNamespaces/startsWithApiNamespace.test.d.ts.map +0 -1
- package/build/types/shared/sanitizeMetadata.test.d.ts +0 -1
- package/build/types/shared/sanitizeMetadata.test.d.ts.map +0 -1
- package/build/types/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.d.ts +0 -1
- package/build/types/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.d.ts.map +0 -1
- package/build/types/v2.0/generateClientSdkVersionTwoPointZero.test.d.ts +0 -1
- package/build/types/v2.0/generateClientSdkVersionTwoPointZero.test.d.ts.map +0 -1
- package/build/types/v2.0/generatePerActionDataFiles.test.d.ts +0 -1
- package/build/types/v2.0/generatePerActionDataFiles.test.d.ts.map +0 -1
- package/build/types/v2.0/generatePerQueryDataFiles.test.d.ts +0 -1
- package/build/types/v2.0/generatePerQueryDataFiles.test.d.ts.map +0 -1
|
@@ -45,6 +45,7 @@ export function getInterfaceTypesFromQueryDataType(dataType, types) {
|
|
|
45
45
|
case "float":
|
|
46
46
|
case "integer":
|
|
47
47
|
case "long":
|
|
48
|
+
case "mediaReference":
|
|
48
49
|
case "null":
|
|
49
50
|
case "string":
|
|
50
51
|
case "threeDimensionalAggregation":
|
|
@@ -54,6 +55,8 @@ export function getInterfaceTypesFromQueryDataType(dataType, types) {
|
|
|
54
55
|
case "unsupported":
|
|
55
56
|
case "object":
|
|
56
57
|
case "objectSet":
|
|
58
|
+
case "mediaReference":
|
|
59
|
+
case "void":
|
|
57
60
|
/* complete no-op */
|
|
58
61
|
return;
|
|
59
62
|
default:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getInterfaceTypesFromQueryDataType.js","names":["getInterfaceTypesFromQueryDataType","dataType","types","type","subType","add","interfaceTypeApiName","prop","Object","values","fields","fieldType","unionTypes","keyType","valueType","Error"],"sources":["getInterfaceTypesFromQueryDataType.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 { QueryDataType } from \"@osdk/foundry.ontologies\";\n\nexport function getInterfaceTypesFromQueryDataType(\n dataType: QueryDataType,\n types: Set<string>,\n): void {\n switch (dataType.type) {\n case \"array\":\n case \"set\":\n getInterfaceTypesFromQueryDataType(dataType.subType, types);\n return;\n case \"interfaceObject\":\n case \"interfaceObjectSet\":\n types.add(dataType.interfaceTypeApiName!);\n return;\n\n case \"struct\":\n for (const prop of Object.values(dataType.fields)) {\n getInterfaceTypesFromQueryDataType(prop.fieldType, types);\n }\n return;\n\n case \"union\":\n for (const type of dataType.unionTypes) {\n getInterfaceTypesFromQueryDataType(type, types);\n }\n return;\n\n case \"entrySet\":\n getInterfaceTypesFromQueryDataType(dataType.keyType, types);\n getInterfaceTypesFromQueryDataType(dataType.valueType, types);\n return;\n\n case \"attachment\":\n case \"boolean\":\n case \"date\":\n case \"double\":\n case \"float\":\n case \"integer\":\n case \"long\":\n case \"null\":\n case \"string\":\n case \"threeDimensionalAggregation\":\n case \"timestamp\":\n case \"twoDimensionalAggregation\":\n case \"entrySet\":\n case \"unsupported\":\n case \"object\":\n case \"objectSet\":\n /* complete no-op */\n return;\n\n default:\n const _: never = dataType;\n throw new Error(\n `Unknown query data type ${(dataType as any).type}`,\n );\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,OAAO,SAASA,kCAAkCA,CAChDC,QAAuB,EACvBC,KAAkB,EACZ;EACN,QAAQD,QAAQ,CAACE,IAAI;IACnB,KAAK,OAAO;IACZ,KAAK,KAAK;MACRH,kCAAkC,CAACC,QAAQ,CAACG,OAAO,EAAEF,KAAK,CAAC;MAC3D;IACF,KAAK,iBAAiB;IACtB,KAAK,oBAAoB;MACvBA,KAAK,CAACG,GAAG,CAACJ,QAAQ,CAACK,oBAAqB,CAAC;MACzC;IAEF,KAAK,QAAQ;MACX,KAAK,MAAMC,IAAI,IAAIC,MAAM,CAACC,MAAM,CAACR,QAAQ,CAACS,MAAM,CAAC,EAAE;QACjDV,kCAAkC,CAACO,IAAI,CAACI,SAAS,EAAET,KAAK,CAAC;MAC3D;MACA;IAEF,KAAK,OAAO;MACV,KAAK,MAAMC,IAAI,IAAIF,QAAQ,CAACW,UAAU,EAAE;QACtCZ,kCAAkC,CAACG,IAAI,EAAED,KAAK,CAAC;MACjD;MACA;IAEF,KAAK,UAAU;MACbF,kCAAkC,CAACC,QAAQ,CAACY,OAAO,EAAEX,KAAK,CAAC;MAC3DF,kCAAkC,CAACC,QAAQ,CAACa,SAAS,EAAEZ,KAAK,CAAC;MAC7D;IAEF,KAAK,YAAY;IACjB,KAAK,SAAS;IACd,KAAK,MAAM;IACX,KAAK,QAAQ;IACb,KAAK,OAAO;IACZ,KAAK,SAAS;IACd,KAAK,MAAM;IACX,KAAK,MAAM;IACX,KAAK,QAAQ;IACb,KAAK,6BAA6B;IAClC,KAAK,WAAW;IAChB,KAAK,2BAA2B;IAChC,KAAK,UAAU;IACf,KAAK,aAAa;IAClB,KAAK,QAAQ;IACb,KAAK,WAAW;
|
|
1
|
+
{"version":3,"file":"getInterfaceTypesFromQueryDataType.js","names":["getInterfaceTypesFromQueryDataType","dataType","types","type","subType","add","interfaceTypeApiName","prop","Object","values","fields","fieldType","unionTypes","keyType","valueType","Error"],"sources":["getInterfaceTypesFromQueryDataType.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 { QueryDataType } from \"@osdk/foundry.ontologies\";\n\nexport function getInterfaceTypesFromQueryDataType(\n dataType: QueryDataType,\n types: Set<string>,\n): void {\n switch (dataType.type) {\n case \"array\":\n case \"set\":\n getInterfaceTypesFromQueryDataType(dataType.subType, types);\n return;\n case \"interfaceObject\":\n case \"interfaceObjectSet\":\n types.add(dataType.interfaceTypeApiName!);\n return;\n\n case \"struct\":\n for (const prop of Object.values(dataType.fields)) {\n getInterfaceTypesFromQueryDataType(prop.fieldType, types);\n }\n return;\n\n case \"union\":\n for (const type of dataType.unionTypes) {\n getInterfaceTypesFromQueryDataType(type, types);\n }\n return;\n\n case \"entrySet\":\n getInterfaceTypesFromQueryDataType(dataType.keyType, types);\n getInterfaceTypesFromQueryDataType(dataType.valueType, types);\n return;\n\n case \"attachment\":\n case \"boolean\":\n case \"date\":\n case \"double\":\n case \"float\":\n case \"integer\":\n case \"long\":\n case \"mediaReference\":\n case \"null\":\n case \"string\":\n case \"threeDimensionalAggregation\":\n case \"timestamp\":\n case \"twoDimensionalAggregation\":\n case \"entrySet\":\n case \"unsupported\":\n case \"object\":\n case \"objectSet\":\n case \"mediaReference\":\n case \"void\":\n /* complete no-op */\n return;\n\n default:\n const _: never = dataType;\n throw new Error(\n `Unknown query data type ${(dataType as any).type}`,\n );\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,OAAO,SAASA,kCAAkCA,CAChDC,QAAuB,EACvBC,KAAkB,EACZ;EACN,QAAQD,QAAQ,CAACE,IAAI;IACnB,KAAK,OAAO;IACZ,KAAK,KAAK;MACRH,kCAAkC,CAACC,QAAQ,CAACG,OAAO,EAAEF,KAAK,CAAC;MAC3D;IACF,KAAK,iBAAiB;IACtB,KAAK,oBAAoB;MACvBA,KAAK,CAACG,GAAG,CAACJ,QAAQ,CAACK,oBAAqB,CAAC;MACzC;IAEF,KAAK,QAAQ;MACX,KAAK,MAAMC,IAAI,IAAIC,MAAM,CAACC,MAAM,CAACR,QAAQ,CAACS,MAAM,CAAC,EAAE;QACjDV,kCAAkC,CAACO,IAAI,CAACI,SAAS,EAAET,KAAK,CAAC;MAC3D;MACA;IAEF,KAAK,OAAO;MACV,KAAK,MAAMC,IAAI,IAAIF,QAAQ,CAACW,UAAU,EAAE;QACtCZ,kCAAkC,CAACG,IAAI,EAAED,KAAK,CAAC;MACjD;MACA;IAEF,KAAK,UAAU;MACbF,kCAAkC,CAACC,QAAQ,CAACY,OAAO,EAAEX,KAAK,CAAC;MAC3DF,kCAAkC,CAACC,QAAQ,CAACa,SAAS,EAAEZ,KAAK,CAAC;MAC7D;IAEF,KAAK,YAAY;IACjB,KAAK,SAAS;IACd,KAAK,MAAM;IACX,KAAK,QAAQ;IACb,KAAK,OAAO;IACZ,KAAK,SAAS;IACd,KAAK,MAAM;IACX,KAAK,gBAAgB;IACrB,KAAK,MAAM;IACX,KAAK,QAAQ;IACb,KAAK,6BAA6B;IAClC,KAAK,WAAW;IAChB,KAAK,2BAA2B;IAChC,KAAK,UAAU;IACf,KAAK,aAAa;IAClB,KAAK,QAAQ;IACb,KAAK,WAAW;IAChB,KAAK,gBAAgB;IACrB,KAAK,MAAM;MACT;MACA;IAEF;MAEE,MAAM,IAAIa,KAAK,CACb,2BAA4Bd,QAAQ,CAASE,IAAI,EACnD,CAAC;EACL;AACF","ignoreList":[]}
|
|
@@ -47,6 +47,7 @@ export function getObjectTypesFromQueryDataType(dataType, types) {
|
|
|
47
47
|
case "float":
|
|
48
48
|
case "integer":
|
|
49
49
|
case "long":
|
|
50
|
+
case "mediaReference":
|
|
50
51
|
case "null":
|
|
51
52
|
case "string":
|
|
52
53
|
case "threeDimensionalAggregation":
|
|
@@ -56,6 +57,8 @@ export function getObjectTypesFromQueryDataType(dataType, types) {
|
|
|
56
57
|
case "unsupported":
|
|
57
58
|
case "interfaceObject":
|
|
58
59
|
case "interfaceObjectSet":
|
|
60
|
+
case "mediaReference":
|
|
61
|
+
case "void":
|
|
59
62
|
/* complete no-op */
|
|
60
63
|
return;
|
|
61
64
|
default:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getObjectTypesFromQueryDataType.js","names":["getObjectTypesFromQueryDataType","dataType","types","type","subType","add","objectTypeApiName","prop","Object","values","fields","fieldType","unionTypes","keyType","valueType","Error"],"sources":["getObjectTypesFromQueryDataType.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { QueryDataType } from \"@osdk/foundry.ontologies\";\n\nexport function getObjectTypesFromQueryDataType(\n dataType: QueryDataType,\n types: Set<string>,\n): void {\n switch (dataType.type) {\n case \"array\":\n case \"set\":\n getObjectTypesFromQueryDataType(dataType.subType, types);\n return;\n\n case \"object\":\n types.add(dataType.objectTypeApiName);\n return;\n\n case \"objectSet\":\n types.add(dataType.objectTypeApiName!);\n return;\n\n case \"struct\":\n for (const prop of Object.values(dataType.fields)) {\n getObjectTypesFromQueryDataType(prop.fieldType, types);\n }\n return;\n\n case \"union\":\n for (const type of dataType.unionTypes) {\n getObjectTypesFromQueryDataType(type, types);\n }\n return;\n\n case \"entrySet\":\n getObjectTypesFromQueryDataType(dataType.keyType, types);\n getObjectTypesFromQueryDataType(dataType.valueType, types);\n return;\n\n case \"attachment\":\n case \"boolean\":\n case \"date\":\n case \"double\":\n case \"float\":\n case \"integer\":\n case \"long\":\n case \"null\":\n case \"string\":\n case \"threeDimensionalAggregation\":\n case \"timestamp\":\n case \"twoDimensionalAggregation\":\n case \"entrySet\":\n case \"unsupported\":\n case \"interfaceObject\":\n case \"interfaceObjectSet\":\n /* complete no-op */\n return;\n\n default:\n const _: never = dataType;\n throw new Error(\n `Unknown query data type ${(dataType as any).type}`,\n );\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,OAAO,SAASA,+BAA+BA,CAC7CC,QAAuB,EACvBC,KAAkB,EACZ;EACN,QAAQD,QAAQ,CAACE,IAAI;IACnB,KAAK,OAAO;IACZ,KAAK,KAAK;MACRH,+BAA+B,CAACC,QAAQ,CAACG,OAAO,EAAEF,KAAK,CAAC;MACxD;IAEF,KAAK,QAAQ;MACXA,KAAK,CAACG,GAAG,CAACJ,QAAQ,CAACK,iBAAiB,CAAC;MACrC;IAEF,KAAK,WAAW;MACdJ,KAAK,CAACG,GAAG,CAACJ,QAAQ,CAACK,iBAAkB,CAAC;MACtC;IAEF,KAAK,QAAQ;MACX,KAAK,MAAMC,IAAI,IAAIC,MAAM,CAACC,MAAM,CAACR,QAAQ,CAACS,MAAM,CAAC,EAAE;QACjDV,+BAA+B,CAACO,IAAI,CAACI,SAAS,EAAET,KAAK,CAAC;MACxD;MACA;IAEF,KAAK,OAAO;MACV,KAAK,MAAMC,IAAI,IAAIF,QAAQ,CAACW,UAAU,EAAE;QACtCZ,+BAA+B,CAACG,IAAI,EAAED,KAAK,CAAC;MAC9C;MACA;IAEF,KAAK,UAAU;MACbF,+BAA+B,CAACC,QAAQ,CAACY,OAAO,EAAEX,KAAK,CAAC;MACxDF,+BAA+B,CAACC,QAAQ,CAACa,SAAS,EAAEZ,KAAK,CAAC;MAC1D;IAEF,KAAK,YAAY;IACjB,KAAK,SAAS;IACd,KAAK,MAAM;IACX,KAAK,QAAQ;IACb,KAAK,OAAO;IACZ,KAAK,SAAS;IACd,KAAK,MAAM;IACX,KAAK,MAAM;IACX,KAAK,QAAQ;IACb,KAAK,6BAA6B;IAClC,KAAK,WAAW;IAChB,KAAK,2BAA2B;IAChC,KAAK,UAAU;IACf,KAAK,aAAa;IAClB,KAAK,iBAAiB;IACtB,KAAK,oBAAoB;
|
|
1
|
+
{"version":3,"file":"getObjectTypesFromQueryDataType.js","names":["getObjectTypesFromQueryDataType","dataType","types","type","subType","add","objectTypeApiName","prop","Object","values","fields","fieldType","unionTypes","keyType","valueType","Error"],"sources":["getObjectTypesFromQueryDataType.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { QueryDataType } from \"@osdk/foundry.ontologies\";\n\nexport function getObjectTypesFromQueryDataType(\n dataType: QueryDataType,\n types: Set<string>,\n): void {\n switch (dataType.type) {\n case \"array\":\n case \"set\":\n getObjectTypesFromQueryDataType(dataType.subType, types);\n return;\n\n case \"object\":\n types.add(dataType.objectTypeApiName);\n return;\n\n case \"objectSet\":\n types.add(dataType.objectTypeApiName!);\n return;\n\n case \"struct\":\n for (const prop of Object.values(dataType.fields)) {\n getObjectTypesFromQueryDataType(prop.fieldType, types);\n }\n return;\n\n case \"union\":\n for (const type of dataType.unionTypes) {\n getObjectTypesFromQueryDataType(type, types);\n }\n return;\n\n case \"entrySet\":\n getObjectTypesFromQueryDataType(dataType.keyType, types);\n getObjectTypesFromQueryDataType(dataType.valueType, types);\n return;\n\n case \"attachment\":\n case \"boolean\":\n case \"date\":\n case \"double\":\n case \"float\":\n case \"integer\":\n case \"long\":\n case \"mediaReference\":\n case \"null\":\n case \"string\":\n case \"threeDimensionalAggregation\":\n case \"timestamp\":\n case \"twoDimensionalAggregation\":\n case \"entrySet\":\n case \"unsupported\":\n case \"interfaceObject\":\n case \"interfaceObjectSet\":\n case \"mediaReference\":\n case \"void\":\n /* complete no-op */\n return;\n\n default:\n const _: never = dataType;\n throw new Error(\n `Unknown query data type ${(dataType as any).type}`,\n );\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,OAAO,SAASA,+BAA+BA,CAC7CC,QAAuB,EACvBC,KAAkB,EACZ;EACN,QAAQD,QAAQ,CAACE,IAAI;IACnB,KAAK,OAAO;IACZ,KAAK,KAAK;MACRH,+BAA+B,CAACC,QAAQ,CAACG,OAAO,EAAEF,KAAK,CAAC;MACxD;IAEF,KAAK,QAAQ;MACXA,KAAK,CAACG,GAAG,CAACJ,QAAQ,CAACK,iBAAiB,CAAC;MACrC;IAEF,KAAK,WAAW;MACdJ,KAAK,CAACG,GAAG,CAACJ,QAAQ,CAACK,iBAAkB,CAAC;MACtC;IAEF,KAAK,QAAQ;MACX,KAAK,MAAMC,IAAI,IAAIC,MAAM,CAACC,MAAM,CAACR,QAAQ,CAACS,MAAM,CAAC,EAAE;QACjDV,+BAA+B,CAACO,IAAI,CAACI,SAAS,EAAET,KAAK,CAAC;MACxD;MACA;IAEF,KAAK,OAAO;MACV,KAAK,MAAMC,IAAI,IAAIF,QAAQ,CAACW,UAAU,EAAE;QACtCZ,+BAA+B,CAACG,IAAI,EAAED,KAAK,CAAC;MAC9C;MACA;IAEF,KAAK,UAAU;MACbF,+BAA+B,CAACC,QAAQ,CAACY,OAAO,EAAEX,KAAK,CAAC;MACxDF,+BAA+B,CAACC,QAAQ,CAACa,SAAS,EAAEZ,KAAK,CAAC;MAC1D;IAEF,KAAK,YAAY;IACjB,KAAK,SAAS;IACd,KAAK,MAAM;IACX,KAAK,QAAQ;IACb,KAAK,OAAO;IACZ,KAAK,SAAS;IACd,KAAK,MAAM;IACX,KAAK,gBAAgB;IACrB,KAAK,MAAM;IACX,KAAK,QAAQ;IACb,KAAK,6BAA6B;IAClC,KAAK,WAAW;IAChB,KAAK,2BAA2B;IAChC,KAAK,UAAU;IACf,KAAK,aAAa;IAClB,KAAK,iBAAiB;IACtB,KAAK,oBAAoB;IACzB,KAAK,gBAAgB;IACrB,KAAK,MAAM;MACT;MACA;IAEF;MAEE,MAAM,IAAIa,KAAK,CACb,2BAA4Bd,QAAQ,CAASE,IAAI,EACnD,CAAC;EACL;AACF","ignoreList":[]}
|
|
@@ -34,7 +34,8 @@ export const TodoWireOntology = {
|
|
|
34
34
|
objectApiName: "Todo",
|
|
35
35
|
objectTypeApiName: "Todo"
|
|
36
36
|
},
|
|
37
|
-
required: false
|
|
37
|
+
required: false,
|
|
38
|
+
typeClasses: []
|
|
38
39
|
}
|
|
39
40
|
},
|
|
40
41
|
rid: "ri.ontology.main.action-type.9f84017d-cf17-4fa8-84c3-8e01e5d594f2",
|
|
@@ -59,7 +60,8 @@ export const TodoWireOntology = {
|
|
|
59
60
|
"objectTypeApiName": "Todo"
|
|
60
61
|
}
|
|
61
62
|
},
|
|
62
|
-
required: false
|
|
63
|
+
required: false,
|
|
64
|
+
typeClasses: []
|
|
63
65
|
}
|
|
64
66
|
},
|
|
65
67
|
rid: "ri.ontology.main.action-type.8f94017d-cf17-4fa8-84c3-8e01e5d594f2",
|
|
@@ -90,7 +92,8 @@ export const TodoWireOntology = {
|
|
|
90
92
|
type: "integer"
|
|
91
93
|
},
|
|
92
94
|
rid: "rid",
|
|
93
|
-
valueTypeApiName: "numericValueType"
|
|
95
|
+
valueTypeApiName: "numericValueType",
|
|
96
|
+
typeClasses: []
|
|
94
97
|
},
|
|
95
98
|
body: {
|
|
96
99
|
dataType: {
|
|
@@ -98,13 +101,15 @@ export const TodoWireOntology = {
|
|
|
98
101
|
},
|
|
99
102
|
description: "The text of the todo",
|
|
100
103
|
displayName: "Body",
|
|
101
|
-
rid: "rid"
|
|
104
|
+
rid: "rid",
|
|
105
|
+
typeClasses: []
|
|
102
106
|
},
|
|
103
107
|
complete: {
|
|
104
108
|
dataType: {
|
|
105
109
|
type: "boolean"
|
|
106
110
|
},
|
|
107
|
-
rid: "rid"
|
|
111
|
+
rid: "rid",
|
|
112
|
+
typeClasses: []
|
|
108
113
|
},
|
|
109
114
|
array: {
|
|
110
115
|
dataType: {
|
|
@@ -115,7 +120,8 @@ export const TodoWireOntology = {
|
|
|
115
120
|
reducers: []
|
|
116
121
|
},
|
|
117
122
|
valueTypeApiName: "arrayValueType",
|
|
118
|
-
rid: "rid"
|
|
123
|
+
rid: "rid",
|
|
124
|
+
typeClasses: []
|
|
119
125
|
}
|
|
120
126
|
},
|
|
121
127
|
status: "ACTIVE",
|
|
@@ -161,7 +167,8 @@ export const TodoWireOntology = {
|
|
|
161
167
|
type: "string"
|
|
162
168
|
},
|
|
163
169
|
rid: "rid",
|
|
164
|
-
valueTypeApiName: "emailValueType"
|
|
170
|
+
valueTypeApiName: "emailValueType",
|
|
171
|
+
typeClasses: []
|
|
165
172
|
}
|
|
166
173
|
},
|
|
167
174
|
rid: "ridForPerson",
|
|
@@ -231,7 +238,8 @@ export const TodoWireOntology = {
|
|
|
231
238
|
type: "string"
|
|
232
239
|
},
|
|
233
240
|
rid: "idk2",
|
|
234
|
-
required: false
|
|
241
|
+
required: false,
|
|
242
|
+
typeClasses: []
|
|
235
243
|
}
|
|
236
244
|
},
|
|
237
245
|
propertiesV2: {},
|
|
@@ -249,7 +257,8 @@ export const TodoWireOntology = {
|
|
|
249
257
|
type: "string"
|
|
250
258
|
},
|
|
251
259
|
rid: "idk2",
|
|
252
|
-
required: false
|
|
260
|
+
required: false,
|
|
261
|
+
typeClasses: []
|
|
253
262
|
}
|
|
254
263
|
},
|
|
255
264
|
allPropertiesV2: {},
|
|
@@ -265,7 +274,8 @@ export const TodoWireOntology = {
|
|
|
265
274
|
dataType: {
|
|
266
275
|
type: "string"
|
|
267
276
|
},
|
|
268
|
-
rid: "idk2"
|
|
277
|
+
rid: "idk2",
|
|
278
|
+
typeClasses: []
|
|
269
279
|
}
|
|
270
280
|
},
|
|
271
281
|
valueTypes: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TodoWireOntology.js","names":["TodoWireOntology","ontology","rid","apiName","displayName","description","actionTypes","parameters","object","dataType","type","objectApiName","objectTypeApiName","required","operations","status","objectTypes","Todo","objectType","primaryKey","pluralDisplayName","icon","name","color","titleProperty","properties","id","valueTypeApiName","body","complete","array","subType","reducers","linkTypes","cardinality","foreignKeyPropertyApiName","linkTypeRid","implementsInterfaces","implementsInterfaces2","propertiesV2","links","sharedPropertyTypeMapping","Person","email","queryTypes","output","completed","version","someTodo","interfaceTypes","SomeInterface","extendsInterfaces","implementedByObjectTypes","allProperties","allPropertiesV2","allExtendsInterfaces","allLinks","sharedPropertyTypes","SomeProperty","valueTypes","emailValueType","fieldType","constraints","options","arrayValueType","valueConstraint","uniqueValues"],"sources":["TodoWireOntology.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 { WireOntologyDefinition } from \"../../WireOntologyDefinition.js\";\n\nexport const TodoWireOntology: WireOntologyDefinition = {\n ontology: {\n rid: \"ridHere\",\n apiName: \"OntologyApiName\",\n displayName: \"\",\n description: \"\",\n },\n actionTypes: {\n \"markTodoCompleted\": {\n apiName: \"markTodoCompleted\",\n description: \"An action which takes different types of parameters\",\n parameters: {\n object: {\n displayName: \"markTodoCompleted\",\n description: \"A Todo to mark completed\",\n dataType: {\n type: \"object\",\n objectApiName: \"Todo\",\n objectTypeApiName: \"Todo\",\n },\n required: false,\n },\n },\n rid: \"ri.ontology.main.action-type.9f84017d-cf17-4fa8-84c3-8e01e5d594f2\",\n operations: [{\n type: \"modifyObject\",\n objectTypeApiName: \"Todo\",\n }],\n status: \"ACTIVE\",\n },\n \"deleteTodos\": {\n apiName: \"deleteTodos\",\n description: \"An action which takes in an array of objects\",\n parameters: {\n object: {\n displayName: \"deleteTodos\",\n description: \"Todo(s) to be deleted\",\n \"dataType\": {\n \"type\": \"array\",\n\n \"subType\": {\n \"type\": \"object\",\n \"objectApiName\": \"Todo\",\n \"objectTypeApiName\": \"Todo\",\n },\n },\n required: false,\n },\n },\n rid: \"ri.ontology.main.action-type.8f94017d-cf17-4fa8-84c3-8e01e5d594f2\",\n operations: [{\n type: \"deleteObject\",\n objectTypeApiName: \"Todo\",\n }],\n status: \"ACTIVE\",\n },\n },\n objectTypes: {\n Todo: {\n objectType: {\n apiName: \"Todo\",\n primaryKey: \"id\",\n displayName: \"AwesomeTodoDisplayname\",\n pluralDisplayName: \"AwesomeTodoDisplayNames\",\n icon: { type: \"blueprint\", name: \"document\", color: \"blue\" },\n description: \"Its a todo item.\",\n titleProperty: \"body\",\n properties: {\n id: {\n dataType: {\n type: \"integer\",\n },\n rid: \"rid\",\n valueTypeApiName: \"numericValueType\",\n },\n body: {\n dataType: {\n type: \"string\",\n },\n description: \"The text of the todo\",\n displayName: \"Body\",\n rid: \"rid\",\n },\n complete: {\n dataType: {\n type: \"boolean\",\n },\n rid: \"rid\",\n },\n array: {\n dataType: {\n type: \"array\",\n subType: {\n type: \"string\",\n },\n reducers: [],\n },\n valueTypeApiName: \"arrayValueType\",\n rid: \"rid\",\n },\n },\n status: \"ACTIVE\",\n rid: \"ridForTodo\",\n },\n linkTypes: [{\n apiName: \"Assignee\",\n cardinality: \"ONE\",\n displayName: \"Assignee\",\n objectTypeApiName: \"Person\",\n status: \"ACTIVE\",\n foreignKeyPropertyApiName: \"email\",\n linkTypeRid: \"\",\n }],\n implementsInterfaces: [\"SomeInterface\"],\n implementsInterfaces2: {\n \"SomeInterface\": {\n properties: {\n \"SomeProperty\": \"body\",\n },\n propertiesV2: {},\n links: {},\n },\n },\n sharedPropertyTypeMapping: {},\n },\n Person: {\n objectType: {\n apiName: \"Person\",\n primaryKey: \"email\",\n displayName: \"Person\",\n pluralDisplayName: \"Persons\",\n icon: { type: \"blueprint\", name: \"document\", color: \"blue\" },\n description: \"A person\",\n titleProperty: \"email\",\n properties: {\n email: {\n dataType: {\n type: \"string\",\n },\n rid: \"rid\",\n valueTypeApiName: \"emailValueType\",\n },\n },\n\n rid: \"ridForPerson\",\n status: \"ACTIVE\",\n },\n linkTypes: [{\n apiName: \"Todos\",\n cardinality: \"MANY\",\n displayName: \"Todos\",\n objectTypeApiName: \"Todo\",\n status: \"ACTIVE\",\n foreignKeyPropertyApiName: \"id\",\n linkTypeRid: \"\",\n }],\n implementsInterfaces: [],\n implementsInterfaces2: {},\n sharedPropertyTypeMapping: {},\n },\n },\n queryTypes: {\n \"getCount\": {\n apiName: \"getCount\",\n output: {\n type: \"integer\",\n },\n parameters: {\n completed: { dataType: { type: \"boolean\" } },\n },\n rid: \"rid.query.1\",\n version: \"1.1.0\",\n },\n \"returnsTodo\": {\n apiName: \"returnsTodo\",\n output: {\n type: \"object\",\n objectApiName: \"Todo\",\n objectTypeApiName: \"Todo\",\n },\n parameters: {\n someTodo: {\n description: \"Random desc so we test jsdoc\",\n dataType: {\n type: \"object\",\n objectApiName: \"Todo\",\n objectTypeApiName: \"Todo\",\n },\n },\n },\n rid: \"rid.query.2\",\n version: \"3.2.0\",\n },\n },\n interfaceTypes: {\n SomeInterface: {\n apiName: \"SomeInterface\",\n description: \"Some interface\",\n properties: {\n \"SomeProperty\": {\n apiName: \"SomeProperty\",\n description: \"Some property\",\n displayName: \"Sum Property\",\n dataType: {\n type: \"string\",\n },\n rid: \"idk2\",\n required: false,\n },\n },\n propertiesV2: {},\n rid: \"idk\",\n displayName: \"Sum Interface\",\n extendsInterfaces: [],\n links: {},\n implementedByObjectTypes: [],\n allProperties: {\n \"SomeProperty\": {\n apiName: \"SomeProperty\",\n description: \"Some property\",\n displayName: \"Sum Property\",\n dataType: {\n type: \"string\",\n },\n rid: \"idk2\",\n required: false,\n },\n },\n allPropertiesV2: {},\n allExtendsInterfaces: [],\n allLinks: {},\n },\n },\n sharedPropertyTypes: {\n SomeProperty: {\n apiName: \"SomeProperty\",\n description: \"Some property\",\n displayName: \"Sum Property\",\n dataType: {\n type: \"string\",\n },\n rid: \"idk2\",\n },\n },\n valueTypes: {\n emailValueType: {\n apiName: \"emailValueType\",\n description: \"A value type for email addresses\",\n displayName: \"Email Value Type\",\n rid: \"ridForEmailValueType\",\n version: \"1.0.0\",\n fieldType: {\n type: \"string\",\n },\n constraints: [{\n type: \"enum\",\n options: [\"osdk@palantir.com\", \"foundry@palantir.com\"],\n }],\n },\n arrayValueType: {\n apiName: \"arrayValueType\",\n description: \"A value type for arrays of strings\",\n displayName: \"Array Value Type\",\n rid: \"ridForArrayValueType\",\n version: \"1.0.0\",\n fieldType: {\n type: \"array\",\n subType: {\n type: \"string\",\n },\n },\n constraints: [{\n type: \"array\",\n valueConstraint: { type: \"enum\", options: [\"a\", \"b\", \"c\"] },\n uniqueValues: false,\n }],\n },\n },\n} as const satisfies WireOntologyDefinition;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,OAAO,MAAMA,gBAAwC,GAAG;EACtDC,QAAQ,EAAE;IACRC,GAAG,EAAE,SAAS;IACdC,OAAO,EAAE,iBAAiB;IAC1BC,WAAW,EAAE,EAAE;IACfC,WAAW,EAAE;EACf,CAAC;EACDC,WAAW,EAAE;IACX,mBAAmB,EAAE;MACn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AE,gBAAgB;MACzBE,WAAW,EAAE,kCAAkC;MAC/CD,WAAW,EAAE,kBAAkB;MAC/BF,GAAG,EAAE,sBAAsB;MAC3B6C,OAAO,EAAE,OAAO;MAChBc,SAAS,EAAE;QACTnD,IAAI,EAAE;MACR,CAAC;MACDoD,WAAW,EAAE,CAAC;QACZpD,IAAI,EAAE,MAAM;QACZqD,OAAO,EAAE,CAAC,mBAAmB,EAAE,sBAAsB;MACvD,CAAC;IACH,CAAC;IACDC,cAAc,EAAE;MACd7D,OAAO,EAAE,gBAAgB;MACzBE,WAAW,EAAE,oCAAoC;MACjDD,WAAW,EAAE,kBAAkB;MAC/BF,GAAG,EAAE,sBAAsB;MAC3B6C,OAAO,EAAE,OAAO;MAChBc,SAAS,EAAE;QACTnD,IAAI,EAAE,OAAO;QACbqB,OAAO,EAAE;UACPrB,IAAI,EAAE;QACR;MACF,CAAC;MACDoD,WAAW,EAAE,CAAC;QACZpD,IAAI,EAAE,OAAO;QACbuD,eAAe,EAAE;UAAEvD,IAAI,EAAE,MAAM;UAAEqD,OAAO,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG;QAAE,CAAC;QAC3DG,YAAY,EAAE;MAChB,CAAC;IACH;EACF;AACF,CAA2C","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"TodoWireOntology.js","names":["TodoWireOntology","ontology","rid","apiName","displayName","description","actionTypes","parameters","object","dataType","type","objectApiName","objectTypeApiName","required","typeClasses","operations","status","objectTypes","Todo","objectType","primaryKey","pluralDisplayName","icon","name","color","titleProperty","properties","id","valueTypeApiName","body","complete","array","subType","reducers","linkTypes","cardinality","foreignKeyPropertyApiName","linkTypeRid","implementsInterfaces","implementsInterfaces2","propertiesV2","links","sharedPropertyTypeMapping","Person","email","queryTypes","output","completed","version","someTodo","interfaceTypes","SomeInterface","extendsInterfaces","implementedByObjectTypes","allProperties","allPropertiesV2","allExtendsInterfaces","allLinks","sharedPropertyTypes","SomeProperty","valueTypes","emailValueType","fieldType","constraints","options","arrayValueType","valueConstraint","uniqueValues"],"sources":["TodoWireOntology.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 { WireOntologyDefinition } from \"../../WireOntologyDefinition.js\";\n\nexport const TodoWireOntology: WireOntologyDefinition = {\n ontology: {\n rid: \"ridHere\",\n apiName: \"OntologyApiName\",\n displayName: \"\",\n description: \"\",\n },\n actionTypes: {\n \"markTodoCompleted\": {\n apiName: \"markTodoCompleted\",\n description: \"An action which takes different types of parameters\",\n parameters: {\n object: {\n displayName: \"markTodoCompleted\",\n description: \"A Todo to mark completed\",\n dataType: {\n type: \"object\",\n objectApiName: \"Todo\",\n objectTypeApiName: \"Todo\",\n },\n required: false,\n typeClasses: [],\n },\n },\n rid: \"ri.ontology.main.action-type.9f84017d-cf17-4fa8-84c3-8e01e5d594f2\",\n operations: [{\n type: \"modifyObject\",\n objectTypeApiName: \"Todo\",\n }],\n status: \"ACTIVE\",\n },\n \"deleteTodos\": {\n apiName: \"deleteTodos\",\n description: \"An action which takes in an array of objects\",\n parameters: {\n object: {\n displayName: \"deleteTodos\",\n description: \"Todo(s) to be deleted\",\n \"dataType\": {\n \"type\": \"array\",\n\n \"subType\": {\n \"type\": \"object\",\n \"objectApiName\": \"Todo\",\n \"objectTypeApiName\": \"Todo\",\n },\n },\n required: false,\n typeClasses: [],\n },\n },\n rid: \"ri.ontology.main.action-type.8f94017d-cf17-4fa8-84c3-8e01e5d594f2\",\n operations: [{\n type: \"deleteObject\",\n objectTypeApiName: \"Todo\",\n }],\n status: \"ACTIVE\",\n },\n },\n objectTypes: {\n Todo: {\n objectType: {\n apiName: \"Todo\",\n primaryKey: \"id\",\n displayName: \"AwesomeTodoDisplayname\",\n pluralDisplayName: \"AwesomeTodoDisplayNames\",\n icon: { type: \"blueprint\", name: \"document\", color: \"blue\" },\n description: \"Its a todo item.\",\n titleProperty: \"body\",\n properties: {\n id: {\n dataType: {\n type: \"integer\",\n },\n rid: \"rid\",\n valueTypeApiName: \"numericValueType\",\n typeClasses: [],\n },\n body: {\n dataType: {\n type: \"string\",\n },\n description: \"The text of the todo\",\n displayName: \"Body\",\n rid: \"rid\",\n typeClasses: [],\n },\n complete: {\n dataType: {\n type: \"boolean\",\n },\n rid: \"rid\",\n typeClasses: [],\n },\n array: {\n dataType: {\n type: \"array\",\n subType: {\n type: \"string\",\n },\n reducers: [],\n },\n valueTypeApiName: \"arrayValueType\",\n rid: \"rid\",\n typeClasses: [],\n },\n },\n status: \"ACTIVE\",\n rid: \"ridForTodo\",\n },\n linkTypes: [{\n apiName: \"Assignee\",\n cardinality: \"ONE\",\n displayName: \"Assignee\",\n objectTypeApiName: \"Person\",\n status: \"ACTIVE\",\n foreignKeyPropertyApiName: \"email\",\n linkTypeRid: \"\",\n }],\n implementsInterfaces: [\"SomeInterface\"],\n implementsInterfaces2: {\n \"SomeInterface\": {\n properties: {\n \"SomeProperty\": \"body\",\n },\n propertiesV2: {},\n links: {},\n },\n },\n sharedPropertyTypeMapping: {},\n },\n Person: {\n objectType: {\n apiName: \"Person\",\n primaryKey: \"email\",\n displayName: \"Person\",\n pluralDisplayName: \"Persons\",\n icon: { type: \"blueprint\", name: \"document\", color: \"blue\" },\n description: \"A person\",\n titleProperty: \"email\",\n properties: {\n email: {\n dataType: {\n type: \"string\",\n },\n rid: \"rid\",\n valueTypeApiName: \"emailValueType\",\n typeClasses: [],\n },\n },\n\n rid: \"ridForPerson\",\n status: \"ACTIVE\",\n },\n linkTypes: [{\n apiName: \"Todos\",\n cardinality: \"MANY\",\n displayName: \"Todos\",\n objectTypeApiName: \"Todo\",\n status: \"ACTIVE\",\n foreignKeyPropertyApiName: \"id\",\n linkTypeRid: \"\",\n }],\n implementsInterfaces: [],\n implementsInterfaces2: {},\n sharedPropertyTypeMapping: {},\n },\n },\n queryTypes: {\n \"getCount\": {\n apiName: \"getCount\",\n output: {\n type: \"integer\",\n },\n parameters: {\n completed: { dataType: { type: \"boolean\" } },\n },\n rid: \"rid.query.1\",\n version: \"1.1.0\",\n },\n \"returnsTodo\": {\n apiName: \"returnsTodo\",\n output: {\n type: \"object\",\n objectApiName: \"Todo\",\n objectTypeApiName: \"Todo\",\n },\n parameters: {\n someTodo: {\n description: \"Random desc so we test jsdoc\",\n dataType: {\n type: \"object\",\n objectApiName: \"Todo\",\n objectTypeApiName: \"Todo\",\n },\n },\n },\n rid: \"rid.query.2\",\n version: \"3.2.0\",\n },\n },\n interfaceTypes: {\n SomeInterface: {\n apiName: \"SomeInterface\",\n description: \"Some interface\",\n properties: {\n \"SomeProperty\": {\n apiName: \"SomeProperty\",\n description: \"Some property\",\n displayName: \"Sum Property\",\n dataType: {\n type: \"string\",\n },\n rid: \"idk2\",\n required: false,\n typeClasses: [],\n },\n },\n propertiesV2: {},\n rid: \"idk\",\n displayName: \"Sum Interface\",\n extendsInterfaces: [],\n links: {},\n implementedByObjectTypes: [],\n allProperties: {\n \"SomeProperty\": {\n apiName: \"SomeProperty\",\n description: \"Some property\",\n displayName: \"Sum Property\",\n dataType: {\n type: \"string\",\n },\n rid: \"idk2\",\n required: false,\n typeClasses: [],\n },\n },\n allPropertiesV2: {},\n allExtendsInterfaces: [],\n allLinks: {},\n },\n },\n sharedPropertyTypes: {\n SomeProperty: {\n apiName: \"SomeProperty\",\n description: \"Some property\",\n displayName: \"Sum Property\",\n dataType: {\n type: \"string\",\n },\n rid: \"idk2\",\n typeClasses: [],\n },\n },\n valueTypes: {\n emailValueType: {\n apiName: \"emailValueType\",\n description: \"A value type for email addresses\",\n displayName: \"Email Value Type\",\n rid: \"ridForEmailValueType\",\n version: \"1.0.0\",\n fieldType: {\n type: \"string\",\n },\n constraints: [{\n type: \"enum\",\n options: [\"osdk@palantir.com\", \"foundry@palantir.com\"],\n }],\n },\n arrayValueType: {\n apiName: \"arrayValueType\",\n description: \"A value type for arrays of strings\",\n displayName: \"Array Value Type\",\n rid: \"ridForArrayValueType\",\n version: \"1.0.0\",\n fieldType: {\n type: \"array\",\n subType: {\n type: \"string\",\n },\n },\n constraints: [{\n type: \"array\",\n valueConstraint: { type: \"enum\", options: [\"a\", \"b\", \"c\"] },\n uniqueValues: false,\n }],\n },\n },\n} as const satisfies WireOntologyDefinition;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,OAAO,MAAMA,gBAAwC,GAAG;EACtDC,QAAQ,EAAE;IACRC,GAAG,EAAE,SAAS;IACdC,OAAO,EAAE,iBAAiB;IAC1BC,WAAW,EAAE,EAAE;IACfC,WAAW,EAAE;EACf,CAAC;EACDC,WAAW,EAAE;IACX,mBAAmB,EAAE;MACnBH,OAAO,EAAE,mBAAmB;MAC5BE,WAAW,EAAE,qDAAqD;MAClEE,UAAU,EAAE;QACVC,MAAM,EAAE;UACNJ,WAAW,EAAE,mBAAmB;UAChCC,WAAW,EAAE,0BAA0B;UACvCI,QAAQ,EAAE;YACRC,IAAI,EAAE,QAAQ;YACdC,aAAa,EAAE,MAAM;YACrBC,iBAAiB,EAAE;UACrB,CAAC;UACDC,QAAQ,EAAE,KAAK;UACfC,WAAW,EAAE;QACf;MACF,CAAC;MACDZ,GAAG,EAAE,mEAAmE;MACxEa,UAAU,EAAE,CAAC;QACXL,IAAI,EAAE,cAAc;QACpBE,iBAAiB,EAAE;MACrB,CAAC,CAAC;MACFI,MAAM,EAAE;IACV,CAAC;IACD,aAAa,EAAE;MACbb,OAAO,EAAE,aAAa;MACtBE,WAAW,EAAE,8CAA8C;MAC3DE,UAAU,EAAE;QACVC,M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cAAc,EAAE;MACd9D,OAAO,EAAE,gBAAgB;MACzBE,WAAW,EAAE,oCAAoC;MACjDD,WAAW,EAAE,kBAAkB;MAC/BF,GAAG,EAAE,sBAAsB;MAC3B8C,OAAO,EAAE,OAAO;MAChBc,SAAS,EAAE;QACTpD,IAAI,EAAE,OAAO;QACbsB,OAAO,EAAE;UACPtB,IAAI,EAAE;QACR;MACF,CAAC;MACDqD,WAAW,EAAE,CAAC;QACZrD,IAAI,EAAE,OAAO;QACbwD,eAAe,EAAE;UAAExD,IAAI,EAAE,MAAM;UAAEsD,OAAO,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG;QAAE,CAAC;QAC3DG,YAAY,EAAE;MAChB,CAAC;IACH;EACF;AACF,CAA2C","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,
|
|
@@ -175,6 +175,13 @@ export function getQueryParamType(enhancedOntology, input, type, isMapKey = fals
|
|
|
175
175
|
case "timestamp":
|
|
176
176
|
paramType = `Query${type}.PrimitiveType<${JSON.stringify(input.type)}>`;
|
|
177
177
|
break;
|
|
178
|
+
case "mediaReference":
|
|
179
|
+
if (type === "Param") {
|
|
180
|
+
paramType = `Query${type}.PrimitiveType<${JSON.stringify(input.type)}>`;
|
|
181
|
+
} else {
|
|
182
|
+
paramType = `Query${type}.MediaType`;
|
|
183
|
+
}
|
|
184
|
+
break;
|
|
178
185
|
case "struct":
|
|
179
186
|
paramType = `{
|
|
180
187
|
${stringify(input.struct, {
|
|
@@ -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;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,KAAK,CAACR,MAAM,EAAE;IAAES,SAAS,EAAE;EAAK,CAAC,CAAC;EAC3C,MAAMC,OAAO,CAACC,GAAG,CACfC,MAAM,CAACC,MAAM,CAACX,QAAQ,CAACY,UAAU,CAAC,CAACC,GAAG,CAAC,MAAMC,KAAK,IAAI;IACpD,MAAMC,mBAAmB,CACvBlB,EAAE,EACFC,MAAM,EACNM,SAAS,EACTU,KAAK,EACLZ,SAAS,EACTF,QAAQ,EACRG,cAAc,EACdF,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AEF,KAAK,oBAAoB;MACvBM,SAAS,GAAG,QAAQjB,IAAI,kBACtBc,gBAAgB,CAAClC,oBAAoB,CAACmC,KAAK,CAACc,SAAS,CAAC,CACnDlB,+BAA+B,CAAC,IAAI,CAAC,GACvC;MACH;IAEF,KAAK,KAAK;MACRM,SAAS,GAAG,GAAGjB,IAAI,KAAK,OAAO,GAAG,UAAU,GAAG,EAAE,OAC/CD,iBAAiB,CAACe,gBAAgB,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 \"mediaReference\":\n if (type === \"Param\") {\n paramType = `Query${type}.PrimitiveType<${JSON.stringify(input.type)}>`;\n } else {\n paramType = `Query${type}.MediaType`;\n }\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,SAAS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AAI,KAAK,OAAO,GAAG,UAAU,GAAG,EAAE,OAC/CD,iBAAiB,CAACe,gBAAgB,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":[]}
|
|
@@ -16,8 +16,11 @@
|
|
|
16
16
|
|
|
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@osdk/generator",
|
|
3
|
-
"version": "2.8.0-beta.
|
|
3
|
+
"version": "2.8.0-beta.21",
|
|
4
4
|
"description": "",
|
|
5
5
|
"access": "public",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -29,14 +29,14 @@
|
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@osdk/foundry.ontologies": "2.
|
|
32
|
+
"@osdk/foundry.ontologies": "2.50.0",
|
|
33
33
|
"consola": "^3.4.2",
|
|
34
34
|
"fast-deep-equal": "^3.1.3",
|
|
35
35
|
"fetch-retry": "^6.0.0",
|
|
36
36
|
"prettier": "^3.6.2",
|
|
37
37
|
"tiny-invariant": "^1.3.3",
|
|
38
|
-
"@osdk/api": "~2.8.0-beta.
|
|
39
|
-
"@osdk/generator-converters": "~2.8.0-beta.
|
|
38
|
+
"@osdk/api": "~2.8.0-beta.21",
|
|
39
|
+
"@osdk/generator-converters": "~2.8.0-beta.21"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@types/node": "^18.19.124",
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2024 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
import { describe, expect, test } from "vitest";
|
|
18
|
-
import { getPackageJsonContents } from "./generateClientSdkPackage.js";
|
|
19
|
-
describe("generateClientSdkPackage", () => {
|
|
20
|
-
describe(getPackageJsonContents, () => {
|
|
21
|
-
const versions = {
|
|
22
|
-
osdkApiVersion: "^99.9.9",
|
|
23
|
-
osdkClientVersion: "^88.8.8",
|
|
24
|
-
osdkClientApiVersion: "^66.6.6",
|
|
25
|
-
areTheTypesWrongVersion: "^0.15.2",
|
|
26
|
-
tslibVersion: "^2.6.2",
|
|
27
|
-
typescriptVersion: "~5.5.4"
|
|
28
|
-
};
|
|
29
|
-
describe("v2", () => {
|
|
30
|
-
test("returns the package.json contents", async () => {
|
|
31
|
-
expect(getPackageJsonContents("foo", "1.2.3", versions)).toMatchInlineSnapshot(`
|
|
32
|
-
{
|
|
33
|
-
"devDependencies": {
|
|
34
|
-
"@arethetypeswrong/cli": "^0.15.2",
|
|
35
|
-
"@osdk/api": "^99.9.9",
|
|
36
|
-
"tslib": "^2.6.2",
|
|
37
|
-
"typescript": "~5.5.4",
|
|
38
|
-
},
|
|
39
|
-
"exports": {
|
|
40
|
-
".": {
|
|
41
|
-
"import": "./dist/module/index.js",
|
|
42
|
-
"require": "./dist/commonjs/index.js",
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
"files": [
|
|
46
|
-
"**/*.js",
|
|
47
|
-
"**/*.d.ts",
|
|
48
|
-
"dist/**/package.json",
|
|
49
|
-
],
|
|
50
|
-
"main": "./dist/commonjs/index.js",
|
|
51
|
-
"module": "./dist/module/index.js",
|
|
52
|
-
"name": "foo",
|
|
53
|
-
"peerDependencies": {
|
|
54
|
-
"@osdk/api": "^99.9.9",
|
|
55
|
-
"@osdk/client": "^88.8.8",
|
|
56
|
-
},
|
|
57
|
-
"scripts": {
|
|
58
|
-
"check": "npm exec attw $(npm pack)",
|
|
59
|
-
"prepack": "tsc -p ./dist/module/tsconfig.json && tsc -p ./dist/commonjs/tsconfig.json",
|
|
60
|
-
},
|
|
61
|
-
"version": "1.2.3",
|
|
62
|
-
}
|
|
63
|
-
`);
|
|
64
|
-
});
|
|
65
|
-
});
|
|
66
|
-
});
|
|
67
|
-
});
|
|
68
|
-
//# sourceMappingURL=generateClientSdkPackage.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generateClientSdkPackage.test.js","names":["describe","expect","test","getPackageJsonContents","versions","osdkApiVersion","osdkClientVersion","osdkClientApiVersion","areTheTypesWrongVersion","tslibVersion","typescriptVersion","toMatchInlineSnapshot"],"sources":["generateClientSdkPackage.test.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { describe, expect, test } from \"vitest\";\nimport { getPackageJsonContents } from \"./generateClientSdkPackage.js\";\n\ndescribe(\"generateClientSdkPackage\", () => {\n describe(getPackageJsonContents, () => {\n const versions = {\n osdkApiVersion: \"^99.9.9\",\n osdkClientVersion: \"^88.8.8\",\n osdkClientApiVersion: \"^66.6.6\",\n areTheTypesWrongVersion: \"^0.15.2\",\n tslibVersion: \"^2.6.2\",\n typescriptVersion: \"~5.5.4\",\n } as const;\n\n describe(\"v2\", () => {\n test(\"returns the package.json contents\", async () => {\n expect(getPackageJsonContents(\"foo\", \"1.2.3\", versions))\n .toMatchInlineSnapshot(`\n {\n \"devDependencies\": {\n \"@arethetypeswrong/cli\": \"^0.15.2\",\n \"@osdk/api\": \"^99.9.9\",\n \"tslib\": \"^2.6.2\",\n \"typescript\": \"~5.5.4\",\n },\n \"exports\": {\n \".\": {\n \"import\": \"./dist/module/index.js\",\n \"require\": \"./dist/commonjs/index.js\",\n },\n },\n \"files\": [\n \"**/*.js\",\n \"**/*.d.ts\",\n \"dist/**/package.json\",\n ],\n \"main\": \"./dist/commonjs/index.js\",\n \"module\": \"./dist/module/index.js\",\n \"name\": \"foo\",\n \"peerDependencies\": {\n \"@osdk/api\": \"^99.9.9\",\n \"@osdk/client\": \"^88.8.8\",\n },\n \"scripts\": {\n \"check\": \"npm exec attw $(npm pack)\",\n \"prepack\": \"tsc -p ./dist/module/tsconfig.json && tsc -p ./dist/commonjs/tsconfig.json\",\n },\n \"version\": \"1.2.3\",\n }\n `);\n });\n });\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,QAAQ,EAAEC,MAAM,EAAEC,IAAI,QAAQ,QAAQ;AAC/C,SAASC,sBAAsB,QAAQ,+BAA+B;AAEtEH,QAAQ,CAAC,0BAA0B,EAAE,MAAM;EACzCA,QAAQ,CAACG,sBAAsB,EAAE,MAAM;IACrC,MAAMC,QAAQ,GAAG;MACfC,cAAc,EAAE,SAAS;MACzBC,iBAAiB,EAAE,SAAS;MAC5BC,oBAAoB,EAAE,SAAS;MAC/BC,uBAAuB,EAAE,SAAS;MAClCC,YAAY,EAAE,QAAQ;MACtBC,iBAAiB,EAAE;IACrB,CAAU;IAEVV,QAAQ,CAAC,IAAI,EAAE,MAAM;MACnBE,IAAI,CAAC,mCAAmC,EAAE,YAAY;QACpDD,MAAM,CAACE,sBAAsB,CAAC,KAAK,EAAE,OAAO,EAAEC,QAAQ,CAAC,CAAC,CACrDO,qBAAqB,CAAC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,CAAC;MACN,CAAC,CAAC;IACJ,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2024 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
import { describe, expect, it } from "vitest";
|
|
18
|
-
import { startsWithApiNamespace } from "./startsWithApiNamespace.js";
|
|
19
|
-
describe(startsWithApiNamespace, () => {
|
|
20
|
-
describe("a name with periods", () => {
|
|
21
|
-
const partialNamespace = "a.b";
|
|
22
|
-
const fullNamespace = `${partialNamespace}.c`;
|
|
23
|
-
const fullApiName = `${fullNamespace}.${"Foo"}`;
|
|
24
|
-
it("returns false if only partial namespace is provided", () => {
|
|
25
|
-
expect(startsWithApiNamespace(fullApiName, partialNamespace)).toBe(false);
|
|
26
|
-
});
|
|
27
|
-
it("returns true if full namespace is provided", () => {
|
|
28
|
-
expect(startsWithApiNamespace(fullApiName, fullNamespace)).toBe(true);
|
|
29
|
-
});
|
|
30
|
-
it("returns false if a wrong namespace is provided", () => {
|
|
31
|
-
expect(startsWithApiNamespace(fullApiName, "incorrect.namespace")).toBe(false);
|
|
32
|
-
});
|
|
33
|
-
it("return false if no namespace is provided", () => {
|
|
34
|
-
expect(startsWithApiNamespace(fullApiName, undefined)).toBe(false);
|
|
35
|
-
});
|
|
36
|
-
});
|
|
37
|
-
describe("a name without periods", () => {
|
|
38
|
-
const apiNameOnly = "Foo";
|
|
39
|
-
it("returns false if any namespace is provided", () => {
|
|
40
|
-
expect(startsWithApiNamespace(apiNameOnly, "incorrect.namespace")).toBe(false);
|
|
41
|
-
});
|
|
42
|
-
it("returns true if no namespace is provided", () => {
|
|
43
|
-
expect(startsWithApiNamespace(apiNameOnly, undefined)).toBe(true);
|
|
44
|
-
});
|
|
45
|
-
});
|
|
46
|
-
});
|
|
47
|
-
//# sourceMappingURL=startsWithApiNamespace.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"startsWithApiNamespace.test.js","names":["describe","expect","it","startsWithApiNamespace","partialNamespace","fullNamespace","fullApiName","toBe","undefined","apiNameOnly"],"sources":["startsWithApiNamespace.test.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { describe, expect, it } from \"vitest\";\nimport { startsWithApiNamespace } from \"./startsWithApiNamespace.js\";\n\ndescribe(startsWithApiNamespace, () => {\n describe(\"a name with periods\", () => {\n const wrongNamespace = \"incorrect.namespace\";\n const partialNamespace = \"a.b\";\n const fullNamespace = `${partialNamespace}.c`;\n const apiNameOnly = \"Foo\";\n const fullApiName = `${fullNamespace}.${apiNameOnly}`;\n\n it(\"returns false if only partial namespace is provided\", () => {\n expect(startsWithApiNamespace(fullApiName, partialNamespace)).toBe(\n false,\n );\n });\n\n it(\"returns true if full namespace is provided\", () => {\n expect(startsWithApiNamespace(fullApiName, fullNamespace)).toBe(true);\n });\n\n it(\"returns false if a wrong namespace is provided\", () => {\n expect(startsWithApiNamespace(fullApiName, wrongNamespace)).toBe(false);\n });\n\n it(\"return false if no namespace is provided\", () => {\n expect(startsWithApiNamespace(fullApiName, undefined)).toBe(false);\n });\n });\n\n describe(\"a name without periods\", () => {\n const wrongNamespace = \"incorrect.namespace\";\n const apiNameOnly = \"Foo\";\n\n it(\"returns false if any namespace is provided\", () => {\n expect(startsWithApiNamespace(apiNameOnly, wrongNamespace)).toBe(\n false,\n );\n });\n\n it(\"returns true if no namespace is provided\", () => {\n expect(startsWithApiNamespace(apiNameOnly, undefined)).toBe(true);\n });\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AAC7C,SAASC,sBAAsB,QAAQ,6BAA6B;AAEpEH,QAAQ,CAACG,sBAAsB,EAAE,MAAM;EACrCH,QAAQ,CAAC,qBAAqB,EAAE,MAAM;IAEpC,MAAMI,gBAAgB,GAAG,KAAK;IAC9B,MAAMC,aAAa,GAAG,GAAGD,gBAAgB,IAAI;IAE7C,MAAME,WAAW,GAAG,GAAGD,aAAa,IADhB,KAAK,EAC4B;IAErDH,EAAE,CAAC,qDAAqD,EAAE,MAAM;MAC9DD,MAAM,CAACE,sBAAsB,CAACG,WAAW,EAAEF,gBAAgB,CAAC,CAAC,CAACG,IAAI,CAChE,KACF,CAAC;IACH,CAAC,CAAC;IAEFL,EAAE,CAAC,4CAA4C,EAAE,MAAM;MACrDD,MAAM,CAACE,sBAAsB,CAACG,WAAW,EAAED,aAAa,CAAC,CAAC,CAACE,IAAI,CAAC,IAAI,CAAC;IACvE,CAAC,CAAC;IAEFL,EAAE,CAAC,gDAAgD,EAAE,MAAM;MACzDD,MAAM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