@osdk/functions 1.6.0-beta.2 → 1.6.0-beta.4

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 (66) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/build/browser/aliases/custom.js +26 -0
  3. package/build/browser/aliases/custom.js.map +1 -0
  4. package/build/browser/aliases/environment.js +48 -0
  5. package/build/browser/aliases/environment.js.map +1 -0
  6. package/build/browser/aliases/index.js +19 -0
  7. package/build/browser/aliases/index.js.map +1 -0
  8. package/build/browser/aliases/loaders.js +66 -0
  9. package/build/browser/aliases/loaders.js.map +1 -0
  10. package/build/browser/aliases/model.js +26 -0
  11. package/build/browser/aliases/model.js.map +1 -0
  12. package/build/browser/aliases/types.js +30 -0
  13. package/build/browser/aliases/types.js.map +1 -0
  14. package/build/browser/edits/EditBatch.js.map +1 -1
  15. package/build/browser/index.js +1 -0
  16. package/build/browser/index.js.map +1 -1
  17. package/build/cjs/{EditBatch-CwPxevhT.d.cts → EditBatch-DenXqhoa.d.cts} +2 -2
  18. package/build/cjs/index.cjs +133 -0
  19. package/build/cjs/index.cjs.map +1 -1
  20. package/build/cjs/index.d.cts +21 -2
  21. package/build/cjs/public/experimental.d.cts +1 -1
  22. package/build/cjs/public/unstable-do-not-use.d.cts +1 -1
  23. package/build/esm/aliases/custom.js +26 -0
  24. package/build/esm/aliases/custom.js.map +1 -0
  25. package/build/esm/aliases/environment.js +48 -0
  26. package/build/esm/aliases/environment.js.map +1 -0
  27. package/build/esm/aliases/index.js +19 -0
  28. package/build/esm/aliases/index.js.map +1 -0
  29. package/build/esm/aliases/loaders.js +66 -0
  30. package/build/esm/aliases/loaders.js.map +1 -0
  31. package/build/esm/aliases/model.js +26 -0
  32. package/build/esm/aliases/model.js.map +1 -0
  33. package/build/esm/aliases/types.js +30 -0
  34. package/build/esm/aliases/types.js.map +1 -0
  35. package/build/esm/edits/EditBatch.js.map +1 -1
  36. package/build/esm/index.js +1 -0
  37. package/build/esm/index.js.map +1 -1
  38. package/build/types/aliases/custom.d.ts +3 -0
  39. package/build/types/aliases/custom.d.ts.map +1 -0
  40. package/build/types/aliases/environment.d.ts +6 -0
  41. package/build/types/aliases/environment.d.ts.map +1 -0
  42. package/build/types/aliases/index.d.ts +2 -0
  43. package/build/types/aliases/index.d.ts.map +1 -0
  44. package/build/types/aliases/loaders.d.ts +3 -0
  45. package/build/types/aliases/loaders.d.ts.map +1 -0
  46. package/build/types/aliases/model.d.ts +3 -0
  47. package/build/types/aliases/model.d.ts.map +1 -0
  48. package/build/types/aliases/types.d.ts +40 -0
  49. package/build/types/aliases/types.d.ts.map +1 -0
  50. package/build/types/edits/EditBatch.d.ts +2 -2
  51. package/build/types/edits/EditBatch.d.ts.map +1 -1
  52. package/build/types/index.d.ts +1 -0
  53. package/build/types/index.d.ts.map +1 -1
  54. package/package.json +4 -4
  55. package/build/browser/edits/createEditBatch.test.js +0 -519
  56. package/build/browser/edits/createEditBatch.test.js.map +0 -1
  57. package/build/browser/transactions/EditRequestManager.test.js +0 -311
  58. package/build/browser/transactions/EditRequestManager.test.js.map +0 -1
  59. package/build/esm/edits/createEditBatch.test.js +0 -519
  60. package/build/esm/edits/createEditBatch.test.js.map +0 -1
  61. package/build/esm/transactions/EditRequestManager.test.js +0 -311
  62. package/build/esm/transactions/EditRequestManager.test.js.map +0 -1
  63. package/build/types/edits/createEditBatch.test.d.ts +0 -1
  64. package/build/types/edits/createEditBatch.test.d.ts.map +0 -1
  65. package/build/types/transactions/EditRequestManager.test.d.ts +0 -1
  66. package/build/types/transactions/EditRequestManager.test.d.ts.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,33 @@
1
1
  # @osdk/functions
2
2
 
3
+ ## 1.6.0-beta.4
4
+
5
+ ### Minor Changes
6
+
7
+ - 7538b79: Allow link/unlink edits for ONE direction links
8
+ - 34a5ad2: Add helper functions for resolving custom and model aliases in functions
9
+
10
+ ### Patch Changes
11
+
12
+ - Updated dependencies [09e5659]
13
+ - Updated dependencies [2ebe62c]
14
+ - @osdk/client@2.8.0-beta.16
15
+
16
+ ## 1.6.0-beta.3
17
+
18
+ ### Minor Changes
19
+
20
+ - 35f2f1a: Add Media inputs/outputs for Queries
21
+
22
+ ### Patch Changes
23
+
24
+ - Updated dependencies [e64bf0b]
25
+ - Updated dependencies [baba327]
26
+ - Updated dependencies [d1ad4d1]
27
+ - Updated dependencies [35f2f1a]
28
+ - Updated dependencies [71e28ef]
29
+ - @osdk/client@2.8.0-beta.14
30
+
3
31
  ## 1.6.0-beta.2
4
32
 
5
33
  ### Minor Changes
