@osdk/client 2.2.0-beta.12 → 2.2.0-beta.13

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 (151) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/build/browser/actions/actions.test.js +1 -1
  3. package/build/browser/actions/actions.test.js.map +1 -1
  4. package/build/browser/index.js +1 -1
  5. package/build/browser/index.js.map +1 -1
  6. package/build/browser/logger/TestLogger.js +59 -0
  7. package/build/browser/logger/TestLogger.js.map +1 -0
  8. package/build/browser/object/attachment.test.js.map +1 -1
  9. package/build/browser/object/convertWireToOsdkObjects/createOsdkInterface.js +4 -0
  10. package/build/browser/object/convertWireToOsdkObjects/createOsdkInterface.js.map +1 -1
  11. package/build/browser/object/convertWireToOsdkObjects/createOsdkObject.js +44 -33
  12. package/build/browser/object/convertWireToOsdkObjects/createOsdkObject.js.map +1 -1
  13. package/build/browser/object/convertWireToOsdkObjects.js +4 -9
  14. package/build/browser/object/convertWireToOsdkObjects.js.map +1 -1
  15. package/build/browser/object/convertWireToOsdkObjects.test.js +29 -25
  16. package/build/browser/object/convertWireToOsdkObjects.test.js.map +1 -1
  17. package/build/browser/object/fetchPage.js +4 -3
  18. package/build/browser/object/fetchPage.js.map +1 -1
  19. package/build/browser/object/object.test.js +17 -1
  20. package/build/browser/object/object.test.js.map +1 -1
  21. package/build/browser/object/timeseries.test.js.map +1 -1
  22. package/build/browser/objectSet/ObjectSet.test.js +98 -1
  23. package/build/browser/objectSet/ObjectSet.test.js.map +1 -1
  24. package/build/browser/objectSet/ObjectSetListenerWebsocket.js +2 -2
  25. package/build/browser/objectSet/ObjectSetListenerWebsocket.js.map +1 -1
  26. package/build/browser/objectSet/ObjectSetListenerWebsocket.test.js +2 -3
  27. package/build/browser/objectSet/ObjectSetListenerWebsocket.test.js.map +1 -1
  28. package/build/browser/objectSet/createObjectSet.js +1 -0
  29. package/build/browser/objectSet/createObjectSet.js.map +1 -1
  30. package/build/browser/observable/internal/ActionApplication.js +4 -4
  31. package/build/browser/observable/internal/ActionApplication.js.map +1 -1
  32. package/build/browser/observable/internal/ObjectQuery.js +1 -1
  33. package/build/browser/observable/internal/ObjectQuery.js.map +1 -1
  34. package/build/browser/observable/internal/OptimisticJob.js +1 -1
  35. package/build/browser/observable/internal/OptimisticJob.js.map +1 -1
  36. package/build/browser/observable/internal/Store.js +2 -2
  37. package/build/browser/observable/internal/Store.js.map +1 -1
  38. package/build/browser/observable/internal/Store.test.js +173 -216
  39. package/build/browser/observable/internal/Store.test.js.map +1 -1
  40. package/build/browser/queries/applyQuery.js +3 -3
  41. package/build/browser/queries/applyQuery.js.map +1 -1
  42. package/build/browser/util/UserAgent.js +1 -1
  43. package/build/browser/util/extractRdpDefinition.js +87 -0
  44. package/build/browser/util/extractRdpDefinition.js.map +1 -0
  45. package/build/browser/util/extractRdpDefinition.test.js +144 -0
  46. package/build/browser/util/extractRdpDefinition.test.js.map +1 -0
  47. package/build/browser/util/objectSpecifierUtils.js +48 -0
  48. package/build/browser/util/objectSpecifierUtils.js.map +1 -0
  49. package/build/browser/util/objectSpecifierUtils.test.js +42 -0
  50. package/build/browser/util/objectSpecifierUtils.test.js.map +1 -0
  51. package/build/browser/util/toDataValueQueries.js +2 -4
  52. package/build/browser/util/toDataValueQueries.js.map +1 -1
  53. package/build/cjs/{chunk-EY52J5Z4.cjs → chunk-USHAX4EP.cjs} +89 -17
  54. package/build/cjs/chunk-USHAX4EP.cjs.map +1 -0
  55. package/build/cjs/{chunk-MCQVHD2F.cjs → chunk-VT3UM6EP.cjs} +17 -16
  56. package/build/cjs/chunk-VT3UM6EP.cjs.map +1 -0
  57. package/build/cjs/index.cjs +104 -95
  58. package/build/cjs/index.cjs.map +1 -1
  59. package/build/cjs/index.d.cts +11 -3
  60. package/build/cjs/public/internal.cjs +6 -7
  61. package/build/cjs/public/internal.cjs.map +1 -1
  62. package/build/cjs/public/unstable-do-not-use.cjs +67 -66
  63. package/build/cjs/public/unstable-do-not-use.cjs.map +1 -1
  64. package/build/esm/actions/actions.test.js +1 -1
  65. package/build/esm/actions/actions.test.js.map +1 -1
  66. package/build/esm/index.js +1 -1
  67. package/build/esm/index.js.map +1 -1
  68. package/build/esm/logger/TestLogger.js +59 -0
  69. package/build/esm/logger/TestLogger.js.map +1 -0
  70. package/build/esm/object/attachment.test.js.map +1 -1
  71. package/build/esm/object/convertWireToOsdkObjects/createOsdkInterface.js +4 -0
  72. package/build/esm/object/convertWireToOsdkObjects/createOsdkInterface.js.map +1 -1
  73. package/build/esm/object/convertWireToOsdkObjects/createOsdkObject.js +44 -33
  74. package/build/esm/object/convertWireToOsdkObjects/createOsdkObject.js.map +1 -1
  75. package/build/esm/object/convertWireToOsdkObjects.js +4 -9
  76. package/build/esm/object/convertWireToOsdkObjects.js.map +1 -1
  77. package/build/esm/object/convertWireToOsdkObjects.test.js +29 -25
  78. package/build/esm/object/convertWireToOsdkObjects.test.js.map +1 -1
  79. package/build/esm/object/fetchPage.js +4 -3
  80. package/build/esm/object/fetchPage.js.map +1 -1
  81. package/build/esm/object/object.test.js +17 -1
  82. package/build/esm/object/object.test.js.map +1 -1
  83. package/build/esm/object/timeseries.test.js.map +1 -1
  84. package/build/esm/objectSet/ObjectSet.test.js +98 -1
  85. package/build/esm/objectSet/ObjectSet.test.js.map +1 -1
  86. package/build/esm/objectSet/ObjectSetListenerWebsocket.js +2 -2
  87. package/build/esm/objectSet/ObjectSetListenerWebsocket.js.map +1 -1
  88. package/build/esm/objectSet/ObjectSetListenerWebsocket.test.js +2 -3
  89. package/build/esm/objectSet/ObjectSetListenerWebsocket.test.js.map +1 -1
  90. package/build/esm/objectSet/createObjectSet.js +1 -0
  91. package/build/esm/objectSet/createObjectSet.js.map +1 -1
  92. package/build/esm/observable/internal/ActionApplication.js +4 -4
  93. package/build/esm/observable/internal/ActionApplication.js.map +1 -1
  94. package/build/esm/observable/internal/ObjectQuery.js +1 -1
  95. package/build/esm/observable/internal/ObjectQuery.js.map +1 -1
  96. package/build/esm/observable/internal/OptimisticJob.js +1 -1
  97. package/build/esm/observable/internal/OptimisticJob.js.map +1 -1
  98. package/build/esm/observable/internal/Store.js +2 -2
  99. package/build/esm/observable/internal/Store.js.map +1 -1
  100. package/build/esm/observable/internal/Store.test.js +173 -216
  101. package/build/esm/observable/internal/Store.test.js.map +1 -1
  102. package/build/esm/queries/applyQuery.js +3 -3
  103. package/build/esm/queries/applyQuery.js.map +1 -1
  104. package/build/esm/util/UserAgent.js +1 -1
  105. package/build/esm/util/extractRdpDefinition.js +87 -0
  106. package/build/esm/util/extractRdpDefinition.js.map +1 -0
  107. package/build/esm/util/extractRdpDefinition.test.js +144 -0
  108. package/build/esm/util/extractRdpDefinition.test.js.map +1 -0
  109. package/build/esm/util/objectSpecifierUtils.js +48 -0
  110. package/build/esm/util/objectSpecifierUtils.js.map +1 -0
  111. package/build/esm/util/objectSpecifierUtils.test.js +42 -0
  112. package/build/esm/util/objectSpecifierUtils.test.js.map +1 -0
  113. package/build/esm/util/toDataValueQueries.js +2 -4
  114. package/build/esm/util/toDataValueQueries.js.map +1 -1
  115. package/build/types/index.d.ts +1 -1
  116. package/build/types/index.d.ts.map +1 -1
  117. package/build/types/logger/TestLogger.d.ts +14 -0
  118. package/build/types/logger/TestLogger.d.ts.map +1 -0
  119. package/build/types/object/convertWireToOsdkObjects.d.ts +4 -4
  120. package/build/types/object/convertWireToOsdkObjects.d.ts.map +1 -1
  121. package/build/types/object/fetchPage.d.ts.map +1 -1
  122. package/build/types/object/object.test.d.ts.map +1 -1
  123. package/build/types/objectSet/ObjectSet.test.d.ts.map +1 -1
  124. package/build/types/observable/internal/ActionApplication.d.ts +2 -2
  125. package/build/types/observable/internal/ActionApplication.d.ts.map +1 -1
  126. package/build/types/observable/internal/OptimisticJob.d.ts.map +1 -1
  127. package/build/types/observable/internal/Store.d.ts +2 -2
  128. package/build/types/observable/internal/Store.d.ts.map +1 -1
  129. package/build/types/queries/applyQuery.d.ts +2 -2
  130. package/build/types/queries/applyQuery.d.ts.map +1 -1
  131. package/build/types/util/extractRdpDefinition.d.ts +4 -0
  132. package/build/types/util/extractRdpDefinition.d.ts.map +1 -0
  133. package/build/types/util/extractRdpDefinition.test.d.ts +1 -0
  134. package/build/types/util/extractRdpDefinition.test.d.ts.map +1 -0
  135. package/build/types/util/objectSpecifierUtils.d.ts +24 -0
  136. package/build/types/util/objectSpecifierUtils.d.ts.map +1 -0
  137. package/build/types/util/objectSpecifierUtils.test.d.ts +1 -0
  138. package/build/types/util/objectSpecifierUtils.test.d.ts.map +1 -0
  139. package/package.json +11 -11
  140. package/build/browser/object/createObjectSpecifierFromPrimaryKey.js +0 -20
  141. package/build/browser/object/createObjectSpecifierFromPrimaryKey.js.map +0 -1
  142. package/build/cjs/chunk-EY52J5Z4.cjs.map +0 -1
  143. package/build/cjs/chunk-MCQVHD2F.cjs.map +0 -1
  144. package/build/cjs/chunk-Q7SFCCGT.cjs +0 -11
  145. package/build/cjs/chunk-Q7SFCCGT.cjs.map +0 -1
  146. package/build/cjs/graphql-RGM5SRWV.cjs +0 -10532
  147. package/build/cjs/graphql-RGM5SRWV.cjs.map +0 -1
  148. package/build/esm/object/createObjectSpecifierFromPrimaryKey.js +0 -20
  149. package/build/esm/object/createObjectSpecifierFromPrimaryKey.js.map +0 -1
  150. package/build/types/object/createObjectSpecifierFromPrimaryKey.d.ts +0 -2
  151. package/build/types/object/createObjectSpecifierFromPrimaryKey.d.ts.map +0 -1
