@osdk/integration-testing 0.0.0 → 0.1.0

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 (192) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/bin/postinstall.mjs +15 -0
  3. package/build/browser/cli-service/CliServiceLauncher.js +220 -0
  4. package/build/browser/cli-service/CliServiceLauncher.js.map +1 -0
  5. package/build/browser/cli-service/FoundryCliService.js +168 -0
  6. package/build/browser/cli-service/FoundryCliService.js.map +1 -0
  7. package/build/browser/cli-service/OntologyServer.js +32 -0
  8. package/build/browser/cli-service/OntologyServer.js.map +1 -0
  9. package/build/browser/cli-service/ServiceDiscoverer.js +100 -0
  10. package/build/browser/cli-service/ServiceDiscoverer.js.map +1 -0
  11. package/build/browser/cli-service/StatusServer.js +91 -0
  12. package/build/browser/cli-service/StatusServer.js.map +1 -0
  13. package/build/browser/createIntegrationClient.js +67 -0
  14. package/build/browser/createIntegrationClient.js.map +1 -0
  15. package/build/browser/createIntegrationServer.js +115 -0
  16. package/build/browser/createIntegrationServer.js.map +1 -0
  17. package/build/browser/createSeedClient.js +77 -0
  18. package/build/browser/createSeedClient.js.map +1 -0
  19. package/build/browser/generated/cli/OntologySeedingService/setSeed.js +28 -0
  20. package/build/browser/generated/cli/OntologySeedingService/setSeed.js.map +1 -0
  21. package/build/browser/generated/cli/OntologySeedingService.js +19 -0
  22. package/build/browser/generated/cli/OntologySeedingService.js.map +1 -0
  23. package/build/browser/generated/cli/StatusService/getStatus.js +25 -0
  24. package/build/browser/generated/cli/StatusService/getStatus.js.map +1 -0
  25. package/build/browser/generated/cli/StatusService/publishStatus.js +26 -0
  26. package/build/browser/generated/cli/StatusService/publishStatus.js.map +1 -0
  27. package/build/browser/generated/cli/StatusService.js +20 -0
  28. package/build/browser/generated/cli/StatusService.js.map +1 -0
  29. package/build/browser/generated/cli/__components.js +2 -0
  30. package/build/browser/generated/cli/__components.js.map +1 -0
  31. package/build/browser/generated/cli/index.js +20 -0
  32. package/build/browser/generated/cli/index.js.map +1 -0
  33. package/build/browser/index.js +27 -0
  34. package/build/browser/index.js.map +1 -0
  35. package/build/browser/scripts/download.js +92 -0
  36. package/build/browser/scripts/download.js.map +1 -0
  37. package/build/browser/scripts/foundry-host.js +59 -0
  38. package/build/browser/scripts/foundry-host.js.map +1 -0
  39. package/build/browser/scripts/foundry-token.js +50 -0
  40. package/build/browser/scripts/foundry-token.js.map +1 -0
  41. package/build/browser/scripts/gitRemote.js +39 -0
  42. package/build/browser/scripts/gitRemote.js.map +1 -0
  43. package/build/browser/scripts/postinstall.js +38 -0
  44. package/build/browser/scripts/postinstall.js.map +1 -0
  45. package/build/browser/test/NoSpawnStatusServer.js +33 -0
  46. package/build/browser/test/NoSpawnStatusServer.js.map +1 -0
  47. package/build/browser/test/StubService.js +61 -0
  48. package/build/browser/test/StubService.js.map +1 -0
  49. package/build/browser/test/emptyOntologyMetadata.js +32 -0
  50. package/build/browser/test/emptyOntologyMetadata.js.map +1 -0
  51. package/build/browser/test/stubStatusServer.js +74 -0
  52. package/build/browser/test/stubStatusServer.js.map +1 -0
  53. package/build/browser/test/writeDiscoveryFile.js +39 -0
  54. package/build/browser/test/writeDiscoveryFile.js.map +1 -0
  55. package/build/browser/types.js +2 -0
  56. package/build/browser/types.js.map +1 -0
  57. package/build/browser/utils/empty-ontology-block.js +61 -0
  58. package/build/browser/utils/empty-ontology-block.js.map +1 -0
  59. package/build/browser/utils/foundry-cli.js +46 -0
  60. package/build/browser/utils/foundry-cli.js.map +1 -0
  61. package/build/browser/utils/process.js +26 -0
  62. package/build/browser/utils/process.js.map +1 -0
  63. package/build/browser/utils/service.js +33 -0
  64. package/build/browser/utils/service.js.map +1 -0
  65. package/build/cjs/index.cjs +841 -0
  66. package/build/cjs/index.cjs.map +1 -0
  67. package/build/cjs/index.d.cts +118 -0
  68. package/build/esm/cli-service/CliServiceLauncher.js +220 -0
  69. package/build/esm/cli-service/CliServiceLauncher.js.map +1 -0
  70. package/build/esm/cli-service/FoundryCliService.js +168 -0
  71. package/build/esm/cli-service/FoundryCliService.js.map +1 -0
  72. package/build/esm/cli-service/OntologyServer.js +32 -0
  73. package/build/esm/cli-service/OntologyServer.js.map +1 -0
  74. package/build/esm/cli-service/ServiceDiscoverer.js +100 -0
  75. package/build/esm/cli-service/ServiceDiscoverer.js.map +1 -0
  76. package/build/esm/cli-service/StatusServer.js +91 -0
  77. package/build/esm/cli-service/StatusServer.js.map +1 -0
  78. package/build/esm/createIntegrationClient.js +67 -0
  79. package/build/esm/createIntegrationClient.js.map +1 -0
  80. package/build/esm/createIntegrationServer.js +115 -0
  81. package/build/esm/createIntegrationServer.js.map +1 -0
  82. package/build/esm/createSeedClient.js +77 -0
  83. package/build/esm/createSeedClient.js.map +1 -0
  84. package/build/esm/generated/cli/OntologySeedingService/setSeed.js +28 -0
  85. package/build/esm/generated/cli/OntologySeedingService/setSeed.js.map +1 -0
  86. package/build/esm/generated/cli/OntologySeedingService.js +19 -0
  87. package/build/esm/generated/cli/OntologySeedingService.js.map +1 -0
  88. package/build/esm/generated/cli/StatusService/getStatus.js +25 -0
  89. package/build/esm/generated/cli/StatusService/getStatus.js.map +1 -0
  90. package/build/esm/generated/cli/StatusService/publishStatus.js +26 -0
  91. package/build/esm/generated/cli/StatusService/publishStatus.js.map +1 -0
  92. package/build/esm/generated/cli/StatusService.js +20 -0
  93. package/build/esm/generated/cli/StatusService.js.map +1 -0
  94. package/build/esm/generated/cli/__components.js +2 -0
  95. package/build/esm/generated/cli/__components.js.map +1 -0
  96. package/build/esm/generated/cli/index.js +20 -0
  97. package/build/esm/generated/cli/index.js.map +1 -0
  98. package/build/esm/index.js +27 -0
  99. package/build/esm/index.js.map +1 -0
  100. package/build/esm/scripts/download.js +92 -0
  101. package/build/esm/scripts/download.js.map +1 -0
  102. package/build/esm/scripts/foundry-host.js +59 -0
  103. package/build/esm/scripts/foundry-host.js.map +1 -0
  104. package/build/esm/scripts/foundry-token.js +50 -0
  105. package/build/esm/scripts/foundry-token.js.map +1 -0
  106. package/build/esm/scripts/gitRemote.js +39 -0
  107. package/build/esm/scripts/gitRemote.js.map +1 -0
  108. package/build/esm/scripts/postinstall.js +38 -0
  109. package/build/esm/scripts/postinstall.js.map +1 -0
  110. package/build/esm/test/NoSpawnStatusServer.js +33 -0
  111. package/build/esm/test/NoSpawnStatusServer.js.map +1 -0
  112. package/build/esm/test/StubService.js +61 -0
  113. package/build/esm/test/StubService.js.map +1 -0
  114. package/build/esm/test/emptyOntologyMetadata.js +32 -0
  115. package/build/esm/test/emptyOntologyMetadata.js.map +1 -0
  116. package/build/esm/test/stubStatusServer.js +74 -0
  117. package/build/esm/test/stubStatusServer.js.map +1 -0
  118. package/build/esm/test/writeDiscoveryFile.js +39 -0
  119. package/build/esm/test/writeDiscoveryFile.js.map +1 -0
  120. package/build/esm/types.js +2 -0
  121. package/build/esm/types.js.map +1 -0
  122. package/build/esm/utils/empty-ontology-block.js +61 -0
  123. package/build/esm/utils/empty-ontology-block.js.map +1 -0
  124. package/build/esm/utils/foundry-cli.js +46 -0
  125. package/build/esm/utils/foundry-cli.js.map +1 -0
  126. package/build/esm/utils/process.js +26 -0
  127. package/build/esm/utils/process.js.map +1 -0
  128. package/build/esm/utils/service.js +33 -0
  129. package/build/esm/utils/service.js.map +1 -0
  130. package/build/types/cli-service/CliServiceLauncher.d.ts +36 -0
  131. package/build/types/cli-service/CliServiceLauncher.d.ts.map +1 -0
  132. package/build/types/cli-service/FoundryCliService.d.ts +60 -0
  133. package/build/types/cli-service/FoundryCliService.d.ts.map +1 -0
  134. package/build/types/cli-service/OntologyServer.d.ts +10 -0
  135. package/build/types/cli-service/OntologyServer.d.ts.map +1 -0
  136. package/build/types/cli-service/ServiceDiscoverer.d.ts +22 -0
  137. package/build/types/cli-service/ServiceDiscoverer.d.ts.map +1 -0
  138. package/build/types/cli-service/StatusServer.d.ts +17 -0
  139. package/build/types/cli-service/StatusServer.d.ts.map +1 -0
  140. package/build/types/createIntegrationClient.d.ts +2 -0
  141. package/build/types/createIntegrationClient.d.ts.map +1 -0
  142. package/build/types/createIntegrationServer.d.ts +2 -0
  143. package/build/types/createIntegrationServer.d.ts.map +1 -0
  144. package/build/types/createSeedClient.d.ts +9 -0
  145. package/build/types/createSeedClient.d.ts.map +1 -0
  146. package/build/types/generated/cli/OntologySeedingService/setSeed.d.ts +9 -0
  147. package/build/types/generated/cli/OntologySeedingService/setSeed.d.ts.map +1 -0
  148. package/build/types/generated/cli/OntologySeedingService.d.ts +1 -0
  149. package/build/types/generated/cli/OntologySeedingService.d.ts.map +1 -0
  150. package/build/types/generated/cli/StatusService/getStatus.d.ts +6 -0
  151. package/build/types/generated/cli/StatusService/getStatus.d.ts.map +1 -0
  152. package/build/types/generated/cli/StatusService/publishStatus.d.ts +7 -0
  153. package/build/types/generated/cli/StatusService/publishStatus.d.ts.map +1 -0
  154. package/build/types/generated/cli/StatusService.d.ts +2 -0
  155. package/build/types/generated/cli/StatusService.d.ts.map +1 -0
  156. package/build/types/generated/cli/__components.d.ts +189 -0
  157. package/build/types/generated/cli/__components.d.ts.map +1 -0
  158. package/build/types/generated/cli/index.d.ts +3 -0
  159. package/build/types/generated/cli/index.d.ts.map +1 -0
  160. package/build/types/index.d.ts +10 -0
  161. package/build/types/index.d.ts.map +1 -0
  162. package/build/types/scripts/download.d.ts +6 -0
  163. package/build/types/scripts/download.d.ts.map +1 -0
  164. package/build/types/scripts/foundry-host.d.ts +7 -0
  165. package/build/types/scripts/foundry-host.d.ts.map +1 -0
  166. package/build/types/scripts/foundry-token.d.ts +5 -0
  167. package/build/types/scripts/foundry-token.d.ts.map +1 -0
  168. package/build/types/scripts/gitRemote.d.ts +9 -0
  169. package/build/types/scripts/gitRemote.d.ts.map +1 -0
  170. package/build/types/scripts/postinstall.d.ts +1 -0
  171. package/build/types/scripts/postinstall.d.ts.map +1 -0
  172. package/build/types/test/NoSpawnStatusServer.d.ts +11 -0
  173. package/build/types/test/NoSpawnStatusServer.d.ts.map +1 -0
  174. package/build/types/test/StubService.d.ts +23 -0
  175. package/build/types/test/StubService.d.ts.map +1 -0
  176. package/build/types/test/emptyOntologyMetadata.d.ts +3 -0
  177. package/build/types/test/emptyOntologyMetadata.d.ts.map +1 -0
  178. package/build/types/test/stubStatusServer.d.ts +14 -0
  179. package/build/types/test/stubStatusServer.d.ts.map +1 -0
  180. package/build/types/test/writeDiscoveryFile.d.ts +8 -0
  181. package/build/types/test/writeDiscoveryFile.d.ts.map +1 -0
  182. package/build/types/types.d.ts +104 -0
  183. package/build/types/types.d.ts.map +1 -0
  184. package/build/types/utils/empty-ontology-block.d.ts +4 -0
  185. package/build/types/utils/empty-ontology-block.d.ts.map +1 -0
  186. package/build/types/utils/foundry-cli.d.ts +13 -0
  187. package/build/types/utils/foundry-cli.d.ts.map +1 -0
  188. package/build/types/utils/process.d.ts +1 -0
  189. package/build/types/utils/process.d.ts.map +1 -0
  190. package/build/types/utils/service.d.ts +4 -0
  191. package/build/types/utils/service.d.ts.map +1 -0
  192. package/package.json +93 -1