@@ -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
+ import { loadResolvedAliases } from "./loaders.js";
18
+ export function custom(alias) {
19
+ const resolvedAliases = loadResolvedAliases();
20
+ if (!(alias in resolvedAliases.custom)) {
21
+ const available = Object.keys(resolvedAliases.custom);
22
+ throw new Error(`Custom alias '${alias}' not found. Available aliases: [${available.join(", ")}]`);
23
+ }
24
+ return resolvedAliases.custom[alias];
25
+ }
26
+ //# sourceMappingURL=custom.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"custom.js","names":["loadResolvedAliases","custom","alias","resolvedAliases","available","Object","keys","Error","join"],"sources":["custom.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 { loadResolvedAliases } from \"./loaders.js\";\nimport type { Custom } from \"./types.js\";\nexport type { Custom } from \"./types.js\";\n\nexport function custom(alias: string): Custom {\n const resolvedAliases = loadResolvedAliases();\n\n if (!(alias in resolvedAliases.custom)) {\n const available = Object.keys(resolvedAliases.custom);\n throw new Error(\n `Custom alias '${alias}' not found. Available aliases: [${\n available.join(\", \")\n }]`,\n );\n }\n\n return resolvedAliases.custom[alias] as Custom;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,mBAAmB,QAAQ,cAAc;AAIlD,OAAO,SAASC,MAAMA,CAACC,KAAa,EAAU;EAC5C,MAAMC,eAAe,GAAGH,mBAAmB,CAAC,CAAC;EAE7C,IAAI,EAAEE,KAAK,IAAIC,eAAe,CAACF,MAAM,CAAC,EAAE;IACtC,MAAMG,SAAS,GAAGC,MAAM,CAACC,IAAI,CAACH,eAAe,CAACF,MAAM,CAAC;IACrD,MAAM,IAAIM,KAAK,CACb,iBAAiBL,KAAK,oCACpBE,SAAS,CAACI,IAAI,CAAC,IAAI,CAAC,GAExB,CAAC;EACH;EAEA,OAAOL,eAAe,CAACF,MAAM,CAACC,KAAK,CAAC;AACtC","ignoreList":[]}
@@ -0,0 +1,48 @@
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 { AliasEnvironment } from "./types.js";
18
+ export const ALIASES_JSON_FILE_ENV_VAR = "ALIASES_JSON_FILE";
19
+ export const RESOURCES_JSON_FILE_ENV_VAR = "RESOURCES_JSON_FILE";
20
+ export function detectEnvironment() {
21
+ const aliasesFileSet = ALIASES_JSON_FILE_ENV_VAR in process.env;
22
+ const resourcesFileSet = RESOURCES_JSON_FILE_ENV_VAR in process.env;
23
+ if (aliasesFileSet && resourcesFileSet) {
24
+ throw new Error(`Ambiguous alias configuration: both ${ALIASES_JSON_FILE_ENV_VAR} and ` + `${RESOURCES_JSON_FILE_ENV_VAR} are set. Only one should be configured.`);
25
+ }
26
+ if (aliasesFileSet) {
27
+ return AliasEnvironment.PUBLISHED;
28
+ }
29
+ if (resourcesFileSet) {
30
+ return AliasEnvironment.LIVE_PREVIEW;
31
+ }
32
+ throw new Error(`Unknown alias environment: neither ${ALIASES_JSON_FILE_ENV_VAR} nor ${RESOURCES_JSON_FILE_ENV_VAR} is set.`);
33
+ }
34
+ export function getAliasesFilePath() {
35
+ const path = process.env[ALIASES_JSON_FILE_ENV_VAR];
36
+ if (path == null) {
37
+ throw new Error(`${ALIASES_JSON_FILE_ENV_VAR} environment variable is not set`);
38
+ }
39
+ return path;
40
+ }
41
+ export function getResourcesFilePath() {
42
+ const path = process.env[RESOURCES_JSON_FILE_ENV_VAR];
43
+ if (path == null) {
44
+ throw new Error(`${RESOURCES_JSON_FILE_ENV_VAR} environment variable is not set`);
45
+ }
46
+ return path;
47
+ }
48
+ //# sourceMappingURL=environment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"environment.js","names":["AliasEnvironment","ALIASES_JSON_FILE_ENV_VAR","RESOURCES_JSON_FILE_ENV_VAR","detectEnvironment","aliasesFileSet","process","env","resourcesFileSet","Error","PUBLISHED","LIVE_PREVIEW","getAliasesFilePath","path","getResourcesFilePath"],"sources":["environment.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 { AliasEnvironment } from \"./types.js\";\n\nexport const ALIASES_JSON_FILE_ENV_VAR = \"ALIASES_JSON_FILE\";\nexport const RESOURCES_JSON_FILE_ENV_VAR = \"RESOURCES_JSON_FILE\";\n\nexport function detectEnvironment(): AliasEnvironment {\n const aliasesFileSet = ALIASES_JSON_FILE_ENV_VAR in process.env;\n const resourcesFileSet = RESOURCES_JSON_FILE_ENV_VAR in process.env;\n\n if (aliasesFileSet && resourcesFileSet) {\n throw new Error(\n `Ambiguous alias configuration: both ${ALIASES_JSON_FILE_ENV_VAR} and `\n + `${RESOURCES_JSON_FILE_ENV_VAR} are set. Only one should be configured.`,\n );\n }\n\n if (aliasesFileSet) {\n return AliasEnvironment.PUBLISHED;\n }\n if (resourcesFileSet) {\n return AliasEnvironment.LIVE_PREVIEW;\n }\n\n throw new Error(\n `Unknown alias environment: neither ${ALIASES_JSON_FILE_ENV_VAR} nor ${RESOURCES_JSON_FILE_ENV_VAR} is set.`,\n );\n}\n\nexport function getAliasesFilePath(): string {\n const path = process.env[ALIASES_JSON_FILE_ENV_VAR];\n if (path == null) {\n throw new Error(\n `${ALIASES_JSON_FILE_ENV_VAR} environment variable is not set`,\n );\n }\n return path;\n}\n\nexport function getResourcesFilePath(): string {\n const path = process.env[RESOURCES_JSON_FILE_ENV_VAR];\n if (path == null) {\n throw new Error(\n `${RESOURCES_JSON_FILE_ENV_VAR} environment variable is not set`,\n );\n }\n return path;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,gBAAgB,QAAQ,YAAY;AAE7C,OAAO,MAAMC,yBAAyB,GAAG,mBAAmB;AAC5D,OAAO,MAAMC,2BAA2B,GAAG,qBAAqB;AAEhE,OAAO,SAASC,iBAAiBA,CAAA,EAAqB;EACpD,MAAMC,cAAc,GAAGH,yBAAyB,IAAII,OAAO,CAACC,GAAG;EAC/D,MAAMC,gBAAgB,GAAGL,2BAA2B,IAAIG,OAAO,CAACC,GAAG;EAEnE,IAAIF,cAAc,IAAIG,gBAAgB,EAAE;IACtC,MAAM,IAAIC,KAAK,CACb,uCAAuCP,yBAAyB,OAAO,GACnE,GAAGC,2BAA2B,0CACpC,CAAC;EACH;EAEA,IAAIE,cAAc,EAAE;IAClB,OAAOJ,gBAAgB,CAACS,SAAS;EACnC;EACA,IAAIF,gBAAgB,EAAE;IACpB,OAAOP,gBAAgB,CAACU,YAAY;EACtC;EAEA,MAAM,IAAIF,KAAK,CACb,sCAAsCP,yBAAyB,QAAQC,2BAA2B,UACpG,CAAC;AACH;AAEA,OAAO,SAASS,kBAAkBA,CAAA,EAAW;EAC3C,MAAMC,IAAI,GAAGP,OAAO,CAACC,GAAG,CAACL,yBAAyB,CAAC;EACnD,IAAIW,IAAI,IAAI,IAAI,EAAE;IAChB,MAAM,IAAIJ,KAAK,CACb,GAAGP,yBAAyB,kCAC9B,CAAC;EACH;EACA,OAAOW,IAAI;AACb;AAEA,OAAO,SAASC,oBAAoBA,CAAA,EAAW;EAC7C,MAAMD,IAAI,GAAGP,OAAO,CAACC,GAAG,CAACJ,2BAA2B,CAAC;EACrD,IAAIU,IAAI,IAAI,IAAI,EAAE;IAChB,MAAM,IAAIJ,KAAK,CACb,GAAGN,2BAA2B,kCAChC,CAAC;EACH;EACA,OAAOU,IAAI;AACb","ignoreList":[]}
@@ -0,0 +1,19 @@
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 * from "./custom.js";
18
+ export * from "./model.js";
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["index.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 * from \"./custom.js\";\nexport * from \"./model.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,cAAc,aAAa;AAC3B,cAAc,YAAY","ignoreList":[]}
@@ -0,0 +1,66 @@
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 * as fs from "fs";
18
+ import { detectEnvironment, getAliasesFilePath, getResourcesFilePath } from "./environment.js";
19
+ import { AliasEnvironment } from "./types.js";
20
+ let cachedPublishedAliases;
21
+ function loadPublishedAliases() {
22
+ if (cachedPublishedAliases !== undefined) {
23
+ return cachedPublishedAliases;
24
+ }
25
+ const aliasesPath = getAliasesFilePath();
26
+ if (!fs.existsSync(aliasesPath)) {
27
+ throw new Error(`Aliases file not found at ${aliasesPath}`);
28
+ }
29
+ const data = fs.readFileSync(aliasesPath, "utf-8");
30
+ const aliasesFile = JSON.parse(data);
31
+ cachedPublishedAliases = {
32
+ custom: aliasesFile.defaults.custom,
33
+ models: Object.fromEntries(Object.entries(aliasesFile.defaults.models).map(([alias, {
34
+ id: identifier
35
+ }]) => [alias, identifier]))
36
+ };
37
+ return cachedPublishedAliases;
38
+ }
39
+ function loadPreviewAliases() {
40
+ const resourcesPath = getResourcesFilePath();
41
+ if (!fs.existsSync(resourcesPath)) {
42
+ throw new Error(`Resources file not found at ${resourcesPath}`);
43
+ }
44
+ const data = fs.readFileSync(resourcesPath, "utf-8");
45
+ const resourcesFile = JSON.parse(data);
46
+ return {
47
+ custom: resourcesFile.resources.custom,
48
+ models: Object.fromEntries(resourcesFile.resources.models.filter(model => model.alias != null).map(({
49
+ alias,
50
+ identifier
51
+ }) => [alias, identifier]))
52
+ };
53
+ }
54
+ export function resetPublishedCache() {
55
+ cachedPublishedAliases = undefined;
56
+ }
57
+ export function loadResolvedAliases() {
58
+ const environment = detectEnvironment();
59
+ switch (environment) {
60
+ case AliasEnvironment.PUBLISHED:
61
+ return loadPublishedAliases();
62
+ case AliasEnvironment.LIVE_PREVIEW:
63
+ return loadPreviewAliases();
64
+ }
65
+ }
66
+ //# sourceMappingURL=loaders.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loaders.js","names":["fs","detectEnvironment","getAliasesFilePath","getResourcesFilePath","AliasEnvironment","cachedPublishedAliases","loadPublishedAliases","undefined","aliasesPath","existsSync","Error","data","readFileSync","aliasesFile","JSON","parse","custom","defaults","models","Object","fromEntries","entries","map","alias","id","identifier","loadPreviewAliases","resourcesPath","resourcesFile","resources","filter","model","resetPublishedCache","loadResolvedAliases","environment","PUBLISHED","LIVE_PREVIEW"],"sources":["loaders.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 * as fs from \"fs\";\nimport {\n detectEnvironment,\n getAliasesFilePath,\n getResourcesFilePath,\n} from \"./environment.js\";\nimport { AliasEnvironment } from \"./types.js\";\nimport type {\n AliasesFile,\n Model,\n ModelResource,\n ResolvedAliases,\n ResourcesFile,\n} from \"./types.js\";\n\nlet cachedPublishedAliases: ResolvedAliases | undefined;\n\nfunction loadPublishedAliases(): ResolvedAliases {\n if (cachedPublishedAliases !== undefined) {\n return cachedPublishedAliases;\n }\n const aliasesPath = getAliasesFilePath();\n if (!fs.existsSync(aliasesPath)) {\n throw new Error(`Aliases file not found at ${aliasesPath}`);\n }\n\n const data = fs.readFileSync(aliasesPath, \"utf-8\");\n const aliasesFile = JSON.parse(data) as AliasesFile;\n\n cachedPublishedAliases = {\n custom: aliasesFile.defaults.custom,\n models: Object.fromEntries<Model>(\n Object.entries(aliasesFile.defaults.models).map((\n [alias, { id: identifier }],\n ) => [alias, identifier]),\n ),\n };\n return cachedPublishedAliases;\n}\n\nfunction loadPreviewAliases(): ResolvedAliases {\n const resourcesPath = getResourcesFilePath();\n if (!fs.existsSync(resourcesPath)) {\n throw new Error(`Resources file not found at ${resourcesPath}`);\n }\n\n const data = fs.readFileSync(resourcesPath, \"utf-8\");\n const resourcesFile = JSON.parse(data) as ResourcesFile;\n\n return {\n custom: resourcesFile.resources.custom,\n models: Object.fromEntries<Model>(\n resourcesFile.resources.models\n .filter((model): model is ModelResource & { alias: string } =>\n model.alias != null\n )\n .map(({ alias, identifier }) => [alias, identifier]),\n ),\n };\n}\n\nexport function resetPublishedCache(): void {\n cachedPublishedAliases = undefined;\n}\n\nexport function loadResolvedAliases(): ResolvedAliases {\n const environment = detectEnvironment();\n switch (environment) {\n case AliasEnvironment.PUBLISHED:\n return loadPublishedAliases();\n case AliasEnvironment.LIVE_PREVIEW:\n return loadPreviewAliases();\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,KAAKA,EAAE,MAAM,IAAI;AACxB,SACEC,iBAAiB,EACjBC,kBAAkB,EAClBC,oBAAoB,QACf,kBAAkB;AACzB,SAASC,gBAAgB,QAAQ,YAAY;AAS7C,IAAIC,sBAAmD;AAEvD,SAASC,oBAAoBA,CAAA,EAAoB;EAC/C,IAAID,sBAAsB,KAAKE,SAAS,EAAE;IACxC,OAAOF,sBAAsB;EAC/B;EACA,MAAMG,WAAW,GAAGN,kBAAkB,CAAC,CAAC;EACxC,IAAI,CAACF,EAAE,CAACS,UAAU,CAACD,WAAW,CAAC,EAAE;IAC/B,MAAM,IAAIE,KAAK,CAAC,6BAA6BF,WAAW,EAAE,CAAC;EAC7D;EAEA,MAAMG,IAAI,GAAGX,EAAE,CAACY,YAAY,CAACJ,WAAW,EAAE,OAAO,CAAC;EAClD,MAAMK,WAAW,GAAGC,IAAI,CAACC,KAAK,CAACJ,IAAI,CAAgB;EAEnDN,sBAAsB,GAAG;IACvBW,MAAM,EAAEH,WAAW,CAACI,QAAQ,CAACD,MAAM;IACnCE,MAAM,EAAEC,MAAM,CAACC,WAAW,CACxBD,MAAM,CAACE,OAAO,CAACR,WAAW,CAACI,QAAQ,CAACC,MAAM,CAAC,CAACI,GAAG,CAAC,CAC9C,CAACC,KAAK,EAAE;MAAEC,EAAE,EAAEC;IAAW,CAAC,CAAC,KACxB,CAACF,KAAK,EAAEE,UAAU,CAAC,CAC1B;EACF,CAAC;EACD,OAAOpB,sBAAsB;AAC/B;AAEA,SAASqB,kBAAkBA,CAAA,EAAoB;EAC7C,MAAMC,aAAa,GAAGxB,oBAAoB,CAAC,CAAC;EAC5C,IAAI,CAACH,EAAE,CAACS,UAAU,CAACkB,aAAa,CAAC,EAAE;IACjC,MAAM,IAAIjB,KAAK,CAAC,+BAA+BiB,aAAa,EAAE,CAAC;EACjE;EAEA,MAAMhB,IAAI,GAAGX,EAAE,CAACY,YAAY,CAACe,aAAa,EAAE,OAAO,CAAC;EACpD,MAAMC,aAAa,GAAGd,IAAI,CAACC,KAAK,CAACJ,IAAI,CAAkB;EAEvD,OAAO;IACLK,MAAM,EAAEY,aAAa,CAACC,SAAS,CAACb,MAAM;IACtCE,MAAM,EAAEC,MAAM,CAACC,WAAW,CACxBQ,aAAa,CAACC,SAAS,CAACX,MAAM,CAC3BY,MAAM,CAAEC,KAAK,IACZA,KAAK,CAACR,KAAK,IAAI,IACjB,CAAC,CACAD,GAAG,CAAC,CAAC;MAAEC,KAAK;MAAEE;IAAW,CAAC,KAAK,CAACF,KAAK,EAAEE,UAAU,CAAC,CACvD;EACF,CAAC;AACH;AAEA,OAAO,SAASO,mBAAmBA,CAAA,EAAS;EAC1C3B,sBAAsB,GAAGE,SAAS;AACpC;AAEA,OAAO,SAAS0B,mBAAmBA,CAAA,EAAoB;EACrD,MAAMC,WAAW,GAAGjC,iBAAiB,CAAC,CAAC;EACvC,QAAQiC,WAAW;IACjB,KAAK9B,gBAAgB,CAAC+B,SAAS;MAC7B,OAAO7B,oBAAoB,CAAC,CAAC;IAC/B,KAAKF,gBAAgB,CAACgC,YAAY;MAChC,OAAOV,kBAAkB,CAAC,CAAC;EAC/B;AACF","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
+ import { loadResolvedAliases } from "./loaders.js";
18
+ export function model(alias) {
19
+ const resolvedAliases = loadResolvedAliases();
20
+ if (!(alias in resolvedAliases.models)) {
21
+ const available = Object.keys(resolvedAliases.models);
22
+ throw new Error(`Model alias '${alias}' not found. Available aliases: [${available.join(", ")}]`);
23
+ }
24
+ return resolvedAliases.models[alias];
25
+ }
26
+ //# sourceMappingURL=model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model.js","names":["loadResolvedAliases","model","alias","resolvedAliases","models","available","Object","keys","Error","join"],"sources":["model.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 { loadResolvedAliases } from \"./loaders.js\";\nimport type { Model } from \"./types.js\";\nexport type { Model } from \"./types.js\";\n\nexport function model(alias: string): Model {\n const resolvedAliases = loadResolvedAliases();\n\n if (!(alias in resolvedAliases.models)) {\n const available = Object.keys(resolvedAliases.models);\n throw new Error(\n `Model alias '${alias}' not found. Available aliases: [${\n available.join(\", \")\n }]`,\n );\n }\n\n return resolvedAliases.models[alias];\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,mBAAmB,QAAQ,cAAc;AAIlD,OAAO,SAASC,KAAKA,CAACC,KAAa,EAAS;EAC1C,MAAMC,eAAe,GAAGH,mBAAmB,CAAC,CAAC;EAE7C,IAAI,EAAEE,KAAK,IAAIC,eAAe,CAACC,MAAM,CAAC,EAAE;IACtC,MAAMC,SAAS,GAAGC,MAAM,CAACC,IAAI,CAACJ,eAAe,CAACC,MAAM,CAAC;IACrD,MAAM,IAAII,KAAK,CACb,gBAAgBN,KAAK,oCACnBG,SAAS,CAACI,IAAI,CAAC,IAAI,CAAC,GAExB,CAAC;EACH;EAEA,OAAON,eAAe,CAACC,MAAM,CAACF,KAAK,CAAC;AACtC","ignoreList":[]}
@@ -0,0 +1,30 @@
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
+ // Types relevant to OSDK APIs
18
+
19
+ // Environment
20
+
21
+ export let AliasEnvironment = /*#__PURE__*/function (AliasEnvironment) {
22
+ AliasEnvironment["PUBLISHED"] = "PUBLISHED";
23
+ AliasEnvironment["LIVE_PREVIEW"] = "LIVE_PREVIEW";
24
+ return AliasEnvironment;
25
+ }({});
26
+
27
+ // Live preview mode types (resources.json)
28
+
29
+ // Published mode types (aliases.json)
30
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","names":["AliasEnvironment"],"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\n// Types relevant to OSDK APIs\n\nexport type Custom = string & { readonly __brand: \"Custom\" };\n\nexport interface Model {\n rid: string;\n}\n\nexport interface ResolvedAliases {\n custom: Record<string, string>;\n models: Record<string, Model>;\n}\n\n// Environment\n\nexport enum AliasEnvironment {\n PUBLISHED = \"PUBLISHED\",\n LIVE_PREVIEW = \"LIVE_PREVIEW\",\n}\n\n// Live preview mode types (resources.json)\n\nexport interface ModelResource {\n identifier: ModelIdentifier;\n verbs: string[];\n alias?: string | null;\n}\n\nexport interface ResourceScopes {\n custom: Record<string, string>;\n models: ModelResource[];\n}\n\nexport interface ResourcesFile {\n resources: ResourceScopes;\n}\n\n// Published mode types (aliases.json)\n\nexport interface ModelIdentifier {\n rid: string;\n}\n\nexport interface ModelValue {\n id: ModelIdentifier;\n}\n\nexport interface DefaultAliases {\n custom: Record<string, string>;\n models: Record<string, ModelValue>;\n}\n\nexport interface AliasesFile {\n defaults: DefaultAliases;\n version: number;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAaA;;AAEA,WAAYA,gBAAgB,0BAAhBA,gBAAgB;EAAhBA,gBAAgB;EAAhBA,gBAAgB;EAAA,OAAhBA,gBAAgB;AAAA;;AAK5B;;AAiBA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"EditBatch.js","names":[],"sources":["EditBatch.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n CompileTimeMetadata,\n InterfaceDefinition,\n ObjectTypeDefinition,\n} from \"@osdk/client\";\nimport type {\n AddLink,\n AnyEdit,\n CreateObject,\n CreateObjectForInterface,\n DeleteObject,\n DeleteObjectForInterface,\n InterfaceLocator,\n ObjectLocator,\n RemoveLink,\n UpdateObject,\n UpdateObjectForInterface,\n} from \"./types.js\";\n\n// Helper type for literal \"apiName\" values without resorting to expensive type inference.\ninterface ObjectTypeDefinitionForLocator<OL extends ObjectLocator<any>>\n extends ObjectTypeDefinition\n{\n apiName: OL[\"$apiName\"];\n}\n\ninterface InterfaceDefinitionForLocator<IL extends ObjectLocator<any>>\n extends InterfaceDefinition\n{\n apiName: IL[\"$apiName\"];\n}\n\n// AddLink helper types\nexport type AddLinkSources<X extends AnyEdit> = X extends\n AddLink<infer OTD, any> ? ObjectLocator<OTD> : never;\n\nexport type AddLinkApiNames<X extends AnyEdit, SOL extends ObjectLocator<any>> =\n X extends AddLink<ObjectTypeDefinitionForLocator<SOL>, infer A> ? A : never;\n\nexport type AddLinkTargets<\n X extends AnyEdit,\n SOL extends ObjectLocator<any>,\n A extends string,\n> = X extends AddLink<ObjectTypeDefinitionForLocator<SOL>, A>\n ? (X extends AddLink<infer OTD, A>\n ? (CompileTimeMetadata<OTD>[\"links\"][A][\"multiplicity\"] extends true\n ? Array<X[\"target\"]> | X[\"target\"]\n : never)\n : never)\n : never;\n\n// RemoveLink helper types\nexport type RemoveLinkSources<X extends AnyEdit> = X extends\n RemoveLink<infer OTD, any> ? ObjectLocator<OTD> : never;\n\nexport type RemoveLinkApiNames<\n X extends AnyEdit,\n SOL extends ObjectLocator<any>,\n> = X extends RemoveLink<ObjectTypeDefinitionForLocator<SOL>, infer L> ? L\n : never;\n\nexport type RemoveLinkTargets<\n X extends AnyEdit,\n SOL extends ObjectLocator<any>,\n A extends string,\n> = X extends RemoveLink<ObjectTypeDefinitionForLocator<SOL>, A>\n ? (X extends RemoveLink<infer OTD, A>\n ? (CompileTimeMetadata<OTD>[\"links\"][A][\"multiplicity\"] extends true\n ? Array<X[\"target\"]> | X[\"target\"]\n : never)\n : never)\n : never;\n\n// CreateObject helper types\nexport type CreatableObjectOrInterfaceTypes<X extends AnyEdit> = X extends\n CreateObject<infer OTD> ? OTD\n : X extends CreateObjectForInterface<infer ID> ? ID\n : never;\n\nexport type CreatableObjectOrInterfaceTypeProperties<\n X extends AnyEdit,\n OI extends ObjectTypeDefinition | InterfaceDefinition,\n> = X extends CreateObject<infer OTD> ? OTD extends OI ? X[\"properties\"] : never\n : X extends CreateObjectForInterface<infer ID>\n ? ID extends OI ? X[\"properties\"] : never\n : never;\n\n// DeleteObject helper types\nexport type DeletableObjectOrInterfaceLocators<X extends AnyEdit> = X extends\n DeleteObject<infer OTD> ? ObjectLocator<OTD>\n : X extends DeleteObjectForInterface<infer ID> ? InterfaceLocator<ID>\n : never;\n\n// UpdateObject and UpdateInterface helper types\nexport type UpdatableObjectOrInterfaceLocators<X extends AnyEdit> = X extends\n UpdateObject<infer OTD> ? ObjectLocator<OTD>\n : X extends UpdateObjectForInterface<infer ID> ? InterfaceLocator<ID>\n : never;\n\nexport type UpdatableObjectOrInterfaceLocatorProperties<\n X extends AnyEdit,\n OL extends ObjectLocator<any>,\n> = X extends UpdateObject<ObjectTypeDefinitionForLocator<OL>> ? X[\"properties\"]\n : X extends UpdateObjectForInterface<InterfaceDefinitionForLocator<OL>>\n ? X[\"properties\"]\n : never;\n\nexport interface EditBatch<\n X extends AnyEdit = never,\n> {\n link: <\n SOL extends AddLinkSources<X>,\n A extends AddLinkApiNames<X, SOL>,\n >(\n source: SOL,\n apiName: A,\n target: AddLinkTargets<X, SOL, A>,\n ) => void;\n\n unlink: <\n SOL extends RemoveLinkSources<X>,\n A extends RemoveLinkApiNames<X, SOL>,\n >(\n source: SOL,\n apiName: A,\n target: RemoveLinkTargets<X, SOL, A>,\n ) => void;\n\n create: <OI extends CreatableObjectOrInterfaceTypes<X>>(\n objectOrInterfaceType: OI,\n properties: CreatableObjectOrInterfaceTypeProperties<X, OI>,\n ) => void;\n\n delete: <OL extends DeletableObjectOrInterfaceLocators<X>>(obj: OL) => void;\n\n update: <OL extends UpdatableObjectOrInterfaceLocators<X>>(\n obj: OL,\n properties: UpdatableObjectOrInterfaceLocatorProperties<X, OL>,\n ) => void;\n\n getEdits: () => X[];\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"EditBatch.js","names":[],"sources":["EditBatch.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n CompileTimeMetadata,\n InterfaceDefinition,\n ObjectTypeDefinition,\n} from \"@osdk/client\";\nimport type {\n AddLink,\n AnyEdit,\n CreateObject,\n CreateObjectForInterface,\n DeleteObject,\n DeleteObjectForInterface,\n InterfaceLocator,\n ObjectLocator,\n RemoveLink,\n UpdateObject,\n UpdateObjectForInterface,\n} from \"./types.js\";\n\n// Helper type for literal \"apiName\" values without resorting to expensive type inference.\ninterface ObjectTypeDefinitionForLocator<OL extends ObjectLocator<any>>\n extends ObjectTypeDefinition\n{\n apiName: OL[\"$apiName\"];\n}\n\ninterface InterfaceDefinitionForLocator<IL extends ObjectLocator<any>>\n extends InterfaceDefinition\n{\n apiName: IL[\"$apiName\"];\n}\n\n// AddLink helper types\nexport type AddLinkSources<X extends AnyEdit> = X extends\n AddLink<infer OTD, any> ? ObjectLocator<OTD> : never;\n\nexport type AddLinkApiNames<X extends AnyEdit, SOL extends ObjectLocator<any>> =\n X extends AddLink<ObjectTypeDefinitionForLocator<SOL>, infer A> ? A : never;\n\nexport type AddLinkTargets<\n X extends AnyEdit,\n SOL extends ObjectLocator<any>,\n A extends string,\n> = X extends AddLink<ObjectTypeDefinitionForLocator<SOL>, A>\n ? (X extends AddLink<infer OTD, A>\n ? (CompileTimeMetadata<OTD>[\"links\"][A][\"multiplicity\"] extends true\n ? Array<X[\"target\"]> | X[\"target\"]\n : X[\"target\"])\n : never)\n : never;\n\n// RemoveLink helper types\nexport type RemoveLinkSources<X extends AnyEdit> = X extends\n RemoveLink<infer OTD, any> ? ObjectLocator<OTD> : never;\n\nexport type RemoveLinkApiNames<\n X extends AnyEdit,\n SOL extends ObjectLocator<any>,\n> = X extends RemoveLink<ObjectTypeDefinitionForLocator<SOL>, infer L> ? L\n : never;\n\nexport type RemoveLinkTargets<\n X extends AnyEdit,\n SOL extends ObjectLocator<any>,\n A extends string,\n> = X extends RemoveLink<ObjectTypeDefinitionForLocator<SOL>, A>\n ? (X extends RemoveLink<infer OTD, A>\n ? (CompileTimeMetadata<OTD>[\"links\"][A][\"multiplicity\"] extends true\n ? Array<X[\"target\"]> | X[\"target\"]\n : X[\"target\"])\n : never)\n : never;\n\n// CreateObject helper types\nexport type CreatableObjectOrInterfaceTypes<X extends AnyEdit> = X extends\n CreateObject<infer OTD> ? OTD\n : X extends CreateObjectForInterface<infer ID> ? ID\n : never;\n\nexport type CreatableObjectOrInterfaceTypeProperties<\n X extends AnyEdit,\n OI extends ObjectTypeDefinition | InterfaceDefinition,\n> = X extends CreateObject<infer OTD> ? OTD extends OI ? X[\"properties\"] : never\n : X extends CreateObjectForInterface<infer ID>\n ? ID extends OI ? X[\"properties\"] : never\n : never;\n\n// DeleteObject helper types\nexport type DeletableObjectOrInterfaceLocators<X extends AnyEdit> = X extends\n DeleteObject<infer OTD> ? ObjectLocator<OTD>\n : X extends DeleteObjectForInterface<infer ID> ? InterfaceLocator<ID>\n : never;\n\n// UpdateObject and UpdateInterface helper types\nexport type UpdatableObjectOrInterfaceLocators<X extends AnyEdit> = X extends\n UpdateObject<infer OTD> ? ObjectLocator<OTD>\n : X extends UpdateObjectForInterface<infer ID> ? InterfaceLocator<ID>\n : never;\n\nexport type UpdatableObjectOrInterfaceLocatorProperties<\n X extends AnyEdit,\n OL extends ObjectLocator<any>,\n> = X extends UpdateObject<ObjectTypeDefinitionForLocator<OL>> ? X[\"properties\"]\n : X extends UpdateObjectForInterface<InterfaceDefinitionForLocator<OL>>\n ? X[\"properties\"]\n : never;\n\nexport interface EditBatch<\n X extends AnyEdit = never,\n> {\n link: <\n SOL extends AddLinkSources<X>,\n A extends AddLinkApiNames<X, SOL>,\n >(\n source: SOL,\n apiName: A,\n target: AddLinkTargets<X, SOL, A>,\n ) => void;\n\n unlink: <\n SOL extends RemoveLinkSources<X>,\n A extends RemoveLinkApiNames<X, SOL>,\n >(\n source: SOL,\n apiName: A,\n target: RemoveLinkTargets<X, SOL, A>,\n ) => void;\n\n create: <OI extends CreatableObjectOrInterfaceTypes<X>>(\n objectOrInterfaceType: OI,\n properties: CreatableObjectOrInterfaceTypeProperties<X, OI>,\n ) => void;\n\n delete: <OL extends DeletableObjectOrInterfaceLocators<X>>(obj: OL) => void;\n\n update: <OL extends UpdatableObjectOrInterfaceLocators<X>>(\n obj: OL,\n properties: UpdatableObjectOrInterfaceLocatorProperties<X, OL>,\n ) => void;\n\n getEdits: () => X[];\n}\n"],"mappings":"","ignoreList":[]}
@@ -14,6 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
+ export * as Aliases from "./aliases/index.js";
17
18
  export { createEditBatch } from "./edits/createEditBatch.js";
