@osdk/client 2.4.0-beta.9 → 2.4.0-rc.19

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 (153) hide show
  1. package/CHANGELOG.md +113 -0
  2. package/build/browser/MinimalClientContext.js.map +1 -1
  3. package/build/browser/createClient.js +5 -5
  4. package/build/browser/createClient.js.map +1 -1
  5. package/build/browser/createMinimalClient.js +1 -0
  6. package/build/browser/createMinimalClient.js.map +1 -1
  7. package/build/browser/derivedProperties/createWithPropertiesObjectSet.js +0 -17
  8. package/build/browser/derivedProperties/createWithPropertiesObjectSet.js.map +1 -1
  9. package/build/browser/fetchMetadata.test.js +7 -1
  10. package/build/browser/fetchMetadata.test.js.map +1 -1
  11. package/build/browser/index.js +2 -1
  12. package/build/browser/index.js.map +1 -1
  13. package/build/browser/object/convertWireToOsdkObjects.js +3 -2
  14. package/build/browser/object/convertWireToOsdkObjects.js.map +1 -1
  15. package/build/browser/object/convertWireToOsdkObjects.test.js +36 -24
  16. package/build/browser/object/convertWireToOsdkObjects.test.js.map +1 -1
  17. package/build/browser/object/fetchPage.js +4 -2
  18. package/build/browser/object/fetchPage.js.map +1 -1
  19. package/build/browser/object/mediaUpload.js +0 -3
  20. package/build/browser/object/mediaUpload.js.map +1 -1
  21. package/build/browser/objectSet/InterfaceObjectSet.test.js +5 -1
  22. package/build/browser/objectSet/InterfaceObjectSet.test.js.map +1 -1
  23. package/build/browser/objectSet/createObjectSet.js +5 -1
  24. package/build/browser/objectSet/createObjectSet.js.map +1 -1
  25. package/build/browser/observable/internal/ActionApplication.js +1 -1
  26. package/build/browser/observable/internal/ActionApplication.js.map +1 -1
  27. package/build/browser/public/unstable-do-not-use.js +1 -0
  28. package/build/browser/public/unstable-do-not-use.js.map +1 -1
  29. package/build/browser/public-utils/hydrateObjectSetFromObjectRids.js +4 -1
  30. package/build/browser/public-utils/hydrateObjectSetFromObjectRids.js.map +1 -1
  31. package/build/browser/public-utils/hydrateObjectSetFromRid.js +4 -1
  32. package/build/browser/public-utils/hydrateObjectSetFromRid.js.map +1 -1
  33. package/build/browser/queries/applyQuery.js +24 -1
  34. package/build/browser/queries/applyQuery.js.map +1 -1
  35. package/build/browser/queries/queries.test.js +27 -2
  36. package/build/browser/queries/queries.test.js.map +1 -1
  37. package/build/browser/queries/types.js.map +1 -1
  38. package/build/browser/util/UserAgent.js +2 -2
  39. package/build/browser/util/UserAgent.js.map +1 -1
  40. package/build/browser/util/WireObjectSet.js +1 -1
  41. package/build/browser/util/WireObjectSet.js.map +1 -1
  42. package/build/browser/util/extractObjectOrInterfaceType.js +96 -0
  43. package/build/browser/util/extractObjectOrInterfaceType.js.map +1 -0
  44. package/build/browser/util/extractObjectOrInterfaceType.test.js +135 -0
  45. package/build/browser/util/extractObjectOrInterfaceType.test.js.map +1 -0
  46. package/build/browser/util/interfaceUtils.js +10 -0
  47. package/build/browser/util/interfaceUtils.js.map +1 -1
  48. package/build/browser/util/objectSpecifierUtils.js +12 -0
  49. package/build/browser/util/objectSpecifierUtils.js.map +1 -1
  50. package/build/browser/util/toDataValue.js +1 -15
  51. package/build/browser/util/toDataValue.js.map +1 -1
  52. package/build/browser/util/toDataValue.test.js +2 -42
  53. package/build/browser/util/toDataValue.test.js.map +1 -1
  54. package/build/browser/util/toDataValueQueries.js +11 -0
  55. package/build/browser/util/toDataValueQueries.js.map +1 -1
  56. package/build/cjs/{Client-CgL2LKN9.d.cts → Client-CF85LpFu.d.cts} +2 -2
  57. package/build/cjs/{chunk-YZHCDIYC.cjs → chunk-MZ7AHGMR.cjs} +117 -85
  58. package/build/cjs/chunk-MZ7AHGMR.cjs.map +1 -0
  59. package/build/cjs/{chunk-E5BQ7757.cjs → chunk-OZFAMHII.cjs} +119 -64
  60. package/build/cjs/chunk-OZFAMHII.cjs.map +1 -0
  61. package/build/cjs/chunk-Q7SFCCGT.cjs +11 -0
  62. package/build/cjs/chunk-Q7SFCCGT.cjs.map +1 -0
  63. package/build/cjs/createClient-BJo8T7Js.d.cts +9 -0
  64. package/build/cjs/delay-QK4T7RVX.cjs +74 -0
  65. package/build/cjs/delay-QK4T7RVX.cjs.map +1 -0
  66. package/build/cjs/index.cjs +9 -8
  67. package/build/cjs/index.cjs.map +1 -1
  68. package/build/cjs/index.d.cts +15 -8
  69. package/build/cjs/public/internal.cjs +17 -10
  70. package/build/cjs/public/internal.cjs.map +1 -1
  71. package/build/cjs/public/internal.d.cts +1 -1
  72. package/build/cjs/public/unstable-do-not-use.cjs +22 -71
  73. package/build/cjs/public/unstable-do-not-use.cjs.map +1 -1
  74. package/build/cjs/public/unstable-do-not-use.d.cts +2 -1
  75. package/build/esm/MinimalClientContext.js.map +1 -1
  76. package/build/esm/createClient.js +5 -5
  77. package/build/esm/createClient.js.map +1 -1
  78. package/build/esm/createMinimalClient.js +1 -0
  79. package/build/esm/createMinimalClient.js.map +1 -1
  80. package/build/esm/derivedProperties/createWithPropertiesObjectSet.js +0 -17
  81. package/build/esm/derivedProperties/createWithPropertiesObjectSet.js.map +1 -1
  82. package/build/esm/fetchMetadata.test.js +7 -1
  83. package/build/esm/fetchMetadata.test.js.map +1 -1
  84. package/build/esm/index.js +2 -1
  85. package/build/esm/index.js.map +1 -1
  86. package/build/esm/object/convertWireToOsdkObjects.js +3 -2
  87. package/build/esm/object/convertWireToOsdkObjects.js.map +1 -1
  88. package/build/esm/object/convertWireToOsdkObjects.test.js +36 -24
  89. package/build/esm/object/convertWireToOsdkObjects.test.js.map +1 -1
  90. package/build/esm/object/fetchPage.js +4 -2
  91. package/build/esm/object/fetchPage.js.map +1 -1
  92. package/build/esm/object/mediaUpload.js +0 -3
  93. package/build/esm/object/mediaUpload.js.map +1 -1
  94. package/build/esm/objectSet/InterfaceObjectSet.test.js +5 -1
  95. package/build/esm/objectSet/InterfaceObjectSet.test.js.map +1 -1
  96. package/build/esm/objectSet/createObjectSet.js +5 -1
  97. package/build/esm/objectSet/createObjectSet.js.map +1 -1
  98. package/build/esm/observable/internal/ActionApplication.js +1 -1
  99. package/build/esm/observable/internal/ActionApplication.js.map +1 -1
  100. package/build/esm/public/unstable-do-not-use.js +1 -0
  101. package/build/esm/public/unstable-do-not-use.js.map +1 -1
  102. package/build/esm/public-utils/hydrateObjectSetFromObjectRids.js +4 -1
  103. package/build/esm/public-utils/hydrateObjectSetFromObjectRids.js.map +1 -1
  104. package/build/esm/public-utils/hydrateObjectSetFromRid.js +4 -1
  105. package/build/esm/public-utils/hydrateObjectSetFromRid.js.map +1 -1
  106. package/build/esm/queries/applyQuery.js +24 -1
  107. package/build/esm/queries/applyQuery.js.map +1 -1
  108. package/build/esm/queries/queries.test.js +27 -2
  109. package/build/esm/queries/queries.test.js.map +1 -1
  110. package/build/esm/queries/types.js.map +1 -1
  111. package/build/esm/util/UserAgent.js +2 -2
  112. package/build/esm/util/UserAgent.js.map +1 -1
  113. package/build/esm/util/WireObjectSet.js +1 -1
  114. package/build/esm/util/WireObjectSet.js.map +1 -1
  115. package/build/esm/util/extractObjectOrInterfaceType.js +96 -0
  116. package/build/esm/util/extractObjectOrInterfaceType.js.map +1 -0
  117. package/build/esm/util/extractObjectOrInterfaceType.test.js +135 -0
  118. package/build/esm/util/extractObjectOrInterfaceType.test.js.map +1 -0
  119. package/build/esm/util/interfaceUtils.js +10 -0
  120. package/build/esm/util/interfaceUtils.js.map +1 -1
  121. package/build/esm/util/objectSpecifierUtils.js +12 -0
  122. package/build/esm/util/objectSpecifierUtils.js.map +1 -1
  123. package/build/esm/util/toDataValue.js +1 -15
  124. package/build/esm/util/toDataValue.js.map +1 -1
  125. package/build/esm/util/toDataValue.test.js +2 -42
  126. package/build/esm/util/toDataValue.test.js.map +1 -1
  127. package/build/esm/util/toDataValueQueries.js +11 -0
  128. package/build/esm/util/toDataValueQueries.js.map +1 -1
  129. package/build/types/MinimalClientContext.d.ts +1 -0
  130. package/build/types/MinimalClientContext.d.ts.map +1 -1
  131. package/build/types/createClient.d.ts +1 -0
  132. package/build/types/createClient.d.ts.map +1 -1
  133. package/build/types/index.d.ts +3 -2
  134. package/build/types/index.d.ts.map +1 -1
  135. package/build/types/object/fetchPage.d.ts.map +1 -1
  136. package/build/types/object/mediaUpload.d.ts +1 -2
  137. package/build/types/object/mediaUpload.d.ts.map +1 -1
  138. package/build/types/observable/internal/ActionApplication.d.ts.map +1 -1
  139. package/build/types/public/unstable-do-not-use.d.ts +1 -0
  140. package/build/types/public/unstable-do-not-use.d.ts.map +1 -1
  141. package/build/types/queries/applyQuery.d.ts +5 -1
  142. package/build/types/queries/applyQuery.d.ts.map +1 -1
  143. package/build/types/queries/types.d.ts +2 -2
  144. package/build/types/queries/types.d.ts.map +1 -1
  145. package/build/types/util/extractObjectOrInterfaceType.d.ts +1 -0
  146. package/build/types/util/extractObjectOrInterfaceType.d.ts.map +1 -0
  147. package/build/types/util/extractObjectOrInterfaceType.test.d.ts +1 -0
  148. package/build/types/util/extractObjectOrInterfaceType.test.d.ts.map +1 -0
  149. package/build/types/util/objectSpecifierUtils.d.ts +13 -1
  150. package/build/types/util/objectSpecifierUtils.d.ts.map +1 -1
  151. package/package.json +8 -8
  152. package/build/cjs/chunk-E5BQ7757.cjs.map +0 -1
  153. package/build/cjs/chunk-YZHCDIYC.cjs.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,118 @@
1
1
  # @osdk/client
2
2
 
3
+ ## 2.4.0-rc.19
4
+
5
+ ### Patch Changes
6
+
7
+ - 8dd6229: Remove features not supported for RC
8
+ - Updated dependencies [8dd6229]
9
+ - @osdk/api@2.4.0-rc.19
10
+ - @osdk/generator-converters@2.4.0-rc.19
11
+ - @osdk/client.unstable@2.4.0-rc.19
12
+
13
+ ## 2.4.0-beta.18
14
+
15
+ ### Patch Changes
16
+
17
+ - 11d2f23: Add fix for interface links.
18
+ - 44bbbe0: Add interface query support.
19
+ - Updated dependencies [722c89a]
20
+ - Updated dependencies [44bbbe0]
21
+ - @osdk/api@2.4.0-beta.18
22
+ - @osdk/generator-converters@2.4.0-beta.18
23
+ - @osdk/client.unstable@2.4.0-beta.18
24
+
25
+ ## 2.4.0-beta.17
26
+
27
+ ### Minor Changes
28
+
29
+ - 06fd45a: Export createObjectSpecifierFromPrimaryKey
30
+
31
+ ### Patch Changes
32
+
33
+ - @osdk/api@2.4.0-beta.17
34
+ - @osdk/client.unstable@2.4.0-beta.17
35
+ - @osdk/generator-converters@2.4.0-beta.17
36
+
37
+ ## 2.4.0-beta.16
38
+
39
+ ### Minor Changes
40
+
41
+ - c763807: Fix hydrate method for object rids to work with interfaces.
42
+
43
+ ### Patch Changes
44
+
45
+ - @osdk/api@2.4.0-beta.16
46
+ - @osdk/client.unstable@2.4.0-beta.16
47
+ - @osdk/generator-converters@2.4.0-beta.16
48
+
49
+ ## 2.4.0-beta.15
50
+
51
+ ### Minor Changes
52
+
53
+ - d2d36e1: Fix module resolution for node when importing unstable code
54
+
55
+ ### Patch Changes
56
+
57
+ - @osdk/api@2.4.0-beta.15
58
+ - @osdk/client.unstable@2.4.0-beta.15
59
+ - @osdk/generator-converters@2.4.0-beta.15
60
+
61
+ ## 2.4.0-beta.14
62
+
63
+ ### Patch Changes
64
+
65
+ - Updated dependencies [5c76e33]
66
+ - @osdk/client.unstable@2.4.0-beta.14
67
+ - @osdk/api@2.4.0-beta.14
68
+ - @osdk/generator-converters@2.4.0-beta.14
69
+
70
+ ## 2.4.0-beta.13
71
+
72
+ ### Minor Changes
73
+
74
+ - 4bc848b: Add interface link support.
75
+
76
+ ### Patch Changes
77
+
78
+ - Updated dependencies [4bc848b]
79
+ - @osdk/generator-converters@2.4.0-beta.13
80
+ - @osdk/api@2.4.0-beta.13
81
+ - @osdk/client.unstable@2.4.0-beta.13
82
+
83
+ ## 2.4.0-beta.12
84
+
85
+ ### Minor Changes
86
+
87
+ - 402eb67: Fix hydrate to support interface object sets.
88
+
89
+ ### Patch Changes
90
+
91
+ - @osdk/api@2.4.0-beta.12
92
+ - @osdk/client.unstable@2.4.0-beta.12
93
+ - @osdk/generator-converters@2.4.0-beta.12
94
+
95
+ ## 2.4.0-beta.11
96
+
97
+ ### Patch Changes
98
+
99
+ - Updated dependencies [f277b30]
100
+ - @osdk/generator-converters@2.4.0-beta.11
101
+ - @osdk/api@2.4.0-beta.11
102
+ - @osdk/client.unstable@2.4.0-beta.11
103
+
104
+ ## 2.4.0-beta.10
105
+
106
+ ### Minor Changes
107
+
108
+ - f022ffe: Add experimental transactions shape
109
+
110
+ ### Patch Changes
111
+
112
+ - @osdk/api@2.4.0-beta.10
113
+ - @osdk/client.unstable@2.4.0-beta.10
114
+ - @osdk/generator-converters@2.4.0-beta.10
115
+
3
116
  ## 2.4.0-beta.9
4
117
 
5
118
  ### Minor Changes