@@ -0,0 +1,39 @@
1
+ /*
2
+ * Copyright 2026 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import { mkdir, writeFile } from "node:fs/promises";
18
+ import { join } from "node:path";
19
+ import { discoveryFileName } from "../utils/service.js";
20
+
21
+ /**
22
+ * Write a discovery file the way a running service would.
23
+ *
24
+ * Defaults `pid` to this process so the record reads as live; pass a dead pid
25
+ * to exercise staleness.
26
+ */
27
+ export const writeDiscoveryFile = async (projectDir, name, discovery) => {
28
+ const dir = join(projectDir, ".palantir");
29
+ await mkdir(dir, {
30
+ recursive: true
31
+ });
32
+ const contents = {
33
+ pid: process.pid,
34
+ processStartTimeSecs: Math.floor(Date.now() / 1000),
35
+ ...discovery
36
+ };
37
+ await writeFile(join(dir, discoveryFileName(name)), JSON.stringify(contents, null, 2), "utf-8");
38
+ };
39
+ //# sourceMappingURL=writeDiscoveryFile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"writeDiscoveryFile.js","names":["mkdir","writeFile","join","discoveryFileName","writeDiscoveryFile","projectDir","name","discovery","dir","recursive","contents","pid","process","processStartTimeSecs","Math","floor","Date","now","JSON","stringify"],"sources":["writeDiscoveryFile.ts"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { mkdir, writeFile } from \"node:fs/promises\";\nimport { join } from \"node:path\";\n\nimport type {\n ComponentDiscovery,\n ServiceName,\n} from \"../generated/cli/index.js\";\nimport { discoveryFileName } from \"../utils/service.js\";\n\n/**\n * Write a discovery file the way a running service would.\n *\n * Defaults `pid` to this process so the record reads as live; pass a dead pid\n * to exercise staleness.\n */\nexport const writeDiscoveryFile = async (\n projectDir: string,\n name: ServiceName,\n discovery: Partial<ComponentDiscovery> & Pick<ComponentDiscovery, \"url\">,\n): Promise<void> => {\n const dir = join(projectDir, \".palantir\");\n await mkdir(dir, { recursive: true });\n const contents: ComponentDiscovery = {\n pid: process.pid,\n processStartTimeSecs: Math.floor(Date.now() / 1000),\n ...discovery,\n };\n await writeFile(\n join(dir, discoveryFileName(name)),\n JSON.stringify(contents, null, 2),\n \"utf-8\",\n );\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,KAAK,EAAEC,SAAS,QAAQ,kBAAkB;AACnD,SAASC,IAAI,QAAQ,WAAW;AAMhC,SAASC,iBAAiB,QAAQ,qBAAqB;;AAEvD;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,kBAAkB,GAAG,MAAAA,CAChCC,UAAkB,EAClBC,IAAiB,EACjBC,SAAwE,KACtD;EAClB,MAAMC,GAAG,GAAGN,IAAI,CAACG,UAAU,EAAE,WAAW,CAAC;EACzC,MAAML,KAAK,CAACQ,GAAG,EAAE;IAAEC,SAAS,EAAE;EAAK,CAAC,CAAC;EACrC,MAAMC,QAA4B,GAAG;IACnCC,GAAG,EAAEC,OAAO,CAACD,GAAG;IAChBE,oBAAoB,EAAEC,IAAI,CAACC,KAAK,CAACC,IAAI,CAACC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC;IACnD,GAAGV;EACL,CAAC;EACD,MAAMN,SAAS,CACbC,IAAI,CAACM,GAAG,EAAEL,iBAAiB,CAACG,IAAI,CAAC,CAAC,EAClCY,IAAI,CAACC,SAAS,CAACT,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,EACjC,OACF,CAAC;AACH,CAAC","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","names":[],"sources":["types.ts"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { LinkTypeApiNamesFor, PrimaryKeyType } from \"@osdk/api\";\nimport type { Client, ObjectTypeDefinition } from \"@osdk/client\";\nimport type { OntologyFullMetadata } from \"@osdk/foundry.ontologies\";\nimport type {\n LinkTargets,\n SeedFunction,\n SeedOutput,\n SeedProps,\n SeedRef,\n} from \"@osdk/seed-helpers\";\nimport type { MockClient } from \"@osdk/unit-testing\";\n\nexport type IntegrationClient = Client & {\n // local ontology does not have the ability to support function queries at the moment.\n whenQuery: MockClient[\"whenQuery\"];\n clearStubs(): MockClient[\"clearStubs\"];\n};\n\nexport interface IntegrationClientConfig {\n baseUrl: string;\n metadata: OntologyFullMetadata;\n caCertPath?: string;\n}\n\nexport interface IntegrationServerConfig {\n /** Path to a prebuilt ontology metadata JSON. */\n metadata: OntologyFullMetadata;\n /** Path to the `foundry` binary. Defaults to `foundry` on `PATH`. */\n foundryCliPath?: string;\n /**\n * Directory to create this server's run directory in. Each server gets its\n * own `.test-run-*` beneath it, removed on {@link IntegrationServer.stop}, so\n * servers sharing a `projectPath` stay isolated. Must already exist; defaults\n * to the working directory.\n */\n projectPath?: string;\n}\n\nexport interface IntegrationServer {\n start(): Promise<void>;\n stop(): Promise<void>;\n getOntologyUrl(): string | undefined;\n getSeedClient(): Promise<SeedClient>;\n getClient(): Promise<IntegrationClient>;\n}\n\nexport type SeedClient = {\n /**\n * Transactional interface to SeedBuilder\n * Applies changes if function is provided, calls .addAll(seed) if SeedOutput is provided.\n */\n <T = void>(seed: SeedFunction<T> | SeedOutput): Promise<T>;\n /**\n * Returns a reference to an object already in the seed, or `undefined` if none\n * exists. Read-only: nothing is applied to the server.\n * @param o Object type definition\n * @param primaryKey Primary key value of the object\n * @returns Reference to the object, or `undefined` if not found\n */\n ref<Q extends ObjectTypeDefinition>(\n o: Q,\n primaryKey: PrimaryKeyType<Q>,\n ): SeedRef<Q> | undefined;\n /**\n * Replaces the entire seed with `seed` and applies it, discarding everything\n * accumulated so far. Clears the seed when called with no argument.\n * @param seed Seed output to reset to, or `undefined` to clear\n */\n set(seed?: SeedOutput): Promise<void>;\n /**\n * Merges an existing seed output into the current seed and applies it.\n * @param seed Seed output to merge in; must match the metadata the client was created with\n */\n addAll(seed: SeedOutput): Promise<void>;\n /**\n * Creates an object of the given type and applies the seed.\n * @param o Object type definition\n * @param props Object properties, including its primary key\n * @returns Reference to the created object\n * @throws {Error} if an object of that type already exists with the same primary key\n */\n create<Q extends ObjectTypeDefinition>(\n o: Q,\n props: SeedProps<Q>,\n ): Promise<SeedRef<Q>>;\n /**\n * Merges `props` into the referenced object and applies the seed. Properties not\n * included are left unchanged; the object is created if it does not yet exist.\n * @param ref Reference to the object to update\n * @param props Partial object properties to merge in, excluding the primary key\n * @returns The same reference passed in\n */\n update<Q extends ObjectTypeDefinition>(\n ref: SeedRef<Q>,\n props: Partial<\n Omit<SeedProps<Q>, Exclude<Q[\"primaryKeyApiName\"], undefined>>\n >,\n ): Promise<SeedRef<Q>>;\n /**\n * Removes the referenced object from the seed and applies it. No-op if the object\n * does not exist.\n * @param ref Reference to the object to delete\n */\n delete<Q extends ObjectTypeDefinition>(ref: SeedRef<Q>): Promise<void>;\n /**\n * Links the source object to one or more targets via the given link type and\n * applies the seed. Re-adding an existing link is a no-op.\n * @param source Reference to the source object\n * @param apiName Link type API name\n * @param target Reference (or references) to the target object(s)\n */\n link<Q extends ObjectTypeDefinition, A extends LinkTypeApiNamesFor<Q>>(\n source: SeedRef<Q>,\n apiName: A,\n target: LinkTargets<Q, A>,\n ): Promise<void>;\n /**\n * Removes links from the source object to the given targets via the link type and\n * applies the seed. No-op if no matching links exist.\n * @param source Reference to the source object\n * @param apiName Link type API name\n * @param target Reference (or references) to the target object(s)\n */\n unlink<Q extends ObjectTypeDefinition, A extends LinkTypeApiNamesFor<Q>>(\n source: SeedRef<Q>,\n apiName: A,\n target: LinkTargets<Q, A>,\n ): Promise<void>;\n};\n"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,61 @@
1
+ /*
2
+ * Copyright 2026 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ export const EMPTY_ONTOLOGY_BLOCK_DATA = {
18
+ objectTypes: {},
19
+ sharedPropertyTypes: {},
20
+ interfaceTypes: {},
21
+ linkTypes: {},
22
+ actionTypes: {},
23
+ blockPermissionInformation: {
24
+ actionTypes: {},
25
+ objectTypes: {},
26
+ linkTypes: {},
27
+ interfaceTypes: {},
28
+ sharedPropertyTypes: {}
29
+ },
30
+ blockOutputCompassLocations: {},
31
+ knownIdentifiers: {
32
+ actionParameterIds: {},
33
+ actionParameters: {},
34
+ actionTypes: {},
35
+ datasourceColumns: {},
36
+ datasources: {},
37
+ filesDatasources: {},
38
+ functions: {},
39
+ geotimeSeriesSyncs: {},
40
+ groupIds: {},
41
+ interfaceActionTypeConstraints: {},
42
+ interfaceLinkTypes: {},
43
+ interfaceParameterConstraints: {},
44
+ interfacePropertyTypes: {},
45
+ interfaceTypes: {},
46
+ linkTypeIds: {},
47
+ linkTypes: {},
48
+ markings: {},
49
+ objectTypeIds: {},
50
+ objectTypes: {},
51
+ propertyTypeIds: {},
52
+ propertyTypes: {},
53
+ sharedPropertyTypes: {},
54
+ timeSeriesSyncs: {},
55
+ valueTypes: {},
56
+ webhooks: {},
57
+ workshopModules: {}
58
+ },
59
+ ruleSets: {}
60
+ };
61
+ //# sourceMappingURL=empty-ontology-block.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"empty-ontology-block.js","names":["EMPTY_ONTOLOGY_BLOCK_DATA","objectTypes","sharedPropertyTypes","interfaceTypes","linkTypes","actionTypes","blockPermissionInformation","blockOutputCompassLocations","knownIdentifiers","actionParameterIds","actionParameters","datasourceColumns","datasources","filesDatasources","functions","geotimeSeriesSyncs","groupIds","interfaceActionTypeConstraints","interfaceLinkTypes","interfaceParameterConstraints","interfacePropertyTypes","linkTypeIds","markings","objectTypeIds","propertyTypeIds","propertyTypes","timeSeriesSyncs","valueTypes","webhooks","workshopModules","ruleSets"],"sources":["empty-ontology-block.ts"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { PreviewOntologyIrConverter } from \"@osdk/generator-converters.preview\";\n\ntype OntologyBlockDataV2 = Parameters<\n typeof PreviewOntologyIrConverter.getPreviewFullMetadataFromBlockData\n>[0];\n\nexport const EMPTY_ONTOLOGY_BLOCK_DATA: OntologyBlockDataV2 = {\n objectTypes: {},\n sharedPropertyTypes: {},\n interfaceTypes: {},\n linkTypes: {},\n actionTypes: {},\n blockPermissionInformation: {\n actionTypes: {},\n objectTypes: {},\n linkTypes: {},\n interfaceTypes: {},\n sharedPropertyTypes: {},\n },\n blockOutputCompassLocations: {},\n knownIdentifiers: {\n actionParameterIds: {},\n actionParameters: {},\n actionTypes: {},\n datasourceColumns: {},\n datasources: {},\n filesDatasources: {},\n functions: {},\n geotimeSeriesSyncs: {},\n groupIds: {},\n interfaceActionTypeConstraints: {},\n interfaceLinkTypes: {},\n interfaceParameterConstraints: {},\n interfacePropertyTypes: {},\n interfaceTypes: {},\n linkTypeIds: {},\n linkTypes: {},\n markings: {},\n objectTypeIds: {},\n objectTypes: {},\n propertyTypeIds: {},\n propertyTypes: {},\n sharedPropertyTypes: {},\n timeSeriesSyncs: {},\n valueTypes: {},\n webhooks: {},\n workshopModules: {},\n },\n ruleSets: {},\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAQA,OAAO,MAAMA,yBAA8C,GAAG;EAC5DC,WAAW,EAAE,CAAC,CAAC;EACfC,mBAAmB,EAAE,CAAC,CAAC;EACvBC,cAAc,EAAE,CAAC,CAAC;EAClBC,SAAS,EAAE,CAAC,CAAC;EACbC,WAAW,EAAE,CAAC,CAAC;EACfC,0BAA0B,EAAE;IAC1BD,WAAW,EAAE,CAAC,CAAC;IACfJ,WAAW,EAAE,CAAC,CAAC;IACfG,SAAS,EAAE,CAAC,CAAC;IACbD,cAAc,EAAE,CAAC,CAAC;IAClBD,mBAAmB,EAAE,CAAC;EACxB,CAAC;EACDK,2BAA2B,EAAE,CAAC,CAAC;EAC/BC,gBAAgB,EAAE;IAChBC,kBAAkB,EAAE,CAAC,CAAC;IACtBC,gBAAgB,EAAE,CAAC,CAAC;IACpBL,WAAW,EAAE,CAAC,CAAC;IACfM,iBAAiB,EAAE,CAAC,CAAC;IACrBC,WAAW,EAAE,CAAC,CAAC;IACfC,gBAAgB,EAAE,CAAC,CAAC;IACpBC,SAAS,EAAE,CAAC,CAAC;IACbC,kBAAkB,EAAE,CAAC,CAAC;IACtBC,QAAQ,EAAE,CAAC,CAAC;IACZC,8BAA8B,EAAE,CAAC,CAAC;IAClCC,kBAAkB,EAAE,CAAC,CAAC;IACtBC,6BAA6B,EAAE,CAAC,CAAC;IACjCC,sBAAsB,EAAE,CAAC,CAAC;IAC1BjB,cAAc,EAAE,CAAC,CAAC;IAClBkB,WAAW,EAAE,CAAC,CAAC;IACfjB,SAAS,EAAE,CAAC,CAAC;IACbkB,QAAQ,EAAE,CAAC,CAAC;IACZC,aAAa,EAAE,CAAC,CAAC;IACjBtB,WAAW,EAAE,CAAC,CAAC;IACfuB,eAAe,EAAE,CAAC,CAAC;IACnBC,aAAa,EAAE,CAAC,CAAC;IACjBvB,mBAAmB,EAAE,CAAC,CAAC;IACvBwB,eAAe,EAAE,CAAC,CAAC;IACnBC,UAAU,EAAE,CAAC,CAAC;IACdC,QAAQ,EAAE,CAAC,CAAC;IACZC,eAAe,EAAE,CAAC;EACpB,CAAC;EACDC,QAAQ,EAAE,CAAC;AACb,CAAC","ignoreList":[]}
@@ -0,0 +1,46 @@
1
+ /*
2
+ * Copyright 2026 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import { exec } from "node:child_process";
18
+ import { promisify } from "node:util";
19
+ import { gte, valid } from "semver";
20
+ export const MIN_FOUNDRY_CLI_VERSION = "0.224.0";
21
+ const FOUNDRY_VERSION_PATTERN = /cli (\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?)/u;
22
+ const parseFoundryVersion = stdout => stdout.trim().match(FOUNDRY_VERSION_PATTERN)?.[1];
23
+ const versionIsAtMinimum = (version, min) => valid(version) != null && valid(min) != null && gte(version, min);
24
+ const execAsync = promisify(exec);
25
+ export const checkFoundryCliVersion = () => {
26
+ return execAsync("which foundry").then(() => execAsync("foundry --version")).then(({
27
+ stdout
28
+ }) => {
29
+ const version = parseFoundryVersion(stdout);
30
+ if (!version) return {
31
+ type: "version-error"
32
+ };
33
+ const isMin = versionIsAtMinimum(version, MIN_FOUNDRY_CLI_VERSION);
34
+ if (!isMin) return {
35
+ type: "version-incompatible",
36
+ version
37
+ };
38
+ return {
39
+ type: "installed",
40
+ version
41
+ };
42
+ }).catch(() => ({
43
+ type: "not-found"
44
+ }));
45
+ };
46
+ //# sourceMappingURL=foundry-cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"foundry-cli.js","names":["exec","promisify","gte","valid","MIN_FOUNDRY_CLI_VERSION","FOUNDRY_VERSION_PATTERN","parseFoundryVersion","stdout","trim","match","versionIsAtMinimum","version","min","execAsync","checkFoundryCliVersion","then","type","isMin","catch"],"sources":["foundry-cli.ts"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { exec } from \"node:child_process\";\nimport { promisify } from \"node:util\";\n\nimport { gte, valid } from \"semver\";\n\nexport const MIN_FOUNDRY_CLI_VERSION = \"0.224.0\";\n\nconst FOUNDRY_VERSION_PATTERN =\n /cli (\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z.-]+)?(?:\\+[0-9A-Za-z.-]+)?)/u;\n\nexport type FoundryProbeResult =\n | {\n type: \"installed\";\n version: string;\n }\n | {\n type: \"version-incompatible\";\n version: string;\n }\n | {\n type: \"version-error\";\n }\n | {\n type: \"not-found\";\n };\n\nconst parseFoundryVersion = (stdout: string): string | undefined =>\n stdout.trim().match(FOUNDRY_VERSION_PATTERN)?.[1];\n\nconst versionIsAtMinimum = (version: string, min: string): boolean =>\n valid(version) != null && valid(min) != null && gte(version, min);\n\nconst execAsync = promisify(exec);\n\nexport const checkFoundryCliVersion = (): Promise<FoundryProbeResult> => {\n return execAsync(\"which foundry\")\n .then(() => execAsync(\"foundry --version\"))\n .then<FoundryProbeResult>(({ stdout }) => {\n const version = parseFoundryVersion(stdout);\n if (!version) return { type: \"version-error\" };\n const isMin = versionIsAtMinimum(version, MIN_FOUNDRY_CLI_VERSION);\n if (!isMin) return { type: \"version-incompatible\", version };\n return { type: \"installed\", version };\n })\n .catch<FoundryProbeResult>(() => ({ type: \"not-found\" }));\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAI,QAAQ,oBAAoB;AACzC,SAASC,SAAS,QAAQ,WAAW;AAErC,SAASC,GAAG,EAAEC,KAAK,QAAQ,QAAQ;AAEnC,OAAO,MAAMC,uBAAuB,GAAG,SAAS;AAEhD,MAAMC,uBAAuB,GAC3B,+DAA+D;AAkBjE,MAAMC,mBAAmB,GAAIC,MAAc,IACzCA,MAAM,CAACC,IAAI,CAAC,CAAC,CAACC,KAAK,CAACJ,uBAAuB,CAAC,GAAG,CAAC,CAAC;AAEnD,MAAMK,kBAAkB,GAAGA,CAACC,OAAe,EAAEC,GAAW,KACtDT,KAAK,CAACQ,OAAO,CAAC,IAAI,IAAI,IAAIR,KAAK,CAACS,GAAG,CAAC,IAAI,IAAI,IAAIV,GAAG,CAACS,OAAO,EAAEC,GAAG,CAAC;AAEnE,MAAMC,SAAS,GAAGZ,SAAS,CAACD,IAAI,CAAC;AAEjC,OAAO,MAAMc,sBAAsB,GAAGA,CAAA,KAAmC;EACvE,OAAOD,SAAS,CAAC,eAAe,CAAC,CAC9BE,IAAI,CAAC,MAAMF,SAAS,CAAC,mBAAmB,CAAC,CAAC,CAC1CE,IAAI,CAAqB,CAAC;IAAER;EAAO,CAAC,KAAK;IACxC,MAAMI,OAAO,GAAGL,mBAAmB,CAACC,MAAM,CAAC;IAC3C,IAAI,CAACI,OAAO,EAAE,OAAO;MAAEK,IAAI,EAAE;IAAgB,CAAC;IAC9C,MAAMC,KAAK,GAAGP,kBAAkB,CAACC,OAAO,EAAEP,uBAAuB,CAAC;IAClE,IAAI,CAACa,KAAK,EAAE,OAAO;MAAED,IAAI,EAAE,sBAAsB;MAAEL;IAAQ,CAAC;IAC5D,OAAO;MAAEK,IAAI,EAAE,WAAW;MAAEL;IAAQ,CAAC;EACvC,CAAC,CAAC,CACDO,KAAK,CAAqB,OAAO;IAAEF,IAAI,EAAE;EAAY,CAAC,CAAC,CAAC;AAC7D,CAAC","ignoreList":[]}
@@ -0,0 +1,26 @@
1
+ /*
2
+ * Copyright 2026 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ export const isProcessAlive = pid => {
18
+ try {
19
+ process.kill(pid, 0);
20
+ return true;
21
+ } catch (err) {
22
+ // EPERM means the process exists but is owned by another user.
23
+ return err.code === "EPERM";
24
+ }
25
+ };
26
+ //# sourceMappingURL=process.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"process.js","names":["isProcessAlive","pid","process","kill","err","code"],"sources":["process.ts"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const isProcessAlive = (pid: number): boolean => {\n try {\n process.kill(pid, 0);\n return true;\n } catch (err) {\n // EPERM means the process exists but is owned by another user.\n return (err as NodeJS.ErrnoException).code === \"EPERM\";\n }\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,MAAMA,cAAc,GAAIC,GAAW,IAAc;EACtD,IAAI;IACFC,OAAO,CAACC,IAAI,CAACF,GAAG,EAAE,CAAC,CAAC;IACpB,OAAO,IAAI;EACb,CAAC,CAAC,OAAOG,GAAG,EAAE;IACZ;IACA,OAAQA,GAAG,CAA2BC,IAAI,KAAK,OAAO;EACxD;AACF,CAAC","ignoreList":[]}
@@ -0,0 +1,33 @@
1
+ /*
2
+ * Copyright 2026 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ const SERVICE_FILE_NAMES = {
18
+ ONTOLOGY: "ontology",
19
+ TYPESCRIPT_FUNCTIONS: "typescript-functions",
20
+ PYTHON_FUNCTIONS: "python-functions",
21
+ APP: "app",
22
+ STATUS_SERVER: "status-server",
23
+ PLATFORM_API_PROXY: "platform-api-proxy"
24
+ };
25
+ const SERVICE_NAMES_BY_FILE_NAME = new Map(Object.entries(SERVICE_FILE_NAMES).map(([name, stem]) => [stem, name]));
26
+ export const serviceNameFromFileName = fileName => {
27
+ const name = fileName.match(/^\.?(?<name>.+)-discovery\.json$/u)?.groups?.name;
28
+ return name === undefined ? undefined : SERVICE_NAMES_BY_FILE_NAME.get(name);
29
+ };
30
+
31
+ /** The name a running service publishes its discovery record under. */
32
+ export const discoveryFileName = name => `.${SERVICE_FILE_NAMES[name]}-discovery.json`;
33
+ //# sourceMappingURL=service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"service.js","names":["SERVICE_FILE_NAMES","ONTOLOGY","TYPESCRIPT_FUNCTIONS","PYTHON_FUNCTIONS","APP","STATUS_SERVER","PLATFORM_API_PROXY","SERVICE_NAMES_BY_FILE_NAME","Map","Object","entries","map","name","stem","serviceNameFromFileName","fileName","match","groups","undefined","get","discoveryFileName"],"sources":["service.ts"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { ServiceName } from \"../generated/cli/__components.js\";\n\nconst SERVICE_FILE_NAMES = {\n ONTOLOGY: \"ontology\",\n TYPESCRIPT_FUNCTIONS: \"typescript-functions\",\n PYTHON_FUNCTIONS: \"python-functions\",\n APP: \"app\",\n STATUS_SERVER: \"status-server\",\n PLATFORM_API_PROXY: \"platform-api-proxy\",\n} as const satisfies Record<ServiceName, string>;\n\nconst SERVICE_NAMES_BY_FILE_NAME = new Map<string, ServiceName>(\n Object.entries(SERVICE_FILE_NAMES).map(([name, stem]) => [\n stem,\n name as ServiceName,\n ]),\n);\n\nexport const serviceNameFromFileName = (\n fileName: string,\n): ServiceName | undefined => {\n const name = fileName.match(/^\\.?(?<name>.+)-discovery\\.json$/u)?.groups\n ?.name;\n return name === undefined ? undefined : SERVICE_NAMES_BY_FILE_NAME.get(name);\n};\n\n/** The name a running service publishes its discovery record under. */\nexport const discoveryFileName = (name: ServiceName): string =>\n `.${SERVICE_FILE_NAMES[name]}-discovery.json`;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,MAAMA,kBAAkB,GAAG;EACzBC,QAAQ,EAAE,UAAU;EACpBC,oBAAoB,EAAE,sBAAsB;EAC5CC,gBAAgB,EAAE,kBAAkB;EACpCC,GAAG,EAAE,KAAK;EACVC,aAAa,EAAE,eAAe;EAC9BC,kBAAkB,EAAE;AACtB,CAAgD;AAEhD,MAAMC,0BAA0B,GAAG,IAAIC,GAAG,CACxCC,MAAM,CAACC,OAAO,CAACV,kBAAkB,CAAC,CAACW,GAAG,CAAC,CAAC,CAACC,IAAI,EAAEC,IAAI,CAAC,KAAK,CACvDA,IAAI,EACJD,IAAI,CACL,CACH,CAAC;AAED,OAAO,MAAME,uBAAuB,GAClCC,QAAgB,IACY;EAC5B,MAAMH,IAAI,GAAGG,QAAQ,CAACC,KAAK,CAAC,mCAAmC,CAAC,EAAEC,MAAM,EACpEL,IAAI;EACR,OAAOA,IAAI,KAAKM,SAAS,GAAGA,SAAS,GAAGX,0BAA0B,CAACY,GAAG,CAACP,IAAI,CAAC;AAC9E,CAAC;;AAED;AACA,OAAO,MAAMQ,iBAAiB,GAAIR,IAAiB,IACjD,IAAIZ,kBAAkB,CAACY,IAAI,CAAC,iBAAiB","ignoreList":[]}