18
19
  export { UserFacingError } from "./errors/UserFacingError.js";
19
20
  export { uploadMedia } from "./helpers/uploadMedia.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["createEditBatch","UserFacingError","uploadMedia"],"sources":["index.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 type {\n DateISOString,\n Double,\n Float,\n Integer,\n Long,\n TimestampISOString,\n} from \"./PrimitiveTypes.js\";\n\nexport type {\n Attachment,\n MediaReference,\n MediaUpload,\n Range,\n ThreeDimensionalAggregation,\n TwoDimensionalAggregation,\n} from \"@osdk/client\";\n\nexport { createEditBatch } from \"./edits/createEditBatch.js\";\nexport type { EditBatch } from \"./edits/EditBatch.js\";\nexport type { Edits } from \"./edits/types.js\";\nexport { UserFacingError } from \"./errors/UserFacingError.js\";\nexport { uploadMedia } from \"./helpers/uploadMedia.js\";\n\nexport type {\n EmailNotification,\n Notification,\n NotificationLink,\n NotificationLinkTarget,\n ObjectLinkTarget,\n PlatformNotification,\n RidLinkTarget,\n UrlLinkTarget,\n} from \"./Notification.js\";\n\nexport type { ClassificationMarking, MandatoryMarking } from \"./Markings.js\";\nexport type { GroupId, Principal, UserId } from \"./UserGroup.js\";\n\nexport type { Geometry, Point } from \"geojson\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAoBA,SAASA,eAAe,QAAQ,4BAA4B;AAG5D,SAASC,eAAe,QAAQ,6BAA6B;AAC7D,SAASC,WAAW,QAAQ,0BAA0B","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["Aliases","createEditBatch","UserFacingError","uploadMedia"],"sources":["index.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 type {\n DateISOString,\n Double,\n Float,\n Integer,\n Long,\n TimestampISOString,\n} from \"./PrimitiveTypes.js\";\n\nexport type {\n Attachment,\n MediaReference,\n MediaUpload,\n Range,\n ThreeDimensionalAggregation,\n TwoDimensionalAggregation,\n} from \"@osdk/client\";\n\nexport * as Aliases from \"./aliases/index.js\";\nexport { createEditBatch } from \"./edits/createEditBatch.js\";\nexport type { EditBatch } from \"./edits/EditBatch.js\";\nexport type { Edits } from \"./edits/types.js\";\nexport { UserFacingError } from \"./errors/UserFacingError.js\";\nexport { uploadMedia } from \"./helpers/uploadMedia.js\";\n\nexport type {\n EmailNotification,\n Notification,\n NotificationLink,\n NotificationLinkTarget,\n ObjectLinkTarget,\n PlatformNotification,\n RidLinkTarget,\n UrlLinkTarget,\n} from \"./Notification.js\";\n\nexport type { ClassificationMarking, MandatoryMarking } from \"./Markings.js\";\nexport type { GroupId, Principal, UserId } from \"./UserGroup.js\";\n\nexport type { Geometry, Point } from \"geojson\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAoBA,OAAO,KAAKA,OAAO,MAAM,oBAAoB;AAC7C,SAASC,eAAe,QAAQ,4BAA4B;AAG5D,SAASC,eAAe,QAAQ,6BAA6B;AAC7D,SAASC,WAAW,QAAQ,0BAA0B","ignoreList":[]}
