@osdk/maker 0.14.0-beta.7 → 0.14.0-beta.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/build/browser/api/code-snippets/createCodeSnippets.js +91 -0
  3. package/build/browser/api/code-snippets/createCodeSnippets.js.map +1 -0
  4. package/build/browser/api/code-snippets/snippetTypes.js +60 -0
  5. package/build/browser/api/code-snippets/snippetTypes.js.map +1 -0
  6. package/build/browser/api/defineDeleteInterfaceObjectAction.js +2 -2
  7. package/build/browser/api/defineDeleteInterfaceObjectAction.js.map +1 -1
  8. package/build/browser/api/defineOntology.js +5 -1
  9. package/build/browser/api/defineOntology.js.map +1 -1
  10. package/build/browser/api/test/actions.test.js +9 -9
  11. package/build/browser/api/test/actions.test.js.map +1 -1
  12. package/build/browser/cli/main.js +23 -4
  13. package/build/browser/cli/main.js.map +1 -1
  14. package/build/cjs/index.cjs +1300 -40
  15. package/build/cjs/index.cjs.map +1 -1
  16. package/build/cjs/index.d.cts +1 -1
  17. package/build/esm/api/code-snippets/createCodeSnippets.js +91 -0
  18. package/build/esm/api/code-snippets/createCodeSnippets.js.map +1 -0
  19. package/build/esm/api/code-snippets/snippetTypes.js +60 -0
  20. package/build/esm/api/code-snippets/snippetTypes.js.map +1 -0
  21. package/build/esm/api/defineDeleteInterfaceObjectAction.js +2 -2
  22. package/build/esm/api/defineDeleteInterfaceObjectAction.js.map +1 -1
  23. package/build/esm/api/defineOntology.js +5 -1
  24. package/build/esm/api/defineOntology.js.map +1 -1
  25. package/build/esm/api/test/actions.test.js +9 -9
  26. package/build/esm/api/test/actions.test.js.map +1 -1
  27. package/build/esm/cli/main.js +23 -4
  28. package/build/esm/cli/main.js.map +1 -1
  29. package/build/types/api/code-snippets/createCodeSnippets.d.ts +2 -0
  30. package/build/types/api/code-snippets/createCodeSnippets.d.ts.map +1 -0
  31. package/build/types/api/code-snippets/snippetTypes.d.ts +23 -0
  32. package/build/types/api/code-snippets/snippetTypes.d.ts.map +1 -0
  33. package/build/types/api/defineOntology.d.ts +1 -1
  34. package/build/types/api/defineOntology.d.ts.map +1 -1
  35. package/package.json +4 -3
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @osdk/maker
2
2
 
3
+ ## 0.14.0-beta.9
4
+
5
+ ### Minor Changes
6
+
7
+ - 55e104e: Add code snippet generation into osdk/maker
8
+ - 949646b: Fix delete interface bug
9
+
10
+ ### Patch Changes
11
+
12
+ - Updated dependencies [2556c64]
13
+ - @osdk/api@2.6.0-beta.5
14
+
15
+ ## 0.14.0-beta.8
16
+
17
+ ### Minor Changes
18
+
19
+ - 296b34d: Add support for interface deletes
20
+
3
21
  ## 0.14.0-beta.7
4
22
 
5
23
  ### Minor Changes