@@ -0,0 +1,87 @@
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 invariant from "tiny-invariant";
18
+ export async function extractRdpDefinition(clientCtx, objectSet, methodInputObjectType) {
19
+ return (await extractRdpDefinitionInternal(clientCtx, objectSet, methodInputObjectType))[0];
20
+ }
21
+
22
+ /* @internal
23
+ * Returns a tuple of the derived property definitions and the object type that the derived property is defined on.
24
+ */
25
+ async function extractRdpDefinitionInternal(clientCtx, objectSet, methodInputObjectType) {
26
+ const result = {};
27
+ switch (objectSet.type) {
28
+ case "searchAround":
29
+ {
30
+ const [definitions, childObjectType] = await extractRdpDefinitionInternal(clientCtx, objectSet.objectSet, methodInputObjectType);
31
+ const objDef = await clientCtx.ontologyProvider.getObjectDefinition(childObjectType);
32
+ const linkDef = objDef.links[objectSet.link];
33
+ !linkDef ? process.env.NODE_ENV !== "production" ? invariant(false, `Missing link definition for '${objectSet.link}'`) : invariant(false) : void 0;
34
+ return [{
35
+ ...result,
36
+ ...definitions
37
+ }, objDef.links[objectSet.link].targetType];
38
+ }
39
+ case "withProperties":
40
+ {
41
+ // These are the definitions and current object type for all object set operations prior to the definition (e.g. filter, pivotTo, etc.)
42
+ const [definitions, childObjectType] = await extractRdpDefinitionInternal(clientCtx, objectSet.objectSet, methodInputObjectType);
43
+ for (const [name, definition] of Object.entries(objectSet.derivedProperties)) {
44
+ if (definition.type !== "selection") {
45
+ continue;
46
+ }
47
+ switch (definition.operation.type) {
48
+ case "collectList":
49
+ case "collectSet":
50
+ case "get":
51
+ // This is the object set construction for the derived property definition construction. We pass in childObjectType so that when we reach MethodInputObjectSet, we know where to start looking.
52
+ const [_, operationLevelObjectType] = await extractRdpDefinitionInternal(clientCtx, definition.objectSet, childObjectType);
53
+ const objDef = await clientCtx.ontologyProvider.getObjectDefinition(operationLevelObjectType);
54
+ result[name] = objDef.properties[definition.operation.selectedPropertyApiName];
55
+ default:
56
+ continue;
57
+ }
58
+ }
59
+ return [{
60
+ ...result,
61
+ ...definitions
62
+ }, childObjectType];
63
+ }
64
+ case "methodInput":
65
+ return [{}, methodInputObjectType];
66
+ case "base":
67
+ return [{}, objectSet.objectType];
68
+ case "interfaceBase":
69
+ return [{}, objectSet.interfaceType];
70
+ case "filter":
71
+ case "asBaseObjectTypes":
72
+ case "asType":
73
+ case "nearestNeighbors":
74
+ return extractRdpDefinitionInternal(clientCtx, objectSet.objectSet, methodInputObjectType);
75
+ // These will throw in OSS so we should throw here so no request is made
76
+ case "intersect":
77
+ case "static":
78
+ case "subtract":
79
+ case "union":
80
+ case "reference":
81
+ return [{}, ""];
82
+ // We don't have to worry about new object sets being added and breaking people since the OSDK is always constructing these.
83
+ default:
84
+ process.env.NODE_ENV !== "production" ? invariant(false, `Unsupported object set type for Runtime Derived Properties`) : invariant(false);
85
+ }
86
+ }
87
+ //# sourceMappingURL=extractRdpDefinition.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extractRdpDefinition.js","names":["invariant","extractRdpDefinition","clientCtx","objectSet","methodInputObjectType","extractRdpDefinitionInternal","result","type","definitions","childObjectType","objDef","ontologyProvider","getObjectDefinition","linkDef","links","link","process","env","NODE_ENV","targetType","name","definition","Object","entries","derivedProperties","operation","_","operationLevelObjectType","properties","selectedPropertyApiName","objectType","interfaceType"],"sources":["extractRdpDefinition.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 { ObjectMetadata } from \"@osdk/api\";\nimport type { ObjectSet } from \"@osdk/foundry.ontologies\";\nimport invariant from \"tiny-invariant\";\nimport type { MinimalClient } from \"../MinimalClientContext.js\";\n\nexport async function extractRdpDefinition(\n clientCtx: MinimalClient,\n objectSet: ObjectSet,\n methodInputObjectType: string,\n): Promise<\n Record<string, ObjectMetadata.Property>\n> {\n return (await extractRdpDefinitionInternal(\n clientCtx,\n objectSet,\n methodInputObjectType,\n ))[0];\n}\n\n/* @internal\n* Returns a tuple of the derived property definitions and the object type that the derived property is defined on.\n*/\nasync function extractRdpDefinitionInternal(\n clientCtx: MinimalClient,\n objectSet: ObjectSet,\n methodInputObjectType: string,\n): Promise<\n [Record<string, ObjectMetadata.Property>, string]\n> {\n const result: Record<string, ObjectMetadata.Property> = {};\n\n switch (objectSet.type) {\n case \"searchAround\": {\n const [definitions, childObjectType] = await extractRdpDefinitionInternal(\n clientCtx,\n objectSet.objectSet,\n methodInputObjectType,\n );\n const objDef = await clientCtx.ontologyProvider.getObjectDefinition(\n childObjectType,\n );\n const linkDef = objDef.links[objectSet.link];\n invariant(linkDef, `Missing link definition for '${objectSet.link}'`);\n return [\n { ...result, ...definitions },\n objDef.links[objectSet.link].targetType,\n ];\n }\n case \"withProperties\": {\n // These are the definitions and current object type for all object set operations prior to the definition (e.g. filter, pivotTo, etc.)\n const [definitions, childObjectType] = await extractRdpDefinitionInternal(\n clientCtx,\n objectSet.objectSet,\n methodInputObjectType,\n );\n\n for (\n const [name, definition] of Object.entries(objectSet.derivedProperties)\n ) {\n if (definition.type !== \"selection\") {\n continue;\n }\n\n switch (definition.operation.type) {\n case \"collectList\":\n case \"collectSet\":\n case \"get\":\n // This is the object set construction for the derived property definition construction. We pass in childObjectType so that when we reach MethodInputObjectSet, we know where to start looking.\n const [_, operationLevelObjectType] =\n await extractRdpDefinitionInternal(\n clientCtx,\n definition.objectSet,\n childObjectType,\n );\n const objDef = await clientCtx.ontologyProvider.getObjectDefinition(\n operationLevelObjectType,\n );\n\n result[name] =\n objDef.properties[definition.operation.selectedPropertyApiName];\n\n default:\n continue;\n }\n }\n return [{ ...result, ...definitions }, childObjectType];\n }\n case \"methodInput\":\n return [{}, methodInputObjectType];\n case \"base\":\n return [{}, objectSet.objectType];\n case \"interfaceBase\":\n return [{}, objectSet.interfaceType];\n case \"filter\":\n case \"asBaseObjectTypes\":\n case \"asType\":\n case \"nearestNeighbors\":\n return extractRdpDefinitionInternal(\n clientCtx,\n objectSet.objectSet,\n methodInputObjectType,\n );\n // These will throw in OSS so we should throw here so no request is made\n case \"intersect\":\n case \"static\":\n case \"subtract\":\n case \"union\":\n case \"reference\":\n return [{}, \"\"];\n // We don't have to worry about new object sets being added and breaking people since the OSDK is always constructing these.\n default:\n const _: never = objectSet;\n invariant(\n false,\n `Unsupported object set type for Runtime Derived Properties`,\n );\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,OAAOA,SAAS,MAAM,gBAAgB;AAGtC,OAAO,eAAeC,oBAAoBA,CACxCC,SAAwB,EACxBC,SAAoB,EACpBC,qBAA6B,EAG7B;EACA,OAAO,CAAC,MAAMC,4BAA4B,CACxCH,SAAS,EACTC,SAAS,EACTC,qBACF,CAAC,EAAE,CAAC,CAAC;AACP;;AAEA;AACA;AACA;AACA,eAAeC,4BAA4BA,CACzCH,SAAwB,EACxBC,SAAoB,EACpBC,qBAA6B,EAG7B;EACA,MAAME,MAA+C,GAAG,CAAC,CAAC;EAE1D,QAAQH,SAAS,CAACI,IAAI;IACpB,KAAK,cAAc;MAAE;QACnB,MAAM,CAACC,WAAW,EAAEC,eAAe,CAAC,GAAG,MAAMJ,4BAA4B,CACvEH,SAAS,EACTC,SAAS,CAACA,SAAS,EACnBC,qBACF,CAAC;QACD,MAAMM,MAAM,GAAG,MAAMR,SAAS,CAACS,gBAAgB,CAACC,mBAAmB,CACjEH,eACF,CAAC;QACD,MAAMI,OAAO,GAAGH,MAAM,CAACI,KAAK,CAACX,SAAS,CAACY,IAAI,CAAC;QAC5C,CAAUF,OAAO,GAAAG,OAAA,CAAAC,GAAA,CAAAC,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AAe;MAClB,OAAO,CAAC,CAAC,CAAC,EAAE3B,SAAS,CAAC4B,aAAa,CAAC;IACtC,KAAK,QAAQ;IACb,KAAK,mBAAmB;IACxB,KAAK,QAAQ;IACb,KAAK,kBAAkB;MACrB,OAAO1B,4BAA4B,CACjCH,SAAS,EACTC,SAAS,CAACA,SAAS,EACnBC,qBACF,CAAC;IACH;IACA,KAAK,WAAW;IAChB,KAAK,QAAQ;IACb,KAAK,UAAU;IACf,KAAK,OAAO;IACZ,KAAK,WAAW;MACd,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;IACjB;IACA;MAEEY,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAAlB,SAAS,QAEP,4DAA4D,IAF9DA,SAAS;EAIb;AACF","ignoreList":[]}
@@ -0,0 +1,144 @@
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 { describe, expect, it } from "vitest";
18
+ import { extractRdpDefinition } from "./extractRdpDefinition.js";
19
+ describe("extractRdpDefinition", () => {
20
+ const mockClientCtx = {
21
+ ontologyProvider: {
22
+ getObjectDefinition: objectType => {
23
+ if (objectType === "BaseType") {
24
+ return {
25
+ links: {
26
+ testLink1: {
27
+ targetType: "SecondType",
28
+ "multiplicity": "many"
29
+ }
30
+ }
31
+ };
32
+ } else if (objectType === "SecondType") {
33
+ return {
34
+ links: {
35
+ testLink2: {
36
+ targetType: "ThirdType",
37
+ "multiplicity": "many"
38
+ }
39
+ }
40
+ };
41
+ } else if (objectType === "ThirdType") {
42
+ return {
43
+ properties: {
44
+ testProperty: {
45
+ type: "attachment"
46
+ }
47
+ }
48
+ };
49
+ } else {
50
+ throw new Error(`Missing definition for '${objectType}'`);
51
+ }
52
+ }
53
+ }
54
+ };
55
+ const objectSet = {
56
+ type: "withProperties",
57
+ objectSet: {
58
+ type: "searchAround",
59
+ objectSet: {
60
+ type: "base",
61
+ objectType: "BaseType"
62
+ },
63
+ link: "testLink1"
64
+ },
65
+ derivedProperties: {
66
+ myRdp: {
67
+ type: "selection",
68
+ objectSet: {
69
+ type: "searchAround",
70
+ objectSet: {
71
+ type: "methodInput"
72
+ },
73
+ link: "testLink2"
74
+ },
75
+ operation: {
76
+ type: "get",
77
+ selectedPropertyApiName: "testProperty"
78
+ }
79
+ }
80
+ }
81
+ };
82
+ it("handles 'withProperties' object set type", async () => {
83
+ const result = await extractRdpDefinition(mockClientCtx, objectSet, "");
84
+ expect(result).toMatchInlineSnapshot(`
85
+ {
86
+ "myRdp": {
87
+ "type": "attachment",
88
+ },
89
+ }
90
+ `);
91
+ });
92
+ it("combines definitions from multiple derived properties", async () => {
93
+ const result = await extractRdpDefinition(mockClientCtx, {
94
+ type: "withProperties",
95
+ objectSet,
96
+ derivedProperties: {
97
+ rdp1: {
98
+ type: "selection",
99
+ objectSet: {
100
+ type: "searchAround",
101
+ objectSet: {
102
+ type: "methodInput"
103
+ },
104
+ link: "testLink2"
105
+ },
106
+ operation: {
107
+ type: "collectList",
108
+ selectedPropertyApiName: "testProperty",
109
+ limit: 100
110
+ }
111
+ },
112
+ rdp2: {
113
+ type: "selection",
114
+ objectSet: {
115
+ type: "searchAround",
116
+ objectSet: {
117
+ type: "methodInput"
118
+ },
119
+ link: "testLink2"
120
+ },
121
+ operation: {
122
+ type: "collectSet",
123
+ selectedPropertyApiName: "testProperty",
124
+ limit: 100
125
+ }
126
+ }
127
+ }
128
+ }, "");
129
+ expect(result).toMatchInlineSnapshot(`
130
+ {
131
+ "myRdp": {
132
+ "type": "attachment",
133
+ },
134
+ "rdp1": {
135
+ "type": "attachment",
136
+ },
137
+ "rdp2": {
138
+ "type": "attachment",
139
+ },
140
+ }
141
+ `);
142
+ });
143
+ });
144
+ //# sourceMappingURL=extractRdpDefinition.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extractRdpDefinition.test.js","names":["describe","expect","it","extractRdpDefinition","mockClientCtx","ontologyProvider","getObjectDefinition","objectType","links","testLink1","targetType","testLink2","properties","testProperty","type","Error","objectSet","link","derivedProperties","myRdp","operation","selectedPropertyApiName","result","toMatchInlineSnapshot","rdp1","limit","rdp2"],"sources":["extractRdpDefinition.test.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 { ObjectMetadata } from \"@osdk/api\";\nimport type { ObjectSet } from \"@osdk/foundry.ontologies\";\nimport { describe, expect, it } from \"vitest\";\nimport type { MinimalClient } from \"../MinimalClientContext.js\";\nimport { extractRdpDefinition } from \"./extractRdpDefinition.js\";\n\ndescribe(\"extractRdpDefinition\", () => {\n const mockClientCtx = {\n ontologyProvider: {\n getObjectDefinition: (objectType: string) => {\n if (objectType === \"BaseType\") {\n return {\n links: {\n testLink1: {\n targetType: \"SecondType\",\n \"multiplicity\": \"many\",\n } satisfies ObjectMetadata.Link<any, any>,\n },\n };\n } else if (objectType === \"SecondType\") {\n return {\n links: {\n testLink2: {\n targetType: \"ThirdType\",\n \"multiplicity\": \"many\",\n } satisfies ObjectMetadata.Link<any, any>,\n },\n };\n } else if (objectType === \"ThirdType\") {\n return {\n properties: {\n testProperty: {\n type: \"attachment\",\n } satisfies ObjectMetadata.Property,\n },\n };\n } else {\n throw new Error(`Missing definition for '${objectType}'`);\n }\n },\n } as any,\n } as MinimalClient;\n\n const objectSet: ObjectSet = {\n type: \"withProperties\",\n objectSet: {\n type: \"searchAround\",\n objectSet: { type: \"base\", objectType: \"BaseType\" },\n link: \"testLink1\",\n },\n derivedProperties: {\n myRdp: {\n type: \"selection\",\n objectSet: {\n type: \"searchAround\",\n objectSet: { type: \"methodInput\" },\n link: \"testLink2\",\n },\n operation: { type: \"get\", selectedPropertyApiName: \"testProperty\" },\n },\n },\n };\n\n it(\"handles 'withProperties' object set type\", async () => {\n const result = await extractRdpDefinition(\n mockClientCtx,\n objectSet,\n \"\",\n );\n\n expect(result).toMatchInlineSnapshot(\n `\n {\n \"myRdp\": {\n \"type\": \"attachment\",\n },\n }\n `,\n );\n });\n\n it(\"combines definitions from multiple derived properties\", async () => {\n const nestedObjectSet: ObjectSet = {\n type: \"withProperties\",\n objectSet,\n derivedProperties: {\n rdp1: {\n type: \"selection\",\n objectSet: {\n type: \"searchAround\",\n objectSet: { type: \"methodInput\" },\n link: \"testLink2\",\n },\n operation: {\n type: \"collectList\",\n selectedPropertyApiName: \"testProperty\",\n limit: 100,\n },\n },\n rdp2: {\n type: \"selection\",\n objectSet: {\n type: \"searchAround\",\n objectSet: { type: \"methodInput\" },\n link: \"testLink2\",\n },\n operation: {\n type: \"collectSet\",\n selectedPropertyApiName: \"testProperty\",\n limit: 100,\n },\n },\n },\n };\n\n const result = await extractRdpDefinition(\n mockClientCtx,\n nestedObjectSet,\n \"\",\n );\n\n expect(result).toMatchInlineSnapshot(`\n {\n \"myRdp\": {\n \"type\": \"attachment\",\n },\n \"rdp1\": {\n \"type\": \"attachment\",\n },\n \"rdp2\": {\n \"type\": \"attachment\",\n },\n }\n `);\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC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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
+ /**
18
+ * Creates an Object Specifier. An ObjectSpecifier is a string that uniquely identifies an object in the system,
19
+ * even when loading an interface object where primary key uniqueness is not guaranteed.
20
+ *
21
+ * @param objectDef - An Object Type Definition
22
+ * @param primaryKey - The value you want to use as the primary key
23
+ * @returns An Object Specifier
24
+ */
25
+ export function createObjectSpecifierFromPrimaryKey(objectDef, primaryKey) {
26
+ return `${objectDef.apiName}:${primaryKey}`;
27
+ }
28
+
29
+ /**
30
+ * Extracts the primary key from an ObjectSpecifier on an OSDK object.
31
+ *
32
+ * @param ObjectSpecifier
33
+ * @returns A string representing the primary key
34
+ */
35
+ export function extractPrimaryKeyFromObjectSpecifier(ObjectSpecifier) {
36
+ return ObjectSpecifier.split(":")[1];
37
+ }
38
+
39
+ /**
40
+ * Extracts the object type from an ObjectSpecifier on an OSDK object.
41
+ *
42
+ * @param ObjectSpecifier
43
+ * @returns The object type extracted from the ObjectSpecifier
44
+ */
45
+ export function extractObjectTypeFromObjectSpecifier(ObjectSpecifier) {
46
+ return ObjectSpecifier.split(":")[0];
47
+ }
48
+ //# sourceMappingURL=objectSpecifierUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"objectSpecifierUtils.js","names":["createObjectSpecifierFromPrimaryKey","objectDef","primaryKey","apiName","extractPrimaryKeyFromObjectSpecifier","ObjectSpecifier","split","extractObjectTypeFromObjectSpecifier"],"sources":["objectSpecifierUtils.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 ObjectSpecifier,\n ObjectTypeDefinition,\n PrimaryKeyType,\n} from \"@osdk/api\";\n\n/**\n * Creates an Object Specifier. An ObjectSpecifier is a string that uniquely identifies an object in the system,\n * even when loading an interface object where primary key uniqueness is not guaranteed.\n *\n * @param objectDef - An Object Type Definition\n * @param primaryKey - The value you want to use as the primary key\n * @returns An Object Specifier\n */\nexport function createObjectSpecifierFromPrimaryKey<\n Q extends ObjectTypeDefinition,\n>(objectDef: Q, primaryKey: PrimaryKeyType<Q>): ObjectSpecifier<Q> {\n return `${objectDef.apiName}:${primaryKey}` as ObjectSpecifier<Q>;\n}\n\n/**\n * Extracts the primary key from an ObjectSpecifier on an OSDK object.\n *\n * @param ObjectSpecifier\n * @returns A string representing the primary key\n */\nexport function extractPrimaryKeyFromObjectSpecifier(\n ObjectSpecifier: ObjectSpecifier<any>,\n): string {\n return ObjectSpecifier.split(\":\")[1];\n}\n\n/**\n * Extracts the object type from an ObjectSpecifier on an OSDK object.\n *\n * @param ObjectSpecifier\n * @returns The object type extracted from the ObjectSpecifier\n */\nexport function extractObjectTypeFromObjectSpecifier(\n ObjectSpecifier: ObjectSpecifier<any>,\n): string {\n return ObjectSpecifier.split(\":\")[0];\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,mCAAmCA,CAEjDC,SAAY,EAAEC,UAA6B,EAAsB;EACjE,OAAO,GAAGD,SAAS,CAACE,OAAO,IAAID,UAAU,EAAE;AAC7C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASE,oCAAoCA,CAClDC,eAAqC,EAC7B;EACR,OAAOA,eAAe,CAACC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AACtC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,oCAAoCA,CAClDF,eAAqC,EAC7B;EACR,OAAOA,eAAe,CAACC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AACtC","ignoreList":[]}
@@ -0,0 +1,42 @@
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 { describe, expect, it } from "vitest";
18
+ import { createObjectSpecifierFromPrimaryKey, extractObjectTypeFromObjectSpecifier, extractPrimaryKeyFromObjectSpecifier } from "./objectSpecifierUtils.js";
19
+ describe("ObjectSpecifier Utilities", () => {
20
+ const mockObjectTypeDefinition = {
21
+ apiName: "myApi"
22
+ };
23
+ describe("createObjectSpecifierFromPrimaryKey", () => {
24
+ it("creates a specifier in the format 'apiName:primaryKey'", () => {
25
+ const specifier = createObjectSpecifierFromPrimaryKey(mockObjectTypeDefinition, "12345");
26
+ expect(specifier).toBe("myApi:12345");
27
+ });
28
+ });
29
+ describe("extractPrimaryKeyFromObjectSpecifier", () => {
30
+ it("extracts the primary key portion correctly", () => {
31
+ const primaryKey = extractPrimaryKeyFromObjectSpecifier("myApi:12345");
32
+ expect(primaryKey).toBe("12345");
33
+ });
34
+ });
35
+ describe("extractObjectTypeFromObjectSpecifier", () => {
36
+ it("extracts the object type portion correctly", () => {
37
+ const objectType = extractObjectTypeFromObjectSpecifier("myApi:12345");
38
+ expect(objectType).toBe("myApi");
39
+ });
40
+ });
41
+ });
42
+ //# sourceMappingURL=objectSpecifierUtils.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"objectSpecifierUtils.test.js","names":["describe","expect","it","createObjectSpecifierFromPrimaryKey","extractObjectTypeFromObjectSpecifier","extractPrimaryKeyFromObjectSpecifier","mockObjectTypeDefinition","apiName","specifier","toBe","primaryKey","objectType"],"sources":["objectSpecifierUtils.test.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 { ObjectSpecifier, ObjectTypeDefinition } from \"@osdk/api\";\nimport { describe, expect, it } from \"vitest\";\nimport {\n createObjectSpecifierFromPrimaryKey,\n extractObjectTypeFromObjectSpecifier,\n extractPrimaryKeyFromObjectSpecifier,\n} from \"./objectSpecifierUtils.js\";\n\ndescribe(\"ObjectSpecifier Utilities\", () => {\n const mockObjectTypeDefinition = {\n apiName: \"myApi\",\n } as ObjectTypeDefinition;\n\n describe(\"createObjectSpecifierFromPrimaryKey\", () => {\n it(\"creates a specifier in the format 'apiName:primaryKey'\", () => {\n const primaryKey = \"12345\";\n const specifier = createObjectSpecifierFromPrimaryKey(\n mockObjectTypeDefinition,\n primaryKey,\n );\n expect(specifier).toBe(\"myApi:12345\");\n });\n });\n\n describe(\"extractPrimaryKeyFromObjectSpecifier\", () => {\n it(\"extracts the primary key portion correctly\", () => {\n const specifier = \"myApi:12345\" as ObjectSpecifier<any>;\n const primaryKey = extractPrimaryKeyFromObjectSpecifier(specifier);\n expect(primaryKey).toBe(\"12345\");\n });\n });\n\n describe(\"extractObjectTypeFromObjectSpecifier\", () => {\n it(\"extracts the object type portion correctly\", () => {\n const specifier = \"myApi:12345\" as ObjectSpecifier<any>;\n const objectType = extractObjectTypeFromObjectSpecifier(specifier);\n expect(objectType).toBe(\"myApi\");\n });\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AAC7C,SACEC,mCAAmC,EACnCC,oCAAoC,EACpCC,oCAAoC,QAC/B,2BAA2B;AAElCL,QAAQ,CAAC,2BAA2B,EAAE,MAAM;EAC1C,MAAMM,wBAAwB,GAAG;IAC/BC,OAAO,EAAE;EACX,CAAyB;EAEzBP,QAAQ,CAAC,qCAAqC,EAAE,MAAM;IACpDE,EAAE,CAAC,wDAAwD,EAAE,MAAM;MAEjE,MAAMM,SAAS,GAAGL,mCAAmC,CACnDG,wBAAwB,EAFP,OAInB,CAAC;MACDL,MAAM,CAACO,SAAS,CAAC,CAACC,IAAI,CAAC,aAAa,CAAC;IACvC,CAAC,CAAC;EACJ,CAAC,CAAC;EAEFT,QAAQ,CAAC,sCAAsC,EAAE,MAAM;IACrDE,EAAE,CAAC,4CAA4C,EAAE,MAAM;MAErD,MAAMQ,UAAU,GAAGL,oCAAoC,CADrC,aAC+C,CAAC;MAClEJ,MAAM,CAACS,UAAU,CAAC,CAACD,IAAI,CAAC,OAAO,CAAC;IAClC,CAAC,CAAC;EACJ,CAAC,CAAC;EAEFT,QAAQ,CAAC,sCAAsC,EAAE,MAAM;IACrDE,EAAE,CAAC,4CAA4C,EAAE,MAAM;MAErD,MAAMS,UAAU,GAAGP,oCAAoC,CADrC,aAC+C,CAAC;MAClEH,MAAM,CAACU,UAAU,CAAC,CAACF,IAAI,CAAC,OAAO,CAAC;IAClC,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -18,6 +18,7 @@ import * as OntologiesV2 from "@osdk/foundry.ontologies";
18
18
  import { isAttachmentFile, isAttachmentUpload } from "../object/AttachmentUpload.js";