@@ -1 +1 @@
1
- {"version":3,"file":"MinimalClientContext.js","names":[],"sources":["MinimalClientContext.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 { Logger } from \"@osdk/api\";\nimport type { SharedClientContext } from \"@osdk/shared.client2\";\nimport type {\n convertWireToOsdkObjects,\n convertWireToOsdkObjects2,\n} from \"./object/convertWireToOsdkObjects.js\";\nimport type { ObjectSetFactory } from \"./objectSet/ObjectSetFactory.js\";\nimport type { OntologyProvider } from \"./ontology/OntologyProvider.js\";\n\ndeclare const tag: unique symbol;\n\nexport type ClientCacheKey = {} & { readonly [tag]: void };\n\nexport type RequestContext = {\n finalMethodCall?: string;\n};\n\nexport interface MinimalClient extends SharedClientContext {\n ontologyRid: string | Promise<string>;\n ontologyProvider: OntologyProvider;\n logger?: Logger;\n /** @internal */\n objectSetFactory: ObjectSetFactory<any, any>;\n /** @internal */\n objectFactory: typeof convertWireToOsdkObjects;\n /** @internal */\n objectFactory2: typeof convertWireToOsdkObjects2;\n\n clientCacheKey: ClientCacheKey;\n requestContext: RequestContext;\n}\n\nexport type MinimalClientParams = {\n metadata: MinimalClientMetadata;\n provider: OntologyProvider;\n};\n\nexport interface MinimalClientMetadata {\n ontologyRid: string | Promise<string>;\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"MinimalClientContext.js","names":[],"sources":["MinimalClientContext.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 { Logger } from \"@osdk/api\";\nimport type { SharedClientContext } from \"@osdk/shared.client2\";\nimport type {\n convertWireToOsdkObjects,\n convertWireToOsdkObjects2,\n} from \"./object/convertWireToOsdkObjects.js\";\nimport type { ObjectSetFactory } from \"./objectSet/ObjectSetFactory.js\";\nimport type { OntologyProvider } from \"./ontology/OntologyProvider.js\";\n\ndeclare const tag: unique symbol;\n\nexport type ClientCacheKey = {} & { readonly [tag]: void };\n\nexport type RequestContext = {\n finalMethodCall?: string;\n};\n\nexport interface MinimalClient extends SharedClientContext {\n ontologyRid: string | Promise<string>;\n ontologyProvider: OntologyProvider;\n logger?: Logger;\n transactionRid?: string;\n /** @internal */\n objectSetFactory: ObjectSetFactory<any, any>;\n /** @internal */\n objectFactory: typeof convertWireToOsdkObjects;\n /** @internal */\n objectFactory2: typeof convertWireToOsdkObjects2;\n\n clientCacheKey: ClientCacheKey;\n requestContext: RequestContext;\n}\n\nexport type MinimalClientParams = {\n metadata: MinimalClientMetadata;\n provider: OntologyProvider;\n};\n\nexport interface MinimalClientMetadata {\n ontologyRid: string | Promise<string>;\n}\n"],"mappings":"","ignoreList":[]}
@@ -51,9 +51,7 @@ class QueryInvoker {
51
51
  }
52
52
 
53
53
  /** @internal */
54
- export function createClientInternal(objectSetFactory,
55
- // first so i can bind
56
- baseUrl, ontologyRid, tokenProvider, options = undefined, fetchFn = fetch) {
54
+ export function createClientInternal(objectSetFactory, transactionRid, baseUrl, ontologyRid, tokenProvider, options = undefined, fetchFn = fetch) {
57
55
  if (typeof ontologyRid === "string") {
58
56
  if (!ontologyRid.startsWith("ri.")) {
59
57
  throw new Error("Invalid ontology RID");
@@ -71,7 +69,8 @@ baseUrl, ontologyRid, tokenProvider, options = undefined, fetchFn = fetch) {
71
69
  ontologyRid
72
70
  }, baseUrl, tokenProvider, {
73
71
  ...options,
74
- logger: options?.logger ?? new MinimalLogger()
72
+ logger: options?.logger ?? new MinimalLogger(),
73
+ transactionRid: transactionRid
75
74
  }, fetchFn, objectSetFactory);
76
75
  return createClientFromContext(clientCtx);
77
76
  }
@@ -142,7 +141,8 @@ export function createClientFromContext(clientCtx) {
142
141
  });
143
142
  return client;
144
143
  }