@@ -0,0 +1,91 @@
1
+ /*
2
+ * Copyright 2025 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 { TYPESCRIPT_OSDK_SNIPPETS } from "@osdk/typescript-sdk-docs";
18
+ import { consola } from "consola";
19
+ import * as fs from "fs";
20
+ import Mustache from "mustache";
21
+ import * as path from "path";
22
+ import { OntologyEntityTypeEnum } from "../common/OntologyEntityTypeEnum.js";
23
+ import { actionSnippets, interfaceSnippets, objectSnippets } from "./snippetTypes.js";
24
+ export function createCodeSnippets(ontology, packageName, outputDir) {
25
+ if (outputDir === undefined) {
26
+ outputDir = "./code-snippets";
27
+ }
28
+ if (!fs.existsSync(outputDir)) {
29
+ fs.mkdirSync(outputDir, {
30
+ recursive: true
31
+ });
32
+ }
33
+ if (packageName === undefined) {
34
+ packageName = "";
35
+ }
36
+ consola.info("Generating code snippets to ", outputDir);
37
+ for (const type of Object.values(OntologyEntityTypeEnum)) {
38
+ for (const object of Object.values(ontology[type])) {
39
+ let snippet = {};
40
+ switch (type) {
41
+ case OntologyEntityTypeEnum.OBJECT_TYPE:
42
+ snippet = generateObjectSnippet(object, packageName);
43
+ break;
44
+ case OntologyEntityTypeEnum.ACTION_TYPE:
45
+ snippet = generateActionSnippet(object, packageName);
46
+ break;
47
+ case OntologyEntityTypeEnum.INTERFACE_TYPE:
48
+ snippet = generateInterfaceSnippet(object, packageName);
49
+ break;
50
+ default:
51
+ continue;
52
+ }
53
+ fs.writeFileSync(path.join(outputDir, object.apiName), JSON.stringify(snippet));
54
+ }
55
+ }
56
+ consola.info("Finished Code Snippet Generation");
57
+ }
58
+ function generateInterfaceSnippet(interfaceType, packageName) {
59
+ const interfaceContext = {
60
+ "interfaceApiName": interfaceType.apiName,
61
+ "packageName": packageName,
62
+ "objectOrInterfaceApiName": interfaceType.apiName,
63
+ "propertyNames": Object.keys(interfaceType.propertiesV2)
64
+ };
65
+ return getSnippets(interfaceSnippets, interfaceContext);
66
+ }
67
+ function generateObjectSnippet(objectType, packageName) {
68
+ const objectContext = {
69
+ "objectType": objectType.apiName,
70
+ "packageName": packageName,
71
+ "objectOrInterfaceApiName": objectType.apiName
72
+ };
73
+ return getSnippets(objectSnippets, objectContext);
74
+ }
75
+ function generateActionSnippet(actionType, packageName) {
76
+ const actionContext = {
77
+ "actionApiName": actionType.apiName,
78
+ "packageName": packageName
79
+ };
80
+ return getSnippets(actionSnippets, actionContext);
81
+ }
82
+ function getSnippets(snippetType, context) {
83
+ const allSnippets = {};
84
+ for (const templateName of Object.keys(snippetType).filter(key => isNaN(Number(key)))) {
85
+ const latestTemplate = Object.values(TYPESCRIPT_OSDK_SNIPPETS.versions).find(v => v.snippets[templateName])?.snippets[templateName][0].template ?? "";
86
+ const renderedTemplate = Mustache.render(latestTemplate, context);
87
+ allSnippets[templateName] = renderedTemplate;
88
+ }
89
+ return allSnippets;
90
+ }
91
+ //# sourceMappingURL=createCodeSnippets.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createCodeSnippets.js","names":["TYPESCRIPT_OSDK_SNIPPETS","consola","fs","Mustache","path","OntologyEntityTypeEnum","actionSnippets","interfaceSnippets","objectSnippets","createCodeSnippets","ontology","packageName","outputDir","undefined","existsSync","mkdirSync","recursive","info","type","Object","values","object","snippet","OBJECT_TYPE","generateObjectSnippet","ACTION_TYPE","generateActionSnippet","INTERFACE_TYPE","generateInterfaceSnippet","writeFileSync","join","apiName","JSON","stringify","interfaceType","interfaceContext","keys","propertiesV2","getSnippets","objectType","objectContext","actionType","actionContext","snippetType","context","allSnippets","templateName","filter","key","isNaN","Number","latestTemplate","versions","find","v","snippets","template","renderedTemplate","render"],"sources":["createCodeSnippets.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 { TYPESCRIPT_OSDK_SNIPPETS } from \"@osdk/typescript-sdk-docs\";\nimport { consola } from \"consola\";\nimport * as fs from \"fs\";\nimport Mustache from \"mustache\";\nimport * as path from \"path\";\nimport type { ActionType } from \"../action/ActionType.js\";\nimport type { OntologyDefinition } from \"../common/OntologyDefinition.js\";\nimport { OntologyEntityTypeEnum } from \"../common/OntologyEntityTypeEnum.js\";\nimport type { InterfaceType } from \"../interface/InterfaceType.js\";\nimport type { ObjectType } from \"../object/ObjectType.js\";\nimport {\n actionSnippets,\n interfaceSnippets,\n objectSnippets,\n} from \"./snippetTypes.js\";\n\nexport function createCodeSnippets(\n ontology: OntologyDefinition,\n packageName: string | undefined,\n outputDir: string | undefined,\n): void {\n if (outputDir === undefined) {\n outputDir = \"./code-snippets\";\n }\n if (!fs.existsSync(outputDir)) {\n fs.mkdirSync(outputDir, { recursive: true });\n }\n if (packageName === undefined) {\n packageName = \"\";\n }\n consola.info(\"Generating code snippets to \", outputDir);\n for (const type of Object.values(OntologyEntityTypeEnum)) {\n for (const object of Object.values(ontology[type])) {\n let snippet = {};\n switch (type) {\n case OntologyEntityTypeEnum.OBJECT_TYPE:\n snippet = generateObjectSnippet(object, packageName);\n break;\n case OntologyEntityTypeEnum.ACTION_TYPE:\n snippet = generateActionSnippet(object, packageName);\n break;\n case OntologyEntityTypeEnum.INTERFACE_TYPE:\n snippet = generateInterfaceSnippet(object, packageName);\n break;\n default:\n continue;\n }\n fs.writeFileSync(\n path.join(outputDir, object.apiName),\n JSON.stringify(snippet),\n );\n }\n }\n consola.info(\"Finished Code Snippet Generation\");\n}\n\nfunction generateInterfaceSnippet(\n interfaceType: InterfaceType,\n packageName: string,\n) {\n const interfaceContext = {\n \"interfaceApiName\": interfaceType.apiName,\n \"packageName\": packageName,\n \"objectOrInterfaceApiName\": interfaceType.apiName,\n \"propertyNames\": Object.keys(interfaceType.propertiesV2),\n };\n\n return getSnippets(interfaceSnippets, interfaceContext);\n}\n\nfunction generateObjectSnippet(objectType: ObjectType, packageName: string) {\n const objectContext = {\n \"objectType\": objectType.apiName,\n \"packageName\": packageName,\n \"objectOrInterfaceApiName\": objectType.apiName,\n };\n return getSnippets(objectSnippets, objectContext);\n}\n\nfunction generateActionSnippet(actionType: ActionType, packageName: string) {\n const actionContext = {\n \"actionApiName\": actionType.apiName,\n \"packageName\": packageName,\n };\n return getSnippets(actionSnippets, actionContext);\n}\n\nfunction getSnippets(\n snippetType:\n | typeof interfaceSnippets\n | typeof actionSnippets\n | typeof objectSnippets,\n context: {},\n) {\n const allSnippets = {};\n for (\n const templateName of Object.keys(snippetType).filter(key =>\n isNaN(Number(key))\n )\n ) {\n const latestTemplate =\n Object.values(TYPESCRIPT_OSDK_SNIPPETS.versions).find(v =>\n v.snippets[templateName]\n )?.snippets[templateName][0].template ?? \"\";\n const renderedTemplate = Mustache.render(latestTemplate, context);\n (allSnippets as any)[templateName] = renderedTemplate;\n }\n return allSnippets;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,wBAAwB,QAAQ,2BAA2B;AACpE,SAASC,OAAO,QAAQ,SAAS;AACjC,OAAO,KAAKC,EAAE,MAAM,IAAI;AACxB,OAAOC,QAAQ,MAAM,UAAU;AAC/B,OAAO,KAAKC,IAAI,MAAM,MAAM;AAG5B,SAASC,sBAAsB,QAAQ,qCAAqC;AAG5E,SACEC,cAAc,EACdC,iBAAiB,EACjBC,cAAc,QACT,mBAAmB;AAE1B,OAAO,SAASC,kBAAkBA,CAChCC,QAA4B,EAC5BC,WAA+B,EAC/BC,SAA6B,EACvB;EACN,IAAIA,SAAS,KAAKC,SAAS,EAAE;IAC3BD,SAAS,GAAG,iBAAiB;EAC/B;EACA,IAAI,CAACV,EAAE,CAACY,UAAU,CAACF,SAAS,CAAC,EAAE;IAC7BV,EAAE,CAACa,SAAS,CAACH,SAAS,EAAE;MAAEI,SAAS,EAAE;IAAK,CAAC,CAAC;EAC9C;EACA,IAAIL,WAAW,KAAKE,SAAS,EAAE;IAC7BF,WAAW,GAAG,EAAE;EAClB;EACAV,OAAO,CAACgB,IAAI,CAAC,8BAA8B,EAAEL,SAAS,CAAC;EACvD,KAAK,MAAMM,IAAI,IAAIC,MAAM,CAACC,MAAM,CAACf,sBAAsB,CAAC,EAAE;IACxD,KAAK,MAAMgB,MAAM,IAAIF,MAAM,CAACC,MAAM,CAACV,QAAQ,CAACQ,IAAI,CAAC,CAAC,EA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1E,MAAM+B,aAAa,GAAG;IACpB,eAAe,EAAED,UAAU,CAACV,OAAO;IACnC,aAAa,EAAEpB;EACjB,CAAC;EACD,OAAO2B,WAAW,CAAChC,cAAc,EAAEoC,aAAa,CAAC;AACnD;AAEA,SAASJ,WAAWA,CAClBK,WAGyB,EACzBC,OAAW,EACX;EACA,MAAMC,WAAW,GAAG,CAAC,CAAC;EACtB,KACE,MAAMC,YAAY,IAAI3B,MAAM,CAACiB,IAAI,CAACO,WAAW,CAAC,CAACI,MAAM,CAACC,GAAG,IACvDC,KAAK,CAACC,MAAM,CAACF,GAAG,CAAC,CACnB,CAAC,EACD;IACA,MAAMG,cAAc,GAClBhC,MAAM,CAACC,MAAM,CAACpB,wBAAwB,CAACoD,QAAQ,CAAC,CAACC,IAAI,CAACC,CAAC,IACrDA,CAAC,CAACC,QAAQ,CAACT,YAAY,CACzB,CAAC,EAAES,QAAQ,CAACT,YAAY,CAAC,CAAC,CAAC,CAAC,CAACU,QAAQ,IAAI,EAAE;IAC7C,MAAMC,gBAAgB,GAAGtD,QAAQ,CAACuD,MAAM,CAACP,cAAc,EAAEP,OAAO,CAAC;IAChEC,WAAW,CAASC,YAAY,CAAC,GAAGW,gBAAgB;EACvD;EACA,OAAOZ,WAAW;AACpB","ignoreList":[]}
@@ -0,0 +1,60 @@
1
+ /*
2
+ * Copyright 2025 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
+ export let interfaceSnippets = /*#__PURE__*/function (interfaceSnippets) {
18
+ interfaceSnippets[interfaceSnippets["loadInterfacesReference"] = 0] = "loadInterfacesReference";
19
+ interfaceSnippets[interfaceSnippets["loadAllInterfacesReference"] = 1] = "loadAllInterfacesReference";
20
+ interfaceSnippets[interfaceSnippets["loadOrderedInterfacesReference"] = 2] = "loadOrderedInterfacesReference";
21
+ interfaceSnippets[interfaceSnippets["searchInterfacesReference"] = 3] = "searchInterfacesReference";
22
+ interfaceSnippets[interfaceSnippets["loadInterfaceMetadataSnippet"] = 4] = "loadInterfaceMetadataSnippet";
23
+ interfaceSnippets[interfaceSnippets["subscribeToObjectSetInstructions"] = 5] = "subscribeToObjectSetInstructions";
24
+ return interfaceSnippets;
25
+ }({});
26
+ export let actionSnippets = /*#__PURE__*/function (actionSnippets) {
27
+ actionSnippets[actionSnippets["applyAction"] = 0] = "applyAction";
28
+ actionSnippets[actionSnippets["batchApplyAction"] = 1] = "batchApplyAction";
29
+ return actionSnippets;
30
+ }({});
31
+ export let objectSnippets = /*#__PURE__*/function (objectSnippets) {
32
+ objectSnippets[objectSnippets["loadSingleObjectGuide"] = 0] = "loadSingleObjectGuide";
33
+ objectSnippets[objectSnippets["loadObjectsReference"] = 1] = "loadObjectsReference";
34
+ objectSnippets[objectSnippets["loadAllObjectsReference"] = 2] = "loadAllObjectsReference";
35
+ objectSnippets[objectSnippets["loadOrderedInterfacesReference"] = 3] = "loadOrderedInterfacesReference";
36
+ // what
37
+ objectSnippets[objectSnippets["searchObjectsGuide"] = 4] = "searchObjectsGuide";
38
+ // There's specific search queries under this one too, but a little verbose
39
+ objectSnippets[objectSnippets["aggregationTemplate"] = 5] = "aggregationTemplate";
40
+ /* Types of aggregation + group bys
41
+ approximateDistinctAggregationTemplate,
42
+ exactDistinctAggregationTemplate,
43
+ numericAggregationTemplate,
44
+ countAggregationTemplate,
45
+ fixedWidthGroupByTemplate,
46
+ durationGroupByTemplate,
47
+ exactGroupByTemplate,
48
+ rangeGroupByTemplate,
49
+ */
50
+ objectSnippets[objectSnippets["objectSetOperationsGuide"] = 6] = "objectSetOperationsGuide";
51
+ /* Types of set operations
52
+ objectSetOperationsUnion,
53
+ objectSetOperationsSubtract,
54
+ objectSetOperationsIntersect,
55
+ */
56
+ objectSnippets[objectSnippets["loadObjectMetadataSnippet"] = 7] = "loadObjectMetadataSnippet";
57
+ objectSnippets[objectSnippets["subscribeToObjectSetInstructions"] = 8] = "subscribeToObjectSetInstructions";
58
+ return objectSnippets;
59
+ }({});
60
+ //# sourceMappingURL=snippetTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"snippetTypes.js","names":["interfaceSnippets","actionSnippets","objectSnippets"],"sources":["snippetTypes.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\nexport enum interfaceSnippets {\n loadInterfacesReference,\n loadAllInterfacesReference,\n loadOrderedInterfacesReference,\n searchInterfacesReference,\n loadInterfaceMetadataSnippet,\n subscribeToObjectSetInstructions,\n}\n\nexport enum actionSnippets {\n applyAction,\n batchApplyAction,\n}\n\nexport enum objectSnippets {\n loadSingleObjectGuide,\n loadObjectsReference,\n loadAllObjectsReference,\n loadOrderedInterfacesReference, // what\n searchObjectsGuide, // There's specific search queries under this one too, but a little verbose\n aggregationTemplate,\n /* Types of aggregation + group bys\n approximateDistinctAggregationTemplate,\n exactDistinctAggregationTemplate,\n numericAggregationTemplate,\n countAggregationTemplate,\n fixedWidthGroupByTemplate,\n durationGroupByTemplate,\n exactGroupByTemplate,\n rangeGroupByTemplate,\n */\n objectSetOperationsGuide,\n /* Types of set operations\n objectSetOperationsUnion,\n objectSetOperationsSubtract,\n objectSetOperationsIntersect,\n */\n loadObjectMetadataSnippet,\n subscribeToObjectSetInstructions,\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,WAAYA,iBAAiB,0BAAjBA,iBAAiB;EAAjBA,iBAAiB,CAAjBA,iBAAiB;EAAjBA,iBAAiB,CAAjBA,iBAAiB;EAAjBA,iBAAiB,CAAjBA,iBAAiB;EAAjBA,iBAAiB,CAAjBA,iBAAiB;EAAjBA,iBAAiB,CAAjBA,iBAAiB;EAAjBA,iBAAiB,CAAjBA,iBAAiB;EAAA,OAAjBA,iBAAiB;AAAA;AAS7B,WAAYC,cAAc,0BAAdA,cAAc;EAAdA,cAAc,CAAdA,cAAc;EAAdA,cAAc,CAAdA,cAAc;EAAA,OAAdA,cAAc;AAAA;AAK1B,WAAYC,cAAc,0BAAdA,cAAc;EAAdA,cAAc,CAAdA,cAAc;EAAdA,cAAc,CAAdA,cAAc;EAAdA,cAAc,CAAdA,cAAc;EAAdA,cAAc,CAAdA,cAAc;EAIQ;EAJtBA,cAAc,CAAdA,cAAc;EAKJ;EALVA,cAAc,CAAdA,cAAc;EAOxB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAhBYA,cAAc,CAAdA,cAAc;EAkBxB;AACF;AACA;AACA;AACA;EAtBYA,cAAc,CAAdA,cAAc;EAAdA,cAAc,CAAdA,cAAc;EAAA,OAAdA,cAAc;AAAA","ignoreList":[]}
@@ -43,8 +43,8 @@ export function defineDeleteInterfaceObjectAction(def) {
43
43
  }