@@ -9,10 +9,10 @@ interface InterfaceDefinitionForLocator<IL extends ObjectLocator<any>> extends I
9
9
  }
10
10
  type AddLinkSources<X extends AnyEdit> = X extends AddLink<infer OTD, any> ? ObjectLocator<OTD> : never;
11
11
  type AddLinkApiNames<X extends AnyEdit, SOL extends ObjectLocator<any>> = X extends AddLink<ObjectTypeDefinitionForLocator<SOL>, infer A> ? A : never;
12
- type AddLinkTargets<X extends AnyEdit, SOL extends ObjectLocator<any>, A extends string> = X extends AddLink<ObjectTypeDefinitionForLocator<SOL>, A> ? (X extends AddLink<infer OTD, A> ? (CompileTimeMetadata<OTD>["links"][A]["multiplicity"] extends true ? Array<X["target"]> | X["target"] : never) : never) : never;
12
+ type AddLinkTargets<X extends AnyEdit, SOL extends ObjectLocator<any>, A extends string> = X extends AddLink<ObjectTypeDefinitionForLocator<SOL>, A> ? (X extends AddLink<infer OTD, A> ? (CompileTimeMetadata<OTD>["links"][A]["multiplicity"] extends true ? Array<X["target"]> | X["target"] : X["target"]) : never) : never;
13
13
  type RemoveLinkSources<X extends AnyEdit> = X extends RemoveLink<infer OTD, any> ? ObjectLocator<OTD> : never;