145
- export const createClient = createClientInternal.bind(undefined, createObjectSet);
144
+ export const createClient = createClientInternal.bind(undefined, createObjectSet, undefined);
145
+ export const createClientWithTransaction = (transactionRid, ...args) => createClientInternal(createObjectSet, transactionRid, ...args);
146
146
  function createWithRid(rids) {
147
147
  return {
148
148
  type: "static",
@@ -1 +1 @@
1
- {"version":3,"file":"createClient.js","names":["__EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference","__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid","__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid","__EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks","OntologiesV2","symbolClientContext","oldSymbolClientContext","createBulkLinksAsyncIterFactory","applyAction","additionalContext","createMinimalClient","fetchMetadataInternal","MinimalLogger","fetchPage","fetchSingle","createObjectSet","applyQuery","ActionInvoker","constructor","clientCtx","actionDef","bind","undefined","batchApplyAction","QueryInvoker","queryDef","executeFunction","createClientInternal","objectSetFactory","baseUrl","ontologyRid","tokenProvider","options","fetchFn","fetch","startsWith","Error","then","logger","createClientFromContext","fetchMetadata","client","Object","defineProperties","o","type","name","getBulkLinks","fetchOneByRid","objectType","rid","createWithRid","createMediaReference","args","data","fileName","propertyType","MediaReferenceProperties","upload","apiName","mediaItemPath","preview","fetchPageByRid","objectOrInterfaceType","rids","value","createClient"],"sources":["createClient.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n ActionDefinition,\n FetchPageArgs,\n InterfaceDefinition,\n Logger,\n NullabilityAdherence,\n ObjectOrInterfaceDefinition,\n ObjectSet,\n ObjectTypeDefinition,\n Osdk,\n PropertyKeys,\n QueryDefinition,\n SelectArg,\n} from \"@osdk/api\";\nimport type {\n Experiment,\n ExperimentFns,\n MinimalObjectSet,\n} from \"@osdk/api/unstable\";\nimport {\n __EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference,\n __EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid,\n __EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid,\n __EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks,\n} from \"@osdk/api/unstable\";\nimport type { ObjectSet as WireObjectSet } from \"@osdk/foundry.ontologies\";\nimport * as OntologiesV2 from \"@osdk/foundry.ontologies\";\nimport { symbolClientContext as oldSymbolClientContext } from \"@osdk/shared.client\";\nimport { createBulkLinksAsyncIterFactory } from \"./__unstable/createBulkLinksAsyncIterFactory.js\";\nimport type { ActionSignatureFromDef } from \"./actions/applyAction.js\";\nimport { applyAction } from \"./actions/applyAction.js\";\nimport { additionalContext, type Client } from \"./Client.js\";\nimport { createMinimalClient } from \"./createMinimalClient.js\";\nimport { fetchMetadataInternal } from \"./fetchMetadata.js\";\nimport { MinimalLogger } from \"./logger/MinimalLogger.js\";\nimport type { MinimalClient } from \"./MinimalClientContext.js\";\nimport { fetchPage } from \"./object/fetchPage.js\";\nimport { fetchSingle } from \"./object/fetchSingle.js\";\nimport { createObjectSet } from \"./objectSet/createObjectSet.js\";\nimport type { ObjectSetFactory } from \"./objectSet/ObjectSetFactory.js\";\nimport { applyQuery } from \"./queries/applyQuery.js\";\nimport type { QuerySignatureFromDef } from \"./queries/types.js\";\n\n// We import it this way to keep compatible with CJS. If we referenced the\n// value of `symbolClientContext` directly, then we would have to a dynamic import\n// in `createClientInternal` which would make it async and a break.\n// Since this is just a string in `@osdk/shared.client2` instead of a symbol,\n// we can safely perform this trick.\ntype newSymbolClientContext =\n // eslint-disable-next-line @typescript-eslint/consistent-type-imports\n typeof import(\"@osdk/shared.client2\").symbolClientContext;\n\nclass ActionInvoker<Q extends ActionDefinition<any>>\n implements ActionSignatureFromDef<Q>\n{\n constructor(\n clientCtx: MinimalClient,\n actionDef: ActionDefinition<any>,\n ) {\n // We type the property as a generic function as binding `applyAction`\n // doesn't return a type thats all that useful anyway\n // The implements covers us for the most part here as this exact type doesn't\n // escape this file\n this.applyAction = applyAction.bind(undefined, clientCtx, actionDef);\n this.batchApplyAction = applyAction.bind(undefined, clientCtx, actionDef);\n }\n\n applyAction: (...args: any[]) => any;\n batchApplyAction: (...args: any[]) => any;\n}\n\nclass QueryInvoker<Q extends QueryDefinition<any>>\n implements QuerySignatureFromDef<Q>\n{\n constructor(\n clientCtx: MinimalClient,\n queryDef: QueryDefinition<any>,\n ) {\n this.executeFunction = applyQuery.bind(undefined, clientCtx, queryDef);\n }\n\n executeFunction: (...args: any[]) => any;\n}\n\n/** @internal */\nexport function createClientInternal(\n objectSetFactory: ObjectSetFactory<any, any>, // first so i can bind\n baseUrl: string,\n ontologyRid: string | Promise<string>,\n tokenProvider: () => Promise<string>,\n options: { logger?: Logger } | undefined = undefined,\n fetchFn: typeof globalThis.fetch = fetch,\n): Client {\n if (typeof ontologyRid === \"string\") {\n if (!ontologyRid.startsWith(\"ri.\")) {\n throw new Error(\"Invalid ontology RID\");\n }\n } else {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n ontologyRid.then((ontologyRid) => {\n if (!ontologyRid.startsWith(\"ri.\")) {\n // FIXME this promise is not await so this just shows up as an unhandled promise rejection\n throw new Error(\"Invalid ontology RID\");\n }\n });\n }\n\n const clientCtx: MinimalClient = createMinimalClient(\n { ontologyRid },\n baseUrl,\n tokenProvider,\n { ...options, logger: options?.logger ?? new MinimalLogger() },\n fetchFn,\n objectSetFactory,\n );\n\n return createClientFromContext(clientCtx);\n}\n\n/**\n * @internal\n */\nexport function createClientFromContext(clientCtx: MinimalClient) {\n function clientFn<\n T extends\n | ObjectOrInterfaceDefinition\n | ActionDefinition<any>\n | QueryDefinition<any>\n | Experiment<\"2.0.8\">\n | Experiment<\"2.1.0\">,\n >(o: T): T extends ObjectTypeDefinition ? ObjectSet<T>\n : T extends InterfaceDefinition ? MinimalObjectSet<T>\n : T extends ActionDefinition<any> ? ActionSignatureFromDef<T>\n : T extends QueryDefinition<any> ? QuerySignatureFromDef<T>\n : T extends Experiment<\"2.0.8\"> | Experiment<\"2.1.0\">\n ? { invoke: ExperimentFns<T> }\n : never\n {\n if (o.type === \"object\" || o.type === \"interface\") {\n return clientCtx.objectSetFactory(o, clientCtx) as any;\n } else if (o.type === \"action\") {\n return new ActionInvoker(\n clientCtx,\n o,\n ) as (T extends ActionDefinition<any>\n // first `as` to the action definition for our \"real\" typecheck\n ? ActionSignatureFromDef<T>\n : never) as any; // then as any for dealing with the conditional return value\n } else if (o.type === \"query\") {\n return new QueryInvoker(\n clientCtx,\n o,\n ) as (T extends QueryDefinition<any> ? QuerySignatureFromDef<T>\n : never) as any;\n } else if (o.type === \"experiment\") {\n switch (o.name) {\n case __EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks.name:\n return {\n getBulkLinks: createBulkLinksAsyncIterFactory(\n clientCtx,\n ),\n } as any;\n case __EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid.name:\n return {\n fetchOneByRid: async <\n Q extends ObjectTypeDefinition,\n const L extends PropertyKeys<Q>,\n const R extends boolean,\n const S extends false | \"throw\" = NullabilityAdherence.Default,\n >(\n objectType: Q,\n rid: string,\n options: SelectArg<Q, L, R, S>,\n ) => {\n return await fetchSingle(\n clientCtx,\n objectType,\n options,\n createWithRid(\n [rid],\n ),\n ) as Osdk<Q>;\n },\n } as any;\n case __EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference.name:\n return {\n createMediaReference: async <\n Q extends ObjectTypeDefinition,\n const L extends PropertyKeys.Filtered<Q, \"mediaReference\">,\n >(args: {\n data: Blob;\n fileName: string;\n objectType: Q;\n propertyType: L;\n }) => {\n const { data, fileName, objectType, propertyType } = args;\n return await OntologiesV2.MediaReferenceProperties.upload(\n clientCtx,\n await clientCtx.ontologyRid,\n objectType.apiName,\n propertyType as string,\n data,\n {\n mediaItemPath: fileName,\n preview: true,\n },\n );\n },\n } as any;\n\n case __EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid.name:\n return {\n fetchPageByRid: async <\n Q extends ObjectOrInterfaceDefinition,\n const L extends PropertyKeys<Q>,\n const R extends boolean,\n const S extends false | \"throw\" = NullabilityAdherence.Default,\n >(\n objectOrInterfaceType: Q,\n rids: string[],\n options: FetchPageArgs<Q, L, R, any, S> = {},\n ) => {\n return await fetchPage(\n clientCtx,\n objectOrInterfaceType,\n options,\n createWithRid(rids),\n );\n },\n } as any;\n }\n\n throw new Error(\"not implemented\");\n } else {\n throw new Error(\"not implemented\");\n }\n }\n\n const fetchMetadata = fetchMetadataInternal.bind(\n undefined,\n clientCtx,\n );\n\n const symbolClientContext: newSymbolClientContext = \"__osdkClientContext\";\n\n const client: Client = Object.defineProperties<Client>(\n clientFn as Client,\n {\n [oldSymbolClientContext]: {\n value: clientCtx,\n },\n [symbolClientContext]: {\n value: clientCtx,\n },\n [additionalContext]: {\n value: clientCtx,\n },\n fetchMetadata: {\n value: fetchMetadata,\n },\n } satisfies Record<keyof Client, PropertyDescriptor>,\n );\n\n return client;\n}\n\nexport const createClient: (\n baseUrl: string,\n ontologyRid: string | Promise<string>,\n tokenProvider: () => Promise<string>,\n options?: {\n logger?: Logger;\n } | undefined,\n fetchFn?: typeof fetch | undefined,\n) => Client = createClientInternal.bind(\n undefined,\n createObjectSet,\n);\n\nfunction createWithRid(\n rids: string[],\n) {\n const withRid: WireObjectSet = {\n type: \"static\",\n \"objects\": rids,\n };\n\n return withRid;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAqBA,SACEA,uDAAuD,EACvDC,gDAAgD,EAChDC,iDAAiD,EACjDC,+CAA+C,QAC1C,oBAAoB;AAE3B,OAAO,KAAKC,YAAY,MAAM,0BAA0B;AACxD,SAASC,mBAAmB,IAAIC,sBAAsB,QAAQ,qBAAqB;AACnF,SAASC,+BAA+B,QAAQ,iDAAiD;AAEjG,SAASC,WAAW,QAAQ,0BAA0B;AACtD,SAASC,iBAAiB,QAAqB,aAAa;AAC5D,SAASC,mBAAmB,QAAQ,0BAA0B;AAC9D,SAASC,qBAAqB,QAAQ,oBAAoB;AAC1D,SAASC,aAAa,QAAQ,2BAA2B;AAEzD,SAASC,SAAS,QAAQ,uBAAuB;AACjD,SAASC,WAAW,QAAQ,yBAAyB;AACrD,SAASC,eAAe,QAAQ,gCAAgC;AAEhE,SAASC,UAAU,QAAQ,yBAAyB;;A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IMENTAL__NOT_SUPPORTED_YET__createMediaReference","__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid","__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid","__EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks","OntologiesV2","symbolClientContext","oldSymbolClientContext","createBulkLinksAsyncIterFactory","applyAction","additionalContext","createMinimalClient","fetchMetadataInternal","MinimalLogger","fetchPage","fetchSingle","createObjectSet","applyQuery","ActionInvoker","constructor","clientCtx","actionDef","bind","undefined","batchApplyAction","QueryInvoker","queryDef","executeFunction","createClientInternal","objectSetFactory","transactionRid","baseUrl","ontologyRid","tokenProvider","options","fetchFn","fetch","startsWith","Error","then","logger","createClientFromContext","fetchMetadata","client","Object","defineProperties","o","type","name","getBulkLinks","fetchOneByRid","objectType","rid","createWithRid","createMediaReference","args","data","fileName","propertyType","MediaReferenceProperties","upload","apiName","mediaItemPath","preview","fetchPageByRid","objectOrInterfaceType","rids","value","createClient","createClientWithTransaction"],"sources":["createClient.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n ActionDefinition,\n FetchPageArgs,\n InterfaceDefinition,\n Logger,\n NullabilityAdherence,\n ObjectOrInterfaceDefinition,\n ObjectSet,\n ObjectTypeDefinition,\n Osdk,\n PropertyKeys,\n QueryDefinition,\n SelectArg,\n} from \"@osdk/api\";\nimport type {\n Experiment,\n ExperimentFns,\n MinimalObjectSet,\n} from \"@osdk/api/unstable\";\nimport {\n __EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference,\n __EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid,\n __EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid,\n __EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks,\n} from \"@osdk/api/unstable\";\nimport type { ObjectSet as WireObjectSet } from \"@osdk/foundry.ontologies\";\nimport * as OntologiesV2 from \"@osdk/foundry.ontologies\";\nimport { symbolClientContext as oldSymbolClientContext } from \"@osdk/shared.client\";\nimport { createBulkLinksAsyncIterFactory } from \"./__unstable/createBulkLinksAsyncIterFactory.js\";\nimport type { ActionSignatureFromDef } from \"./actions/applyAction.js\";\nimport { applyAction } from \"./actions/applyAction.js\";\nimport { additionalContext, type Client } from \"./Client.js\";\nimport { createMinimalClient } from \"./createMinimalClient.js\";\nimport { fetchMetadataInternal } from \"./fetchMetadata.js\";\nimport { MinimalLogger } from \"./logger/MinimalLogger.js\";\nimport type { MinimalClient } from \"./MinimalClientContext.js\";\nimport { fetchPage } from \"./object/fetchPage.js\";\nimport { fetchSingle } from \"./object/fetchSingle.js\";\nimport { createObjectSet } from \"./objectSet/createObjectSet.js\";\nimport type { ObjectSetFactory } from \"./objectSet/ObjectSetFactory.js\";\nimport { applyQuery } from \"./queries/applyQuery.js\";\nimport type { QuerySignatureFromDef } from \"./queries/types.js\";\n\n// We import it this way to keep compatible with CJS. If we referenced the\n// value of `symbolClientContext` directly, then we would have to a dynamic import\n// in `createClientInternal` which would make it async and a break.\n// Since this is just a string in `@osdk/shared.client2` instead of a symbol,\n// we can safely perform this trick.\ntype newSymbolClientContext =\n // eslint-disable-next-line @typescript-eslint/consistent-type-imports\n typeof import(\"@osdk/shared.client2\").symbolClientContext;\n\nclass ActionInvoker<Q extends ActionDefinition<any>>\n implements ActionSignatureFromDef<Q>\n{\n constructor(\n clientCtx: MinimalClient,\n actionDef: ActionDefinition<any>,\n ) {\n // We type the property as a generic function as binding `applyAction`\n // doesn't return a type thats all that useful anyway\n // The implements covers us for the most part here as this exact type doesn't\n // escape this file\n this.applyAction = applyAction.bind(undefined, clientCtx, actionDef);\n this.batchApplyAction = applyAction.bind(undefined, clientCtx, actionDef);\n }\n\n applyAction: (...args: any[]) => any;\n batchApplyAction: (...args: any[]) => any;\n}\n\nclass QueryInvoker<Q extends QueryDefinition<any>>\n implements QuerySignatureFromDef<Q>\n{\n constructor(\n clientCtx: MinimalClient,\n queryDef: QueryDefinition<any>,\n ) {\n this.executeFunction = applyQuery.bind(undefined, clientCtx, queryDef);\n }\n\n executeFunction: (...args: any[]) => any;\n}\n\n/** @internal */\nexport function createClientInternal(\n objectSetFactory: ObjectSetFactory<any, any>,\n transactionRid: string | undefined,\n baseUrl: string,\n ontologyRid: string | Promise<string>,\n tokenProvider: () => Promise<string>,\n options: { logger?: Logger } | undefined = undefined,\n fetchFn: typeof globalThis.fetch = fetch,\n): Client {\n if (typeof ontologyRid === \"string\") {\n if (!ontologyRid.startsWith(\"ri.\")) {\n throw new Error(\"Invalid ontology RID\");\n }\n } else {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n ontologyRid.then((ontologyRid) => {\n if (!ontologyRid.startsWith(\"ri.\")) {\n // FIXME this promise is not await so this just shows up as an unhandled promise rejection\n throw new Error(\"Invalid ontology RID\");\n }\n });\n }\n\n const clientCtx: MinimalClient = createMinimalClient(\n { ontologyRid },\n baseUrl,\n tokenProvider,\n {\n ...options,\n logger: options?.logger ?? new MinimalLogger(),\n transactionRid: transactionRid,\n },\n fetchFn,\n objectSetFactory,\n );\n\n return createClientFromContext(clientCtx);\n}\n\n/**\n * @internal\n */\nexport function createClientFromContext(clientCtx: MinimalClient) {\n function clientFn<\n T extends\n | ObjectOrInterfaceDefinition\n | ActionDefinition<any>\n | QueryDefinition<any>\n | Experiment<\"2.0.8\">\n | Experiment<\"2.1.0\">,\n >(o: T): T extends ObjectTypeDefinition ? ObjectSet<T>\n : T extends InterfaceDefinition ? MinimalObjectSet<T>\n : T extends ActionDefinition<any> ? ActionSignatureFromDef<T>\n : T extends QueryDefinition<any> ? QuerySignatureFromDef<T>\n : T extends Experiment<\"2.0.8\"> | Experiment<\"2.1.0\">\n ? { invoke: ExperimentFns<T> }\n : never\n {\n if (o.type === \"object\" || o.type === \"interface\") {\n return clientCtx.objectSetFactory(o, clientCtx) as any;\n } else if (o.type === \"action\") {\n return new ActionInvoker(\n clientCtx,\n o,\n ) as (T extends ActionDefinition<any>\n // first `as` to the action definition for our \"real\" typecheck\n ? ActionSignatureFromDef<T>\n : never) as any; // then as any for dealing with the conditional return value\n } else if (o.type === \"query\") {\n return new QueryInvoker(\n clientCtx,\n o,\n ) as (T extends QueryDefinition<any> ? QuerySignatureFromDef<T>\n : never) as any;\n } else if (o.type === \"experiment\") {\n switch (o.name) {\n case __EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks.name:\n return {\n getBulkLinks: createBulkLinksAsyncIterFactory(\n clientCtx,\n ),\n } as any;\n case __EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid.name:\n return {\n fetchOneByRid: async <\n Q extends ObjectTypeDefinition,\n const L extends PropertyKeys<Q>,\n const R extends boolean,\n const S extends false | \"throw\" = NullabilityAdherence.Default,\n >(\n objectType: Q,\n rid: string,\n options: SelectArg<Q, L, R, S>,\n ) => {\n return await fetchSingle(\n clientCtx,\n objectType,\n options,\n createWithRid(\n [rid],\n ),\n ) as Osdk<Q>;\n },\n } as any;\n case __EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference.name:\n return {\n createMediaReference: async <\n Q extends ObjectTypeDefinition,\n const L extends PropertyKeys.Filtered<Q, \"mediaReference\">,\n >(args: {\n data: Blob;\n fileName: string;\n objectType: Q;\n propertyType: L;\n }) => {\n const { data, fileName, objectType, propertyType } = args;\n return await OntologiesV2.MediaReferenceProperties.upload(\n clientCtx,\n await clientCtx.ontologyRid,\n objectType.apiName,\n propertyType as string,\n data,\n {\n mediaItemPath: fileName,\n preview: true,\n },\n );\n },\n } as any;\n\n case __EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid.name:\n return {\n fetchPageByRid: async <\n Q extends ObjectOrInterfaceDefinition,\n const L extends PropertyKeys<Q>,\n const R extends boolean,\n const S extends false | \"throw\" = NullabilityAdherence.Default,\n >(\n objectOrInterfaceType: Q,\n rids: string[],\n options: FetchPageArgs<Q, L, R, any, S> = {},\n ) => {\n return await fetchPage(\n clientCtx,\n objectOrInterfaceType,\n options,\n createWithRid(rids),\n );\n },\n } as any;\n }\n\n throw new Error(\"not implemented\");\n } else {\n throw new Error(\"not implemented\");\n }\n }\n\n const fetchMetadata = fetchMetadataInternal.bind(\n undefined,\n clientCtx,\n );\n\n const symbolClientContext: newSymbolClientContext = \"__osdkClientContext\";\n\n const client: Client = Object.defineProperties<Client>(\n clientFn as Client,\n {\n [oldSymbolClientContext]: {\n value: clientCtx,\n },\n [symbolClientContext]: {\n value: clientCtx,\n },\n [additionalContext]: {\n value: clientCtx,\n },\n fetchMetadata: {\n value: fetchMetadata,\n },\n } satisfies Record<keyof Client, PropertyDescriptor>,\n );\n\n return client;\n}\n\nexport const createClient: (\n baseUrl: string,\n ontologyRid: string | Promise<string>,\n tokenProvider: () => Promise<string>,\n options?: {\n logger?: Logger;\n } | undefined,\n fetchFn?: typeof fetch | undefined,\n) => Client = createClientInternal.bind(\n undefined,\n createObjectSet,\n undefined,\n);\n\nexport const createClientWithTransaction: (\n transactionRid: string,\n ...args: Parameters<typeof createClient>\n) => Client = (transactionRid, ...args) =>\n createClientInternal(\n createObjectSet,\n transactionRid,\n ...args,\n ) as Client;\n\nfunction createWithRid(\n rids: string[],\n) {\n const withRid: WireObjectSet = {\n type: \"static\",\n \"objects\": rids,\n };\n\n return withRid;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAqBA,SACEA,uDAAuD,EACvDC,gDAAgD,EAChDC,iDAAiD,EACjDC,+CAA+C,QAC1C,oBAAoB;AAE3B,OAA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E/C;IACT,CAAC;IACD,CARgD,qBAAqB,GAQ9C;MACrB+C,KAAK,EAAE/C;IACT,CAAC;IACD,CAACV,iBAAiB,GAAG;MACnByD,KAAK,EAAE/C;IACT,CAAC;IACDsB,aAAa,EAAE;MACbyB,KAAK,EAAEzB;IACT;EACF,CACF,CAAC;EAED,OAAOC,MAAM;AACf;AAEA,OAAO,MAAMyB,YAQF,GAAGxC,oBAAoB,CAACN,IAAI,CACrCC,SAAS,EACTP,eAAe,EACfO,SACF,CAAC;AAED,OAAO,MAAM8C,2BAGF,GAAGA,CAACvC,cAAc,EAAE,GAAGyB,IAAI,KACpC3B,oBAAoB,CAClBZ,eAAe,EACfc,cAAc,EACd,GAAGyB,IACL,CAAW;AAEb,SAASF,aAAaA,CACpBa,IAAc,EACd;EAMA,OAL+B;IAC7BnB,IAAI,EAAE,QAAQ;IACd,SAAS,EAAEmB;EACb,CAAC;AAGH","ignoreList":[]}
@@ -39,6 +39,7 @@ export function createMinimalClient(metadata, baseUrl, tokenProvider, options =
39
39
  objectFactory2: convertWireToOsdkObjects2,
40
40
  ontologyRid: metadata.ontologyRid,
41
41
  logger: options.logger,
42
+ transactionRid: options.transactionRid,
42
43
  clientCacheKey: {},
43
44
  requestContext: {}
44
45
  };
@@ -1 +1 @@
1
- {"version":3,"file":"createMinimalClient.js","names":["createSharedClientContext","convertWireToOsdkObjects","convertWireToOsdkObjects2","createObjectSet","createStandardOntologyProviderFactory","USER_AGENT","createMinimalClient","metadata","baseUrl","tokenProvider","options","fetchFn","global","fetch","objectSetFactory","createOntologyProviderFactory","process","env","NODE_ENV","URL","e","hint","startsWith","Error","processedBaseUrl","pathname","endsWith","minimalClient","toString","objectFactory","objectFactory2","ontologyRid","logger","clientCacheKey","requestContext","Object","freeze","assign","ontologyProvider"],"sources":["createMinimalClient.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 { Logger } from \"@osdk/api\";\nimport { createSharedClientContext } from \"@osdk/shared.client.impl\";\nimport type {\n ClientCacheKey,\n MinimalClient,\n MinimalClientParams,\n} from \"./MinimalClientContext.js\";\nimport {\n convertWireToOsdkObjects,\n convertWireToOsdkObjects2,\n} from \"./object/convertWireToOsdkObjects.js\";\nimport { createObjectSet } from \"./objectSet/createObjectSet.js\";\nimport type { ObjectSetFactory } from \"./objectSet/ObjectSetFactory.js\";\nimport type { OntologyProvider } from \"./ontology/OntologyProvider.js\";\nimport {\n createStandardOntologyProviderFactory,\n type OntologyCachingOptions,\n} from \"./ontology/StandardOntologyProvider.js\";\nimport { USER_AGENT } from \"./util/UserAgent.js\";\n\n/** @internal */\nexport function createMinimalClient(\n metadata: MinimalClientParams[\"metadata\"],\n baseUrl: string,\n tokenProvider: () => Promise<string>,\n options: OntologyCachingOptions & { logger?: Logger } = {},\n fetchFn: (\n input: Request | URL | string,\n init?: RequestInit | undefined,\n ) => Promise<Response> = global.fetch,\n objectSetFactory: ObjectSetFactory<any, any> = createObjectSet,\n createOntologyProviderFactory: (\n a: OntologyCachingOptions & { logger?: Logger },\n ) => (minimalClient: MinimalClient) => OntologyProvider =\n createStandardOntologyProviderFactory,\n) {\n if (process.env.NODE_ENV !== \"production\") {\n try {\n new URL(baseUrl);\n } catch (e) {\n const hint =\n !baseUrl.startsWith(\"http://\") || !baseUrl.startsWith(\"https://\")\n ? \". Did you forget to add 'http://' or 'https://'?\"\n : \"\";\n throw new Error(`Invalid stack URL: ${baseUrl}${hint}`);\n }\n }\n const processedBaseUrl = new URL(baseUrl);\n processedBaseUrl.pathname += processedBaseUrl.pathname.endsWith(\"/\")\n ? \"\"\n : \"/\";\n const minimalClient: MinimalClient = {\n ...createSharedClientContext(\n processedBaseUrl.toString(),\n tokenProvider,\n USER_AGENT,\n fetchFn,\n ),\n objectSetFactory,\n objectFactory: convertWireToOsdkObjects,\n objectFactory2: convertWireToOsdkObjects2,\n ontologyRid: metadata.ontologyRid,\n logger: options.logger,\n clientCacheKey: {} as ClientCacheKey,\n requestContext: {},\n } satisfies Omit<\n MinimalClient,\n \"ontologyProvider\"\n > as any;\n\n return Object.freeze(Object.assign(minimalClient, {\n ontologyProvider: createOntologyProviderFactory(\n options,\n )(minimalClient),\n }));\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,yBAAyB,QAAQ,0BAA0B;AAMpE,SACEC,wBAAwB,EACxBC,yBAAyB,QACpB,sCAAsC;AAC7C,SAASC,eAAe,QAAQ,gCAAgC;AAGhE,SACEC,qCAAqC,QAEhC,wCAAwC;AAC/C,SAASC,UAAU,QAAQ,qBAAqB;;AAEhD;AACA,OAAO,SAASC,mBAAmBA,CACjCC,QAAyC,EACzCC,OAAe,EACfC,aAAoC,EACpCC,OAAqD,GAAG,CAAC,CAAC,EAC1DC,OAGsB,GAAGC,MAAM,CAACC,KAAK,EACrCC,gBAA4C,GAAGX,eAAe,EAC9DY,6BAEuD,GACrDX,qCAAqC,EACvC;EACA,IAAIY,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,EAAE;IACzC,IAAI;MACF,IAAIC,GAAG,CAACX,OAAO,CAAC;IAClB,CAAC,CAAC,OAAOY,CAAC,EAAE;MACV,MAAMC,IAAI,GACR,CAACb,OAAO,CAACc,UAAU,CAAC,SAAS,CAAC,IAAI,CAACd,OAAO,CAACc,UAAU,CAAC,UAAU,CAAC,GAC7D,kDAAkD,GAClD,EAAE;MACR,MAAM,IAAIC,KAAK,CAAC,sBAAsBf,OAAO,GAAGa,IAAI,EAAE,CAAC;IACzD;EACF;EACA,MAAMG,gBAAgB,GAAG,IAAIL,GAAG,CAACX,OAAO,CAAC;EACzCgB,gBAAgB,CAACC,QAAQ,IAAID,gBAAgB,CAACC,QAAQ,CAACC,QAAQ,CAAC,GAAG,CAAC,GAChE,EAAE,GACF,GAAG;EACP,MAAMC,aAA4B,GAAG;IACnC,GAAG3B,yBAAyB,CAC1BwB,gBAAgB,CAACI,QAAQ,CAAC,CAAC,EAC3BnB,aAAa,EACbJ,UAAU,EACVM,OACF,CAAC;IACDG,gBAAgB;IAChBe,aAAa,EAAE5B,wBAAwB;IACvC6B,cAAc,EAAE5B,yBAAyB;IACzC6B,WAAW,EAAExB,QAAQ,CAACwB,WAAW;IACjCC,MAAM,EAAEtB,OAAO,CAACsB,MAAM;IACtBC,cAAc,EAAE,CAAC,CAAmB;IACpCC,cAAc,EAAE,CAAC;EACnB,CAGQ;EAER,OAAOC,MAAM,CAACC,MAAM,CAACD,MAAM,CAACE,MAAM,CAACV,aAAa,EAAE;IAChDW,gBAAgB,EAAEvB,6BAA6B,CAC7CL,OACF,CAAC,CAACiB,aAAa;EACjB,CAAC,CAAC,CAAC;AACL","ignoreList":[]}
1
+ {"version":3,"file":"createMinimalClient.js","names":["createSharedClientContext","convertWireToOsdkObjects","convertWireToOsdkObjects2","createObjectSet","createStandardOntologyProviderFactory","USER_AGENT","createMinimalClient","metadata","baseUrl","tokenProvider","options","fetchFn","global","fetch","objectSetFactory","createOntologyProviderFactory","process","env","NODE_ENV","URL","e","hint","startsWith","Error","processedBaseUrl","pathname","endsWith","minimalClient","toString","objectFactory","objectFactory2","ontologyRid","logger","transactionRid","clientCacheKey","requestContext","Object","freeze","assign","ontologyProvider"],"sources":["createMinimalClient.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 { Logger } from \"@osdk/api\";\nimport { createSharedClientContext } from \"@osdk/shared.client.impl\";\nimport type {\n ClientCacheKey,\n MinimalClient,\n MinimalClientParams,\n} from \"./MinimalClientContext.js\";\nimport {\n convertWireToOsdkObjects,\n convertWireToOsdkObjects2,\n} from \"./object/convertWireToOsdkObjects.js\";\nimport { createObjectSet } from \"./objectSet/createObjectSet.js\";\nimport type { ObjectSetFactory } from \"./objectSet/ObjectSetFactory.js\";\nimport type { OntologyProvider } from \"./ontology/OntologyProvider.js\";\nimport {\n createStandardOntologyProviderFactory,\n type OntologyCachingOptions,\n} from \"./ontology/StandardOntologyProvider.js\";\nimport { USER_AGENT } from \"./util/UserAgent.js\";\n\n/** @internal */\nexport function createMinimalClient(\n metadata: MinimalClientParams[\"metadata\"],\n baseUrl: string,\n tokenProvider: () => Promise<string>,\n options: OntologyCachingOptions & {\n logger?: Logger;\n transactionRid?: string;\n } = {},\n fetchFn: (\n input: Request | URL | string,\n init?: RequestInit | undefined,\n ) => Promise<Response> = global.fetch,\n objectSetFactory: ObjectSetFactory<any, any> = createObjectSet,\n createOntologyProviderFactory: (\n a: OntologyCachingOptions & { logger?: Logger },\n ) => (minimalClient: MinimalClient) => OntologyProvider =\n createStandardOntologyProviderFactory,\n) {\n if (process.env.NODE_ENV !== \"production\") {\n try {\n new URL(baseUrl);\n } catch (e) {\n const hint =\n !baseUrl.startsWith(\"http://\") || !baseUrl.startsWith(\"https://\")\n ? \". Did you forget to add 'http://' or 'https://'?\"\n : \"\";\n throw new Error(`Invalid stack URL: ${baseUrl}${hint}`);\n }\n }\n const processedBaseUrl = new URL(baseUrl);\n processedBaseUrl.pathname += processedBaseUrl.pathname.endsWith(\"/\")\n ? \"\"\n : \"/\";\n const minimalClient: MinimalClient = {\n ...createSharedClientContext(\n processedBaseUrl.toString(),\n tokenProvider,\n USER_AGENT,\n fetchFn,\n ),\n objectSetFactory,\n objectFactory: convertWireToOsdkObjects,\n objectFactory2: convertWireToOsdkObjects2,\n ontologyRid: metadata.ontologyRid,\n logger: options.logger,\n transactionRid: options.transactionRid,\n clientCacheKey: {} as ClientCacheKey,\n requestContext: {},\n } satisfies Omit<\n MinimalClient,\n \"ontologyProvider\"\n > as any;\n\n return Object.freeze(Object.assign(minimalClient, {\n ontologyProvider: createOntologyProviderFactory(\n options,\n )(minimalClient),\n }));\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,yBAAyB,QAAQ,0BAA0B;AAMpE,SACEC,wBAAwB,EACxBC,yBAAyB,QACpB,sCAAsC;AAC7C,SAASC,eAAe,QAAQ,gCAAgC;AAGhE,SACEC,qCAAqC,QAEhC,wCAAwC;AAC/C,SAASC,UAAU,QAAQ,qBAAqB;;AAEhD;AACA,OAAO,SAASC,mBAAmBA,CACjCC,QAAyC,EACzCC,OAAe,EACfC,aAAoC,EACpCC,OAGC,GAAG,CAAC,CAAC,EACNC,OAGsB,GAAGC,MAAM,CAACC,KAAK,EACrCC,gBAA4C,GAAGX,eAAe,EAC9DY,6BAEuD,GACrDX,qCAAqC,EACvC;EACA,IAAIY,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,EAAE;IACzC,IAAI;MACF,IAAIC,GAAG,CAACX,OAAO,CAAC;IAClB,CAAC,CAAC,OAAOY,CAAC,EAAE;MACV,MAAMC,IAAI,GACR,CAACb,OAAO,CAACc,UAAU,CAAC,SAAS,CAAC,IAAI,CAACd,OAAO,CAACc,UAAU,CAAC,UAAU,CAAC,GAC7D,kDAAkD,GAClD,EAAE;MACR,MAAM,IAAIC,KAAK,CAAC,sBAAsBf,OAAO,GAAGa,IAAI,EAAE,CAAC;IACzD;EACF;EACA,MAAMG,gBAAgB,GAAG,IAAIL,GAAG,CAACX,OAAO,CAAC;EACzCgB,gBAAgB,CAACC,QAAQ,IAAID,gBAAgB,CAACC,QAAQ,CAACC,QAAQ,CAAC,GAAG,CAAC,GAChE,EAAE,GACF,GAAG;EACP,MAAMC,aAA4B,GAAG;IACnC,GAAG3B,yBAAyB,CAC1BwB,gBAAgB,CAACI,QAAQ,CAAC,CAAC,EAC3BnB,aAAa,EACbJ,UAAU,EACVM,OACF,CAAC;IACDG,gBAAgB;IAChBe,aAAa,EAAE5B,wBAAwB;IACvC6B,cAAc,EAAE5B,yBAAyB;IACzC6B,WAAW,EAAExB,QAAQ,CAACwB,WAAW;IACjCC,MAAM,EAAEtB,OAAO,CAACsB,MAAM;IACtBC,cAAc,EAAEvB,OAAO,CAACuB,cAAc;IACtCC,cAAc,EAAE,CAAC,CAAmB;IACpCC,cAAc,EAAE,CAAC;EACnB,CAGQ;EAER,OAAOC,MAAM,CAACC,MAAM,CAACD,MAAM,CAACE,MAAM,CAACX,aAAa,EAAE;IAChDY,gBAAgB,EAAExB,6BAA6B,CAC7CL,OACF,CAAC,CAACiB,aAAa;EACjB,CAAC,CAAC,CAAC;AACL","ignoreList":[]}
@@ -106,23 +106,6 @@ export function createWithPropertiesObjectSet(objectType, objectSet, definitionM
106
106
  const selectorResult = derivedPropertyDefinitionFactory(wrappedObjectSet, definitionMap);
107
107
  definitionMap.set(selectorResult, wrappedObjectSet);
108
108
  return selectorResult;
109
- },
110
- constant: {
111
- double: () => {
112
- process.env.NODE_ENV !== "production" ? invariant(false, "Not supported") : invariant(false);
113
- },
114
- integer: () => {
115
- process.env.NODE_ENV !== "production" ? invariant(false, "Not supported") : invariant(false);
116
- },
117
- long: () => {
118
- process.env.NODE_ENV !== "production" ? invariant(false, "Not supported") : invariant(false);
119
- },
120
- datetime: () => {
121
- process.env.NODE_ENV !== "production" ? invariant(false, "Not supported") : invariant(false);
122
- },
123
- timestamp: () => {
124
- process.env.NODE_ENV !== "production" ? invariant(false, "Not supported") : invariant(false);
125
- }
126
109
  }
127
110
  };
128
111
  }
@@ -1 +1 @@
1
- {"version":3,"file":"createWithPropertiesObjectSet.js","names":["invariant","modernToLegacyWhereClause","derivedPropertyDefinitionFactory","createWithPropertiesObjectSet","objectType","objectSet","definitionMap","fromBaseObjectSet","pivotTo","link","type","where","clause","aggregate","aggregation","opt","splitAggregation","split","length","process","env","NODE_ENV","aggregationPropertyName","aggregationOperation","aggregationOperationDefinition","selectedPropertyApiName","approximatePercentile","percentile","limit","undefined","wrappedObjectSet","operation","selectorResult","set","selectProperty","name","apiName","constant","double","integer","long","datetime","timestamp"],"sources":["createWithPropertiesObjectSet.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 { DerivedProperty, ObjectOrInterfaceDefinition } from \"@osdk/api\";\nimport type {\n DerivedPropertyDefinition,\n ObjectSet as WireObjectSet,\n SelectedPropertyOperation,\n} from \"@osdk/foundry.ontologies\";\nimport invariant from \"tiny-invariant\";\nimport { modernToLegacyWhereClause } from \"../internal/conversions/modernToLegacyWhereClause.js\";\nimport { derivedPropertyDefinitionFactory } from \"./derivedPropertyDefinitionFactory.js\";\n\ntype WithConstSelect<Q extends ObjectOrInterfaceDefinition> =\n & DerivedProperty.SelectPropertyBuilder<Q, false>\n & {\n constant: DerivedProperty.Builder<Q, true>[\"constant\"];\n };\n\n/** @internal */\nexport function createWithPropertiesObjectSet<\n Q extends ObjectOrInterfaceDefinition,\n>(\n objectType: Q,\n objectSet: WireObjectSet,\n definitionMap: Map<any, DerivedPropertyDefinition>,\n fromBaseObjectSet: boolean = false,\n): WithConstSelect<Q> {\n return {\n pivotTo: (link) => {\n return createWithPropertiesObjectSet(objectType, {\n type: \"searchAround\",\n objectSet,\n link,\n }, definitionMap);\n },\n where: (clause) => {\n return createWithPropertiesObjectSet(objectType, {\n type: \"filter\",\n objectSet: objectSet,\n where: modernToLegacyWhereClause(clause, objectType),\n }, definitionMap);\n },\n aggregate: (aggregation: string, opt: any) => {\n const splitAggregation = aggregation.split(\":\");\n invariant(\n splitAggregation.length === 2 || splitAggregation[0] === \"$count\",\n \"Invalid aggregation format\",\n );\n const [aggregationPropertyName, aggregationOperation] = splitAggregation;\n let aggregationOperationDefinition: SelectedPropertyOperation;\n switch (aggregationOperation) {\n case \"sum\":\n case \"avg\":\n case \"min\":\n case \"max\":\n case \"exactDistinct\":\n case \"approximateDistinct\":\n aggregationOperationDefinition = {\n type: aggregationOperation,\n selectedPropertyApiName: aggregationPropertyName,\n };\n break;\n case \"approximatePercentile\":\n aggregationOperationDefinition = {\n type: \"approximatePercentile\",\n selectedPropertyApiName: aggregationPropertyName,\n approximatePercentile: opt?.percentile ?? .5,\n };\n break;\n case \"collectSet\":\n case \"collectList\":\n aggregationOperationDefinition = {\n type: aggregationOperation,\n selectedPropertyApiName: aggregationPropertyName,\n limit: opt?.limit ?? 100,\n };\n break;\n case undefined:\n if (aggregationPropertyName === \"$count\") {\n aggregationOperationDefinition = {\n type: \"count\",\n };\n break;\n }\n default:\n invariant(\n false,\n \"Invalid aggregation operation \" + aggregationOperation,\n );\n }\n const wrappedObjectSet: DerivedPropertyDefinition = {\n type: \"selection\",\n objectSet: objectSet,\n operation: aggregationOperationDefinition,\n };\n const selectorResult: DerivedProperty.Definition<any, any> =\n derivedPropertyDefinitionFactory(wrappedObjectSet, definitionMap);\n definitionMap.set(selectorResult, wrappedObjectSet);\n return selectorResult as any;\n },\n selectProperty: (name) => {\n if (fromBaseObjectSet) {\n const wrappedObjectSet: DerivedPropertyDefinition = {\n type: \"property\",\n apiName: name,\n };\n const selectorResult: DerivedProperty.Definition<any, any> =\n derivedPropertyDefinitionFactory(wrappedObjectSet, definitionMap);\n definitionMap.set(selectorResult, wrappedObjectSet);\n return selectorResult as any;\n }\n const wrappedObjectSet: DerivedPropertyDefinition = {\n type: \"selection\",\n objectSet: objectSet,\n operation: {\n type: \"get\",\n selectedPropertyApiName: name,\n },\n };\n const selectorResult: DerivedProperty.Definition<any, any> =\n derivedPropertyDefinitionFactory(wrappedObjectSet, definitionMap);\n definitionMap.set(selectorResult, wrappedObjectSet);\n return selectorResult as any;\n },\n constant: {\n double: (value) => {\n invariant(false, \"Not supported\");\n },\n integer: (value) => {\n invariant(false, \"Not supported\");\n },\n long: (value) => {\n invariant(false, \"Not supported\");\n },\n datetime: (value) => {\n invariant(false, \"Not supported\");\n },\n timestamp: (value) => {\n invariant(false, \"Not supported\");\n },\n },\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAQA,OAAOA,SAAS,MAAM,gBAAgB;AACtC,SAASC,yBAAyB,QAAQ,sDAAsD;AAChG,SAASC,gCAAgC,QAAQ,uCAAuC;AAQxF;AACA,OAAO,SAASC,6BAA6BA,CAG3CC,UAAa,EACbC,SAAwB,EACxBC,aAAkD,EAClDC,iBAA0B,GAAG,KAAK,EACd;EACpB,OAAO;IACLC,OAAO,EAAGC,IAAI,IAAK;MACjB,OAAON,6BAA6B,CAACC,UAAU,EAAE;QAC/CM,IAAI,EAAE,cAAc;QACpBL,SAAS;QACTI;MACF,CAAC,EAAEH,aAAa,CAAC;IACnB,CAAC;IACDK,KAAK,EAAGC,MAAM,IAAK;MACjB,OAAOT,6BAA6B,CAACC,UAAU,EAAE;QAC/CM,IAAI,EAAE,QAAQ;QACdL,SAAS,EAAEA,SAAS;QACpBM,KAAK,EAAEV,yBAAyB,CAACW,MAAM,EAAER,UAAU;MACr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AAAC,GAAA,CAAAC,QAAA,oBAAArB,SAAS,QAAQ,eAAe,IAAhCA,SAAS;MACX,CAAC;MACDyC,QAAQ,EAAEA,CAAA,KAAW;QACnBtB,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAArB,SAAS,QAAQ,eAAe,IAAhCA,SAAS;MACX,CAAC;MACD0C,SAAS,EAAEA,CAAA,KAAW;QACpBvB,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAArB,SAAS,QAAQ,eAAe,IAAhCA,SAAS;MACX;IACF;EACF,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"file":"createWithPropertiesObjectSet.js","names":["invariant","modernToLegacyWhereClause","derivedPropertyDefinitionFactory","createWithPropertiesObjectSet","objectType","objectSet","definitionMap","fromBaseObjectSet","pivotTo","link","type","where","clause","aggregate","aggregation","opt","splitAggregation","split","length","process","env","NODE_ENV","aggregationPropertyName","aggregationOperation","aggregationOperationDefinition","selectedPropertyApiName","approximatePercentile","percentile","limit","undefined","wrappedObjectSet","operation","selectorResult","set","selectProperty","name","apiName"],"sources":["createWithPropertiesObjectSet.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 { DerivedProperty, ObjectOrInterfaceDefinition } from \"@osdk/api\";\nimport type {\n DerivedPropertyDefinition,\n ObjectSet as WireObjectSet,\n SelectedPropertyOperation,\n} from \"@osdk/foundry.ontologies\";\nimport invariant from \"tiny-invariant\";\nimport { modernToLegacyWhereClause } from \"../internal/conversions/modernToLegacyWhereClause.js\";\nimport { derivedPropertyDefinitionFactory } from \"./derivedPropertyDefinitionFactory.js\";\n\ntype WithConstSelect<Q extends ObjectOrInterfaceDefinition> =\n DerivedProperty.SelectPropertyBuilder<Q, false>;\n\n/** @internal */\nexport function createWithPropertiesObjectSet<\n Q extends ObjectOrInterfaceDefinition,\n>(\n objectType: Q,\n objectSet: WireObjectSet,\n definitionMap: Map<any, DerivedPropertyDefinition>,\n fromBaseObjectSet: boolean = false,\n): WithConstSelect<Q> {\n return {\n pivotTo: (link) => {\n return createWithPropertiesObjectSet(objectType, {\n type: \"searchAround\",\n objectSet,\n link,\n }, definitionMap);\n },\n where: (clause) => {\n return createWithPropertiesObjectSet(objectType, {\n type: \"filter\",\n objectSet: objectSet,\n where: modernToLegacyWhereClause(clause, objectType),\n }, definitionMap);\n },\n aggregate: (aggregation: string, opt: any) => {\n const splitAggregation = aggregation.split(\":\");\n invariant(\n splitAggregation.length === 2 || splitAggregation[0] === \"$count\",\n \"Invalid aggregation format\",\n );\n const [aggregationPropertyName, aggregationOperation] = splitAggregation;\n let aggregationOperationDefinition: SelectedPropertyOperation;\n switch (aggregationOperation) {\n case \"sum\":\n case \"avg\":\n case \"min\":\n case \"max\":\n case \"exactDistinct\":\n case \"approximateDistinct\":\n aggregationOperationDefinition = {\n type: aggregationOperation,\n selectedPropertyApiName: aggregationPropertyName,\n };\n break;\n case \"approximatePercentile\":\n aggregationOperationDefinition = {\n type: \"approximatePercentile\",\n selectedPropertyApiName: aggregationPropertyName,\n approximatePercentile: opt?.percentile ?? .5,\n };\n break;\n case \"collectSet\":\n case \"collectList\":\n aggregationOperationDefinition = {\n type: aggregationOperation,\n selectedPropertyApiName: aggregationPropertyName,\n limit: opt?.limit ?? 100,\n };\n break;\n case undefined:\n if (aggregationPropertyName === \"$count\") {\n aggregationOperationDefinition = {\n type: \"count\",\n };\n break;\n }\n default:\n invariant(\n false,\n \"Invalid aggregation operation \" + aggregationOperation,\n );\n }\n const wrappedObjectSet: DerivedPropertyDefinition = {\n type: \"selection\",\n objectSet: objectSet,\n operation: aggregationOperationDefinition,\n };\n const selectorResult: DerivedProperty.Definition<any, any> =\n derivedPropertyDefinitionFactory(wrappedObjectSet, definitionMap);\n definitionMap.set(selectorResult, wrappedObjectSet);\n return selectorResult as any;\n },\n selectProperty: (name) => {\n if (fromBaseObjectSet) {\n const wrappedObjectSet: DerivedPropertyDefinition = {\n type: \"property\",\n apiName: name,\n };\n const selectorResult: DerivedProperty.Definition<any, any> =\n derivedPropertyDefinitionFactory(wrappedObjectSet, definitionMap);\n definitionMap.set(selectorResult, wrappedObjectSet);\n return selectorResult as any;\n }\n const wrappedObjectSet: DerivedPropertyDefinition = {\n type: \"selection\",\n objectSet: objectSet,\n operation: {\n type: \"get\",\n selectedPropertyApiName: name,\n },\n };\n const selectorResult: DerivedProperty.Definition<any, any> =\n derivedPropertyDefinitionFactory(wrappedObjectSet, definitionMap);\n definitionMap.set(selectorResult, wrappedObjectSet);\n return selectorResult as any;\n },\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAQA,OAAOA,SAAS,MAAM,gBAAgB;AACtC,SAASC,yBAAyB,QAAQ,sDAAsD;AAChG,SAASC,gCAAgC,QAAQ,uCAAuC;AAKxF;AACA,OAAO,SAASC,6BAA6BA,CAG3CC,UAAa,EACbC,SAAwB,EACxBC,aAAkD,EAClDC,iBAA0B,GAAG,KAAK,EACd;EACpB,OAAO;IACLC,OAAO,EAAGC,IAAI,IAAK;MACjB,OAAON,6BAA6B,CAACC,UAAU,EAAE;QAC/CM,IAAI,EAAE,cAAc;QACpBL,SAAS;QACTI;MACF,CAAC,EAAEH,aAAa,CAAC;IACnB,CAAC;IACDK,KAAK,EAAGC,MAAM,IAAK;MACjB,OAAOT,6BAA6B,CAACC,UAAU,EAAE;QAC/CM,IAAI,EAAE,QAAQ;QACdL,SAAS,EAAEA,SAAS;QACpBM,KAAK,EAAEV,yBAAyB,CAACW,MAAM,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vB,SAAS;MAIb;MACA,MAAM8B,gBAA2C,GAAG;QAClDpB,IAAI,EAAE,WAAW;QACjBL,SAAS,EAAEA,SAAS;QACpB0B,SAAS,EAAEP;MACb,CAAC;MACD,MAAMQ,cAAoD,GACxD9B,gCAAgC,CAAC4B,gBAAgB,EAAExB,aAAa,CAAC;MACnEA,aAAa,CAAC2B,GAAG,CAACD,cAAc,EAAEF,gBAAgB,CAAC;MACnD,OAAOE,cAAc;IACvB,CAAC;IACDE,cAAc,EAAGC,IAAI,IAAK;MACxB,IAAI5B,iBAAiB,EAAE;QACrB,MAAMuB,gBAA2C,GAAG;UAClDpB,IAAI,EAAE,UAAU;UAChB0B,OAAO,EAAED;QACX,CAAC;QACD,MAAMH,cAAoD,GACxD9B,gCAAgC,CAAC4B,gBAAgB,EAAExB,aAAa,CAAC;QACnEA,aAAa,CAAC2B,GAAG,CAACD,cAAc,EAAEF,gBAAgB,CAAC;QACnD,OAAOE,cAAc;MACvB;MACA,MAAMF,gBAA2C,GAAG;QAClDpB,IAAI,EAAE,WAAW;QACjBL,SAAS,EAAEA,SAAS;QACpB0B,SAAS,EAAE;UACTrB,IAAI,EAAE,KAAK;UACXe,uBAAuB,EAAEU;QAC3B;MACF,CAAC;MACD,MAAMH,cAAoD,GACxD9B,gCAAgC,CAAC4B,gBAAgB,EAAExB,aAAa,CAAC;MACnEA,aAAa,CAAC2B,GAAG,CAACD,cAAc,EAAEF,gBAAgB,CAAC;MACnD,OAAOE,cAAc;IACvB;EACF,CAAC;AACH","ignoreList":[]}
@@ -168,7 +168,13 @@ describe("FetchMetadata", () => {
168
168
  "Person",
169
169
  ],
170
170
  "implements": [],
171
- "links": {},
171
+ "links": {
172
+ "toBar": {
173
+ "multiplicity": true,
174
+ "targetType": "interface",
175
+ "targetTypeApiName": "BarInterface",
176
+ },
177
+ },
172
178
  "properties": {
173
179
  "fooSpt": {
174
180
  "description": "A foo",
@@ -1 +1 @@
1
- {"version":3,"file":"fetchMetadata.test.js","names":["$Actions","$Interfaces","$Objects","$Queries","LegacyFauxFoundry","startNodeApiServer","beforeAll","describe","expect","expectTypeOf","it","createClient","client","testSetup","apiServer","close","objectMetadata","fetchMetadata","Employee","toEqualTypeOf","toMatchInlineSnapshot","interfaceMetadata","FooInterface","actionMetadata","moveOffice","queryMetadata","queryAcceptsObject"],"sources":["fetchMetadata.test.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n ActionMetadata,\n InterfaceMetadata,\n ObjectMetadata,\n QueryMetadata,\n} from \"@osdk/api\";\nimport {\n $Actions,\n $Interfaces,\n $Objects,\n $Queries,\n} from \"@osdk/client.test.ontology\";\nimport { LegacyFauxFoundry, startNodeApiServer } from \"@osdk/shared.test\";\nimport { beforeAll, describe, expect, expectTypeOf, it } from \"vitest\";\nimport type { Client } from \"./Client.js\";\nimport { createClient } from \"./createClient.js\";\n\ndescribe(\"FetchMetadata\", () => {\n let client: Client;\n\n beforeAll(() => {\n const testSetup = startNodeApiServer(new LegacyFauxFoundry(), createClient);\n ({ client } = testSetup);\n return () => {\n testSetup.apiServer.close();\n };\n });\n\n it(\"fetches object metadata correctly\", async () => {\n const objectMetadata = await client.fetchMetadata($Objects.Employee);\n\n expectTypeOf(objectMetadata).toEqualTypeOf<\n ObjectMetadata\n >();\n\n expect(objectMetadata).toMatchInlineSnapshot(`\n {\n \"apiName\": \"Employee\",\n \"description\": \"A full-time or part-time \n\n employee of our firm\",\n \"displayName\": \"Employee\",\n \"icon\": {\n \"color\": \"blue\",\n \"name\": \"person\",\n \"type\": \"blueprint\",\n },\n \"implements\": [\n \"FooInterface\",\n ],\n \"interfaceMap\": {\n \"FooInterface\": {\n \"fooSpt\": \"fullName\",\n },\n },\n \"inverseInterfaceMap\": {\n \"FooInterface\": {\n \"fullName\": \"fooSpt\",\n },\n },\n \"links\": {\n \"lead\": {\n \"multiplicity\": false,\n \"targetType\": \"Employee\",\n },\n \"officeLink\": {\n \"multiplicity\": false,\n \"targetType\": \"Office\",\n },\n \"peeps\": {\n \"multiplicity\": true,\n \"targetType\": \"Employee\",\n },\n },\n \"pluralDisplayName\": \"Employees\",\n \"primaryKeyApiName\": \"employeeId\",\n \"primaryKeyType\": \"integer\",\n \"properties\": {\n \"class\": {\n \"description\": \"\",\n \"displayName\": undefined,\n \"multiplicity\": false,\n \"nullable\": true,\n \"type\": \"string\",\n },\n \"employeeId\": {\n \"description\": undefined,\n \"displayName\": undefined,\n \"multiplicity\": false,\n \"nullable\": false,\n \"type\": \"integer\",\n },\n \"employeeLocation\": {\n \"description\": \"Geotime series reference of the location of the employee\",\n \"displayName\": undefined,\n \"multiplicity\": false,\n \"nullable\": true,\n \"type\": \"geotimeSeriesReference\",\n },\n \"employeeSensor\": {\n \"description\": \"TimeSeries sensor of the status of the employee\",\n \"displayName\": undefined,\n \"multiplicity\": false,\n \"nullable\": true,\n \"type\": \"sensorTimeseries\",\n },\n \"employeeStatus\": {\n \"description\": \"TimeSeries of the status of the employee\",\n \"displayName\": undefined,\n \"multiplicity\": false,\n \"nullable\": true,\n \"type\": \"stringTimeseries\",\n },\n \"fullName\": {\n \"description\": undefined,\n \"displayName\": undefined,\n \"multiplicity\": false,\n \"nullable\": true,\n \"type\": \"string\",\n },\n \"office\": {\n \"description\": \"The unique \"ID\" of the employee's \\\\\"primary\\\\\" assigned office.\n This is some more text.\",\n \"displayName\": undefined,\n \"multiplicity\": false,\n \"nullable\": true,\n \"type\": \"string\",\n },\n \"skillSet\": {\n \"description\": \"The skills of the employee\",\n \"displayName\": undefined,\n \"multiplicity\": false,\n \"nullable\": true,\n \"type\": \"string\",\n },\n \"skillSetEmbedding\": {\n \"description\": \"Vectorized skill set\",\n \"displayName\": undefined,\n \"multiplicity\": false,\n \"nullable\": true,\n \"type\": \"vector\",\n },\n \"startDate\": {\n \"description\": \"The date the employee was hired (most recently, if they were re-hired)\",\n \"displayName\": undefined,\n \"multiplicity\": false,\n \"nullable\": true,\n \"type\": \"datetime\",\n },\n },\n \"rid\": \"ri.ontology.main.object-type.401ac022-89eb-4591-8b7e-0a912b9efb44\",\n \"status\": \"ACTIVE\",\n \"titleProperty\": \"fullName\",\n \"type\": \"object\",\n \"visibility\": \"NORMAL\",\n }\n `);\n });\n\n it(\"fetches interface metadata correctly\", async () => {\n const interfaceMetadata = await client.fetchMetadata(\n $Interfaces.FooInterface,\n );\n\n expectTypeOf(interfaceMetadata).toEqualTypeOf<\n InterfaceMetadata\n >();\n\n expect(interfaceMetadata).toMatchInlineSnapshot(`\n {\n \"apiName\": \"FooInterface\",\n \"description\": \"Interface for Foo\",\n \"displayName\": \"Foo Interface\",\n \"implementedBy\": [\n \"Employee\",\n \"Person\",\n ],\n \"implements\": [],\n \"links\": {},\n \"properties\": {\n \"fooSpt\": {\n \"description\": \"A foo\",\n \"displayName\": \"Foo\",\n \"multiplicity\": false,\n \"nullable\": true,\n \"type\": \"string\",\n },\n },\n \"rid\": \"ri.interface.main.interface.1\",\n \"type\": \"interface\",\n }\n `);\n });\n\n it(\"fetches action metadata correctly\", async () => {\n const actionMetadata = await client.fetchMetadata(\n $Actions.moveOffice,\n );\n\n expectTypeOf(actionMetadata).toEqualTypeOf<ActionMetadata>();\n\n expect(actionMetadata).toMatchInlineSnapshot(`\n {\n \"apiName\": \"moveOffice\",\n \"description\": \"Update an office's physical location\",\n \"displayName\": \"move-office\",\n \"modifiedEntities\": {\n \"Office\": {\n \"created\": false,\n \"modified\": true,\n },\n },\n \"parameters\": {\n \"newAddress\": {\n \"description\": \"The office's new physical address (not necessarily shipping address)\",\n \"multiplicity\": false,\n \"nullable\": true,\n \"type\": \"string\",\n },\n \"newCapacity\": {\n \"description\": \"The maximum seated-at-desk capacity of the new office (maximum fire-safe capacity may be higher)\",\n \"multiplicity\": false,\n \"nullable\": true,\n \"type\": \"integer\",\n },\n \"officeId\": {\n \"description\": undefined,\n \"multiplicity\": false,\n \"nullable\": false,\n \"type\": \"string\",\n },\n \"officeNames\": {\n \"description\": \"A list of all office names\",\n \"multiplicity\": true,\n \"nullable\": true,\n \"type\": \"integer\",\n },\n },\n \"rid\": \"ri.ontology.main.action-type.9f84017d-cf17-4fa8-84c3-8e01e5d594f2\",\n \"status\": \"ACTIVE\",\n \"type\": \"action\",\n }\n `);\n });\n\n it(\"fetches query metadata correctly\", async () => {\n const queryMetadata = await client.fetchMetadata(\n $Queries.queryAcceptsObject,\n );\n\n expectTypeOf(queryMetadata).toEqualTypeOf<QueryMetadata>();\n\n expect(queryMetadata).toMatchInlineSnapshot(`\n {\n \"apiName\": \"queryAcceptsObject\",\n \"description\": \"description of the query that takes object types\",\n \"displayName\": \"QueryAcceptsObject\",\n \"output\": {\n \"nullable\": false,\n \"object\": \"Employee\",\n \"type\": \"object\",\n },\n \"parameters\": {\n \"object\": {\n \"description\": undefined,\n \"nullable\": false,\n \"object\": \"Employee\",\n \"type\": \"object\",\n },\n },\n \"rid\": \"ri.function-registry.main.function.9b55870a-63c7-4d48-8f06-9627c0805968\",\n \"type\": \"query\",\n \"version\": \"0.11.0\",\n }\n `);\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAQA,SACEA,QAAQ,EACRC,WAAW,EACXC,QAAQ,EACRC,QAAQ,QACH,4BAA4B;AACnC,SAASC,iBAAiB,EAAEC,kBAAkB,QAAQ,mBAAmB;AACzE,SAASC,SAAS,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,YAAY,EAAEC,EAAE,QAAQ,QAAQ;AAEtE,SAASC,YAAY,QAAQ,mBAAmB;AAEhDJ,QAAQ,CAAC,eAAe,EAAE,MAAM;EAC9B,IAAIK,MAAc;EAElBN,SAAS,CAAC,MAAM;IACd,MAAMO,SAAS,GAAGR,kBAAkB,CAAC,IAAID,iBAAiB,CAAC,CAAC,EAAEO,YAAY,CAAC;IAC3E,CAAC;MAAEC;IAAO,CAAC,GAAGC,SAAS;IACvB,OAAO,MAAM;MACXA,SAAS,CAACC,SAAS,CAACC,KAAK,CAAC,CAAC;IAC7B,CAAC;EACH,CAAC,CAAC;EAEFL,EAAE,CAAC,mCAAmC,EAAE,YAAY;IAClD,MAAMM,cAAc,GAAG,MAAMJ,MAAM,CAACK,aAAa,CAACf,QAAQ,CAACgB,QAAQ,CAAC;IAEpET,YAAY,CAACO,cAAc,CAAC,CAACG,aAAa,CAExC,CAAC;IAEHX,MAAM,CAACQ,cAAc,CAAC,CAACI,qBAAqB,CAAC;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,CAAC;EACJ,CAAC,CAAC;EAEFV,EAAE,CAAC,sCAAsC,EAAE,YAAY;IACrD,MAAMW,iBAAiB,GAAG,MAAMT,MAAM,CAACK,aAAa,CAClDhB,WAAW,CAACqB,YACd,CAAC;IAEDb,YAAY,CAACY,iBAAiB,CAAC,CAACF,aAAa,CAE3C,CAAC;IAEHX,MAAM,CAACa,iBAAiB,CAAC,CAACD,qBAAqB,CAAC;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,CAAC;EACJ,CAAC,CAAC;EAEFV,EAAE,CAAC,mCAAmC,EAAE,YAAY;IAClD,MAAMa,cAAc,GAAG,MAAMX,MAAM,CAACK,aAAa,CAC/CjB,QAAQ,CAACwB,UACX,CAAC;IAEDf,YAAY,CAACc,cAAc,CAAC,CAACJ,aAAa,CAAiB,CAAC;IAE5DX,MAAM,CAACe,cAAc,CAAC,CAACH,qBAAqB,CAAC;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,CAAC;EACJ,CAAC,CAAC;EAEFV,EAAE,CAAC,kCAAkC,EAAE,YAAY;IACjD,MAAMe,aAAa,GAAG,MAAMb,MAAM,CAACK,aAAa,CAC9Cd,QAAQ,CAACuB,kBACX,CAAC;IAEDjB,YAAY,CAACgB,aAAa,CAAC,CAACN,aAAa,CAAgB,CAAC;IAE1DX,MAAM,CAACiB,aAAa,CAAC,CAACL,qBAAqB,CAAC;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"fetchMetadata.test.js","names":["$Actions","$Interfaces","$Objects","$Queries","LegacyFauxFoundry","startNodeApiServer","beforeAll","describe","expect","expectTypeOf","it","createClient","client","testSetup","apiServer","close","objectMetadata","fetchMetadata","Employee","toEqualTypeOf","toMatchInlineSnapshot","interfaceMetadata","FooInterface","actionMetadata","moveOffice","queryMetadata","queryAcceptsObject"],"sources":["fetchMetadata.test.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n ActionMetadata,\n InterfaceMetadata,\n ObjectMetadata,\n QueryMetadata,\n} from \"@osdk/api\";\nimport {\n $Actions,\n $Interfaces,\n $Objects,\n $Queries,\n} from \"@osdk/client.test.ontology\";\nimport { LegacyFauxFoundry, startNodeApiServer } from \"@osdk/shared.test\";\nimport { beforeAll, describe, expect, expectTypeOf, it } from \"vitest\";\nimport type { Client } from \"./Client.js\";\nimport { createClient } from \"./createClient.js\";\n\ndescribe(\"FetchMetadata\", () => {\n let client: Client;\n\n beforeAll(() => {\n const testSetup = startNodeApiServer(new LegacyFauxFoundry(), createClient);\n ({ client } = testSetup);\n return () => {\n testSetup.apiServer.close();\n };\n });\n\n it(\"fetches object metadata correctly\", async () => {\n const objectMetadata = await client.fetchMetadata($Objects.Employee);\n\n expectTypeOf(objectMetadata).toEqualTypeOf<\n ObjectMetadata\n >();\n\n expect(objectMetadata).toMatchInlineSnapshot(`\n {\n \"apiName\": \"Employee\",\n \"description\": \"A full-time or part-time \n\n employee of our firm\",\n \"displayName\": \"Employee\",\n \"icon\": {\n \"color\": \"blue\",\n \"name\": \"person\",\n \"type\": \"blueprint\",\n },\n \"implements\": [\n \"FooInterface\",\n ],\n \"interfaceMap\": {\n \"FooInterface\": {\n \"fooSpt\": \"fullName\",\n },\n },\n \"inverseInterfaceMap\": {\n \"FooInterface\": {\n \"fullName\": \"fooSpt\",\n },\n },\n \"links\": {\n \"lead\": {\n \"multiplicity\": false,\n \"targetType\": \"Employee\",\n },\n \"officeLink\": {\n \"multiplicity\": false,\n \"targetType\": \"Office\",\n },\n \"peeps\": {\n \"multiplicity\": true,\n \"targetType\": \"Employee\",\n },\n },\n \"pluralDisplayName\": \"Employees\",\n \"primaryKeyApiName\": \"employeeId\",\n \"primaryKeyType\": \"integer\",\n \"properties\": {\n \"class\": {\n \"description\": \"\",\n \"displayName\": undefined,\n \"multiplicity\": false,\n \"nullable\": true,\n \"type\": \"string\",\n },\n \"employeeId\": {\n \"description\": undefined,\n \"displayName\": undefined,\n \"multiplicity\": false,\n \"nullable\": false,\n \"type\": \"integer\",\n },\n \"employeeLocation\": {\n \"description\": \"Geotime series reference of the location of the employee\",\n \"displayName\": undefined,\n \"multiplicity\": false,\n \"nullable\": true,\n \"type\": \"geotimeSeriesReference\",\n },\n \"employeeSensor\": {\n \"description\": \"TimeSeries sensor of the status of the employee\",\n \"displayName\": undefined,\n \"multiplicity\": false,\n \"nullable\": true,\n \"type\": \"sensorTimeseries\",\n },\n \"employeeStatus\": {\n \"description\": \"TimeSeries of the status of the employee\",\n \"displayName\": undefined,\n \"multiplicity\": false,\n \"nullable\": true,\n \"type\": \"stringTimeseries\",\n },\n \"fullName\": {\n \"description\": undefined,\n \"displayName\": undefined,\n \"multiplicity\": false,\n \"nullable\": true,\n \"type\": \"string\",\n },\n \"office\": {\n \"description\": \"The unique \"ID\" of the employee's \\\\\"primary\\\\\" assigned office.\n This is some more text.\",\n \"displayName\": undefined,\n \"multiplicity\": false,\n \"nullable\": true,\n \"type\": \"string\",\n },\n \"skillSet\": {\n \"description\": \"The skills of the employee\",\n \"displayName\": undefined,\n \"multiplicity\": false,\n \"nullable\": true,\n \"type\": \"string\",\n },\n \"skillSetEmbedding\": {\n \"description\": \"Vectorized skill set\",\n \"displayName\": undefined,\n \"multiplicity\": false,\n \"nullable\": true,\n \"type\": \"vector\",\n },\n \"startDate\": {\n \"description\": \"The date the employee was hired (most recently, if they were re-hired)\",\n \"displayName\": undefined,\n \"multiplicity\": false,\n \"nullable\": true,\n \"type\": \"datetime\",\n },\n },\n \"rid\": \"ri.ontology.main.object-type.401ac022-89eb-4591-8b7e-0a912b9efb44\",\n \"status\": \"ACTIVE\",\n \"titleProperty\": \"fullName\",\n \"type\": \"object\",\n \"visibility\": \"NORMAL\",\n }\n `);\n });\n\n it(\"fetches interface metadata correctly\", async () => {\n const interfaceMetadata = await client.fetchMetadata(\n $Interfaces.FooInterface,\n );\n\n expectTypeOf(interfaceMetadata).toEqualTypeOf<\n InterfaceMetadata\n >();\n\n expect(interfaceMetadata).toMatchInlineSnapshot(`\n {\n \"apiName\": \"FooInterface\",\n \"description\": \"Interface for Foo\",\n \"displayName\": \"Foo Interface\",\n \"implementedBy\": [\n \"Employee\",\n \"Person\",\n ],\n \"implements\": [],\n \"links\": {\n \"toBar\": {\n \"multiplicity\": true,\n \"targetType\": \"interface\",\n \"targetTypeApiName\": \"BarInterface\",\n },\n },\n \"properties\": {\n \"fooSpt\": {\n \"description\": \"A foo\",\n \"displayName\": \"Foo\",\n \"multiplicity\": false,\n \"nullable\": true,\n \"type\": \"string\",\n },\n },\n \"rid\": \"ri.interface.main.interface.1\",\n \"type\": \"interface\",\n }\n `);\n });\n\n it(\"fetches action metadata correctly\", async () => {\n const actionMetadata = await client.fetchMetadata(\n $Actions.moveOffice,\n );\n\n expectTypeOf(actionMetadata).toEqualTypeOf<ActionMetadata>();\n\n expect(actionMetadata).toMatchInlineSnapshot(`\n {\n \"apiName\": \"moveOffice\",\n \"description\": \"Update an office's physical location\",\n \"displayName\": \"move-office\",\n \"modifiedEntities\": {\n \"Office\": {\n \"created\": false,\n \"modified\": true,\n },\n },\n \"parameters\": {\n \"newAddress\": {\n \"description\": \"The office's new physical address (not necessarily shipping address)\",\n \"multiplicity\": false,\n \"nullable\": true,\n \"type\": \"string\",\n },\n \"newCapacity\": {\n \"description\": \"The maximum seated-at-desk capacity of the new office (maximum fire-safe capacity may be higher)\",\n \"multiplicity\": false,\n \"nullable\": true,\n \"type\": \"integer\",\n },\n \"officeId\": {\n \"description\": undefined,\n \"multiplicity\": false,\n \"nullable\": false,\n \"type\": \"string\",\n },\n \"officeNames\": {\n \"description\": \"A list of all office names\",\n \"multiplicity\": true,\n \"nullable\": true,\n \"type\": \"integer\",\n },\n },\n \"rid\": \"ri.ontology.main.action-type.9f84017d-cf17-4fa8-84c3-8e01e5d594f2\",\n \"status\": \"ACTIVE\",\n \"type\": \"action\",\n }\n `);\n });\n\n it(\"fetches query metadata correctly\", async () => {\n const queryMetadata = await client.fetchMetadata(\n $Queries.queryAcceptsObject,\n );\n\n expectTypeOf(queryMetadata).toEqualTypeOf<QueryMetadata>();\n\n expect(queryMetadata).toMatchInlineSnapshot(`\n {\n \"apiName\": \"queryAcceptsObject\",\n \"description\": \"description of the query that takes object types\",\n \"displayName\": \"QueryAcceptsObject\",\n \"output\": {\n \"nullable\": false,\n \"object\": \"Employee\",\n \"type\": \"object\",\n },\n \"parameters\": {\n \"object\": {\n \"description\": undefined,\n \"nullable\": false,\n \"object\": \"Employee\",\n \"type\": \"object\",\n },\n },\n \"rid\": \"ri.function-registry.main.function.9b55870a-63c7-4d48-8f06-9627c0805968\",\n \"type\": \"query\",\n \"version\": \"0.11.0\",\n }\n `);\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAQA,SACEA,QAAQ,EACRC,WAAW,EACXC,QAAQ,EACRC,QAAQ,QACH,4BAA4B;AACnC,SAASC,iBAAiB,EAAEC,kBAAkB,QAAQ,mBAAmB;AACzE,SAASC,SAAS,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,YAAY,EAAEC,EAAE,QAAQ,QAAQ;AAEtE,SAASC,YAAY,QAAQ,mBAAmB;AAEhDJ,QAAQ,CAAC,eAAe,EAAE,MAAM;EAC9B,IAAIK,MAAc;EAElBN,SAAS,CAAC,MAAM;IACd,MAAMO,SAAS,GAAGR,kBAAkB,CAAC,IAAID,iBAAiB,CAAC,CAAC,EAAEO,YAAY,CAAC;IAC3E,CAAC;MAAEC;IAAO,CAAC,GAAGC,SAAS;IACvB,OAAO,MAAM;MACXA,SAAS,CAACC,SAAS,CAACC,KAAK,CAAC,CAAC;IAC7B,CAAC;EACH,CAAC,CAAC;EAEFL,EAAE,CAAC,mCAAmC,EAAE,YAAY;IAClD,MAAMM,cAAc,GAAG,MAAMJ,MAAM,CAACK,aAAa,CAACf,QAAQ,CAACgB,QAAQ,CAAC;IAEpET,YAAY,CAACO,cAAc,CAAC,CAACG,aAAa,CAExC,CAAC;IAEHX,MAAM,CAACQ,cAAc,CAAC,CAACI,qBAAqB,CAAC;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,CAAC;EACJ,CAAC,CAAC;EAEFV,EAAE,CAAC,sCAAsC,EAAE,YAAY;IACrD,MAAMW,iBAAiB,GAAG,MAAMT,MAAM,CAACK,aAAa,CAClDhB,WAAW,CAACqB,YACd,CAAC;IAEDb,YAAY,CAACY,iBAAiB,CAAC,CAACF,aAAa,CAE3C,CAAC;IAEHX,MAAM,CAACa,iBAAiB,CAAC,CAACD,qBAAqB,CAAC;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,CAAC;EACJ,CAAC,CAAC;EAEFV,EAAE,CAAC,mCAAmC,EAAE,YAAY;IAClD,MAAMa,cAAc,GAAG,MAAMX,MAAM,CAACK,aAAa,CAC/CjB,QAAQ,CAACwB,UACX,CAAC;IAEDf,YAAY,CAACc,cAAc,CAAC,CAACJ,aAAa,CAAiB,CAAC;IAE5DX,MAAM,CAACe,cAAc,CAAC,CAACH,qBAAqB,CAAC;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,CAAC;EACJ,CAAC,CAAC;EAEFV,EAAE,CAAC,kCAAkC,EAAE,YAAY;IACjD,MAAMe,aAAa,GAAG,MAAMb,MAAM,CAACK,aAAa,CAC9Cd,QAAQ,CAACuB,kBACX,CAAC;IAEDjB,YAAY,CAACgB,aAAa,CAAC,CAACN,aAAa,CAAgB,CAAC;IAE1DX,MAAM,CAACiB,aAAa,CAAC,CAACL,qBAAqB,CAAC;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -14,11 +14,12 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- export { isOk, NULL_VALUE } from "@osdk/api";
17
+ export { isOk } from "@osdk/api";
18
18
  export { PalantirApiError } from "@osdk/shared.net.errors";
19
19
  export { ActionValidationError } from "./actions/ActionValidationError.js";
20
20
  export { createClient } from "./createClient.js";
21
21
  export { createPlatformClient } from "./createPlatformClient.js";
22
22
  export { createAttachmentUpload } from "./object/AttachmentUpload.js";
23
23
  export { extractDate, extractDateInLocalTime, extractDateInUTC } from "./util/datetimeConverters.js";
24
+ export { createObjectSpecifierFromPrimaryKey } from "./util/objectSpecifierUtils.js";
24
25
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["isOk","NULL_VALUE","PalantirApiError","ActionValidationError","createClient","createPlatformClient","createAttachmentUpload","extractDate","extractDateInLocalTime","extractDateInUTC"],"sources":["index.ts"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport type {\n ActionDefinition,\n ActionEditResponse,\n ActionMetadata,\n ActionParam,\n ActionReturnTypeForOptions,\n ActionValidationResponse,\n ApplyActionOptions,\n ApplyBatchActionOptions,\n Attachment,\n CompileTimeMetadata,\n InterfaceDefinition,\n Logger,\n ObjectMetadata,\n ObjectSet,\n ObjectSpecifier,\n ObjectTypeDefinition,\n Osdk,\n OsdkObject,\n OsdkObjectCreatePropertyType,\n OsdkObjectPropertyType,\n PageResult,\n PropertyDef,\n PropertyKeys,\n PropertyValueWireToClient,\n QueryDefinition,\n QueryParam,\n QueryResult,\n Range,\n Result,\n SingleLinkAccessor,\n ThreeDimensionalAggregation,\n TwoDimensionalAggregation,\n VersionBound,\n WhereClause,\n} from \"@osdk/api\";\nexport { isOk, NULL_VALUE } from \"@osdk/api\";\nexport { PalantirApiError } from \"@osdk/shared.net.errors\";\n\nexport { ActionValidationError } from \"./actions/ActionValidationError.js\";\nexport type { Client } from \"./Client.js\";\nexport { createClient } from \"./createClient.js\";\nexport { createPlatformClient } from \"./createPlatformClient.js\";\nexport type { PlatformClient } from \"./createPlatformClient.js\";\nexport { createAttachmentUpload } from \"./object/AttachmentUpload.js\";\nexport type { ResultOrError } from \"./ResultOrError.js\";\n\nexport {\n extractDate,\n extractDateInLocalTime,\n extractDateInUTC,\n} from \"./util/datetimeConverters.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAsCA,SAASA,IAAI,EAAEC,UAAU,QAAQ,WAAW;AAC5C,SAASC,gBAAgB,QAAQ,yBAAyB;AAE1D,SAASC,qBAAqB,QAAQ,oCAAoC;AAE1E,SAASC,YAAY,QAAQ,mBAAmB;AAChD,SAASC,oBAAoB,QAAQ,2BAA2B;AAEhE,SAASC,sBAAsB,QAAQ,8BAA8B;AAGrE,SACEC,WAAW,EACXC,sBAAsB,EACtBC,gBAAgB,QACX,8BAA8B","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["isOk","PalantirApiError","ActionValidationError","createClient","createPlatformClient","createAttachmentUpload","extractDate","extractDateInLocalTime","extractDateInUTC","createObjectSpecifierFromPrimaryKey"],"sources":["index.ts"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport type {\n ActionDefinition,\n ActionEditResponse,\n ActionMetadata,\n ActionParam,\n ActionReturnTypeForOptions,\n ActionValidationResponse,\n ApplyActionOptions,\n ApplyBatchActionOptions,\n Attachment,\n CompileTimeMetadata,\n InterfaceDefinition,\n InterfaceMetadata,\n Logger,\n ObjectMetadata,\n ObjectSet,\n ObjectSpecifier,\n ObjectTypeDefinition,\n Osdk,\n OsdkObject,\n OsdkObjectCreatePropertyType,\n OsdkObjectPropertyType,\n PageResult,\n PropertyDef,\n PropertyKeys,\n PropertyValueWireToClient,\n QueryDefinition,\n QueryParam,\n QueryResult,\n Range,\n Result,\n SingleLinkAccessor,\n ThreeDimensionalAggregation,\n TwoDimensionalAggregation,\n VersionBound,\n WhereClause,\n} from \"@osdk/api\";\nexport { isOk } from \"@osdk/api\";\nexport { PalantirApiError } from \"@osdk/shared.net.errors\";\n\nexport { ActionValidationError } from \"./actions/ActionValidationError.js\";\nexport type { Client } from \"./Client.js\";\nexport { createClient } from \"./createClient.js\";\nexport { createPlatformClient } from \"./createPlatformClient.js\";\nexport type { PlatformClient } from \"./createPlatformClient.js\";\nexport { createAttachmentUpload } from \"./object/AttachmentUpload.js\";\nexport type { ResultOrError } from \"./ResultOrError.js\";\n\nexport {\n extractDate,\n extractDateInLocalTime,\n extractDateInUTC,\n} from \"./util/datetimeConverters.js\";\n\nexport { createObjectSpecifierFromPrimaryKey } from \"./util/objectSpecifierUtils.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAuCA,SAASA,IAAI,QAAQ,WAAW;AAChC,SAASC,gBAAgB,QAAQ,yBAAyB;AAE1D,SAASC,qBAAqB,QAAQ,oCAAoC;AAE1E,SAASC,YAAY,QAAQ,mBAAmB;AAChD,SAASC,oBAAoB,QAAQ,2BAA2B;AAEhE,SAASC,sBAAsB,QAAQ,8BAA8B;AAGrE,SACEC,WAAW,EACXC,sBAAsB,EACtBC,gBAAgB,QACX,8BAA8B;AAErC,SAASC,mCAAmC,QAAQ,gCAAgC","ignoreList":[]}
@@ -72,11 +72,12 @@ export async function convertWireToOsdkObjects(client, objects, interfaceApiName
72
72
  */
73
73
  export async function convertWireToOsdkObjects2(client, objects, interfaceApiName, derivedPropertyTypeByName, forceRemoveRid = false, selectedProps, strictNonNull = false, interfaceToObjectTypeMappings = {}) {
74
74
  fixObjectPropertiesInPlace(objects, forceRemoveRid);
75
+ const isInterfaceScoped = Object.keys(interfaceToObjectTypeMappings).length > 0;
75
76
  const ret = [];
76
77
  for (const rawObj of objects) {
77
78
  const objectDef = await client.ontologyProvider.getObjectDefinition(rawObj.$apiName);
78
79
  !objectDef ? process.env.NODE_ENV !== "production" ? invariant(false, `Missing definition for '${rawObj.$apiName}'`) : invariant(false) : void 0;
79
- const interfaceToObjMapping = interfaceApiName ? interfaceToObjectTypeMappings[interfaceApiName][rawObj.$apiName] : undefined;
80
+ const interfaceToObjMapping = interfaceApiName && isInterfaceScoped ? interfaceToObjectTypeMappings[interfaceApiName][rawObj.$apiName] : undefined;
80
81
  const ifaceSelected = interfaceApiName && interfaceToObjMapping ? selectedProps ? Object.keys(interfaceToObjMapping).filter(val => {
81
82
  selectedProps?.includes(interfaceToObjMapping[val]);
82
83
  }) : [...Object.values(interfaceToObjMapping), objectDef.primaryKeyApiName] : undefined;
@@ -97,7 +98,7 @@ export async function convertWireToOsdkObjects2(client, objects, interfaceApiNam
97
98
  continue;
98
99
  }
99
100
  let osdkObject = createOsdkObject(client, objectDef, rawObj, derivedPropertyTypeByName);
100
- if (interfaceApiName) osdkObject = osdkObject.$as(interfaceApiName);
101
+ if (interfaceApiName && isInterfaceScoped) osdkObject = osdkObject.$as(interfaceApiName);
101
102
  ret.push(osdkObject);
102
103
  }
103
104
  return ret;
@@ -1 +1 @@
1
- {"version":3,"file":"convertWireToOsdkObjects.js","names":["invariant","createOsdkObject","convertWireToOsdkObjects","client","objects","interfaceApiName","forceRemoveRid","derivedPropertyTypesByName","selectedProps","strictNonNull","fixObjectPropertiesInPlace","ifaceDef","ontologyProvider","getInterfaceDefinition","undefined","ifaceSelected","Object","keys","properties","ret","rawObj","objectDef","getObjectDefinition","$apiName","process","env","NODE_ENV","objProps","conforming","invariantInterfacesAsViews","apiName","isConforming","reframeAsObjectInPlace","convertInterfacePropNamesToObjectPropNames","Error","osdkObject","$as","push","convertWireToOsdkObjects2","derivedPropertyTypeByName","interfaceToObjectTypeMappings","interfaceToObjMapping","filter","val","includes","values","primaryKeyApiName","ifacePropsToMap","map","ifaceProp","interfaceMap","newProps","sptProp","regularProp","entries","value","assign","$primaryKey","def","obj","propsToCheck","propName","nullable","logger","debug","$objectType","warning","warn","console","error","objs","__rid","$rid","__apiName","__primaryKey","$title","__title"],"sources":["convertWireToOsdkObjects.ts"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n InterfaceMetadata,\n NullabilityAdherence,\n ObjectMetadata,\n} from \"@osdk/api\";\nimport type {\n InterfaceToObjectTypeMappings,\n InterfaceTypeApiName,\n OntologyObjectV2,\n} from \"@osdk/foundry.ontologies\";\nimport invariant from \"tiny-invariant\";\nimport type { DerivedPropertyRuntimeMetadata } from \"../derivedProperties/derivedPropertyRuntimeMetadata.js\";\nimport type { MinimalClient } from \"../MinimalClientContext.js\";\nimport {\n type FetchedObjectTypeDefinition,\n} from \"../ontology/OntologyProvider.js\";\nimport { createOsdkObject } from \"./convertWireToOsdkObjects/createOsdkObject.js\";\nimport type { InterfaceHolder } from \"./convertWireToOsdkObjects/InterfaceHolder.js\";\nimport type { ObjectHolder } from \"./convertWireToOsdkObjects/ObjectHolder.js\";\nimport type { SimpleOsdkProperties } from \"./SimpleOsdkProperties.js\";\n\n/**\n * If interfaceApiName is not undefined, converts the instances of the\n * interface into their respective\n * underlying concrete types and then returns the $as() representation\n * for the consumers.\n *\n * Otherwise just does the conversion\n *\n * May mutate in place for performance reasons. If you need a clean copy,\n * keep it first.\n *\n * However, you must use the returned value, which will be whatever is correct.\n *\n * @internal\n * @param interfaceApiName - if undefined\n */\nexport async function convertWireToOsdkObjects(\n client: MinimalClient,\n objects: OntologyObjectV2[],\n interfaceApiName: string | undefined,\n forceRemoveRid: boolean = false,\n derivedPropertyTypesByName: DerivedPropertyRuntimeMetadata,\n selectedProps?: ReadonlyArray<string>,\n strictNonNull: NullabilityAdherence = false,\n): Promise<Array<ObjectHolder | InterfaceHolder>> {\n // remove the __ prefixed properties and convert them to $ prefixed.\n // updates in place\n fixObjectPropertiesInPlace(objects, forceRemoveRid);\n\n const ifaceDef = interfaceApiName\n ? await client.ontologyProvider.getInterfaceDefinition(interfaceApiName)\n : undefined;\n const ifaceSelected = ifaceDef\n ? (selectedProps ?? Object.keys(ifaceDef.properties))\n : undefined;\n\n const ret = [];\n for (const rawObj of objects) {\n const objectDef = await client.ontologyProvider.getObjectDefinition(\n rawObj.$apiName,\n );\n invariant(objectDef, `Missing definition for '${rawObj.$apiName}'`);\n\n // default value for when we are checking an object\n let objProps;\n\n let conforming = true;\n if (ifaceDef && ifaceSelected) {\n // API returns interface spt names but we cache by real values\n invariantInterfacesAsViews(objectDef, ifaceDef.apiName, client);\n\n conforming &&= isConforming(client, ifaceDef, rawObj, ifaceSelected);\n\n reframeAsObjectInPlace(objectDef, ifaceDef.apiName, rawObj);\n\n objProps = convertInterfacePropNamesToObjectPropNames(\n objectDef,\n ifaceDef.apiName,\n ifaceSelected,\n );\n } else {\n objProps = selectedProps ?? Object.keys(objectDef.properties);\n }\n\n conforming &&= isConforming(client, objectDef, rawObj, objProps);\n\n if (strictNonNull === \"throw\" && !conforming) {\n throw new Error(\n \"Unable to safely convert objects as some non nullable properties are null\",\n );\n } else if (strictNonNull === \"drop\" && !conforming) {\n continue;\n }\n\n let osdkObject: ObjectHolder | InterfaceHolder = createOsdkObject(\n client,\n objectDef,\n rawObj,\n derivedPropertyTypesByName,\n );\n if (interfaceApiName) osdkObject = osdkObject.$as(interfaceApiName);\n\n ret.push(osdkObject);\n }\n\n return ret;\n}\n\nexport async function convertWireToOsdkObjects2(\n client: MinimalClient,\n objects: OntologyObjectV2[],\n interfaceApiName: string,\n derivedPropertyTypeByName: DerivedPropertyRuntimeMetadata,\n forceRemoveRid?: boolean,\n selectedProps?: ReadonlyArray<string>,\n strictNonNull?: NullabilityAdherence,\n interfaceToObjectTypeMappings?: Record<\n InterfaceTypeApiName,\n InterfaceToObjectTypeMappings\n >,\n): Promise<Array<InterfaceHolder>>;\nexport async function convertWireToOsdkObjects2(\n client: MinimalClient,\n objects: OntologyObjectV2[],\n interfaceApiName: undefined,\n derivedPropertyTypeByName: DerivedPropertyRuntimeMetadata,\n forceRemoveRid?: boolean,\n selectedProps?: ReadonlyArray<string>,\n strictNonNull?: NullabilityAdherence,\n interfaceToObjectTypeMappings?: Record<\n InterfaceTypeApiName,\n InterfaceToObjectTypeMappings\n >,\n): Promise<Array<ObjectHolder>>;\nexport async function convertWireToOsdkObjects2(\n client: MinimalClient,\n objects: OntologyObjectV2[],\n interfaceApiName: string | undefined,\n derivedPropertyTypeByName: DerivedPropertyRuntimeMetadata,\n forceRemoveRid?: boolean,\n selectedProps?: ReadonlyArray<string>,\n strictNonNull?: NullabilityAdherence,\n interfaceToObjectTypeMappings?: Record<\n InterfaceTypeApiName,\n InterfaceToObjectTypeMappings\n >,\n): Promise<Array<ObjectHolder | InterfaceHolder>>;\n/**\n * @internal\n */\nexport async function convertWireToOsdkObjects2(\n client: MinimalClient,\n objects: OntologyObjectV2[],\n interfaceApiName: string | undefined,\n derivedPropertyTypeByName: DerivedPropertyRuntimeMetadata,\n forceRemoveRid: boolean = false,\n selectedProps?: ReadonlyArray<string>,\n strictNonNull: NullabilityAdherence = false,\n interfaceToObjectTypeMappings: Record<\n InterfaceTypeApiName,\n InterfaceToObjectTypeMappings\n > = {},\n): Promise<Array<ObjectHolder | InterfaceHolder>> {\n fixObjectPropertiesInPlace(objects, forceRemoveRid);\n\n const ret = [];\n for (const rawObj of objects) {\n const objectDef = await client.ontologyProvider.getObjectDefinition(\n rawObj.$apiName,\n );\n invariant(objectDef, `Missing definition for '${rawObj.$apiName}'`);\n\n const interfaceToObjMapping = interfaceApiName\n ? interfaceToObjectTypeMappings[interfaceApiName as InterfaceTypeApiName][\n rawObj.$apiName\n ]\n : undefined;\n\n const ifaceSelected = interfaceApiName && interfaceToObjMapping\n ? (selectedProps\n ? Object.keys(interfaceToObjMapping).filter(\n val => {\n selectedProps?.includes(interfaceToObjMapping[val]);\n },\n )\n : [\n ...Object.values(interfaceToObjMapping),\n objectDef.primaryKeyApiName,\n ])\n : undefined;\n\n // default value for when we are checking an object\n let objProps;\n\n let conforming = true;\n if (interfaceApiName && ifaceSelected) {\n invariantInterfacesAsViews(objectDef, interfaceApiName, client);\n\n objProps = ifaceSelected;\n } else {\n objProps = selectedProps ?? Object.keys(objectDef.properties);\n }\n\n conforming &&= isConforming(client, objectDef, rawObj, objProps);\n\n if (strictNonNull === \"throw\" && !conforming) {\n throw new Error(\n \"Unable to safely convert objects as some non nullable properties are null\",\n );\n } else if (strictNonNull === \"drop\" && !conforming) {\n continue;\n }\n\n let osdkObject: ObjectHolder | InterfaceHolder = createOsdkObject(\n client,\n objectDef,\n rawObj,\n derivedPropertyTypeByName,\n );\n if (interfaceApiName) osdkObject = osdkObject.$as(interfaceApiName);\n\n ret.push(osdkObject);\n }\n\n return ret;\n}\n\n/**\n * @internal\n *\n * Utility function that lets us take down selected property names from an interface\n * and convert them to an array of property names on an object.\n */\nexport function convertInterfacePropNamesToObjectPropNames(\n objectDef: FetchedObjectTypeDefinition,\n interfaceApiName: string,\n ifacePropsToMap: readonly string[],\n): string[] {\n return ifacePropsToMap.map((ifaceProp) =>\n objectDef.interfaceMap[interfaceApiName][ifaceProp]\n );\n}\n\n/**\n * Takes a raw object from the wire (contextually as an interface) and\n * updates the fields to reflect the underlying objectDef instead\n * @param objectDef\n * @param interfaceApiName\n * @param client\n * @param rawObj\n */\nfunction reframeAsObjectInPlace(\n objectDef: FetchedObjectTypeDefinition,\n interfaceApiName: string,\n rawObj: OntologyObjectV2,\n) {\n const newProps: Record<string, any> = {};\n for (\n const [sptProp, regularProp] of Object.entries(\n objectDef.interfaceMap[interfaceApiName],\n )\n ) {\n if (sptProp in rawObj) {\n const value = rawObj[sptProp];\n delete rawObj[sptProp];\n if (value !== undefined) {\n newProps[regularProp] = value;\n }\n }\n }\n Object.assign(rawObj, newProps);\n\n if (!(objectDef.primaryKeyApiName in rawObj)) {\n rawObj[objectDef.primaryKeyApiName] = rawObj.$primaryKey;\n }\n}\n\nfunction isConforming(\n client: MinimalClient,\n def:\n | InterfaceMetadata\n | ObjectMetadata,\n obj: OntologyObjectV2,\n propsToCheck: readonly string[],\n) {\n for (const propName of propsToCheck) {\n if (\n propName in def.properties && def.properties[propName].nullable === false\n && obj[propName] == null\n ) {\n if (process.env.NODE_ENV !== \"production\") {\n client.logger?.debug(\n {\n obj: {\n $apiName: obj[\"$apiName\"],\n $objectType: obj[\"$objectType\"],\n $primaryKey: obj[\"$primaryKey\"],\n },\n },\n `Found object that does not conform to its definition. Expected ${def.apiName}'s ${propName} to not be null.`,\n );\n }\n return false;\n }\n }\n return true;\n}\n\nfunction invariantInterfacesAsViews(\n objectDef: FetchedObjectTypeDefinition,\n interfaceApiName: string,\n client: MinimalClient,\n): asserts objectDef is typeof objectDef & { interfaceMap: {} } {\n if (objectDef.interfaceMap?.[interfaceApiName] == null) {\n const warning =\n \"Interfaces are only supported 'as views' but your metadata object is missing the correct information. This suggests your interfaces have not been migrated to the newer version yet and you cannot use this version of the SDK.\";\n if (client.logger) {\n client.logger.warn(warning);\n } else {\n // eslint-disable-next-line no-console\n console.error(`WARNING! ${warning}`);\n }\n throw new Error(warning);\n }\n}\n\nfunction fixObjectPropertiesInPlace(\n objs: OntologyObjectV2[],\n forceRemoveRid: boolean,\n): asserts objs is SimpleOsdkProperties[] {\n for (const obj of objs) {\n if (forceRemoveRid) {\n delete obj.__rid;\n }\n\n if (obj.__rid) {\n obj.$rid = obj.__rid;\n delete obj.__rid;\n }\n\n // Backend returns as __apiName but we want to stick to $ structure\n obj.$apiName ??= obj.__apiName;\n\n // for now these are the same but when we start doing interface projections the $objectType will always be underlying and\n // the $apiName will be for the current view (in current designs)\n obj.$objectType = obj.$apiName;\n\n // copying over for now as its always returned. In the future, this should just be inferred from underlying\n obj.$primaryKey ??= obj.__primaryKey;\n obj.$title ??= obj.__title;\n\n // we don't want people to use these\n delete obj.__apiName;\n delete obj.__primaryKey;\n delete obj.__title;\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAYA,OAAOA,SAAS,MAAM,gBAAgB;AAMtC,SAASC,gBAAgB,QAAQ,gDAAgD;AAKjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,eAAeC,wBAAwBA,CAC5CC,MAAqB,EACrBC,OAA2B,EAC3BC,gBAAoC,EACpCC,cAAuB,GAAG,KAAK,EAC/BC,0BAA0D,EAC1DC,aAAqC,EACrCC,aAAmC,GAAG,KAAK,EACK;EAChD;EACA;EACAC,0BAA0B,CAACN,OAAO,EAAEE,cAAc,CAAC;EAEnD,MAAMK,QAAQ,GAAGN,gBAA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AOd,GAAG,CAACe,YAAY;IACvB,OAAOf,GAAG,CAACiB,OAAO;EACpB;AACF","ignoreList":[]}
1
+ {"version":3,"file":"convertWireToOsdkObjects.js","names":["invariant","createOsdkObject","convertWireToOsdkObjects","client","objects","interfaceApiName","forceRemoveRid","derivedPropertyTypesByName","selectedProps","strictNonNull","fixObjectPropertiesInPlace","ifaceDef","ontologyProvider","getInterfaceDefinition","undefined","ifaceSelected","Object","keys","properties","ret","rawObj","objectDef","getObjectDefinition","$apiName","process","env","NODE_ENV","objProps","conforming","invariantInterfacesAsViews","apiName","isConforming","reframeAsObjectInPlace","convertInterfacePropNamesToObjectPropNames","Error","osdkObject","$as","push","convertWireToOsdkObjects2","derivedPropertyTypeByName","interfaceToObjectTypeMappings","isInterfaceScoped","length","interfaceToObjMapping","filter","val","includes","values","primaryKeyApiName","ifacePropsToMap","map","ifaceProp","interfaceMap","newProps","sptProp","regularProp","entries","value","assign","$primaryKey","def","obj","propsToCheck","propName","nullable","logger","debug","$objectType","warning","warn","console","error","objs","__rid","$rid","__apiName","__primaryKey","$title","__title"],"sources":["convertWireToOsdkObjects.ts"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n InterfaceMetadata,\n NullabilityAdherence,\n ObjectMetadata,\n} from \"@osdk/api\";\nimport type {\n InterfaceToObjectTypeMappings,\n InterfaceTypeApiName,\n OntologyObjectV2,\n} from \"@osdk/foundry.ontologies\";\nimport invariant from \"tiny-invariant\";\nimport type { DerivedPropertyRuntimeMetadata } from \"../derivedProperties/derivedPropertyRuntimeMetadata.js\";\nimport type { MinimalClient } from \"../MinimalClientContext.js\";\nimport {\n type FetchedObjectTypeDefinition,\n} from \"../ontology/OntologyProvider.js\";\nimport { createOsdkObject } from \"./convertWireToOsdkObjects/createOsdkObject.js\";\nimport type { InterfaceHolder } from \"./convertWireToOsdkObjects/InterfaceHolder.js\";\nimport type { ObjectHolder } from \"./convertWireToOsdkObjects/ObjectHolder.js\";\nimport type { SimpleOsdkProperties } from \"./SimpleOsdkProperties.js\";\n\n/**\n * If interfaceApiName is not undefined, converts the instances of the\n * interface into their respective\n * underlying concrete types and then returns the $as() representation\n * for the consumers.\n *\n * Otherwise just does the conversion\n *\n * May mutate in place for performance reasons. If you need a clean copy,\n * keep it first.\n *\n * However, you must use the returned value, which will be whatever is correct.\n *\n * @internal\n * @param interfaceApiName - if undefined\n */\nexport async function convertWireToOsdkObjects(\n client: MinimalClient,\n objects: OntologyObjectV2[],\n interfaceApiName: string | undefined,\n forceRemoveRid: boolean = false,\n derivedPropertyTypesByName: DerivedPropertyRuntimeMetadata,\n selectedProps?: ReadonlyArray<string>,\n strictNonNull: NullabilityAdherence = false,\n): Promise<Array<ObjectHolder | InterfaceHolder>> {\n // remove the __ prefixed properties and convert them to $ prefixed.\n // updates in place\n fixObjectPropertiesInPlace(objects, forceRemoveRid);\n\n const ifaceDef = interfaceApiName\n ? await client.ontologyProvider.getInterfaceDefinition(interfaceApiName)\n : undefined;\n const ifaceSelected = ifaceDef\n ? (selectedProps ?? Object.keys(ifaceDef.properties))\n : undefined;\n\n const ret = [];\n for (const rawObj of objects) {\n const objectDef = await client.ontologyProvider.getObjectDefinition(\n rawObj.$apiName,\n );\n invariant(objectDef, `Missing definition for '${rawObj.$apiName}'`);\n\n // default value for when we are checking an object\n let objProps;\n\n let conforming = true;\n if (ifaceDef && ifaceSelected) {\n // API returns interface spt names but we cache by real values\n invariantInterfacesAsViews(objectDef, ifaceDef.apiName, client);\n\n conforming &&= isConforming(client, ifaceDef, rawObj, ifaceSelected);\n\n reframeAsObjectInPlace(objectDef, ifaceDef.apiName, rawObj);\n\n objProps = convertInterfacePropNamesToObjectPropNames(\n objectDef,\n ifaceDef.apiName,\n ifaceSelected,\n );\n } else {\n objProps = selectedProps ?? Object.keys(objectDef.properties);\n }\n\n conforming &&= isConforming(client, objectDef, rawObj, objProps);\n\n if (strictNonNull === \"throw\" && !conforming) {\n throw new Error(\n \"Unable to safely convert objects as some non nullable properties are null\",\n );\n } else if (strictNonNull === \"drop\" && !conforming) {\n continue;\n }\n\n let osdkObject: ObjectHolder | InterfaceHolder = createOsdkObject(\n client,\n objectDef,\n rawObj,\n derivedPropertyTypesByName,\n );\n if (interfaceApiName) osdkObject = osdkObject.$as(interfaceApiName);\n\n ret.push(osdkObject);\n }\n\n return ret;\n}\n\nexport async function convertWireToOsdkObjects2(\n client: MinimalClient,\n objects: OntologyObjectV2[],\n interfaceApiName: string,\n derivedPropertyTypeByName: DerivedPropertyRuntimeMetadata,\n forceRemoveRid?: boolean,\n selectedProps?: ReadonlyArray<string>,\n strictNonNull?: NullabilityAdherence,\n interfaceToObjectTypeMappings?: Record<\n InterfaceTypeApiName,\n InterfaceToObjectTypeMappings\n >,\n): Promise<Array<InterfaceHolder>>;\nexport async function convertWireToOsdkObjects2(\n client: MinimalClient,\n objects: OntologyObjectV2[],\n interfaceApiName: undefined,\n derivedPropertyTypeByName: DerivedPropertyRuntimeMetadata,\n forceRemoveRid?: boolean,\n selectedProps?: ReadonlyArray<string>,\n strictNonNull?: NullabilityAdherence,\n interfaceToObjectTypeMappings?: Record<\n InterfaceTypeApiName,\n InterfaceToObjectTypeMappings\n >,\n): Promise<Array<ObjectHolder>>;\nexport async function convertWireToOsdkObjects2(\n client: MinimalClient,\n objects: OntologyObjectV2[],\n interfaceApiName: string | undefined,\n derivedPropertyTypeByName: DerivedPropertyRuntimeMetadata,\n forceRemoveRid?: boolean,\n selectedProps?: ReadonlyArray<string>,\n strictNonNull?: NullabilityAdherence,\n interfaceToObjectTypeMappings?: Record<\n InterfaceTypeApiName,\n InterfaceToObjectTypeMappings\n >,\n): Promise<Array<ObjectHolder | InterfaceHolder>>;\n/**\n * @internal\n */\nexport async function convertWireToOsdkObjects2(\n client: MinimalClient,\n objects: OntologyObjectV2[],\n interfaceApiName: string | undefined,\n derivedPropertyTypeByName: DerivedPropertyRuntimeMetadata,\n forceRemoveRid: boolean = false,\n selectedProps?: ReadonlyArray<string>,\n strictNonNull: NullabilityAdherence = false,\n interfaceToObjectTypeMappings: Record<\n InterfaceTypeApiName,\n InterfaceToObjectTypeMappings\n > = {},\n): Promise<Array<ObjectHolder | InterfaceHolder>> {\n fixObjectPropertiesInPlace(objects, forceRemoveRid);\n\n const isInterfaceScoped =\n Object.keys(interfaceToObjectTypeMappings).length > 0;\n const ret = [];\n for (const rawObj of objects) {\n const objectDef = await client.ontologyProvider.getObjectDefinition(\n rawObj.$apiName,\n );\n invariant(objectDef, `Missing definition for '${rawObj.$apiName}'`);\n\n const interfaceToObjMapping = (interfaceApiName\n && isInterfaceScoped)\n ? interfaceToObjectTypeMappings[\n interfaceApiName as InterfaceTypeApiName\n ][\n rawObj.$apiName\n ]\n : undefined;\n\n const ifaceSelected = interfaceApiName && interfaceToObjMapping\n ? (selectedProps\n ? Object.keys(interfaceToObjMapping).filter(\n val => {\n selectedProps?.includes(interfaceToObjMapping[val]);\n },\n )\n : [\n ...Object.values(interfaceToObjMapping),\n objectDef.primaryKeyApiName,\n ])\n : undefined;\n\n // default value for when we are checking an object\n let objProps;\n\n let conforming = true;\n if (interfaceApiName && ifaceSelected) {\n invariantInterfacesAsViews(objectDef, interfaceApiName, client);\n\n objProps = ifaceSelected;\n } else {\n objProps = selectedProps ?? Object.keys(objectDef.properties);\n }\n\n conforming &&= isConforming(client, objectDef, rawObj, objProps);\n\n if (strictNonNull === \"throw\" && !conforming) {\n throw new Error(\n \"Unable to safely convert objects as some non nullable properties are null\",\n );\n } else if (strictNonNull === \"drop\" && !conforming) {\n continue;\n }\n\n let osdkObject: ObjectHolder | InterfaceHolder = createOsdkObject(\n client,\n objectDef,\n rawObj,\n derivedPropertyTypeByName,\n );\n if (\n interfaceApiName && isInterfaceScoped\n ) osdkObject = osdkObject.$as(interfaceApiName);\n\n ret.push(osdkObject);\n }\n\n return ret;\n}\n\n/**\n * @internal\n *\n * Utility function that lets us take down selected property names from an interface\n * and convert them to an array of property names on an object.\n */\nexport function convertInterfacePropNamesToObjectPropNames(\n objectDef: FetchedObjectTypeDefinition,\n interfaceApiName: string,\n ifacePropsToMap: readonly string[],\n): string[] {\n return ifacePropsToMap.map((ifaceProp) =>\n objectDef.interfaceMap[interfaceApiName][ifaceProp]\n );\n}\n\n/**\n * Takes a raw object from the wire (contextually as an interface) and\n * updates the fields to reflect the underlying objectDef instead\n * @param objectDef\n * @param interfaceApiName\n * @param client\n * @param rawObj\n */\nfunction reframeAsObjectInPlace(\n objectDef: FetchedObjectTypeDefinition,\n interfaceApiName: string,\n rawObj: OntologyObjectV2,\n) {\n const newProps: Record<string, any> = {};\n for (\n const [sptProp, regularProp] of Object.entries(\n objectDef.interfaceMap[interfaceApiName],\n )\n ) {\n if (sptProp in rawObj) {\n const value = rawObj[sptProp];\n delete rawObj[sptProp];\n if (value !== undefined) {\n newProps[regularProp] = value;\n }\n }\n }\n Object.assign(rawObj, newProps);\n\n if (!(objectDef.primaryKeyApiName in rawObj)) {\n rawObj[objectDef.primaryKeyApiName] = rawObj.$primaryKey;\n }\n}\n\nfunction isConforming(\n client: MinimalClient,\n def:\n | InterfaceMetadata\n | ObjectMetadata,\n obj: OntologyObjectV2,\n propsToCheck: readonly string[],\n) {\n for (const propName of propsToCheck) {\n if (\n propName in def.properties && def.properties[propName].nullable === false\n && obj[propName] == null\n ) {\n if (process.env.NODE_ENV !== \"production\") {\n client.logger?.debug(\n {\n obj: {\n $apiName: obj[\"$apiName\"],\n $objectType: obj[\"$objectType\"],\n $primaryKey: obj[\"$primaryKey\"],\n },\n },\n `Found object that does not conform to its definition. Expected ${def.apiName}'s ${propName} to not be null.`,\n );\n }\n return false;\n }\n }\n return true;\n}\n\nfunction invariantInterfacesAsViews(\n objectDef: FetchedObjectTypeDefinition,\n interfaceApiName: string,\n client: MinimalClient,\n): asserts objectDef is typeof objectDef & { interfaceMap: {} } {\n if (objectDef.interfaceMap?.[interfaceApiName] == null) {\n const warning =\n \"Interfaces are only supported 'as views' but your metadata object is missing the correct information. This suggests your interfaces have not been migrated to the newer version yet and you cannot use this version of the SDK.\";\n if (client.logger) {\n client.logger.warn(warning);\n } else {\n // eslint-disable-next-line no-console\n console.error(`WARNING! ${warning}`);\n }\n throw new Error(warning);\n }\n}\n\nfunction fixObjectPropertiesInPlace(\n objs: OntologyObjectV2[],\n forceRemoveRid: boolean,\n): asserts objs is SimpleOsdkProperties[] {\n for (const obj of objs) {\n if (forceRemoveRid) {\n delete obj.__rid;\n }\n\n if (obj.__rid) {\n obj.$rid = obj.__rid;\n delete obj.__rid;\n }\n\n // Backend returns as __apiName but we want to stick to $ structure\n obj.$apiName ??= obj.__apiName;\n\n // for now these are the same but when we start doing interface projections the $objectType will always be underlying and\n // the $apiName will be for the current view (in current designs)\n obj.$objectType = obj.$apiName;\n\n // copying over for now as its always returned. In the future, this should just be inferred from underlying\n obj.$primaryKey ??= obj.__primaryKey;\n obj.$title ??= obj.__title;\n\n // we don't want people to use these\n delete obj.__apiName;\n delete obj.__primaryKey;\n delete obj.__title;\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAYA,OAAOA,SAAS,MAAM,gBAAgB;AAMtC,SAASC,gBAAgB,QAAQ,gDAAgD;AAKjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,eAAeC,wBAAwBA,CAC5CC,MAAqB,EACrBC,OAA2B,EAC3BC,gBAAoC,EACpCC,cAAuB,GAAG,KAAK,EAC/BC,0BAA0D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