44
44
  }],
45
45
  entities: {
46
- affectedInterfaceTypes: [],
47
- affectedObjectTypes: [def.interfaceType.apiName],
46
+ affectedInterfaceTypes: [def.interfaceType.apiName],
47
+ affectedObjectTypes: [],
48
48
  affectedLinkTypes: [],
49
49
  typeGroups: []
50
50
  }
@@ -1 +1 @@
1
- {"version":3,"file":"defineDeleteInterfaceObjectAction.js","names":["defineAction","kebab","defineDeleteInterfaceObjectAction","def","apiName","interfaceType","split","pop","displayName","displayMetadata","parameters","id","type","interfaceReference","interfaceTypeRid","validation","required","allowedValues","status","rules","deleteObjectRule","objectToDelete","entities","affectedInterfaceTypes","affectedObjectTypes","affectedLinkTypes","typeGroups"],"sources":["defineDeleteInterfaceObjectAction.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 { ActionType } from \"./action/ActionType.js\";\nimport type { InterfaceActionTypeUserDefinition } from \"./defineAction.js\";\nimport { defineAction, kebab } from \"./defineAction.js\";\n\nexport function defineDeleteInterfaceObjectAction(\n def: InterfaceActionTypeUserDefinition,\n): ActionType {\n return defineAction({\n apiName: def.apiName\n ?? `delete-interface-object-${\n kebab(\n def.interfaceType.apiName.split(\".\").pop()\n ?? def.interfaceType.apiName,\n )\n }`,\n displayName: def.displayName\n ?? `Delete ${def.interfaceType.displayMetadata.displayName}`,\n parameters: [\n {\n id: \"objectToDeleteParameter\",\n displayName: \"Delete object\",\n type: {\n type: \"interfaceReference\",\n interfaceReference: { interfaceTypeRid: def.interfaceType.apiName },\n },\n validation: {\n required: true,\n allowedValues: { type: \"interfaceObjectQuery\" },\n },\n },\n ],\n status: def.status ?? \"active\",\n rules: [{\n type: \"deleteObjectRule\",\n deleteObjectRule: {\n objectToDelete: \"objectToDeleteParameter\",\n },\n }],\n entities: {\n affectedInterfaceTypes: [],\n affectedObjectTypes: [def.interfaceType.apiName],\n affectedLinkTypes: [],\n typeGroups: [],\n },\n });\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,SAASA,YAAY,EAAEC,KAAK,QAAQ,mBAAmB;AAEvD,OAAO,SAASC,iCAAiCA,CAC/CC,GAAsC,EAC1B;EACZ,OAAOH,YAAY,CAAC;IAClBI,OAAO,EAAED,GAAG,CAACC,OAAO,IACf,2BACDH,KAAK,CACHE,GAAG,CAACE,aAAa,CAACD,OAAO,CAACE,KAAK,CAAC,GAAG,CAAC,CAACC,GAAG,CAAC,CAAC,IACrCJ,GAAG,CAACE,aAAa,CAACD,OACzB,CAAC,EACD;IACJI,WAAW,EAAEL,GAAG,CAACK,WAAW,IACvB,UAAUL,GAAG,CAACE,aAAa,CAACI,eAAe,CAACD,WAAW,EAAE;IAC9DE,UAAU,EAAE,CACV;MACEC,EAAE,EAAE,yBAAyB;MAC7BH,WAAW,EAAE,eAAe;MAC5BI,IAAI,EAAE;QACJA,IAAI,EAAE,oBAAoB;QAC1BC,kBAAkB,EAAE;UAAEC,gBAAgB,EAAEX,GAAG,CAACE,aAAa,CAACD;QAAQ;MACpE,CAAC;MACDW,UAAU,EAAE;QACVC,QAAQ,EAAE,IAAI;QACdC,aAAa,EAAE;UAAEL,IAAI,EAAE;QAAuB;MAChD;IACF,CAAC,CACF;IACDM,MAAM,EAAEf,GAAG,CAACe,MAAM,IAAI,QAAQ;IAC9BC,KAAK,EAAE,CAAC;MACNP,IAAI,EAAE,kBAAkB;MACxBQ,gBAAgB,EAAE;QAChBC,cAAc,EAAE;MAClB;IACF,CAAC,CAAC;IACFC,QAAQ,EAAE;MACRC,sBAAsB,EAAE,EAAE;MAC1BC,mBAAmB,EAAE,CAACrB,GAAG,CAACE,aAAa,CAACD,OAAO,CAAC;MAChDqB,iBAAiB,EAAE,EAAE;MACrBC,UAAU,EAAE;IACd;EACF,CAAC,CAAC;AACJ","ignoreList":[]}
1
+ {"version":3,"file":"defineDeleteInterfaceObjectAction.js","names":["defineAction","kebab","defineDeleteInterfaceObjectAction","def","apiName","interfaceType","split","pop","displayName","displayMetadata","parameters","id","type","interfaceReference","interfaceTypeRid","validation","required","allowedValues","status","rules","deleteObjectRule","objectToDelete","entities","affectedInterfaceTypes","affectedObjectTypes","affectedLinkTypes","typeGroups"],"sources":["defineDeleteInterfaceObjectAction.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 { ActionType } from \"./action/ActionType.js\";\nimport type { InterfaceActionTypeUserDefinition } from \"./defineAction.js\";\nimport { defineAction, kebab } from \"./defineAction.js\";\n\nexport function defineDeleteInterfaceObjectAction(\n def: InterfaceActionTypeUserDefinition,\n): ActionType {\n return defineAction({\n apiName: def.apiName\n ?? `delete-interface-object-${\n kebab(\n def.interfaceType.apiName.split(\".\").pop()\n ?? def.interfaceType.apiName,\n )\n }`,\n displayName: def.displayName\n ?? `Delete ${def.interfaceType.displayMetadata.displayName}`,\n parameters: [\n {\n id: \"objectToDeleteParameter\",\n displayName: \"Delete object\",\n type: {\n type: \"interfaceReference\",\n interfaceReference: { interfaceTypeRid: def.interfaceType.apiName },\n },\n validation: {\n required: true,\n allowedValues: { type: \"interfaceObjectQuery\" },\n },\n },\n ],\n status: def.status ?? \"active\",\n rules: [{\n type: \"deleteObjectRule\",\n deleteObjectRule: {\n objectToDelete: \"objectToDeleteParameter\",\n },\n }],\n entities: {\n affectedInterfaceTypes: [def.interfaceType.apiName],\n affectedObjectTypes: [],\n affectedLinkTypes: [],\n typeGroups: [],\n },\n });\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,SAASA,YAAY,EAAEC,KAAK,QAAQ,mBAAmB;AAEvD,OAAO,SAASC,iCAAiCA,CAC/CC,GAAsC,EAC1B;EACZ,OAAOH,YAAY,CAAC;IAClBI,OAAO,EAAED,GAAG,CAACC,OAAO,IACf,2BACDH,KAAK,CACHE,GAAG,CAACE,aAAa,CAACD,OAAO,CAACE,KAAK,CAAC,GAAG,CAAC,CAACC,GAAG,CAAC,CAAC,IACrCJ,GAAG,CAACE,aAAa,CAACD,OACzB,CAAC,EACD;IACJI,WAAW,EAAEL,GAAG,CAACK,WAAW,IACvB,UAAUL,GAAG,CAACE,aAAa,CAACI,eAAe,CAACD,WAAW,EAAE;IAC9DE,UAAU,EAAE,CACV;MACEC,EAAE,EAAE,yBAAyB;MAC7BH,WAAW,EAAE,eAAe;MAC5BI,IAAI,EAAE;QACJA,IAAI,EAAE,oBAAoB;QAC1BC,kBAAkB,EAAE;UAAEC,gBAAgB,EAAEX,GAAG,CAACE,aAAa,CAACD;QAAQ;MACpE,CAAC;MACDW,UAAU,EAAE;QACVC,QAAQ,EAAE,IAAI;QACdC,aAAa,EAAE;UAAEL,IAAI,EAAE;QAAuB;MAChD;IACF,CAAC,CACF;IACDM,MAAM,EAAEf,GAAG,CAACe,MAAM,IAAI,QAAQ;IAC9BC,KAAK,EAAE,CAAC;MACNP,IAAI,EAAE,kBAAkB;MACxBQ,gBAAgB,EAAE;QAChBC,cAAc,EAAE;MAClB;IACF,CAAC,CAAC;IACFC,QAAQ,EAAE;MACRC,sBAAsB,EAAE,CAACpB,GAAG,CAACE,aAAa,CAACD,OAAO,CAAC;MACnDoB,mBAAmB,EAAE,EAAE;MACvBC,iBAAiB,EAAE,EAAE;MACrBC,UAAU,EAAE;IACd;EACF,CAAC,CAAC;AACJ","ignoreList":[]}
@@ -22,6 +22,7 @@ import { convertActionValidation } from "../conversion/toMarketplace/convertActi
22
22
  import { convertOntologyDefinition } from "../conversion/toMarketplace/convertOntologyDefinition.js";
23
23
  import { convertOntologyToValueTypeIr } from "../conversion/toMarketplace/convertOntologyToValueTypeIr.js";
24
24
  import { getFormContentOrdering } from "../conversion/toMarketplace/getFormContentOrdering.js";
25
+ import { createCodeSnippets } from "./code-snippets/createCodeSnippets.js";
25
26
  import { OntologyEntityTypeEnum } from "./common/OntologyEntityTypeEnum.js";
26
27
  // type -> apiName -> entity
27
28
  /** @internal */
@@ -48,7 +49,7 @@ export function updateOntology(entity) {
48
49
  }
49
50
  ontologyDefinition[OntologyEntityTypeEnum.VALUE_TYPE][entity.apiName].push(entity);
50
51
  }
51
- export async function defineOntology(ns, body, outputDir, dependencyFile, randomnessKey) {
52
+ export async function defineOntology(ns, body, outputDir, dependencyFile, codeSnippetFiles, snippetPackageName, snippetFileOutputDir, randomnessKey) {
52
53
  namespace = ns;
53
54
  dependencies = {};
54
55
  ontologyDefinition = {
@@ -80,6 +81,9 @@ export async function defineOntology(ns, body, outputDir, dependencyFile, random
80
81
  if (dependencyFile) {
81
82
  writeDependencyFile(dependencyFile);
82
83
  }
84
+ if (codeSnippetFiles) {
85
+ createCodeSnippets(ontologyDefinition, snippetPackageName, snippetFileOutputDir);
86
+ }
83
87
  return convertOntologyDefinition(ontologyDefinition, randomnessKey);
84
88
  }
85
89
  export function writeStaticObjects(outputDir) {
@@ -1 +1 @@
1
- {"version":3,"file":"defineOntology.js","names":["fs","path","convertActionParameters","convertActionSections","convertActionValidation","convertOntologyDefinition","convertOntologyToValueTypeIr","getFormContentOrdering","OntologyEntityTypeEnum","ontologyDefinition","importedTypes","dependencies","namespace","updateOntology","entity","__type","VALUE_TYPE","apiName","undefined","push","defineOntology","ns","body","outputDir","dependencyFile","randomnessKey","OBJECT_TYPE","ACTION_TYPE","LINK_TYPE","INTERFACE_TYPE","SHARED_PROPERTY_TYPE","e","console","error","writeStaticObjects","writeDependencyFile","codegenDir","resolve","typeDirs","existsSync","mkdirSync","recursive","Object","values","forEach","typeDirNameFromMap","currentTypeDirPath","join","rmSync","force","topLevelExportStatements","entries","ontologyTypeEnumKey","entities","typeDirName","typeDirPath","entityModuleNames","entityFileNameBase","camel","withoutNamespace","filePath","entityTypeName","getEntityTypeName","entityJSON","JSON","stringify","replace","_","prefix","value","content","slice","writeFileSync","flag","entityModuleName","length","mainIndexContent","dependencyInjectionString","mainIndexFilePath","buildDatasource","definition","classificationMarkingGroupName","mandatoryMarkingGroupName","needsSecurity","securityConfig","classificationConstraint","markingGroupName","markingConstraint","datasourceName","datasource","editsConfiguration","onlyAllowPrivilegedEdits","redacted","dataSecurity","cleanAndValidateLinkTypeId","step1","linkTypeId","toLowerCase","test","Error","dumpOntologyFullMetadata","dumpValueTypeWireType","convertObjectStatus","status","type","active","experimental","deprecated","message","deadline","replacedBy","convertAction","action","actionValidation","actionParameters","actionSections","parameterOrdering","parameters","map","p","id","actionType","actionTypeLogic","logic","rules","validation","metadata","displayMetadata","configuration","defaultLayout","defaultFormat","displayAndFormat","table","columnWidthByParameterRid","enableFileImport","fitHorizontally","frozenColumnCount","rowHeightInLines","enableLayoutUserSwitch","enableLayoutSwitch","description","displayName","icon","blueprint","locator","color","successMessage","submissionMetadata","typeClasses","submitButtonDisplayMetadata","undoButtonConfiguration","formContentOrdering","sections","extractAllowedValues","allowedValues","oneOf","labelledValues","otherValueAllowed","allowed","min","max","range","minimum","inclusive","maximum","minLength","maxLength","regex","text","failureMessage","datetime","objectTypeReference","interfaceTypeRids","interfaceTypes","geotimeSeriesReference","geotimeSeries","k","renderHintFromBaseType","parameter","checkbox","numericInput","textInput","dateTimePicker","filePicker","mandatoryMarkingPicker","cbacMarkingPicker","dropdown","extractNamespace","substring","lastIndexOf","lastDot","str","result","c","toUpperCase","charAt","namespaceNoDot","endsWith","addNamespaceIfNone","includes"],"sources":["defineOntology.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 {\n ActionTypeStatus,\n OntologyIr,\n OntologyIrActionTypeBlockDataV2,\n OntologyIrAllowedParameterValues,\n OntologyIrObjectTypeDatasource,\n OntologyIrObjectTypeDatasourceDefinition,\n OntologyIrParameter,\n OntologyIrSection,\n OntologyIrValueTypeBlockData,\n ParameterId,\n ParameterRenderHint,\n SectionId,\n} from \"@osdk/client.unstable\";\nimport * as fs from \"fs\";\nimport * as path from \"path\";\nimport { convertActionParameters } from \"../conversion/toMarketplace/convertActionParameters.js\";\nimport { convertActionSections } from \"../conversion/toMarketplace/convertActionSections.js\";\nimport { convertActionValidation } from \"../conversion/toMarketplace/convertActionValidation.js\";\nimport { convertOntologyDefinition } from \"../conversion/toMarketplace/convertOntologyDefinition.js\";\nimport { convertOntologyToValueTypeIr } from \"../conversion/toMarketplace/convertOntologyToValueTypeIr.js\";\nimport { getFormContentOrdering } from \"../conversion/toMarketplace/getFormContentOrdering.js\";\nimport type { ActionParameter } from \"./action/ActionParameter.js\";\nimport type { ActionParameterAllowedValues } from \"./action/ActionParameterAllowedValues.js\";\nimport type { ActionType } from \"./action/ActionType.js\";\nimport type { OntologyDefinition } from \"./common/OntologyDefinition.js\";\nimport { OntologyEntityTypeEnum } from \"./common/OntologyEntityTypeEnum.js\";\nimport type { OntologyEntityType } from \"./common/OntologyEntityTypeMapping.js\";\n\n// type -> apiName -> entity\n/** @internal */\nexport let ontologyDefinition: OntologyDefinition;\n\n// type -> apiName -> entity\n/** @internal */\nexport let importedTypes: OntologyDefinition;\n\n// namespace -> version\n/** @internal */\nexport let dependencies: Record<string, string>;\n\n/** @internal */\nexport let namespace: string;\n\nexport function updateOntology<\n T extends OntologyEntityType,\n>(\n entity: T,\n): void {\n if (entity.__type !== OntologyEntityTypeEnum.VALUE_TYPE) {\n ontologyDefinition[entity.__type][entity.apiName] = entity;\n return;\n }\n // value types are a special case\n if (\n ontologyDefinition[OntologyEntityTypeEnum.VALUE_TYPE][entity.apiName]\n === undefined\n ) {\n ontologyDefinition[OntologyEntityTypeEnum.VALUE_TYPE][entity.apiName] = [];\n }\n ontologyDefinition[OntologyEntityTypeEnum.VALUE_TYPE][entity.apiName]\n .push(entity);\n}\n\nexport async function defineOntology(\n ns: string,\n body: () => void | Promise<void>,\n outputDir: string | undefined,\n dependencyFile?: string,\n randomnessKey?: string,\n): Promise<OntologyIr> {\n namespace = ns;\n dependencies = {};\n ontologyDefinition = {\n OBJECT_TYPE: {},\n ACTION_TYPE: {},\n LINK_TYPE: {},\n INTERFACE_TYPE: {},\n SHARED_PROPERTY_TYPE: {},\n VALUE_TYPE: {},\n };\n importedTypes = {\n SHARED_PROPERTY_TYPE: {},\n OBJECT_TYPE: {},\n ACTION_TYPE: {},\n LINK_TYPE: {},\n INTERFACE_TYPE: {},\n VALUE_TYPE: {},\n };\n try {\n await body();\n } catch (e) {\n // eslint-disable-next-line no-console\n console.error(\n \"Unexpected error while processing the body of the ontology\",\n e,\n );\n throw e;\n }\n\n if (outputDir) {\n writeStaticObjects(outputDir);\n }\n if (dependencyFile) {\n writeDependencyFile(dependencyFile);\n }\n return convertOntologyDefinition(ontologyDefinition, randomnessKey);\n}\n\nexport function writeStaticObjects(outputDir: string): void {\n const codegenDir = path.resolve(outputDir, \"codegen\");\n const typeDirs = {\n [OntologyEntityTypeEnum.SHARED_PROPERTY_TYPE]: \"shared-property-types\",\n [OntologyEntityTypeEnum.ACTION_TYPE]: \"action-types\",\n [OntologyEntityTypeEnum.OBJECT_TYPE]: \"object-types\",\n [OntologyEntityTypeEnum.LINK_TYPE]: \"link-types\",\n [OntologyEntityTypeEnum.INTERFACE_TYPE]: \"interface-types\",\n [OntologyEntityTypeEnum.VALUE_TYPE]: \"value-types\",\n };\n\n if (!fs.existsSync(codegenDir)) {\n fs.mkdirSync(codegenDir, { recursive: true });\n }\n\n Object.values(typeDirs).forEach(typeDirNameFromMap => {\n const currentTypeDirPath = path.join(codegenDir, typeDirNameFromMap);\n if (fs.existsSync(currentTypeDirPath)) {\n fs.rmSync(currentTypeDirPath, { recursive: true, force: true });\n }\n fs.mkdirSync(currentTypeDirPath, { recursive: true });\n });\n\n const topLevelExportStatements: string[] = [];\n\n Object.entries(ontologyDefinition).forEach(\n ([ontologyTypeEnumKey, entities]) => {\n const typeDirName =\n typeDirs[ontologyTypeEnumKey as OntologyEntityTypeEnum];\n\n const typeDirPath = path.join(codegenDir, typeDirName);\n const entityModuleNames: string[] = [];\n\n Object.entries(entities).forEach(\n ([apiName, entity]: [string, OntologyEntityType]) => {\n const entityFileNameBase = camel(withoutNamespace(apiName))\n + (ontologyTypeEnumKey as OntologyEntityTypeEnum\n === OntologyEntityTypeEnum.VALUE_TYPE\n ? \"ValueType\"\n : \"\");\n const filePath = path.join(typeDirPath, `${entityFileNameBase}.ts`);\n const entityTypeName = getEntityTypeName(ontologyTypeEnumKey);\n const entityJSON = JSON.stringify(entity, null, 2).replace(\n /(\"__type\"\\s*:\\s*)\"([^\"]*)\"/g,\n (_, prefix, value) => `${prefix}OntologyEntityTypeEnum.${value}`,\n );\n const content = `\nimport { wrapWithProxy, OntologyEntityTypeEnum } from '@osdk/maker';\nimport type { ${entityTypeName} } from '@osdk/maker';\n\n/** @type {import('@osdk/maker').${entityTypeName}} */\nconst ${entityFileNameBase}_base: ${entityTypeName} = ${\n ontologyTypeEnumKey === \"VALUE_TYPE\"\n ? entityJSON.slice(1, -2)\n : entityJSON\n } as unknown as ${entityTypeName};\n \nexport const ${entityFileNameBase}: ${entityTypeName} = wrapWithProxy(${entityFileNameBase}_base);\n `;\n fs.writeFileSync(filePath, content, { flag: \"w\" });\n entityModuleNames.push(entityFileNameBase);\n },\n );\n\n for (const entityModuleName of entityModuleNames) {\n topLevelExportStatements.push(\n `export { ${entityModuleName} } from \"./codegen/${typeDirName}/${entityModuleName}.js\";`,\n );\n }\n },\n );\n\n if (topLevelExportStatements.length > 0) {\n const mainIndexContent = dependencyInjectionString()\n + topLevelExportStatements.join(\"\\n\") + \"\\n\";\n const mainIndexFilePath = path.join(outputDir, \"index.ts\");\n fs.writeFileSync(mainIndexFilePath, mainIndexContent, { flag: \"w\" });\n }\n}\n\nexport function buildDatasource(\n apiName: string,\n definition: OntologyIrObjectTypeDatasourceDefinition,\n classificationMarkingGroupName?: string,\n mandatoryMarkingGroupName?: string,\n): OntologyIrObjectTypeDatasource {\n const needsSecurity = classificationMarkingGroupName !== undefined\n || mandatoryMarkingGroupName !== undefined;\n\n const securityConfig = needsSecurity\n ? {\n classificationConstraint: classificationMarkingGroupName\n ? {\n markingGroupName: classificationMarkingGroupName,\n }\n : undefined,\n markingConstraint: mandatoryMarkingGroupName\n ? {\n markingGroupName: mandatoryMarkingGroupName,\n }\n : undefined,\n }\n : undefined;\n return ({\n datasourceName: apiName,\n datasource: definition,\n editsConfiguration: {\n onlyAllowPrivilegedEdits: false,\n },\n redacted: false,\n ...((securityConfig !== undefined) && { dataSecurity: securityConfig }),\n });\n}\n\nexport function cleanAndValidateLinkTypeId(apiName: string): string {\n // Insert a dash before any uppercase letter that follows a lowercase letter or digit\n const step1 = apiName.replace(/([a-z0-9])([A-Z])/g, \"$1-$2\");\n // Insert a dash after a sequence of uppercase letters when followed by a lowercase letter\n // then convert the whole string to lowercase\n // e.g., apiName, APIname, and apiNAME will all be converted to api-name\n const linkTypeId = step1.replace(/([A-Z])([A-Z][a-z])/g, \"$1-$2\")\n .toLowerCase();\n\n const VALIDATION_PATTERN = /^([a-z][a-z0-9\\-]*)$/;\n if (!VALIDATION_PATTERN.test(linkTypeId)) {\n throw new Error(\n `LinkType id '${linkTypeId}' must be lower case with dashes.`,\n );\n }\n return linkTypeId;\n}\n\nexport function dumpOntologyFullMetadata(): OntologyIr {\n return convertOntologyDefinition(ontologyDefinition);\n}\n\nexport function dumpValueTypeWireType(): OntologyIrValueTypeBlockData {\n return convertOntologyToValueTypeIr(ontologyDefinition);\n}\n\nexport function convertObjectStatus(status: any): any {\n if (status === undefined) {\n return {\n type: \"active\",\n active: {},\n };\n }\n\n if (status === \"active\") {\n return {\n type: \"active\",\n active: {},\n };\n }\n\n if (status === \"experimental\") {\n return {\n type: \"experimental\",\n experimental: {},\n };\n }\n\n if (typeof status === \"object\" && status.type === \"deprecated\") {\n return {\n type: \"deprecated\",\n deprecated: {\n message: status.message,\n deadline: status.deadline,\n replacedBy: undefined,\n },\n };\n }\n\n return status;\n}\n\nexport function convertAction(\n action: ActionType,\n): OntologyIrActionTypeBlockDataV2 {\n const actionValidation = convertActionValidation(action);\n const actionParameters: Record<ParameterId, OntologyIrParameter> =\n convertActionParameters(action);\n const actionSections: Record<SectionId, OntologyIrSection> =\n convertActionSections(action);\n const parameterOrdering = action.parameterOrdering\n ?? (action.parameters ?? []).map(p => p.id);\n return {\n actionType: {\n actionTypeLogic: {\n logic: {\n rules: action.rules,\n },\n validation: actionValidation,\n },\n metadata: {\n apiName: action.apiName,\n displayMetadata: {\n configuration: {\n defaultLayout: action.defaultFormat ?? \"FORM\",\n displayAndFormat: action.displayAndFormat ?? {\n table: {\n columnWidthByParameterRid: {},\n enableFileImport: true,\n fitHorizontally: false,\n frozenColumnCount: 0,\n rowHeightInLines: 1,\n },\n },\n enableLayoutUserSwitch: action.enableLayoutSwitch ?? false,\n },\n description: action.description ?? \"\",\n displayName: action.displayName,\n icon: {\n type: \"blueprint\",\n blueprint: action.icon ?? { locator: \"edit\", color: \"#000000\" },\n },\n successMessage: action.submissionMetadata?.successMessage\n ? [{\n type: \"message\",\n message: action.submissionMetadata.successMessage,\n }]\n : [],\n typeClasses: action.typeClasses ?? [],\n ...(action.submissionMetadata?.submitButtonDisplayMetadata\n && {\n submitButtonDisplayMetadata:\n action.submissionMetadata.submitButtonDisplayMetadata,\n }),\n ...(action.submissionMetadata?.undoButtonConfiguration\n && {\n undoButtonConfiguration:\n action.submissionMetadata.undoButtonConfiguration,\n }),\n },\n parameterOrdering: parameterOrdering,\n formContentOrdering: getFormContentOrdering(action, parameterOrdering),\n parameters: actionParameters,\n sections: actionSections,\n status: typeof action.status === \"string\"\n ? {\n type: action.status,\n [action.status]: {},\n } as unknown as ActionTypeStatus\n : action.status,\n entities: action.entities,\n },\n },\n };\n}\n\nexport function extractAllowedValues(\n allowedValues: ActionParameterAllowedValues,\n): OntologyIrAllowedParameterValues {\n switch (allowedValues.type) {\n case \"oneOf\":\n return {\n type: \"oneOf\",\n oneOf: {\n type: \"oneOf\",\n oneOf: {\n labelledValues: allowedValues.oneOf,\n otherValueAllowed: {\n allowed: allowedValues.otherValueAllowed\n ?? false,\n },\n },\n },\n };\n case \"range\":\n const { min, max } = allowedValues;\n return {\n type: \"range\",\n range: {\n type: \"range\",\n range: {\n ...(min === undefined\n ? {}\n : { minimum: { inclusive: true, value: min } }),\n ...(max === undefined\n ? {}\n : { maximum: { inclusive: true, value: max } }),\n },\n },\n };\n case \"text\":\n const { minLength, maxLength, regex } = allowedValues;\n return {\n type: \"text\",\n text: {\n type: \"text\",\n text: {\n ...(minLength === undefined\n ? {}\n : { minLength: minLength }),\n ...(maxLength === undefined\n ? {}\n : { maxLength: maxLength }),\n ...(regex === undefined\n ? {}\n : { regex: { regex: regex, failureMessage: \"Invalid input\" } }),\n },\n },\n };\n case \"datetime\":\n const { minimum, maximum } = allowedValues;\n return {\n type: \"datetime\",\n datetime: {\n type: \"datetime\",\n datetime: {\n minimum,\n maximum,\n },\n },\n };\n case \"objectTypeReference\":\n return {\n type: \"objectTypeReference\",\n objectTypeReference: {\n type: \"objectTypeReference\",\n objectTypeReference: {\n interfaceTypeRids: allowedValues.interfaceTypes,\n },\n },\n };\n case \"redacted\":\n return {\n type: \"redacted\",\n redacted: {},\n };\n case \"geotimeSeriesReference\":\n return {\n type: \"geotimeSeriesReference\",\n geotimeSeriesReference: {\n type: \"geotimeSeries\",\n geotimeSeries: {},\n },\n };\n default:\n const k: Partial<OntologyIrAllowedParameterValues[\"type\"]> =\n allowedValues.type;\n return {\n type: k,\n [k]: {\n type: k,\n [k]: {},\n },\n } as unknown as OntologyIrAllowedParameterValues;\n // TODO(dpaquin): there's probably a TS clean way to do this\n }\n}\n\nexport function renderHintFromBaseType(\n parameter: ActionParameter,\n): ParameterRenderHint {\n // TODO(dpaquin): these are just guesses, we should find where they're actually defined\n const type = typeof parameter.type === \"string\"\n ? parameter.type\n : parameter.type.type;\n switch (type) {\n case \"boolean\":\n case \"booleanList\":\n return { type: \"checkbox\", checkbox: {} };\n case \"integer\":\n case \"integerList\":\n case \"long\":\n case \"longList\":\n case \"double\":\n case \"doubleList\":\n case \"decimal\":\n case \"decimalList\":\n return { type: \"numericInput\", numericInput: {} };\n case \"string\":\n case \"stringList\":\n case \"geohash\":\n case \"geohashList\":\n case \"geoshape\":\n case \"geoshapeList\":\n case \"objectSetRid\":\n return { type: \"textInput\", textInput: {} };\n case \"timestamp\":\n case \"timestampList\":\n case \"date\":\n case \"dateList\":\n return { type: \"dateTimePicker\", dateTimePicker: {} };\n case \"attachment\":\n case \"attachmentList\":\n return { type: \"filePicker\", filePicker: {} };\n case \"marking\":\n case \"markingList\":\n if (parameter.validation.allowedValues?.type === \"mandatoryMarking\") {\n return { type: \"mandatoryMarkingPicker\", mandatoryMarkingPicker: {} };\n } else if (parameter.validation.allowedValues?.type === \"cbacMarking\") {\n return { type: \"cbacMarkingPicker\", cbacMarkingPicker: {} };\n } else {\n throw new Error(\n `The allowed values for \"${parameter.displayName}\" are not compatible with the base parameter type`,\n );\n }\n case \"timeSeriesReference\":\n case \"objectReference\":\n case \"objectReferenceList\":\n case \"interfaceReference\":\n case \"interfaceReferenceList\":\n case \"objectTypeReference\":\n case \"mediaReference\":\n case \"mediaReferenceList\":\n case \"geotimeSeriesReference\":\n case \"geotimeSeriesReferenceList\":\n return { type: \"dropdown\", dropdown: {} };\n case \"struct\":\n case \"structList\":\n throw new Error(\"Structs are not supported yet\");\n default:\n throw new Error(`Unknown type ${type}`);\n }\n}\n\nexport function extractNamespace(apiName: string): string {\n return apiName.substring(0, apiName.lastIndexOf(\".\") + 1);\n}\n\nexport function withoutNamespace(apiName: string): string {\n const lastDot = apiName.lastIndexOf(\".\");\n if (lastDot === -1) {\n return apiName;\n }\n return apiName.substring(lastDot + 1);\n}\n\nfunction camel(str: string): string {\n if (!str) {\n return str;\n }\n let result = str.replace(/[-_]+(.)?/g, (_, c) => (c ? c.toUpperCase() : \"\"));\n result = result.charAt(0).toLowerCase() + result.slice(1);\n return result;\n}\n\n/**\n * Gets the TypeScript type name corresponding to an OntologyEntityTypeEnum value\n */\nfunction getEntityTypeName(type: string): string {\n return {\n [OntologyEntityTypeEnum.OBJECT_TYPE]: \"ObjectType\",\n [OntologyEntityTypeEnum.LINK_TYPE]: \"LinkType\",\n [OntologyEntityTypeEnum.INTERFACE_TYPE]: \"InterfaceType\",\n [OntologyEntityTypeEnum.SHARED_PROPERTY_TYPE]: \"SharedPropertyType\",\n [OntologyEntityTypeEnum.ACTION_TYPE]: \"ActionType\",\n [OntologyEntityTypeEnum.VALUE_TYPE]: \"ValueTypeDefinitionVersion\",\n }[type]!;\n}\n\nfunction writeDependencyFile(dependencyFile: string): void {\n fs.writeFileSync(dependencyFile, JSON.stringify(dependencies, null, 2));\n}\n\nfunction dependencyInjectionString(): string {\n const namespaceNoDot: string = namespace.endsWith(\".\")\n ? namespace.slice(0, -1)\n : namespace;\n\n return `import { addDependency } from \"@osdk/maker\";\n// @ts-ignore\naddDependency(\"${namespaceNoDot}\", new URL(import.meta.url).pathname);\n`;\n}\n\nexport function addNamespaceIfNone(apiName: string): string {\n return apiName.includes(\".\") ? apiName : namespace + apiName;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA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OAAOA,OAAO,CAACsL,QAAQ,CAAC,GAAG,CAAC,GAAGtL,OAAO,GAAGL,SAAS,GAAGK,OAAO;AAC9D","ignoreList":[]}
1
+ {"version":3,"file":"defineOntology.js","names":["fs","path","convertActionParameters","convertActionSections","convertActionValidation","convertOntologyDefinition","convertOntologyToValueTypeIr","getFormContentOrdering","createCodeSnippets","OntologyEntityTypeEnum","ontologyDefinition","importedTypes","dependencies","namespace","updateOntology","entity","__type","VALUE_TYPE","apiName","undefined","push","defineOntology","ns","body","outputDir","dependencyFile","codeSnippetFiles","snippetPackageName","snippetFileOutputDir","randomnessKey","OBJECT_TYPE","ACTION_TYPE","LINK_TYPE","INTERFACE_TYPE","SHARED_PROPERTY_TYPE","e","console","error","writeStaticObjects","writeDependencyFile","codegenDir","resolve","typeDirs","existsSync","mkdirSync","recursive","Object","values","forEach","typeDirNameFromMap","currentTypeDirPath","join","rmSync","force","topLevelExportStatements","entries","ontologyTypeEnumKey","entities","typeDirName","typeDirPath","entityModuleNames","entityFileNameBase","camel","withoutNamespace","filePath","entityTypeName","getEntityTypeName","entityJSON","JSON","stringify","replace","_","prefix","value","content","slice","writeFileSync","flag","entityModuleName","length","mainIndexContent","dependencyInjectionString","mainIndexFilePath","buildDatasource","definition","classificationMarkingGroupName","mandatoryMarkingGroupName","needsSecurity","securityConfig","classificationConstraint","markingGroupName","markingConstraint","datasourceName","datasource","editsConfiguration","onlyAllowPrivilegedEdits","redacted","dataSecurity","cleanAndValidateLinkTypeId","step1","linkTypeId","toLowerCase","test","Error","dumpOntologyFullMetadata","dumpValueTypeWireType","convertObjectStatus","status","type","active","experimental","deprecated","message","deadline","replacedBy","convertAction","action","actionValidation","actionParameters","actionSections","parameterOrdering","parameters","map","p","id","actionType","actionTypeLogic","logic","rules","validation","metadata","displayMetadata","configuration","defaultLayout","defaultFormat","displayAndFormat","table","columnWidthByParameterRid","enableFileImport","fitHorizontally","frozenColumnCount","rowHeightInLines","enableLayoutUserSwitch","enableLayoutSwitch","description","displayName","icon","blueprint","locator","color","successMessage","submissionMetadata","typeClasses","submitButtonDisplayMetadata","undoButtonConfiguration","formContentOrdering","sections","extractAllowedValues","allowedValues","oneOf","labelledValues","otherValueAllowed","allowed","min","max","range","minimum","inclusive","maximum","minLength","maxLength","regex","text","failureMessage","datetime","objectTypeReference","interfaceTypeRids","interfaceTypes","geotimeSeriesReference","geotimeSeries","k","renderHintFromBaseType","parameter","checkbox","numericInput","textInput","dateTimePicker","filePicker","mandatoryMarkingPicker","cbacMarkingPicker","dropdown","extractNamespace","substring","lastIndexOf","lastDot","str","result","c","toUpperCase","charAt","namespaceNoDot","endsWith","addNamespaceIfNone","includes"],"sources":["defineOntology.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 {\n ActionTypeStatus,\n OntologyIr,\n OntologyIrActionTypeBlockDataV2,\n OntologyIrAllowedParameterValues,\n OntologyIrObjectTypeDatasource,\n OntologyIrObjectTypeDatasourceDefinition,\n OntologyIrParameter,\n OntologyIrSection,\n OntologyIrValueTypeBlockData,\n ParameterId,\n ParameterRenderHint,\n SectionId,\n} from \"@osdk/client.unstable\";\nimport * as fs from \"fs\";\nimport * as path from \"path\";\nimport { convertActionParameters } from \"../conversion/toMarketplace/convertActionParameters.js\";\nimport { convertActionSections } from \"../conversion/toMarketplace/convertActionSections.js\";\nimport { convertActionValidation } from \"../conversion/toMarketplace/convertActionValidation.js\";\nimport { convertOntologyDefinition } from \"../conversion/toMarketplace/convertOntologyDefinition.js\";\nimport { convertOntologyToValueTypeIr } from \"../conversion/toMarketplace/convertOntologyToValueTypeIr.js\";\nimport { getFormContentOrdering } from \"../conversion/toMarketplace/getFormContentOrdering.js\";\nimport type { ActionParameter } from \"./action/ActionParameter.js\";\nimport type { ActionParameterAllowedValues } from \"./action/ActionParameterAllowedValues.js\";\nimport type { ActionType } from \"./action/ActionType.js\";\nimport { createCodeSnippets } from \"./code-snippets/createCodeSnippets.js\";\nimport type { OntologyDefinition } from \"./common/OntologyDefinition.js\";\nimport { OntologyEntityTypeEnum } from \"./common/OntologyEntityTypeEnum.js\";\nimport type { OntologyEntityType } from \"./common/OntologyEntityTypeMapping.js\";\n\n// type -> apiName -> entity\n/** @internal */\nexport let ontologyDefinition: OntologyDefinition;\n\n// type -> apiName -> entity\n/** @internal */\nexport let importedTypes: OntologyDefinition;\n\n// namespace -> version\n/** @internal */\nexport let dependencies: Record<string, string>;\n\n/** @internal */\nexport let namespace: string;\n\nexport function updateOntology<\n T extends OntologyEntityType,\n>(\n entity: T,\n): void {\n if (entity.__type !== OntologyEntityTypeEnum.VALUE_TYPE) {\n ontologyDefinition[entity.__type][entity.apiName] = entity;\n return;\n }\n // value types are a special case\n if (\n ontologyDefinition[OntologyEntityTypeEnum.VALUE_TYPE][entity.apiName]\n === undefined\n ) {\n ontologyDefinition[OntologyEntityTypeEnum.VALUE_TYPE][entity.apiName] = [];\n }\n ontologyDefinition[OntologyEntityTypeEnum.VALUE_TYPE][entity.apiName]\n .push(entity);\n}\n\nexport async function defineOntology(\n ns: string,\n body: () => void | Promise<void>,\n outputDir: string | undefined,\n dependencyFile?: string,\n codeSnippetFiles?: boolean,\n snippetPackageName?: string,\n snippetFileOutputDir?: string,\n randomnessKey?: string,\n): Promise<OntologyIr> {\n namespace = ns;\n dependencies = {};\n ontologyDefinition = {\n OBJECT_TYPE: {},\n ACTION_TYPE: {},\n LINK_TYPE: {},\n INTERFACE_TYPE: {},\n SHARED_PROPERTY_TYPE: {},\n VALUE_TYPE: {},\n };\n importedTypes = {\n SHARED_PROPERTY_TYPE: {},\n OBJECT_TYPE: {},\n ACTION_TYPE: {},\n LINK_TYPE: {},\n INTERFACE_TYPE: {},\n VALUE_TYPE: {},\n };\n try {\n await body();\n } catch (e) {\n // eslint-disable-next-line no-console\n console.error(\n \"Unexpected error while processing the body of the ontology\",\n e,\n );\n throw e;\n }\n if (outputDir) {\n writeStaticObjects(outputDir);\n }\n if (dependencyFile) {\n writeDependencyFile(dependencyFile);\n }\n if (codeSnippetFiles) {\n createCodeSnippets(\n ontologyDefinition,\n snippetPackageName,\n snippetFileOutputDir,\n );\n }\n\n return convertOntologyDefinition(ontologyDefinition, randomnessKey);\n}\n\nexport function writeStaticObjects(outputDir: string): void {\n const codegenDir = path.resolve(outputDir, \"codegen\");\n const typeDirs = {\n [OntologyEntityTypeEnum.SHARED_PROPERTY_TYPE]: \"shared-property-types\",\n [OntologyEntityTypeEnum.ACTION_TYPE]: \"action-types\",\n [OntologyEntityTypeEnum.OBJECT_TYPE]: \"object-types\",\n [OntologyEntityTypeEnum.LINK_TYPE]: \"link-types\",\n [OntologyEntityTypeEnum.INTERFACE_TYPE]: \"interface-types\",\n [OntologyEntityTypeEnum.VALUE_TYPE]: \"value-types\",\n };\n\n if (!fs.existsSync(codegenDir)) {\n fs.mkdirSync(codegenDir, { recursive: true });\n }\n\n Object.values(typeDirs).forEach(typeDirNameFromMap => {\n const currentTypeDirPath = path.join(codegenDir, typeDirNameFromMap);\n if (fs.existsSync(currentTypeDirPath)) {\n fs.rmSync(currentTypeDirPath, { recursive: true, force: true });\n }\n fs.mkdirSync(currentTypeDirPath, { recursive: true });\n });\n\n const topLevelExportStatements: string[] = [];\n\n Object.entries(ontologyDefinition).forEach(\n ([ontologyTypeEnumKey, entities]) => {\n const typeDirName =\n typeDirs[ontologyTypeEnumKey as OntologyEntityTypeEnum];\n\n const typeDirPath = path.join(codegenDir, typeDirName);\n const entityModuleNames: string[] = [];\n\n Object.entries(entities).forEach(\n ([apiName, entity]: [string, OntologyEntityType]) => {\n const entityFileNameBase = camel(withoutNamespace(apiName))\n + (ontologyTypeEnumKey as OntologyEntityTypeEnum\n === OntologyEntityTypeEnum.VALUE_TYPE\n ? \"ValueType\"\n : \"\");\n const filePath = path.join(typeDirPath, `${entityFileNameBase}.ts`);\n const entityTypeName = getEntityTypeName(ontologyTypeEnumKey);\n const entityJSON = JSON.stringify(entity, null, 2).replace(\n /(\"__type\"\\s*:\\s*)\"([^\"]*)\"/g,\n (_, prefix, value) => `${prefix}OntologyEntityTypeEnum.${value}`,\n );\n const content = `\nimport { wrapWithProxy, OntologyEntityTypeEnum } from '@osdk/maker';\nimport type { ${entityTypeName} } from '@osdk/maker';\n\n/** @type {import('@osdk/maker').${entityTypeName}} */\nconst ${entityFileNameBase}_base: ${entityTypeName} = ${\n ontologyTypeEnumKey === \"VALUE_TYPE\"\n ? entityJSON.slice(1, -2)\n : entityJSON\n } as unknown as ${entityTypeName};\n \nexport const ${entityFileNameBase}: ${entityTypeName} = wrapWithProxy(${entityFileNameBase}_base);\n `;\n fs.writeFileSync(filePath, content, { flag: \"w\" });\n entityModuleNames.push(entityFileNameBase);\n },\n );\n\n for (const entityModuleName of entityModuleNames) {\n topLevelExportStatements.push(\n `export { ${entityModuleName} } from \"./codegen/${typeDirName}/${entityModuleName}.js\";`,\n );\n }\n },\n );\n\n if (topLevelExportStatements.length > 0) {\n const mainIndexContent = dependencyInjectionString()\n + topLevelExportStatements.join(\"\\n\") + \"\\n\";\n const mainIndexFilePath = path.join(outputDir, \"index.ts\");\n fs.writeFileSync(mainIndexFilePath, mainIndexContent, { flag: \"w\" });\n }\n}\n\nexport function buildDatasource(\n apiName: string,\n definition: OntologyIrObjectTypeDatasourceDefinition,\n classificationMarkingGroupName?: string,\n mandatoryMarkingGroupName?: string,\n): OntologyIrObjectTypeDatasource {\n const needsSecurity = classificationMarkingGroupName !== undefined\n || mandatoryMarkingGroupName !== undefined;\n\n const securityConfig = needsSecurity\n ? {\n classificationConstraint: classificationMarkingGroupName\n ? {\n markingGroupName: classificationMarkingGroupName,\n }\n : undefined,\n markingConstraint: mandatoryMarkingGroupName\n ? {\n markingGroupName: mandatoryMarkingGroupName,\n }\n : undefined,\n }\n : undefined;\n return ({\n datasourceName: apiName,\n datasource: definition,\n editsConfiguration: {\n onlyAllowPrivilegedEdits: false,\n },\n redacted: false,\n ...((securityConfig !== undefined) && { dataSecurity: securityConfig }),\n });\n}\n\nexport function cleanAndValidateLinkTypeId(apiName: string): string {\n // Insert a dash before any uppercase letter that follows a lowercase letter or digit\n const step1 = apiName.replace(/([a-z0-9])([A-Z])/g, \"$1-$2\");\n // Insert a dash after a sequence of uppercase letters when followed by a lowercase letter\n // then convert the whole string to lowercase\n // e.g., apiName, APIname, and apiNAME will all be converted to api-name\n const linkTypeId = step1.replace(/([A-Z])([A-Z][a-z])/g, \"$1-$2\")\n .toLowerCase();\n\n const VALIDATION_PATTERN = /^([a-z][a-z0-9\\-]*)$/;\n if (!VALIDATION_PATTERN.test(linkTypeId)) {\n throw new Error(\n `LinkType id '${linkTypeId}' must be lower case with dashes.`,\n );\n }\n return linkTypeId;\n}\n\nexport function dumpOntologyFullMetadata(): OntologyIr {\n return convertOntologyDefinition(ontologyDefinition);\n}\n\nexport function dumpValueTypeWireType(): OntologyIrValueTypeBlockData {\n return convertOntologyToValueTypeIr(ontologyDefinition);\n}\n\nexport function convertObjectStatus(status: any): any {\n if (status === undefined) {\n return {\n type: \"active\",\n active: {},\n };\n }\n\n if (status === \"active\") {\n return {\n type: \"active\",\n active: {},\n };\n }\n\n if (status === \"experimental\") {\n return {\n type: \"experimental\",\n experimental: {},\n };\n }\n\n if (typeof status === \"object\" && status.type === \"deprecated\") {\n return {\n type: \"deprecated\",\n deprecated: {\n message: status.message,\n deadline: status.deadline,\n replacedBy: undefined,\n },\n };\n }\n\n return status;\n}\n\nexport function convertAction(\n action: ActionType,\n): OntologyIrActionTypeBlockDataV2 {\n const actionValidation = convertActionValidation(action);\n const actionParameters: Record<ParameterId, OntologyIrParameter> =\n convertActionParameters(action);\n const actionSections: Record<SectionId, OntologyIrSection> =\n convertActionSections(action);\n const parameterOrdering = action.parameterOrdering\n ?? (action.parameters ?? []).map(p => p.id);\n return {\n actionType: {\n actionTypeLogic: {\n logic: {\n rules: action.rules,\n },\n validation: actionValidation,\n },\n metadata: {\n apiName: action.apiName,\n displayMetadata: {\n configuration: {\n defaultLayout: action.defaultFormat ?? \"FORM\",\n displayAndFormat: action.displayAndFormat ?? {\n table: {\n columnWidthByParameterRid: {},\n enableFileImport: true,\n fitHorizontally: false,\n frozenColumnCount: 0,\n rowHeightInLines: 1,\n },\n },\n enableLayoutUserSwitch: action.enableLayoutSwitch ?? false,\n },\n description: action.description ?? \"\",\n displayName: action.displayName,\n icon: {\n type: \"blueprint\",\n blueprint: action.icon ?? { locator: \"edit\", color: \"#000000\" },\n },\n successMessage: action.submissionMetadata?.successMessage\n ? [{\n type: \"message\",\n message: action.submissionMetadata.successMessage,\n }]\n : [],\n typeClasses: action.typeClasses ?? [],\n ...(action.submissionMetadata?.submitButtonDisplayMetadata\n && {\n submitButtonDisplayMetadata:\n action.submissionMetadata.submitButtonDisplayMetadata,\n }),\n ...(action.submissionMetadata?.undoButtonConfiguration\n && {\n undoButtonConfiguration:\n action.submissionMetadata.undoButtonConfiguration,\n }),\n },\n parameterOrdering: parameterOrdering,\n formContentOrdering: getFormContentOrdering(action, parameterOrdering),\n parameters: actionParameters,\n sections: actionSections,\n status: typeof action.status === \"string\"\n ? {\n type: action.status,\n [action.status]: {},\n } as unknown as ActionTypeStatus\n : action.status,\n entities: action.entities,\n },\n },\n };\n}\n\nexport function extractAllowedValues(\n allowedValues: ActionParameterAllowedValues,\n): OntologyIrAllowedParameterValues {\n switch (allowedValues.type) {\n case \"oneOf\":\n return {\n type: \"oneOf\",\n oneOf: {\n type: \"oneOf\",\n oneOf: {\n labelledValues: allowedValues.oneOf,\n otherValueAllowed: {\n allowed: allowedValues.otherValueAllowed\n ?? false,\n },\n },\n },\n };\n case \"range\":\n const { min, max } = allowedValues;\n return {\n type: \"range\",\n range: {\n type: \"range\",\n range: {\n ...(min === undefined\n ? {}\n : { minimum: { inclusive: true, value: min } }),\n ...(max === undefined\n ? {}\n : { maximum: { inclusive: true, value: max } }),\n },\n },\n };\n case \"text\":\n const { minLength, maxLength, regex } = allowedValues;\n return {\n type: \"text\",\n text: {\n type: \"text\",\n text: {\n ...(minLength === undefined\n ? {}\n : { minLength: minLength }),\n ...(maxLength === undefined\n ? {}\n : { maxLength: maxLength }),\n ...(regex === undefined\n ? {}\n : { regex: { regex: regex, failureMessage: \"Invalid input\" } }),\n },\n },\n };\n case \"datetime\":\n const { minimum, maximum } = allowedValues;\n return {\n type: \"datetime\",\n datetime: {\n type: \"datetime\",\n datetime: {\n minimum,\n maximum,\n },\n },\n };\n case \"objectTypeReference\":\n return {\n type: \"objectTypeReference\",\n objectTypeReference: {\n type: \"objectTypeReference\",\n objectTypeReference: {\n interfaceTypeRids: allowedValues.interfaceTypes,\n },\n },\n };\n case \"redacted\":\n return {\n type: \"redacted\",\n redacted: {},\n };\n case \"geotimeSeriesReference\":\n return {\n type: \"geotimeSeriesReference\",\n geotimeSeriesReference: {\n type: \"geotimeSeries\",\n geotimeSeries: {},\n },\n };\n default:\n const k: Partial<OntologyIrAllowedParameterValues[\"type\"]> =\n allowedValues.type;\n return {\n type: k,\n [k]: {\n type: k,\n [k]: {},\n },\n } as unknown as OntologyIrAllowedParameterValues;\n // TODO(dpaquin): there's probably a TS clean way to do this\n }\n}\n\nexport function renderHintFromBaseType(\n parameter: ActionParameter,\n): ParameterRenderHint {\n // TODO(dpaquin): these are just guesses, we should find where they're actually defined\n const type = typeof parameter.type === \"string\"\n ? parameter.type\n : parameter.type.type;\n switch (type) {\n case \"boolean\":\n case \"booleanList\":\n return { type: \"checkbox\", checkbox: {} };\n case \"integer\":\n case \"integerList\":\n case \"long\":\n case \"longList\":\n case \"double\":\n case \"doubleList\":\n case \"decimal\":\n case \"decimalList\":\n return { type: \"numericInput\", numericInput: {} };\n case \"string\":\n case \"stringList\":\n case \"geohash\":\n case \"geohashList\":\n case \"geoshape\":\n case \"geoshapeList\":\n case \"objectSetRid\":\n return { type: \"textInput\", textInput: {} };\n case \"timestamp\":\n case \"timestampList\":\n case \"date\":\n case \"dateList\":\n return { type: \"dateTimePicker\", dateTimePicker: {} };\n case \"attachment\":\n case \"attachmentList\":\n return { type: \"filePicker\", filePicker: {} };\n case \"marking\":\n case \"markingList\":\n if (parameter.validation.allowedValues?.type === \"mandatoryMarking\") {\n return { type: \"mandatoryMarkingPicker\", mandatoryMarkingPicker: {} };\n } else if (parameter.validation.allowedValues?.type === \"cbacMarking\") {\n return { type: \"cbacMarkingPicker\", cbacMarkingPicker: {} };\n } else {\n throw new Error(\n `The allowed values for \"${parameter.displayName}\" are not compatible with the base parameter type`,\n );\n }\n case \"timeSeriesReference\":\n case \"objectReference\":\n case \"objectReferenceList\":\n case \"interfaceReference\":\n case \"interfaceReferenceList\":\n case \"objectTypeReference\":\n case \"mediaReference\":\n case \"mediaReferenceList\":\n case \"geotimeSeriesReference\":\n case \"geotimeSeriesReferenceList\":\n return { type: \"dropdown\", dropdown: {} };\n case \"struct\":\n case \"structList\":\n throw new Error(\"Structs are not supported yet\");\n default:\n throw new Error(`Unknown type ${type}`);\n }\n}\n\nexport function extractNamespace(apiName: string): string {\n return apiName.substring(0, apiName.lastIndexOf(\".\") + 1);\n}\n\nexport function withoutNamespace(apiName: string): string {\n const lastDot = apiName.lastIndexOf(\".\");\n if (lastDot === -1) {\n return apiName;\n }\n return apiName.substring(lastDot + 1);\n}\n\nfunction camel(str: string): string {\n if (!str) {\n return str;\n }\n let result = str.replace(/[-_]+(.)?/g, (_, c) => (c ? c.toUpperCase() : \"\"));\n result = result.charAt(0).toLowerCase() + result.slice(1);\n return result;\n}\n\n/**\n * Gets the TypeScript type name corresponding to an OntologyEntityTypeEnum value\n */\nfunction getEntityTypeName(type: string): string {\n return {\n [OntologyEntityTypeEnum.OBJECT_TYPE]: \"ObjectType\",\n [OntologyEntityTypeEnum.LINK_TYPE]: \"LinkType\",\n [OntologyEntityTypeEnum.INTERFACE_TYPE]: \"InterfaceType\",\n [OntologyEntityTypeEnum.SHARED_PROPERTY_TYPE]: \"SharedPropertyType\",\n [OntologyEntityTypeEnum.ACTION_TYPE]: \"ActionType\",\n [OntologyEntityTypeEnum.VALUE_TYPE]: \"ValueTypeDefinitionVersion\",\n }[type]!;\n}\n\nfunction writeDependencyFile(dependencyFile: string): void {\n fs.writeFileSync(dependencyFile, JSON.stringify(dependencies, null, 2));\n}\n\nfunction dependencyInjectionString(): string {\n const namespaceNoDot: string = namespace.endsWith(\".\")\n ? namespace.slice(0, -1)\n : namespace;\n\n return `import { addDependency } from \"@osdk/maker\";\n// @ts-ignore\naddDependency(\"${namespaceNoDot}\", new URL(import.meta.url).pathname);\n`;\n}\n\nexport function addNamespaceIfNone(apiName: string): string {\n return apiName.includes(\".\") ? apiName : namespace + apiName;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAgBA,OAAO,KAAKA,EAAE,MAAM,IAAI;AACxB,OAAO,KAAKC,IAAI,MAAM,MAAM;AAC5B,SAASC,uBAAuB,QAAQ,wDAAwD;AAChG,SAASC,qBAAqB,QAAQ,sDAAsD;AAC5F,SAASC,uBAAuB,QAAQ,wDAAwD;AAChG,SAASC,yBAAyB,QAAQ,0DAA0D;AACpG,SAASC,4BAA4B,QAAQ,6DAA6D;AAC1G,SAASC,sBAAsB,QAAQ,uDAAuD;AAI9F,SAASC,kBAAkB,QAAQ,uCAAuC;AAE1E,SAASC,sBAAsB,QAAQ,oCAAoC;AAG3E;AACA;AACA,OAAO,IAAIC,kBAAsC;;AAEjD;AACA;AACA,OAAO,IAAIC,aAAiC;;AAE5C;AACA;AACA,OAAO,IAAIC,YAAoC;;AAE/C;AACA,OAAO,IAAIC,SAAiB;AAE5B,OAAO,SAASC,cAAcA,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C;EACzD,OAAOyH,MAAM;AACf;;AAEA;AACA;AACA;AACA,SAASlI,iBAAiBA,CAAC0C,IAAY,EAAU;EAC/C,OAAO;IACL,CAACnG,sBAAsB,CAACqB,WAAW,GAAG,YAAY;IAClD,CAACrB,sBAAsB,CAACuB,SAAS,GAAG,UAAU;IAC9C,CAACvB,sBAAsB,CAACwB,cAAc,GAAG,eAAe;IACxD,CAACxB,sBAAsB,CAACyB,oBAAoB,GAAG,oBAAoB;IACnE,CAACzB,sBAAsB,CAACsB,WAAW,GAAG,YAAY;IAClD,CAACtB,sBAAsB,CAACQ,UAAU,GAAG;EACvC,CAAC,CAAC2F,IAAI,CAAC;AACT;AAEA,SAASrE,mBAAmBA,CAACd,cAAsB,EAAQ;EACzDzB,EAAE,CAAC4E,aAAa,CAACnD,cAAc,EAAE2C,IAAI,CAACC,SAAS,CAACzD,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AACzE;AAEA,SAASqE,yBAAyBA,CAAA,EAAW;EAC3C,MAAMuH,cAAsB,GAAG3L,SAAS,CAAC4L,QAAQ,CAAC,GAAG,CAAC,GAClD5L,SAAS,CAAC8D,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GACtB9D,SAAS;EAEb,OAAO;AACT;AACA,iBAAiB2L,cAAc;AAC/B,CAAC;AACD;AAEA,OAAO,SAASE,kBAAkBA,CAACxL,OAAe,EAAU;EAC1D,OAAOA,OAAO,CAACyL,QAAQ,CAAC,GAAG,CAAC,GAAGzL,OAAO,GAAGL,SAAS,GAAGK,OAAO;AAC9D","ignoreList":[]}
@@ -1938,11 +1938,11 @@
1938
1938
  "typeClasses": [],
1939
1939
  },
1940
1940
  "entities": {
1941
- "affectedInterfaceTypes": [],
1942
- "affectedLinkTypes": [],
1943
- "affectedObjectTypes": [
1941
+ "affectedInterfaceTypes": [
1944
1942
  "com.palantir.exampleInterface",
1945
1943
  ],
1944
+ "affectedLinkTypes": [],
1945
+ "affectedObjectTypes": [],
1946
1946
  "typeGroups": [],
1947
1947
  },
1948
1948
  "formContentOrdering": [],
@@ -2200,11 +2200,11 @@
2200
2200
  "typeClasses": [],
2201
2201
  },
2202
2202
  "entities": {
2203
- "affectedInterfaceTypes": [],
2204
- "affectedLinkTypes": [],
2205
- "affectedObjectTypes": [
2203
+ "affectedInterfaceTypes": [
2206
2204
  "com.palantir.exampleInterface",
2207
2205
  ],
2206
+ "affectedLinkTypes": [],
2207
+ "affectedObjectTypes": [],
2208
2208
  "typeGroups": [],
2209
2209
  },
2210
2210
  "formContentOrdering": [],
@@ -2462,11 +2462,11 @@
2462
2462
  "typeClasses": [],
2463
2463
  },
2464
2464
  "entities": {
2465
- "affectedInterfaceTypes": [],
2466
- "affectedLinkTypes": [],
2467
- "affectedObjectTypes": [
2465
+ "affectedInterfaceTypes": [
2468
2466
  "com.palantir.exampleInterface",
2469
2467
  ],
2468
+ "affectedLinkTypes": [],
2469
+ "affectedObjectTypes": [],
2470
2470
  "typeGroups": [],
2471
2471
  },
2472
2472
  "formContentOrdering": [],