14
14
  type RemoveLinkApiNames<X extends AnyEdit, SOL extends ObjectLocator<any>> = X extends RemoveLink<ObjectTypeDefinitionForLocator<SOL>, infer L> ? L : never;
15
- type RemoveLinkTargets<X extends AnyEdit, SOL extends ObjectLocator<any>, A extends string> = X extends RemoveLink<ObjectTypeDefinitionForLocator<SOL>, A> ? (X extends RemoveLink<infer OTD, A> ? (CompileTimeMetadata<OTD>["links"][A]["multiplicity"] extends true ? Array<X["target"]> | X["target"] : never) : never) : never;
15
+ type RemoveLinkTargets<X extends AnyEdit, SOL extends ObjectLocator<any>, A extends string> = X extends RemoveLink<ObjectTypeDefinitionForLocator<SOL>, A> ? (X extends RemoveLink<infer OTD, A> ? (CompileTimeMetadata<OTD>["links"][A]["multiplicity"] extends true ? Array<X["target"]> | X["target"] : X["target"]) : never) : never;
16
16
  type CreatableObjectOrInterfaceTypes<X extends AnyEdit> = X extends CreateObject<infer OTD> ? OTD : X extends CreateObjectForInterface<infer ID> ? ID : never;
17
17
  type CreatableObjectOrInterfaceTypeProperties<X extends AnyEdit, OI extends ObjectTypeDefinition | InterfaceDefinition> = X extends CreateObject<infer OTD> ? OTD extends OI ? X["properties"] : never : X extends CreateObjectForInterface<infer ID> ? ID extends OI ? X["properties"] : never : never;