19
19
  import { getWireObjectSet, isObjectSet } from "../objectSet/createObjectSet.js";
20
20
  import { isOsdkBaseObject } from "./isOsdkBaseObject.js";
21
+ import { extractPrimaryKeyFromObjectSpecifier } from "./objectSpecifierUtils.js";
21
22
  import { isWireObjectSet } from "./WireObjectSet.js";
22
23
 
23
24
  /**
@@ -105,7 +106,7 @@ export async function toDataValueQueries(value, client, desiredType) {
105
106
  const entrySet = [];
106
107
  for (const [key, mapValue] of Object.entries(value)) {
107
108
  entrySet.push({
108
- key: desiredType.keyType.type === "object" ? extractPrimaryKeyFromObjectIdentifier(key) : await toDataValueQueries(key, client, desiredType.keyType),
109
+ key: desiredType.keyType.type === "object" ? extractPrimaryKeyFromObjectSpecifier(key) : await toDataValueQueries(key, client, desiredType.keyType),
109
110
  value: await toDataValueQueries(mapValue, client, desiredType.valueType)
110
111
  });
111
112
  }
@@ -135,7 +136,4 @@ export async function toDataValueQueries(value, client, desiredType) {
135
136
  }
136
137
  return value;
137
138
  }
138
- function extractPrimaryKeyFromObjectIdentifier(a) {
139
- return a.substring(a.indexOf(":") + 1);
140
- }
141
139
  //# sourceMappingURL=toDataValueQueries.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"toDataValueQueries.js","names":["OntologiesV2","isAttachmentFile","isAttachmentUpload","getWireObjectSet","isObjectSet","isOsdkBaseObject","isWireObjectSet","toDataValueQueries","value","client","desiredType","Array","isArray","multiplicity","values","from","some","dataValue","converted","push","promiseArray","innerValue","Promise","all","type","attachment","Attachments","upload","data","filename","name","rid","groups","Set","$primaryKey","entrySet","key","mapValue","Object","entries","keyType","extractPrimaryKeyFromObjectIdentifier","valueType","structMap","structValue","a","substring","indexOf"],"sources":["toDataValueQueries.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 { QueryDataTypeDefinition } from \"@osdk/api\";\nimport { type DataValue } from \"@osdk/foundry.ontologies\";\nimport * as OntologiesV2 from \"@osdk/foundry.ontologies\";\nimport type { MinimalClient } from \"../MinimalClientContext.js\";\nimport {\n isAttachmentFile,\n isAttachmentUpload,\n} from \"../object/AttachmentUpload.js\";\nimport { getWireObjectSet, isObjectSet } from \"../objectSet/createObjectSet.js\";\nimport { isOsdkBaseObject } from \"./isOsdkBaseObject.js\";\nimport { isWireObjectSet } from \"./WireObjectSet.js\";\n\n/**\n * Marshall user-facing data into the wire DataValue type\n *\n * @see DataValue for the expected payloads\n * @internal\n */\nexport async function toDataValueQueries(\n value: unknown,\n client: MinimalClient,\n desiredType: QueryDataTypeDefinition,\n): Promise<DataValue> {\n if (value == null) {\n return value;\n }\n\n if (Array.isArray(value) && desiredType.multiplicity) {\n const values = Array.from(value);\n if (\n values.some((dataValue) =>\n isAttachmentUpload(dataValue) || isAttachmentFile(dataValue)\n )\n ) {\n const converted = [];\n for (const value of values) {\n converted.push(await toDataValueQueries(value, client, desiredType));\n }\n return converted;\n }\n const promiseArray = Array.from(\n value,\n async (innerValue) =>\n await toDataValueQueries(innerValue, client, desiredType),\n );\n return Promise.all(promiseArray);\n }\n\n switch (desiredType.type) {\n case \"attachment\": {\n if (isAttachmentUpload(value)) {\n const attachment = await OntologiesV2.Attachments.upload(\n client,\n value.data,\n {\n filename: value.name,\n },\n );\n return attachment.rid;\n }\n\n if (\n isAttachmentFile(value)\n ) {\n const attachment = await OntologiesV2.Attachments.upload(\n client,\n value,\n {\n filename: value.name as string,\n },\n );\n return attachment.rid;\n }\n\n // If it's not an upload, it's just an attachment rid string which we can pass through\n return value;\n }\n case \"twoDimensionalAggregation\": {\n return {\n groups: value,\n };\n }\n case \"threeDimensionalAggregation\": {\n return {\n groups: value,\n };\n }\n\n case \"set\": {\n if (value instanceof Set) {\n const promiseArray = Array.from(\n value,\n async (innerValue) =>\n await toDataValueQueries(innerValue, client, desiredType[\"set\"]),\n );\n return Promise.all(promiseArray);\n }\n break;\n }\n case \"object\": {\n if (isOsdkBaseObject(value)) {\n return value.$primaryKey;\n }\n break;\n }\n case \"objectSet\": {\n // object set (the rid as a string (passes through the last return), or the ObjectSet definition directly)\n if (isWireObjectSet(value)) {\n return value;\n }\n if (isObjectSet(value)) {\n return getWireObjectSet(value);\n }\n break;\n }\n\n case \"map\": {\n if (typeof value === \"object\") {\n const entrySet: Array<{ key: any; value: any }> = [];\n for (const [key, mapValue] of Object.entries(value)) {\n entrySet.push({\n key: desiredType.keyType.type === \"object\"\n ? extractPrimaryKeyFromObjectIdentifier(key)\n : await toDataValueQueries(\n key,\n client,\n desiredType.keyType,\n ),\n value: await toDataValueQueries(\n mapValue,\n client,\n desiredType.valueType,\n ),\n });\n }\n return entrySet;\n }\n break;\n }\n\n case \"struct\": {\n if (typeof value === \"object\") {\n const structMap: { [key: string]: unknown } = {};\n for (const [key, structValue] of Object.entries(value)) {\n structMap[key] = await toDataValueQueries(\n structValue,\n client,\n desiredType[\"struct\"][key],\n );\n }\n return structMap;\n }\n }\n\n case \"boolean\":\n case \"date\":\n case \"double\":\n case \"float\":\n case \"integer\":\n case \"long\":\n case \"string\":\n case \"timestamp\":\n return value;\n }\n return value;\n}\n\nfunction extractPrimaryKeyFromObjectIdentifier(a: string) {\n return a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AACC,SAAS,CAACD,CAAC,CAACE,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AACxC","ignoreList":[]}
1
+ {"version":3,"file":"toDataValueQueries.js","names":["OntologiesV2","isAttachmentFile","isAttachmentUpload","getWireObjectSet","isObjectSet","isOsdkBaseObject","extractPrimaryKeyFromObjectSpecifier","isWireObjectSet","toDataValueQueries","value","client","desiredType","Array","isArray","multiplicity","values","from","some","dataValue","converted","push","promiseArray","innerValue","Promise","all","type","attachment","Attachments","upload","data","filename","name","rid","groups","Set","$primaryKey","entrySet","key","mapValue","Object","entries","keyType","valueType","structMap","structValue"],"sources":["toDataValueQueries.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 { QueryDataTypeDefinition } from \"@osdk/api\";\nimport { type DataValue } from \"@osdk/foundry.ontologies\";\nimport * as OntologiesV2 from \"@osdk/foundry.ontologies\";\nimport type { MinimalClient } from \"../MinimalClientContext.js\";\nimport {\n isAttachmentFile,\n isAttachmentUpload,\n} from \"../object/AttachmentUpload.js\";\nimport { getWireObjectSet, isObjectSet } from \"../objectSet/createObjectSet.js\";\nimport { isOsdkBaseObject } from \"./isOsdkBaseObject.js\";\nimport { extractPrimaryKeyFromObjectSpecifier } from \"./objectSpecifierUtils.js\";\nimport { isWireObjectSet } from \"./WireObjectSet.js\";\n\n/**\n * Marshall user-facing data into the wire DataValue type\n *\n * @see DataValue for the expected payloads\n * @internal\n */\nexport async function toDataValueQueries(\n value: unknown,\n client: MinimalClient,\n desiredType: QueryDataTypeDefinition,\n): Promise<DataValue> {\n if (value == null) {\n return value;\n }\n\n if (Array.isArray(value) && desiredType.multiplicity) {\n const values = Array.from(value);\n if (\n values.some((dataValue) =>\n isAttachmentUpload(dataValue) || isAttachmentFile(dataValue)\n )\n ) {\n const converted = [];\n for (const value of values) {\n converted.push(await toDataValueQueries(value, client, desiredType));\n }\n return converted;\n }\n const promiseArray = Array.from(\n value,\n async (innerValue) =>\n await toDataValueQueries(innerValue, client, desiredType),\n );\n return Promise.all(promiseArray);\n }\n\n switch (desiredType.type) {\n case \"attachment\": {\n if (isAttachmentUpload(value)) {\n const attachment = await OntologiesV2.Attachments.upload(\n client,\n value.data,\n {\n filename: value.name,\n },\n );\n return attachment.rid;\n }\n\n if (\n isAttachmentFile(value)\n ) {\n const attachment = await OntologiesV2.Attachments.upload(\n client,\n value,\n {\n filename: value.name as string,\n },\n );\n return attachment.rid;\n }\n\n // If it's not an upload, it's just an attachment rid string which we can pass through\n return value;\n }\n case \"twoDimensionalAggregation\": {\n return {\n groups: value,\n };\n }\n case \"threeDimensionalAggregation\": {\n return {\n groups: value,\n };\n }\n\n case \"set\": {\n if (value instanceof Set) {\n const promiseArray = Array.from(\n value,\n async (innerValue) =>\n await toDataValueQueries(innerValue, client, desiredType[\"set\"]),\n );\n return Promise.all(promiseArray);\n }\n break;\n }\n case \"object\": {\n if (isOsdkBaseObject(value)) {\n return value.$primaryKey;\n }\n break;\n }\n case \"objectSet\": {\n // object set (the rid as a string (passes through the last return), or the ObjectSet definition directly)\n if (isWireObjectSet(value)) {\n return value;\n }\n if (isObjectSet(value)) {\n return getWireObjectSet(value);\n }\n break;\n }\n\n case \"map\": {\n if (typeof value === \"object\") {\n const entrySet: Array<{ key: any; value: any }> = [];\n for (const [key, mapValue] of Object.entries(value)) {\n entrySet.push({\n key: desiredType.keyType.type === \"object\"\n ? extractPrimaryKeyFromObjectSpecifier(key as any)\n : await toDataValueQueries(\n key,\n client,\n desiredType.keyType,\n ),\n value: await toDataValueQueries(\n mapValue,\n client,\n desiredType.valueType,\n ),\n });\n }\n return entrySet;\n }\n break;\n }\n\n case \"struct\": {\n if (typeof value === \"object\") {\n const structMap: { [key: string]: unknown } = {};\n for (const [key, structValue] of Object.entries(value)) {\n structMap[key] = await toDataValueQueries(\n structValue,\n client,\n desiredType[\"struct\"][key],\n );\n }\n return structMap;\n }\n }\n\n case \"boolean\":\n case \"date\":\n case \"double\":\n case \"float\":\n case \"integer\":\n case \"long\":\n case \"string\":\n case \"timestamp\":\n return value;\n }\n return value;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,OAAO,KAAKA,YAAY,MAAM,0BAA0B;AAExD,SACEC,gBAAgB,EAChBC,kBAAkB,QACb,+BAA+B;AACtC,SAASC,gBAAgB,EAAEC,WAAW,QAAQ,iCAAiC;AAC/E,SAASC,gBAAgB,QAAQ,uBAAuB;AACxD,SAASC,oCAAoC,QAAQ,2BAA2B;AAChF,SAASC,eAAe,QAAQ,oBAAoB;;AAEpD;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,eAAeC,kBAAkBA,CACtCC,KAAc,EACdC,MAAqB,EACrBC,WAAoC,EAChB;EACpB,IAAIF,KAAK,IAAI,IAAI,EAAE;IACjB,OAAOA,KAAK;EACd;EAEA,IAAIG,KAAK,CAACC,OAAO,CAACJ,KAAK,CAAC,IAAIE,WAAW,CAACG,YAAY,EAAE;IACpD,MAAMC,MAAM,GAAGH,KAAK,CAACI,IAAI,CAACP,KAAK,CAAC;IAChC,IACEM,MAAM,CAACE,IAAI,CAAEC,SAAS,IACpBhB,kBAAkB,CAACgB,SAAS,CAAC,IAAIjB,gBAAgB,CAACiB,SAAS,CAC7D,CAAC,EACD;MACA,MAAMC,SAAS,GAAG,EAAE;MACpB,KAAK,MAAMV,KAAK,IAAIM,MAAM,EAAE;QAC1BI,SAAS,CAACC,IAAI,CAAC,MAAMZ,kBAAkB,CAACC,KAAK,EA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AAW,CAAC,QAAQ,CAAC,CAAC0B,GAAG,CAC3B,CAAC;UACH;UACA,OAAOM,SAAS;QAClB;MACF;IAEA,KAAK,SAAS;IACd,KAAK,MAAM;IACX,KAAK,QAAQ;IACb,KAAK,OAAO;IACZ,KAAK,SAAS;IACd,KAAK,MAAM;IACX,KAAK,QAAQ;IACb,KAAK,WAAW;MACd,OAAOlC,KAAK;EAChB;EACA,OAAOA,KAAK;AACd","ignoreList":[]}
@@ -8,6 +8,6 @@ export { createPlatformClient } from "./createPlatformClient.js";
8
8
  export type { PlatformClient } from "./createPlatformClient.js";
9
9
  export type { Logger } from "./logger/Logger.js";
10
10
  export { createAttachmentUpload } from "./object/AttachmentUpload.js";
11
- export { createObjectSpecifierFromPrimaryKey } from "./object/createObjectSpecifierFromPrimaryKey.js";
12
11
  export type { ResultOrError } from "./ResultOrError.js";
12
+ export { createObjectSpecifierFromPrimaryKey } from "./util/objectSpecifierUtils.js";
13
13
  export { extractDate, extractDateInLocalTime, extractDateInUTC } from "./util/datetimeConverters.js";
@@ -1 +1 @@
1
- {"mappings":"AAgBA,eACE,kBACA,oBACA,gBACA,aACA,4BACA,0BACA,oBACA,yBACA,qBACA,gBACA,WACA,iBACA,sBACA,MACA,YACA,YACA,aACA,cACA,2BACA,iBACA,YACA,aACA,QACA,oBACA,cACA,mBACK;AACP,SAAS,YAAY;AACrB,SAAS,wBAAwB;AAEjC,SAAS,6BAA6B;AACtC,eAAc,cAAc;AAC5B,SAAS,oBAAoB;AAC7B,SAAS,4BAA4B;AACrC,eAAc,sBAAsB;AACpC,eAAc,cAAc;AAC5B,SAAS,8BAA8B;AACvC,SAAS,2CAA2C;AACpD,eAAc,qBAAqB;AAEnC,SACE,aACA,wBACA,wBACK","names":[],"sources":["../../src/index.ts"],"version":3,"file":"index.d.ts"}
1
+ {"mappings":"AAgBA,eACE,kBACA,oBACA,gBACA,aACA,4BACA,0BACA,oBACA,yBACA,qBACA,gBACA,WACA,iBACA,sBACA,MACA,YACA,YACA,aACA,cACA,2BACA,iBACA,YACA,aACA,QACA,oBACA,cACA,mBACK;AACP,SAAS,YAAY;AACrB,SAAS,wBAAwB;AAEjC,SAAS,6BAA6B;AACtC,eAAc,cAAc;AAC5B,SAAS,oBAAoB;AAC7B,SAAS,4BAA4B;AACrC,eAAc,sBAAsB;AACpC,eAAc,cAAc;AAC5B,SAAS,8BAA8B;AACvC,eAAc,qBAAqB;AACnC,SACE,2CACK;AAEP,SACE,aACA,wBACA,wBACK","names":[],"sources":["../../src/index.ts"],"version":3,"file":"index.d.ts"}
@@ -0,0 +1,14 @@
1
+ import { BaseLogger } from "./BaseLogger.js";
2
+ import type { Logger } from "./Logger.js";
3
+ /**
4
+ * A logger suitable for using in unit tests.
5
+ * - It uses chalk for colors (Node and browser console.log supports)
6
+ * - Does not rely on async behavior of `pino`.
7
+ */
8
+ export declare class TestLogger extends BaseLogger implements Logger {
9
+ #private;
10
+ constructor(bindings?: Record<string, any>, options?: {
11
+ level?: string
12
+ msgPrefix?: string
13
+ });
14
+ }
@@ -0,0 +1 @@
1
+ {"mappings":"AAkBA,SAAS,kBAAkB,iBAAkB;AAC7C,cAAqB,cAAc,aAAc;;;;;;AAkBjD,OAAO,cAAM,mBAAmB,sBAAsB,OAAO;;CAC3D,YACEA,WAAU,qBACVC,UAAS;EAAE;EAAgB;CAAoB;AAoClD","names":["bindings: Record<string, any>","options: { level?: string; msgPrefix?: string }"],"sources":["../../../src/logger/TestLogger.ts"],"version":3,"file":"TestLogger.d.ts"}
@@ -1,8 +1,8 @@
1
- import type { NullabilityAdherence } from "@osdk/api";
1
+ import type { NullabilityAdherence, ObjectMetadata } from "@osdk/api";
2
2
  import type { InterfaceToObjectTypeMappings, InterfaceTypeApiName, OntologyObjectV2 } from "@osdk/foundry.ontologies";
3
3
  import type { MinimalClient } from "../MinimalClientContext.js";
4
4
  import type { InterfaceHolder } from "./convertWireToOsdkObjects/InterfaceHolder.js";
5
5
  import type { ObjectHolder } from "./convertWireToOsdkObjects/ObjectHolder.js";
6
- export declare function convertWireToOsdkObjects2(client: MinimalClient, objects: OntologyObjectV2[], interfaceApiName: string, forceRemoveRid?: boolean, selectedProps?: ReadonlyArray<string>, strictNonNull?: NullabilityAdherence, interfaceToObjectTypeMappings?: Record<InterfaceTypeApiName, InterfaceToObjectTypeMappings>): Promise<Array<InterfaceHolder>>;
7
- export declare function convertWireToOsdkObjects2(client: MinimalClient, objects: OntologyObjectV2[], interfaceApiName: undefined, forceRemoveRid?: boolean, selectedProps?: ReadonlyArray<string>, strictNonNull?: NullabilityAdherence, interfaceToObjectTypeMappings?: Record<InterfaceTypeApiName, InterfaceToObjectTypeMappings>): Promise<Array<ObjectHolder>>;
8
- export declare function convertWireToOsdkObjects2(client: MinimalClient, objects: OntologyObjectV2[], interfaceApiName: string | undefined, forceRemoveRid?: boolean, selectedProps?: ReadonlyArray<string>, strictNonNull?: NullabilityAdherence, interfaceToObjectTypeMappings?: Record<InterfaceTypeApiName, InterfaceToObjectTypeMappings>): Promise<Array<ObjectHolder | InterfaceHolder>>;
6
+ export declare function convertWireToOsdkObjects2(client: MinimalClient, objects: OntologyObjectV2[], interfaceApiName: string, derivedPropertyTypeByName: Record<string, ObjectMetadata.Property>, forceRemoveRid?: boolean, selectedProps?: ReadonlyArray<string>, strictNonNull?: NullabilityAdherence, interfaceToObjectTypeMappings?: Record<InterfaceTypeApiName, InterfaceToObjectTypeMappings>): Promise<Array<InterfaceHolder>>;
7
+ export declare function convertWireToOsdkObjects2(client: MinimalClient, objects: OntologyObjectV2[], interfaceApiName: undefined, derivedPropertyTypeByName: Record<string, ObjectMetadata.Property>, forceRemoveRid?: boolean, selectedProps?: ReadonlyArray<string>, strictNonNull?: NullabilityAdherence, interfaceToObjectTypeMappings?: Record<InterfaceTypeApiName, InterfaceToObjectTypeMappings>): Promise<Array<ObjectHolder>>;
8
+ export declare function convertWireToOsdkObjects2(client: MinimalClient, objects: OntologyObjectV2[], interfaceApiName: string | undefined, derivedPropertyTypeByName: Record<string, ObjectMetadata.Property>, forceRemoveRid?: boolean, selectedProps?: ReadonlyArray<string>, strictNonNull?: NullabilityAdherence, interfaceToObjectTypeMappings?: Record<InterfaceTypeApiName, InterfaceToObjectTypeMappings>): Promise<Array<ObjectHolder | InterfaceHolder>>;
@@ -1 +1 @@
1
- {"mappings":"AAgBA,cAEE,4BAEK,WAAY;AACnB,cACE,+BACA,sBACA,wBACK,0BAA2B;AAElC,cAAc,qBAAqB,4BAA6B;AAKhE,cAAc,uBAAuB,+CAAgD;AACrF,cAAc,oBAAoB,4CAA6C;AA6F/E,OAAO,iBAAe,0BACpBA,QAAQ,eACRC,SAAS,oBACTC,0BACAC,0BACAC,gBAAgB,uBAChBC,gBAAgB,sBAChBC,gCAAgC,OAC9B,sBACA,iCAED,QAAQ,MAAM;AACjB,OAAO,iBAAe,0BACpBN,QAAQ,eACRC,SAAS,oBACTM,6BACAJ,0BACAC,gBAAgB,uBAChBC,gBAAgB,sBAChBC,gCAAgC,OAC9B,sBACA,iCAED,QAAQ,MAAM;AACjB,OAAO,iBAAe,0BACpBN,QAAQ,eACRC,SAAS,oBACTO,sCACAL,0BACAC,gBAAgB,uBAChBC,gBAAgB,sBAChBC,gCAAgC,OAC9B,sBACA,iCAED,QAAQ,MAAM,eAAe","names":["client: MinimalClient","objects: OntologyObjectV2[]","interfaceApiName: string","forceRemoveRid?: boolean","selectedProps?: ReadonlyArray<string>","strictNonNull?: NullabilityAdherence","interfaceToObjectTypeMappings?: Record<\n InterfaceTypeApiName,\n InterfaceToObjectTypeMappings\n >","interfaceApiName: undefined","interfaceApiName: string | undefined"],"sources":["../../../src/object/convertWireToOsdkObjects.ts"],"version":3,"file":"convertWireToOsdkObjects.d.ts"}
1
+ {"mappings":"AAgBA,cAEE,sBACA,sBACK,WAAY;AACnB,cACE,+BACA,sBACA,wBACK,0BAA2B;AAElC,cAAc,qBAAqB,4BAA6B;AAKhE,cAAc,uBAAuB,+CAAgD;AACrF,cAAc,oBAAoB,4CAA6C;AAiG/E,OAAO,iBAAe,0BACpBA,QAAQ,eACRC,SAAS,oBACTC,0BACAC,2BAA2B,eAEzB,eAAe,WAEjBC,0BACAC,gBAAgB,uBAChBC,gBAAgB,sBAChBC,gCAAgC,OAC9B,sBACA,iCAED,QAAQ,MAAM;AACjB,OAAO,iBAAe,0BACpBP,QAAQ,eACRC,SAAS,oBACTO,6BACAL,2BAA2B,eAEzB,eAAe,WAEjBC,0BACAC,gBAAgB,uBAChBC,gBAAgB,sBAChBC,gCAAgC,OAC9B,sBACA,iCAED,QAAQ,MAAM;AACjB,OAAO,iBAAe,0BACpBP,QAAQ,eACRC,SAAS,oBACTQ,sCACAN,2BAA2B,eAEzB,eAAe,WAEjBC,0BACAC,gBAAgB,uBAChBC,gBAAgB,sBAChBC,gCAAgC,OAC9B,sBACA,iCAED,QAAQ,MAAM,eAAe","names":["client: MinimalClient","objects: OntologyObjectV2[]","interfaceApiName: string","derivedPropertyTypeByName: Record<\n string,\n ObjectMetadata.Property\n >","forceRemoveRid?: boolean","selectedProps?: ReadonlyArray<string>","strictNonNull?: NullabilityAdherence","interfaceToObjectTypeMappings?: Record<\n InterfaceTypeApiName,\n InterfaceToObjectTypeMappings\n >","interfaceApiName: undefined","interfaceApiName: string | undefined"],"sources":["../../../src/object/convertWireToOsdkObjects.ts"],"version":3,"file":"convertWireToOsdkObjects.d.ts"}
@@ -1 +1 @@
1
- {"mappings":"AAgBA,cACE,SAMA,6BAEA,oBAEK,WAAY;AAgBnB,OAAO,iBAAS;CACd,UAAU;CACV,UAAU,aAAa;EAEvBA,MAAM,GACN,GAAG,YAAY,MACd,QAAQ,GAAG","names":["type: Q"],"sources":["../../../src/object/fetchPage.ts"],"version":3,"file":"fetchPage.d.ts"}
1
+ {"mappings":"AAgBA,cACE,SAMA,6BAEA,oBAEK,WAAY;AAiBnB,OAAO,iBAAS;CACd,UAAU;CACV,UAAU,aAAa;EAEvBA,MAAM,GACN,GAAG,YAAY,MACd,QAAQ,GAAG","names":["type: Q"],"sources":["../../../src/object/fetchPage.ts"],"version":3,"file":"fetchPage.d.ts"}
@@ -1 +1 @@
1
- {"mappings":"AAgBA,cAGE,YAEK,WAAY;AACnB,SAAmB,gBAAgB,4BAA6B;AAQhE,cAAiC,cAAc,cAAe;AA2gB9D,OAAO,iBAAe,YAAYA,QAAQ,SAAS,QAAQ,KAAK;AAOhE,OAAO,iBAAe,aACpBA,QAAQ,SACP,QAAQ,SAAS;AAOpB,OAAO,iBAAe,yCACpBA,QAAQ,SACP,QAAQ,KAAK,UAAU;AAM1B,OAAO,iBAAe,iDACpBA,QAAQ,SACP,QAAQ,KAAK,UAAU;AAM1B,OAAO,iBAAe,yCACpBA,QAAQ,SACP,QAAQ,SAAS,kBAAkB;AAMtC,OAAO,iBAAe,iDACpBA,QAAQ,SACP,QAAQ,KAAK,UAAU;AAM1B,OAAO,iBAAe,yCACpBA,QAAQ,SACP,QAAQ,KAAK;AAIhB,OAAO,iBAAe,6CACpBA,QAAQ,SACP,QAAQ,KAAK","names":["client: Client"],"sources":["../../../src/object/object.test.ts"],"version":3,"file":"object.test.d.ts"}
1
+ {"mappings":"AAgBA,cAGE,YAEK,WAAY;AACnB,SAAmB,gBAA8B,4BAA6B;AAQ9E,cAAiC,cAAc,cAAe;AA8hB9D,OAAO,iBAAe,YAAYA,QAAQ,SAAS,QAAQ,KAAK;AAOhE,OAAO,iBAAe,aACpBA,QAAQ,SACP,QAAQ,SAAS;AAOpB,OAAO,iBAAe,yCACpBA,QAAQ,SACP,QAAQ,KAAK,UAAU;AAM1B,OAAO,iBAAe,iDACpBA,QAAQ,SACP,QAAQ,KAAK,UAAU;AAM1B,OAAO,iBAAe,yCACpBA,QAAQ,SACP,QAAQ,SAAS,kBAAkB;AAMtC,OAAO,iBAAe,iDACpBA,QAAQ,SACP,QAAQ,KAAK,UAAU;AAM1B,OAAO,iBAAe,yCACpBA,QAAQ,SACP,QAAQ,KAAK;AAIhB,OAAO,iBAAe,6CACpBA,QAAQ,SACP,QAAQ,KAAK","names":["client: Client"],"sources":["../../../src/object/object.test.ts"],"version":3,"file":"object.test.d.ts"}
@@ -1 +1 @@
1
- {"mappings":"AAgBA,cACE,qBAIA,6BAEA,4BAIK,WAAY;KAsBd,gBACH,UAAU,+BACR,oBAAoB,GAAG;AAyB3B,YAAY;CACV,aAAa;CACb,WAAW;IACT,YAAY,oBAAoB,IAAI,iBAAiB,gBAAgB","names":[],"sources":["../../../src/objectSet/ObjectSet.test.ts"],"version":3,"file":"ObjectSet.test.d.ts"}
1
+ {"mappings":"AAgBA,cAEE,qBAIA,6BAEA,4BAIK,WAAY;KAuBd,gBACH,UAAU,+BACR,oBAAoB,GAAG;AAyB3B,YAAY;CACV,aAAa;CACb,WAAW;IACT,YAAY,oBAAoB,IAAI,iBAAiB,gBAAgB","names":[],"sources":["../../../src/objectSet/ObjectSet.test.ts"],"version":3,"file":"ObjectSet.test.d.ts"}
@@ -1,9 +1,9 @@
1
- import type { ActionDefinition } from "@osdk/api";
1
+ import type { ActionDefinition, ActionEditResponse } from "@osdk/api";
2
2
  import type { ActionSignatureFromDef } from "../../actions/applyAction.js";
3
3
  import type { Store } from "./Store.js";
4
4
  export declare class ActionApplication {
5
5
  #private;
6
6
  private store;
7
7
  constructor(store: Store);
8
- applyAction: <Q extends ActionDefinition<any>>(action: Q, args: Parameters<ActionSignatureFromDef<Q>["applyAction"]>[0], opts?: Store.ApplyActionOptions) => Promise<unknown>;
8
+ applyAction: <Q extends ActionDefinition<any>>(action: Q, args: Parameters<ActionSignatureFromDef<Q>["applyAction"]>[0], opts?: Store.ApplyActionOptions) => Promise<ActionEditResponse>;
9
9
  }
@@ -1 +1 @@
1
- {"mappings":"AAgBA,cAAc,wBAA4C,WAAY;AAEtE,cAAc,8BAA8B,8BAA+B;AAI3E,cAAc,aAAa,YAAa;AAIxC,OAAO,cAAM,kBAAkB;;CACjB;CAAZ,YAAoBA,OAAO;CAE3B,cAAc,UAAU,uBACtBC,QAAQ,GACRC,MAAM,WAAW,uBAAuB,GAAG,gBAAgB,IAC3DC,OAAO,MAAM,uBACV;AA8FN","names":["store: Store","action: Q","args: Parameters<ActionSignatureFromDef<Q>[\"applyAction\"]>[0]","opts?: Store.ApplyActionOptions"],"sources":["../../../../src/observable/internal/ActionApplication.ts"],"version":3,"file":"ActionApplication.d.ts"}
1
+ {"mappings":"AAgBA,cAAc,kBAAkB,0BAA0B,WAAY;AAEtE,cAAc,8BAA8B,8BAA+B;AAI3E,cAAc,aAAa,YAAa;AAIxC,OAAO,cAAM,kBAAkB;;CACjB;CAAZ,YAAoBA,OAAO;CAE3B,cAAc,UAAU,uBACtBC,QAAQ,GACRC,MAAM,WAAW,uBAAuB,GAAG,gBAAgB,IAC3DC,OAAO,MAAM,uBACV,QAAQ;AAmGd","names":["store: Store","action: Q","args: Parameters<ActionSignatureFromDef<Q>[\"applyAction\"]>[0]","opts?: Store.ApplyActionOptions"],"sources":["../../../../src/observable/internal/ActionApplication.ts"],"version":3,"file":"ActionApplication.d.ts"}
@@ -1 +1 @@
1
- {"mappings":"AAkBA,cAAc,yBAAyB,yBAA0B;AACjE,cAAc,eAAe,cAAe;AAC5C,cAAkC,oBAAoB,mBAAoB;AAC1E,cAAc,aAAa,YAAa;AAExC,OAAO,cAAM,cAAc;;CACzB,SAAS;CACT,iBAAiB,QAAQ;CAGzB,YAAYA,OAAO,OAAOC,cAAc;AAmEzC;AAED,OAAO,iBAAS,iBACdD,OAAO,OACPE,gCAAgCC,KAAK,oCAC9B","names":["store: Store","optimisticId: OptimisticId","optimisticUpdate: undefined | ((ctx: OptimisticBuilder) => void)","ctx: OptimisticBuilder"],"sources":["../../../../src/observable/internal/OptimisticJob.ts"],"version":3,"file":"OptimisticJob.d.ts"}
1
+ {"mappings":"AAkBA,cAAc,yBAAyB,yBAA0B;AACjE,cAAc,eAAe,cAAe;AAC5C,cAAkC,oBAAoB,mBAAoB;AAC1E,cAAc,aAAa,YAAa;AAExC,OAAO,cAAM,cAAc;;CACzB,SAAS;CACT,iBAAiB,QAAQ;CAGzB,YAAYA,OAAO,OAAOC,cAAc;AAoEzC;AAED,OAAO,iBAAS,iBACdD,OAAO,OACPE,gCAAgCC,KAAK,oCAC9B","names":["store: Store","optimisticId: OptimisticId","optimisticUpdate: undefined | ((ctx: OptimisticBuilder) => void)","ctx: OptimisticBuilder"],"sources":["../../../../src/observable/internal/OptimisticJob.ts"],"version":3,"file":"OptimisticJob.d.ts"}
@@ -1,4 +1,4 @@
1
- import type { ActionDefinition, InterfaceDefinition, ObjectTypeDefinition, PrimaryKeyType, WhereClause } from "@osdk/api";
1
+ import type { ActionDefinition, ActionEditResponse, InterfaceDefinition, ObjectTypeDefinition, PrimaryKeyType, WhereClause } from "@osdk/api";
2
2
  import type { Observer } from "rxjs";
3
3
  import { BehaviorSubject } from "rxjs";
4
4
  import type { ActionSignatureFromDef } from "../../actions/applyAction.js";
@@ -39,7 +39,7 @@ export declare class Store {
39
39
  orderByCanonicalizer: OrderByCanonicalizer;
40
40
  client: Client;
41
41
  constructor(client: Client);
42
- applyAction: <Q extends ActionDefinition<any>>(action: Q, args: Parameters<ActionSignatureFromDef<Q>["applyAction"]>[0], opts?: Store.ApplyActionOptions) => Promise<unknown>;
42
+ applyAction: <Q extends ActionDefinition<any>>(action: Q, args: Parameters<ActionSignatureFromDef<Q>["applyAction"]>[0], opts?: Store.ApplyActionOptions) => Promise<ActionEditResponse>;
43
43
  removeLayer(layerId: OptimisticId): void;
44
44
  getCacheKey<K extends CacheKey<string, any, any>>(type: K["type"], ...args: K["__cacheKey"]["args"]): K;
45
45
  peekSubject: <KEY extends CacheKey<string, any, any>>(cacheKey: KEY) => BehaviorSubject<SubjectPayload<KEY>> | undefined;
@@ -1 +1 @@
1
- {"mappings":"AAgBA,cACE,kBACA,qBACA,sBACA,gBACA,mBACK,WAAY;AACnB,cAAc,gBAAgB,MAAO;AACrC,SAAS,uBAAuB,MAAO;AAEvC,cAAc,8BAA8B,8BAA+B;AAC3E,cAAiC,cAAc,iBAAkB;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AU,uBAAuB,qBACpDC,SAAS,EAAE,aAAa,GACxBC,IAAI,eAAe,IACnBC,SAAS,qBAAqB,IAC9BC,OAAO,SAAS,iBACf;CAgCH,AAAO,YAAY,UAAU,uBAAuB,qBAClDC,SAAS,mBAAmB,IAC5BC,OAAO,SAAS,eACf;CA6BH,UAAU,UAAU,UAClBC,UAAU,IACT,EAAE,cAAc;CAgBnB,AAAO,aAAa,UAAU,uBAAuB,qBACnDC,KAAK,KAAK,GAAG,SAAS,YACtBR,OAAO,YAAY,IACnBS,SAAS,eAAe,QAAQ,qBAChCC,MAAM,mBACL;CA2BH,AAAO,eAAe,UAAU,sBAC9BT,SAAS,EAAE,aAAa,GACxBC,IAAI,eAAe,KAClB;CAsBH,AAAO,SAAS,UAAU,4BACxBK,UAAU,IACT,MAAM;CAIT,QAAS,GACP,EAAE,cAAc,SAGf,EAHmD;EAClD,eAAe;EACf,UAAU;CACX,GACDI,UAAUC,cAAc,iBAAiB,MACxC;EACD,aAAa;EACb,QAAQ;EACR,SAAS;CACV;CA0ED,AAAO,iBAAiB,UAAU,sBAChCX,SAAS,EAAE,aAAa,GACxBC,IAAI,eAAe,KAClB;CASH,AAAM,uBACJW,SAAS,SACTC,eAAe,2BACd;;;;;;CA6CH,AAAO,qBAAqB,UAAU,sBACpCb,SAAS,EAAE,aAAa,GACxBc,SAAS,sBACR;CA4BH,OAAOC,UAAU;CAIjB,QAAQA,UAAU;AAGnB;AAED,OAAO,iBAAe,eAAe,UAAU,sBAC7CC,OAAO,OACPC,MAAM;CACJ,MAAM,KAAK,GAAG,YAAY;CAC1B,QAAQ,YAAY,KAAK;CACzB,UAAU,QAAQ;AACnB,IACA","names":["k: K","v: Entry<K>[\"value\"]","status: Entry<K>[\"status\"]","ctx: OptimisticBuilder","client: Client","action: Q","args: Parameters<ActionSignatureFromDef<Q>[\"applyAction\"]>[0]","opts?: Store.ApplyActionOptions","layerId: OptimisticId","type: K[\"type\"]","cacheKey: KEY","where: WhereClause<T>","apiName: T[\"apiName\"] | T","pk: PrimaryKeyType<T>","options: ObserveObjectOptions<T>","subFn: Observer<ObjectPayload>","options: ObserveListOptions<T>","subFn: Observer<ListPayload>","cacheKey: K","def: Pick<T, \"type\" | \"apiName\">","orderBy: Record<string, \"asc\" | \"desc\" | undefined>","opts: ListQueryOptions","batchFn: (batchContext: BatchContext) => X","batchContext: BatchContext","changes: Changes","optimisticId?: OptimisticId | undefined","changes: Changes | undefined","cacheKey: CacheKey<string, any, any>","store: Store","args: {\n type: Pick<T, \"apiName\" | \"type\">;\n where?: WhereClause<T> | SimpleWhereClause;\n orderBy?: OrderBy<T>;\n }"],"sources":["../../../../src/observable/internal/Store.ts"],"version":3,"file":"Store.d.ts"}
1
+ {"mappings":"AAgBA,cACE,kBACA,oBACA,qBACA,sBACA,gBACA,mBACK,WAAY;AACnB,cAAc,gBAAgB,MAAO;AACrC,SAAS,uBAAuB,MAAO;AAEvC,cAAc,8BAA8B,8BAA+B;AAC3E,cAAiC,cAAc,iBAAkB;AAGjE,cAAc,mBAAmB,mBAAoB;AACrD,cAAc,qBAAqB,qBAAsB;AACzD,cACE,oBACA,sBACA,SACA,sBACK,wBAAyB;AAChC,cAAc,yBAAyB,yBAA0B;AAEjE,cAAc,gBAAgB,eAAgB;AAE9C,cAAc,iBAAiB,gBAAiB;AAChD,cACO,eAGA,cAAe;AACtB,SAAS,aAAoB,YAAa;AAC1C,cAA4B,wBAAwB,gBAAiB;AACrE,SAAyB,iBAAiB,gBAAiB;AAE3D,SAAS,mBAAmB,kBAAmB;AAC/C,cAAc,oBAAoB,mBAAoB;AACtD,SAAS,4BAA4B,2BAA4B;AAGjE,cAAc,yBAAyB,wBAAyB;AAChE,SAAS,gCAAgC,+BAAgC;AAkBzE,iBAAiB,eAAe,YAAY,kBAAkB,MAAM,KAAK;CACvE;AACD;AAED,iBAAiB,aAAa;CAC5B,SAAS;CACT;CACA;CAEA,QAAQ,UAAU,4BAChBA,GAAG,GACHC,GAAG,MAAM,GAAG,UAC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;EACD,aAAa;EACb,QAAQ;EACR,SAAS;CACV;CA0ED,AAAO,iBAAiB,UAAU,sBAChCX,SAAS,EAAE,aAAa,GACxBC,IAAI,eAAe,KAClB;CASH,AAAM,uBACJW,SAAS,SACTC,eAAe,2BACd;;;;;;CA6CH,AAAO,qBAAqB,UAAU,sBACpCb,SAAS,EAAE,aAAa,GACxBc,SAAS,sBACR;CA4BH,OAAOC,UAAU;CAIjB,QAAQA,UAAU;AAGnB;AAED,OAAO,iBAAe,eAAe,UAAU,sBAC7CC,OAAO,OACPC,MAAM;CACJ,MAAM,KAAK,GAAG,YAAY;CAC1B,QAAQ,YAAY,KAAK;CACzB,UAAU,QAAQ;AACnB,IACA","names":["k: K","v: Entry<K>[\"value\"]","status: Entry<K>[\"status\"]","ctx: OptimisticBuilder","client: Client","action: Q","args: Parameters<ActionSignatureFromDef<Q>[\"applyAction\"]>[0]","opts?: Store.ApplyActionOptions","layerId: OptimisticId","type: K[\"type\"]","cacheKey: KEY","where: WhereClause<T>","apiName: T[\"apiName\"] | T","pk: PrimaryKeyType<T>","options: ObserveObjectOptions<T>","subFn: Observer<ObjectPayload>","options: ObserveListOptions<T>","subFn: Observer<ListPayload>","cacheKey: K","def: Pick<T, \"type\" | \"apiName\">","orderBy: Record<string, \"asc\" | \"desc\" | undefined>","opts: ListQueryOptions","batchFn: (batchContext: BatchContext) => X","batchContext: BatchContext","changes: Changes","optimisticId?: OptimisticId | undefined","changes: Changes | undefined","cacheKey: CacheKey<string, any, any>","store: Store","args: {\n type: Pick<T, \"apiName\" | \"type\">;\n where?: WhereClause<T> | SimpleWhereClause;\n orderBy?: OrderBy<T>;\n }"],"sources":["../../../../src/observable/internal/Store.ts"],"version":3,"file":"Store.d.ts"}
@@ -1,8 +1,8 @@
1
- import type { CompileTimeMetadata, ObjectOrInterfaceDefinition, OsdkBase, PrimaryKeyType, QueryDefinition } from "@osdk/api";
1
+ import type { CompileTimeMetadata, ObjectTypeDefinition, OsdkBase, PrimaryKeyType, QueryDefinition } from "@osdk/api";
2
2
  import type { MinimalClient } from "../MinimalClientContext.js";
3
3
  import type { QueryParameterType, QueryReturnType } from "./types.js";
4
4
  export declare function applyQuery<
5
5
  QD extends QueryDefinition<any>,
6
6
  P extends QueryParameterType<CompileTimeMetadata<QD>["parameters"]>
7
7
  >(client: MinimalClient, query: QD, params?: P): Promise<QueryReturnType<CompileTimeMetadata<QD>["output"]>>;
8
- export declare function createQueryObjectResponse<Q extends ObjectOrInterfaceDefinition>(primaryKey: PrimaryKeyType<Q>, objectDef: Q): OsdkBase<Q>;
8
+ export declare function createQueryObjectResponse<Q extends ObjectTypeDefinition>(primaryKey: PrimaryKeyType<Q>, objectDef: Q): OsdkBase<Q>;
@@ -1 +1 @@
1
- {"mappings":"AAgBA,cAGE,qBACA,6BAEA,UACA,gBAEA,uBAEK,WAAY;AAInB,cAAc,qBAAqB,4BAA6B;AAOhE,cAAc,oBAAoB,uBAAuB,YAAa;AAEtE,OAAO,iBAAe;CACpB,WAAW;CACX,UAAU,mBAAmB,oBAAoB,IAAI;EAErDA,QAAQ,eACRC,OAAO,IACPC,SAAS,IACR,QACD,gBAAgB,oBAAoB,IAAI;AA2U1C,OAAO,iBAAS,0BACd,UAAU,6BAEVC,YAAY,eAAe,IAC3BC,WAAW,IACV,SAAS","names":["client: MinimalClient","query: QD","params?: P","primaryKey: PrimaryKeyType<Q>","objectDef: Q"],"sources":["../../../src/queries/applyQuery.ts"],"version":3,"file":"applyQuery.d.ts"}
1
+ {"mappings":"AAgBA,cAGE,qBAEA,sBACA,UACA,gBAEA,uBAEK,WAAY;AAInB,cAAc,qBAAqB,4BAA6B;AAOhE,cAAc,oBAAoB,uBAAuB,YAAa;AAEtE,OAAO,iBAAe;CACpB,WAAW;CACX,UAAU,mBAAmB,oBAAoB,IAAI;EAErDA,QAAQ,eACRC,OAAO,IACPC,SAAS,IACR,QACD,gBAAgB,oBAAoB,IAAI;AA2U1C,OAAO,iBAAS,0BACd,UAAU,sBAEVC,YAAY,eAAe,IAC3BC,WAAW,IACV,SAAS","names":["client: MinimalClient","query: QD","params?: P","primaryKey: PrimaryKeyType<Q>","objectDef: Q"],"sources":["../../../src/queries/applyQuery.ts"],"version":3,"file":"applyQuery.d.ts"}