18
18
  type DeletableObjectOrInterfaceLocators<X extends AnyEdit> = X extends DeleteObject<infer OTD> ? ObjectLocator<OTD> : X extends DeleteObjectForInterface<infer ID> ? InterfaceLocator<ID> : never;
@@ -1,6 +1,138 @@
1
1
  'use strict';
2
2
 
3
3
  var chunk4DCWE2WY_cjs = require('./chunk-4DCWE2WY.cjs');
4
+ var fs = require('fs');
5
+
6
+ function _interopNamespace(e) {
7
+ if (e && e.__esModule) return e;
8
+ var n = Object.create(null);
9
+ if (e) {
10
+ Object.keys(e).forEach(function (k) {
11
+ if (k !== 'default') {
12
+ var d = Object.getOwnPropertyDescriptor(e, k);
13
+ Object.defineProperty(n, k, d.get ? d : {
14
+ enumerable: true,
15
+ get: function () { return e[k]; }
16
+ });
17
+ }
18
+ });
19
+ }
20
+ n.default = e;
21
+ return Object.freeze(n);
22
+ }
23
+
24
+ var fs__namespace = /*#__PURE__*/_interopNamespace(fs);
25
+
26
+ // src/aliases/index.ts
27
+ var aliases_exports = {};
28
+ chunk4DCWE2WY_cjs.__export(aliases_exports, {
29
+ custom: () => custom,
30
+ model: () => model
31
+ });
32
+
33
+ // src/aliases/types.ts
34
+ var AliasEnvironment = /* @__PURE__ */ (function(AliasEnvironment2) {
35
+ AliasEnvironment2["PUBLISHED"] = "PUBLISHED";
36
+ AliasEnvironment2["LIVE_PREVIEW"] = "LIVE_PREVIEW";
37
+ return AliasEnvironment2;
38
+ })({});
39
+
40
+ // src/aliases/environment.ts
41
+ var ALIASES_JSON_FILE_ENV_VAR = "ALIASES_JSON_FILE";
42
+ var RESOURCES_JSON_FILE_ENV_VAR = "RESOURCES_JSON_FILE";
43
+ function detectEnvironment() {
44
+ const aliasesFileSet = ALIASES_JSON_FILE_ENV_VAR in process.env;
45
+ const resourcesFileSet = RESOURCES_JSON_FILE_ENV_VAR in process.env;
46
+ if (aliasesFileSet && resourcesFileSet) {
47
+ throw new Error(`Ambiguous alias configuration: both ${ALIASES_JSON_FILE_ENV_VAR} and ${RESOURCES_JSON_FILE_ENV_VAR} are set. Only one should be configured.`);
48
+ }
49
+ if (aliasesFileSet) {
50
+ return AliasEnvironment.PUBLISHED;
51
+ }
52
+ if (resourcesFileSet) {
53
+ return AliasEnvironment.LIVE_PREVIEW;
54
+ }
55
+ throw new Error(`Unknown alias environment: neither ${ALIASES_JSON_FILE_ENV_VAR} nor ${RESOURCES_JSON_FILE_ENV_VAR} is set.`);
56
+ }
57
+ function getAliasesFilePath() {
58
+ const path = process.env[ALIASES_JSON_FILE_ENV_VAR];
59
+ if (path == null) {
60
+ throw new Error(`${ALIASES_JSON_FILE_ENV_VAR} environment variable is not set`);
61
+ }
62
+ return path;
63
+ }
64
+ function getResourcesFilePath() {
65
+ const path = process.env[RESOURCES_JSON_FILE_ENV_VAR];
66
+ if (path == null) {
67
+ throw new Error(`${RESOURCES_JSON_FILE_ENV_VAR} environment variable is not set`);
68
+ }
69
+ return path;
70
+ }
71
+
72
+ // src/aliases/loaders.ts
73
+ var cachedPublishedAliases;
74
+ function loadPublishedAliases() {
75
+ if (cachedPublishedAliases !== void 0) {
76
+ return cachedPublishedAliases;
77
+ }
78
+ const aliasesPath = getAliasesFilePath();
79
+ if (!fs__namespace.existsSync(aliasesPath)) {
80
+ throw new Error(`Aliases file not found at ${aliasesPath}`);
81
+ }
82
+ const data = fs__namespace.readFileSync(aliasesPath, "utf-8");
83
+ const aliasesFile = JSON.parse(data);
84
+ cachedPublishedAliases = {
85
+ custom: aliasesFile.defaults.custom,
86
+ models: Object.fromEntries(Object.entries(aliasesFile.defaults.models).map(([alias, {
87
+ id: identifier
88
+ }]) => [alias, identifier]))
89
+ };
90
+ return cachedPublishedAliases;
91
+ }
92
+ function loadPreviewAliases() {
93
+ const resourcesPath = getResourcesFilePath();
94
+ if (!fs__namespace.existsSync(resourcesPath)) {
95
+ throw new Error(`Resources file not found at ${resourcesPath}`);
96
+ }
97
+ const data = fs__namespace.readFileSync(resourcesPath, "utf-8");
98
+ const resourcesFile = JSON.parse(data);
99
+ return {
100
+ custom: resourcesFile.resources.custom,
101
+ models: Object.fromEntries(resourcesFile.resources.models.filter((model2) => model2.alias != null).map(({
102
+ alias,
103
+ identifier
104
+ }) => [alias, identifier]))
105
+ };
106
+ }
107
+ function loadResolvedAliases() {
108
+ const environment = detectEnvironment();
109
+ switch (environment) {
110
+ case AliasEnvironment.PUBLISHED:
111
+ return loadPublishedAliases();
112
+ case AliasEnvironment.LIVE_PREVIEW:
113
+ return loadPreviewAliases();
114
+ }
115
+ }
116
+
117
+ // src/aliases/custom.ts
118
+ function custom(alias) {
119
+ const resolvedAliases = loadResolvedAliases();
120
+ if (!(alias in resolvedAliases.custom)) {
121
+ const available = Object.keys(resolvedAliases.custom);
122
+ throw new Error(`Custom alias '${alias}' not found. Available aliases: [${available.join(", ")}]`);
123
+ }
124
+ return resolvedAliases.custom[alias];
125
+ }
126
+
127
+ // src/aliases/model.ts
128
+ function model(alias) {
129
+ const resolvedAliases = loadResolvedAliases();
130
+ if (!(alias in resolvedAliases.models)) {
131
+ const available = Object.keys(resolvedAliases.models);
132
+ throw new Error(`Model alias '${alias}' not found. Available aliases: [${available.join(", ")}]`);
133
+ }
134
+ return resolvedAliases.models[alias];
135
+ }
4
136
 
5
137
  // src/edits/types.ts
6
138
  function isInterfaceLocator(obj) {
@@ -192,6 +324,7 @@ async function uploadMedia2(client, mediaUpload) {
192
324
  };
193
325
  }
194
326
 
327
+ exports.Aliases = aliases_exports;
195
328
  exports.UserFacingError = UserFacingError;
196
329
  exports.createEditBatch = createEditBatch;
197
330
  exports.uploadMedia = uploadMedia2;