@osdk/generator-converters 2.1.0-beta.9 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/CHANGELOG.md +318 -0
  2. package/build/browser/__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.js +6 -4
  3. package/build/browser/__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.js.map +1 -1
  4. package/build/browser/empty.test.js +1 -0
  5. package/build/browser/empty.test.js.map +1 -1
  6. package/build/browser/getEditedEntities.js +2 -0
  7. package/build/browser/getEditedEntities.js.map +1 -1
  8. package/build/browser/index.js +1 -0
  9. package/build/browser/index.js.map +1 -1
  10. package/build/browser/isNullableQueryDataType.js +1 -0
  11. package/build/browser/isNullableQueryDataType.js.map +1 -1
  12. package/build/browser/wireActionTypeV2ToSdkActionMetadata.js +19 -1
  13. package/build/browser/wireActionTypeV2ToSdkActionMetadata.js.map +1 -1
  14. package/build/browser/wireObjectTypeFullMetadataToSdkObjectMetadata.js +4 -2
  15. package/build/browser/wireObjectTypeFullMetadataToSdkObjectMetadata.js.map +1 -1
  16. package/build/browser/wireObjectTypeFullMetadataToSdkObjectMetadata.test.js +10 -3
  17. package/build/browser/wireObjectTypeFullMetadataToSdkObjectMetadata.test.js.map +1 -1
  18. package/build/browser/wirePropertyV2ToSdkPrimaryKeyTypeDefinition.js +4 -0
  19. package/build/browser/wirePropertyV2ToSdkPrimaryKeyTypeDefinition.js.map +1 -1
  20. package/build/browser/wirePropertyV2ToSdkPropertyDefinition.js +36 -12
  21. package/build/browser/wirePropertyV2ToSdkPropertyDefinition.js.map +1 -1
  22. package/build/browser/wireQueryDataTypeToQueryDataTypeDefinition.js +3 -0
  23. package/build/browser/wireQueryDataTypeToQueryDataTypeDefinition.js.map +1 -1
  24. package/build/browser/wireQueryTypeV2ToSdkQueryMetadata.js +1 -0
  25. package/build/browser/wireQueryTypeV2ToSdkQueryMetadata.js.map +1 -1
  26. package/build/cjs/index.cjs +478 -0
  27. package/build/cjs/index.cjs.map +1 -0
  28. package/build/cjs/index.d.cts +39 -0
  29. package/build/esm/__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.js +6 -4
  30. package/build/esm/__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.js.map +1 -1
  31. package/build/esm/empty.test.js +1 -0
  32. package/build/esm/empty.test.js.map +1 -1
  33. package/build/esm/getEditedEntities.js +2 -0
  34. package/build/esm/getEditedEntities.js.map +1 -1
  35. package/build/esm/index.js +1 -0
  36. package/build/esm/index.js.map +1 -1
  37. package/build/esm/isNullableQueryDataType.js +1 -0
  38. package/build/esm/isNullableQueryDataType.js.map +1 -1
  39. package/build/esm/wireActionTypeV2ToSdkActionMetadata.js +19 -1
  40. package/build/esm/wireActionTypeV2ToSdkActionMetadata.js.map +1 -1
  41. package/build/esm/wireObjectTypeFullMetadataToSdkObjectMetadata.js +4 -2
  42. package/build/esm/wireObjectTypeFullMetadataToSdkObjectMetadata.js.map +1 -1
  43. package/build/esm/wireObjectTypeFullMetadataToSdkObjectMetadata.test.js +10 -3
  44. package/build/esm/wireObjectTypeFullMetadataToSdkObjectMetadata.test.js.map +1 -1
  45. package/build/esm/wirePropertyV2ToSdkPrimaryKeyTypeDefinition.js +4 -0
  46. package/build/esm/wirePropertyV2ToSdkPrimaryKeyTypeDefinition.js.map +1 -1
  47. package/build/esm/wirePropertyV2ToSdkPropertyDefinition.js +36 -12
  48. package/build/esm/wirePropertyV2ToSdkPropertyDefinition.js.map +1 -1
  49. package/build/esm/wireQueryDataTypeToQueryDataTypeDefinition.js +3 -0
  50. package/build/esm/wireQueryDataTypeToQueryDataTypeDefinition.js.map +1 -1
  51. package/build/esm/wireQueryTypeV2ToSdkQueryMetadata.js +1 -0
  52. package/build/esm/wireQueryTypeV2ToSdkQueryMetadata.js.map +1 -1
  53. package/build/types/__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.d.ts +5 -0
  54. package/build/types/__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.d.ts.map +1 -0
  55. package/build/types/empty.test.d.ts +1 -0
  56. package/build/types/empty.test.d.ts.map +1 -0
  57. package/build/types/getEditedEntities.d.ts +6 -0
  58. package/build/types/getEditedEntities.d.ts.map +1 -0
  59. package/build/{browser → types}/index.d.ts +0 -1
  60. package/build/types/index.d.ts.map +1 -0
  61. package/build/types/isNullableQueryDataType.d.ts +2 -0
  62. package/build/types/isNullableQueryDataType.d.ts.map +1 -0
  63. package/build/{browser → types}/wireActionTypeV2ToSdkActionMetadata.d.ts +1 -2
  64. package/build/types/wireActionTypeV2ToSdkActionMetadata.d.ts.map +1 -0
  65. package/build/types/wireObjectTypeFullMetadataToSdkObjectMetadata.d.ts +11 -0
  66. package/build/types/wireObjectTypeFullMetadataToSdkObjectMetadata.d.ts.map +1 -0
  67. package/build/types/wireObjectTypeFullMetadataToSdkObjectMetadata.test.d.ts +1 -0
  68. package/build/types/wireObjectTypeFullMetadataToSdkObjectMetadata.test.d.ts.map +1 -0
  69. package/build/{browser → types}/wirePropertyV2ToSdkPrimaryKeyTypeDefinition.d.ts +1 -2
  70. package/build/types/wirePropertyV2ToSdkPrimaryKeyTypeDefinition.d.ts.map +1 -0
  71. package/build/types/wirePropertyV2ToSdkPropertyDefinition.d.ts +7 -0
  72. package/build/types/wirePropertyV2ToSdkPropertyDefinition.d.ts.map +1 -0
  73. package/build/{browser → types}/wireQueryDataTypeToQueryDataTypeDefinition.d.ts +1 -2
  74. package/build/types/wireQueryDataTypeToQueryDataTypeDefinition.d.ts.map +1 -0
  75. package/build/types/wireQueryTypeV2ToSdkQueryMetadata.d.ts +12 -0
  76. package/build/types/wireQueryTypeV2ToSdkQueryMetadata.d.ts.map +1 -0
  77. package/package.json +24 -11
  78. package/build/browser/__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.d.ts +0 -4
  79. package/build/browser/__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.d.ts.map +0 -1
  80. package/build/browser/empty.test.d.ts +0 -2
  81. package/build/browser/empty.test.d.ts.map +0 -1
  82. package/build/browser/getEditedEntities.d.ts +0 -7
  83. package/build/browser/getEditedEntities.d.ts.map +0 -1
  84. package/build/browser/index.d.ts.map +0 -1
  85. package/build/browser/isNullableQueryDataType.d.ts +0 -3
  86. package/build/browser/isNullableQueryDataType.d.ts.map +0 -1
  87. package/build/browser/wireActionTypeV2ToSdkActionMetadata.d.ts.map +0 -1
  88. package/build/browser/wireObjectTypeFullMetadataToSdkObjectMetadata.d.ts +0 -10
  89. package/build/browser/wireObjectTypeFullMetadataToSdkObjectMetadata.d.ts.map +0 -1
  90. package/build/browser/wireObjectTypeFullMetadataToSdkObjectMetadata.test.d.ts +0 -2
  91. package/build/browser/wireObjectTypeFullMetadataToSdkObjectMetadata.test.d.ts.map +0 -1
  92. package/build/browser/wirePropertyV2ToSdkPrimaryKeyTypeDefinition.d.ts.map +0 -1
  93. package/build/browser/wirePropertyV2ToSdkPropertyDefinition.d.ts +0 -6
  94. package/build/browser/wirePropertyV2ToSdkPropertyDefinition.d.ts.map +0 -1
  95. package/build/browser/wireQueryDataTypeToQueryDataTypeDefinition.d.ts.map +0 -1
  96. package/build/browser/wireQueryTypeV2ToSdkQueryMetadata.d.ts +0 -13
  97. package/build/browser/wireQueryTypeV2ToSdkQueryMetadata.d.ts.map +0 -1
  98. package/build/esm/__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.d.ts +0 -4
  99. package/build/esm/__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.d.ts.map +0 -1
  100. package/build/esm/empty.test.d.ts +0 -2
  101. package/build/esm/empty.test.d.ts.map +0 -1
  102. package/build/esm/getEditedEntities.d.ts +0 -7
  103. package/build/esm/getEditedEntities.d.ts.map +0 -1
  104. package/build/esm/index.d.ts +0 -9
  105. package/build/esm/index.d.ts.map +0 -1
  106. package/build/esm/isNullableQueryDataType.d.ts +0 -3
  107. package/build/esm/isNullableQueryDataType.d.ts.map +0 -1
  108. package/build/esm/wireActionTypeV2ToSdkActionMetadata.d.ts +0 -4
  109. package/build/esm/wireActionTypeV2ToSdkActionMetadata.d.ts.map +0 -1
  110. package/build/esm/wireObjectTypeFullMetadataToSdkObjectMetadata.d.ts +0 -10
  111. package/build/esm/wireObjectTypeFullMetadataToSdkObjectMetadata.d.ts.map +0 -1
  112. package/build/esm/wireObjectTypeFullMetadataToSdkObjectMetadata.test.d.ts +0 -2
  113. package/build/esm/wireObjectTypeFullMetadataToSdkObjectMetadata.test.d.ts.map +0 -1
  114. package/build/esm/wirePropertyV2ToSdkPrimaryKeyTypeDefinition.d.ts +0 -4
  115. package/build/esm/wirePropertyV2ToSdkPrimaryKeyTypeDefinition.d.ts.map +0 -1
  116. package/build/esm/wirePropertyV2ToSdkPropertyDefinition.d.ts +0 -6
  117. package/build/esm/wirePropertyV2ToSdkPropertyDefinition.d.ts.map +0 -1
  118. package/build/esm/wireQueryDataTypeToQueryDataTypeDefinition.d.ts +0 -4
  119. package/build/esm/wireQueryDataTypeToQueryDataTypeDefinition.d.ts.map +0 -1
  120. package/build/esm/wireQueryTypeV2ToSdkQueryMetadata.d.ts +0 -13
  121. package/build/esm/wireQueryTypeV2ToSdkQueryMetadata.d.ts.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,323 @@
1
1
  # @osdk/generator-converters
2
2
 
3
+ ## 2.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 966d408: Rename type for base action parameter types.
8
+ - d794c19: Adding support for struct action params.
9
+ - 25fd9f0: Updating package.json to have better entry points to support react native bundlers.
10
+ - 9c4efe6: Support uploading media parameters through actions
11
+ - 0a7c747: Add support for timeseries sensors.
12
+ - f0b519d: Upgrade to vitest 3 and vite 6
13
+ - 1812118: Add geotime support for OSDK.
14
+ - bc1761c: Update platform API dependencies.
15
+ - c80ca45: Add ability to create interfaces through actions now.
16
+ - bb8b219: Use new external packages instead of the internal ones.
17
+ - 44e62f6: Updating fetch for auth and other packages.
18
+ - 03f95eb: Add support for interface params in actions.
19
+ - 91cfa3a: Fixing url parsing for client.
20
+ - 9d35a1f: Remove unused imports
21
+ - c691c8b: Package now has experimental support for commonjs
22
+ - c9da74c: Improves code quality by fixing linting errors
23
+ - 62c1d63: Add support for reading media reference property in OSDK.
24
+ - 1591f04: Rename base property types.
25
+ - abfe4b3: Add support for reading struct properties.
26
+ - 81b2fb2: Remove duplicate types in case statement.
27
+ - ecd4aee: Fixing use of logging from client for unknown property types.
28
+ - ee6224b: Explicitly type aggregation types in queries.
29
+ - 7d777eb: Improves error message for unsupported query types
30
+ - c682504: Locks dependency version of 3 internal libraries
31
+ - 9018dc2: Updating platform api dependencies.
32
+ - 6b6c8a1: Updates gateway endpoints and changes fetchContents for attachments to return a response
33
+ - bf0e3b4: Ignore unknown property types.
34
+ - 09eaf24: Update to latest platform sdks
35
+ - d665147: Update platform sdk deps
36
+
37
+ ### Patch Changes
38
+
39
+ - Updated dependencies [966d408]
40
+ - Updated dependencies [cddc196]
41
+ - Updated dependencies [d794c19]
42
+ - Updated dependencies [05febf4]
43
+ - Updated dependencies [55c05f2]
44
+ - Updated dependencies [0dc40b0]
45
+ - Updated dependencies [25fd9f0]
46
+ - Updated dependencies [11a05cc]
47
+ - Updated dependencies [7865cb6]
48
+ - Updated dependencies [9c4efe6]
49
+ - Updated dependencies [3ea2e79]
50
+ - Updated dependencies [1812118]
51
+ - Updated dependencies [bc1761c]
52
+ - Updated dependencies [656f975]
53
+ - Updated dependencies [f1145ff]
54
+ - Updated dependencies [f446d0c]
55
+ - Updated dependencies [c80ca45]
56
+ - Updated dependencies [bb8b219]
57
+ - Updated dependencies [03f95eb]
58
+ - Updated dependencies [1a89f23]
59
+ - Updated dependencies [9d35a1f]
60
+ - Updated dependencies [c691c8b]
61
+ - Updated dependencies [749cf69]
62
+ - Updated dependencies [f03e39f]
63
+ - Updated dependencies [11088aa]
64
+ - Updated dependencies [72c1905]
65
+ - Updated dependencies [9298f75]
66
+ - Updated dependencies [f34b3d4]
67
+ - Updated dependencies [acbfab9]
68
+ - Updated dependencies [62c1d63]
69
+ - Updated dependencies [3c9ac22]
70
+ - Updated dependencies [1591f04]
71
+ - Updated dependencies [03e1941]
72
+ - Updated dependencies [abfe4b3]
73
+ - Updated dependencies [b79becf]
74
+ - Updated dependencies [27866a8]
75
+ - Updated dependencies [e5fe7c0]
76
+ - Updated dependencies [1b2e8c9]
77
+ - Updated dependencies [9f3807c]
78
+ - Updated dependencies [0c56d21]
79
+ - Updated dependencies [e548b9b]
80
+ - Updated dependencies [ee6224b]
81
+ - Updated dependencies [1dc0228]
82
+ - Updated dependencies [6c60414]
83
+ - Updated dependencies [5fe2c8d]
84
+ - Updated dependencies [d3b3f35]
85
+ - Updated dependencies [785f663]
86
+ - Updated dependencies [6b6c8a1]
87
+ - Updated dependencies [c537e2d]
88
+ - Updated dependencies [73fa373]
89
+ - Updated dependencies [8e6a5f4]
90
+ - Updated dependencies [2d5e648]
91
+ - Updated dependencies [31e7d70]
92
+ - Updated dependencies [f19da8e]
93
+ - @osdk/api@2.1.0
94
+
95
+ ## 2.1.0-rc.32
96
+
97
+ ### Patch Changes
98
+
99
+ - Updated dependencies [55c05f2]
100
+ - @osdk/api@2.1.0-rc.32
101
+
102
+ ## 2.1.0-beta.31
103
+
104
+ ### Minor Changes
105
+
106
+ - bb8b219: Use new external packages instead of the internal ones.
107
+ - 81b2fb2: Remove duplicate types in case statement.
108
+ - ecd4aee: Fixing use of logging from client for unknown property types.
109
+ - ee6224b: Explicitly type aggregation types in queries.
110
+
111
+ ### Patch Changes
112
+
113
+ - Updated dependencies [bb8b219]
114
+ - Updated dependencies [ee6224b]
115
+ - Updated dependencies [5fe2c8d]
116
+ - @osdk/api@2.1.0-beta.31
117
+
118
+ ## 2.1.0-beta.30
119
+
120
+ ### Minor Changes
121
+
122
+ - 966d408: Rename type for base action parameter types.
123
+ - 1591f04: Rename base property types.
124
+
125
+ ### Patch Changes
126
+
127
+ - Updated dependencies [966d408]
128
+ - Updated dependencies [f03e39f]
129
+ - Updated dependencies [1591f04]
130
+ - Updated dependencies [785f663]
131
+ - Updated dependencies [2d5e648]
132
+ - @osdk/api@2.1.0-beta.30
133
+
134
+ ## 2.1.0-beta.29
135
+
136
+ ### Patch Changes
137
+
138
+ - Updated dependencies [f1145ff]
139
+ - @osdk/api@2.1.0-beta.29
140
+
141
+ ## 2.1.0-beta.28
142
+
143
+ ### Patch Changes
144
+
145
+ - Updated dependencies [f446d0c]
146
+ - @osdk/api@2.1.0-beta.28
147
+
148
+ ## 2.1.0-beta.27
149
+
150
+ ### Patch Changes
151
+
152
+ - @osdk/api@2.1.0-beta.27
153
+
154
+ ## 2.1.0-beta.26
155
+
156
+ ### Minor Changes
157
+
158
+ - 9c4efe6: Support uploading media parameters through actions
159
+ - 44e62f6: Updating fetch for auth and other packages.
160
+
161
+ ### Patch Changes
162
+
163
+ - Updated dependencies [7865cb6]
164
+ - Updated dependencies [9c4efe6]
165
+ - Updated dependencies [f19da8e]
166
+ - @osdk/api@2.1.0-beta.26
167
+
168
+ ## 2.1.0-beta.25
169
+
170
+ ### Minor Changes
171
+
172
+ - c80ca45: Add ability to create interfaces through actions now.
173
+
174
+ ### Patch Changes
175
+
176
+ - Updated dependencies [c80ca45]
177
+ - @osdk/api@2.1.0-beta.25
178
+
179
+ ## 2.1.0-beta.24
180
+
181
+ ### Minor Changes
182
+
183
+ - 03f95eb: Add support for interface params in actions.
184
+ - c691c8b: Package now has experimental support for commonjs
185
+
186
+ ### Patch Changes
187
+
188
+ - Updated dependencies [03f95eb]
189
+ - Updated dependencies [c691c8b]
190
+ - Updated dependencies [3c9ac22]
191
+ - @osdk/api@2.1.0-beta.24
192
+
193
+ ## 2.1.0-beta.23
194
+
195
+ ### Minor Changes
196
+
197
+ - d794c19: Adding support for struct action params.
198
+ - f0b519d: Upgrade to vitest 3 and vite 6
199
+ - 62c1d63: Add support for reading media reference property in OSDK.
200
+ - d665147: Update platform sdk deps
201
+
202
+ ### Patch Changes
203
+
204
+ - Updated dependencies [d794c19]
205
+ - Updated dependencies [62c1d63]
206
+ - @osdk/api@2.1.0-beta.23
207
+
208
+ ## 2.1.0-beta.22
209
+
210
+ ### Minor Changes
211
+
212
+ - c9da74c: Improves code quality by fixing linting errors
213
+
214
+ ### Patch Changes
215
+
216
+ - Updated dependencies [73fa373]
217
+ - @osdk/api@2.1.0-beta.22
218
+
219
+ ## 2.1.0-beta.21
220
+
221
+ ### Patch Changes
222
+
223
+ - Updated dependencies [3ea2e79]
224
+ - Updated dependencies [656f975]
225
+ - Updated dependencies [f34b3d4]
226
+ - @osdk/api@2.1.0-beta.21
227
+
228
+ ## 2.1.0-beta.20
229
+
230
+ ### Minor Changes
231
+
232
+ - 9d35a1f: Remove unused imports
233
+ - abfe4b3: Add support for reading struct properties.
234
+ - bf0e3b4: Ignore unknown property types.
235
+
236
+ ### Patch Changes
237
+
238
+ - Updated dependencies [9d35a1f]
239
+ - Updated dependencies [abfe4b3]
240
+ - Updated dependencies [c537e2d]
241
+ - @osdk/api@2.1.0-beta.20
242
+
243
+ ## 2.1.0-beta.19
244
+
245
+ ### Patch Changes
246
+
247
+ - Updated dependencies [cddc196]
248
+ - @osdk/api@2.1.0-beta.19
249
+
250
+ ## 2.1.0-beta.18
251
+
252
+ ### Patch Changes
253
+
254
+ - @osdk/api@2.1.0-beta.18
255
+
256
+ ## 2.1.0-beta.17
257
+
258
+ ### Patch Changes
259
+
260
+ - @osdk/api@2.1.0-beta.17
261
+
262
+ ## 2.1.0-beta.16
263
+
264
+ ### Patch Changes
265
+
266
+ - Updated dependencies [e5fe7c0]
267
+ - @osdk/api@2.1.0-beta.16
268
+
269
+ ## 2.1.0-beta.15
270
+
271
+ ### Patch Changes
272
+
273
+ - @osdk/api@2.1.0-beta.15
274
+
275
+ ## 2.1.0-beta.14
276
+
277
+ ### Minor Changes
278
+
279
+ - 0a7c747: Add support for timeseries sensors.
280
+ - 91cfa3a: Fixing url parsing for client.
281
+ - 6b6c8a1: Updates gateway endpoints and changes fetchContents for attachments to return a response
282
+
283
+ ### Patch Changes
284
+
285
+ - Updated dependencies [0c56d21]
286
+ - Updated dependencies [6b6c8a1]
287
+ - @osdk/api@2.1.0-beta.14
288
+
289
+ ## 2.1.0-beta.13
290
+
291
+ ### Patch Changes
292
+
293
+ - @osdk/api@2.1.0-beta.13
294
+
295
+ ## 2.1.0-beta.12
296
+
297
+ ### Patch Changes
298
+
299
+ - @osdk/api@2.1.0-beta.12
300
+
301
+ ## 2.1.0-beta.11
302
+
303
+ ### Minor Changes
304
+
305
+ - bc1761c: Update platform API dependencies.
306
+
307
+ ### Patch Changes
308
+
309
+ - Updated dependencies [bc1761c]
310
+ - Updated dependencies [9298f75]
311
+ - @osdk/api@2.1.0-beta.11
312
+
313
+ ## 2.1.0-beta.10
314
+
315
+ ### Patch Changes
316
+
317
+ - Updated dependencies [11a05cc]
318
+ - Updated dependencies [11088aa]
319
+ - @osdk/api@2.1.0-beta.10
320
+
3
321
  ## 2.1.0-beta.9
4
322
 
5
323
  ### Patch Changes
@@ -13,8 +13,9 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
+
16
17
  import { wirePropertyV2ToSdkPropertyDefinition } from "./wirePropertyV2ToSdkPropertyDefinition.js";
17
- export function __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(interfaceType) {
18
+ export function __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(interfaceType, v2, log) {
18
19
  return {
19
20
  type: "interface",
20
21
  rid: interfaceType.rid,
@@ -23,9 +24,10 @@ export function __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(interfaceTyp
23
24
  description: interfaceType.description,
24
25
  implements: interfaceType.extendsInterfaces,
25
26
  properties: Object.fromEntries(Object.entries(interfaceType.properties).map(([key, value]) => {
26
- return [key, wirePropertyV2ToSdkPropertyDefinition(value, true)];
27
- })),
28
- links: {}
27
+ return [key, wirePropertyV2ToSdkPropertyDefinition(value, true, log)];
28
+ }).filter(([key, value]) => value != null)),
29
+ links: {},
30
+ implementedBy: interfaceType.implementedByObjectTypes
29
31
  };
30
32
  }
31
33
  //# sourceMappingURL=__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.js","names":["wirePropertyV2ToSdkPropertyDefinition","__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition","interfaceType","type","rid","apiName","displayName","description","implements","extendsInterfaces","properties","Object","fromEntries","entries","map","key","value","links"],"sources":["__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.js"],"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 */\nimport { wirePropertyV2ToSdkPropertyDefinition } from \"./wirePropertyV2ToSdkPropertyDefinition.js\";\nexport function __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(interfaceType, v2) {\n return {\n type: \"interface\",\n rid: interfaceType.rid,\n apiName: interfaceType.apiName,\n displayName: interfaceType.displayName,\n description: interfaceType.description,\n implements: interfaceType.extendsInterfaces,\n properties: Object.fromEntries(Object.entries(interfaceType.properties).map(([key, value]) => {\n return [\n key,\n wirePropertyV2ToSdkPropertyDefinition(value, true),\n ];\n })),\n links: {},\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,qCAAqC,QAAQ,4CAA4C;AAClG,OAAO,SAASC,mDAAmDA,CAACC,aAAa,EAAM;EACnF,OAAO;IACHC,IAAI,EAAE,WAAW;IACjBC,GAAG,EAAEF,aAAa,CAACE,GAAG;IACtBC,OAAO,EAAEH,aAAa,CAACG,OAAO;IAC9BC,WAAW,EAAEJ,aAAa,CAACI,WAAW;IACtCC,WAAW,EAAEL,aAAa,CAACK,WAAW;IACtCC,UAAU,EAAEN,aAAa,CAACO,iBAAiB;IAC3CC,UAAU,EAAEC,MAAM,CAACC,WAAW,CAACD,MAAM,CAACE,OAAO,CAACX,aAAa,CAACQ,UAAU,CAAC,CAACI,GAAG,CAAC,CAAC,CAACC,GAAG,EAAEC,KAAK,CAAC,KAAK;MAC1F,OAAO,CACHD,GAAG,EACHf,qCAAqC,CAACgB,KAAK,EAAE,IAAI,CAAC,CACrD;IACL,CAAC,CAAC,CAAC;IACHC,KAAK,EAAE,CAAC;EACZ,CAAC;AACL","ignoreList":[]}
1
+ {"version":3,"file":"__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.js","names":["wirePropertyV2ToSdkPropertyDefinition","__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition","interfaceType","v2","log","type","rid","apiName","displayName","description","implements","extendsInterfaces","properties","Object","fromEntries","entries","map","key","value","filter","links","implementedBy","implementedByObjectTypes"],"sources":["__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.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 { InterfaceMetadata } from \"@osdk/api\";\nimport type { InterfaceType } from \"@osdk/foundry.ontologies\";\nimport { wirePropertyV2ToSdkPropertyDefinition } from \"./wirePropertyV2ToSdkPropertyDefinition.js\";\n\nexport function __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(\n interfaceType: InterfaceType,\n v2: boolean,\n log?: { info: (msg: string) => void },\n): InterfaceMetadata {\n return {\n type: \"interface\",\n rid: interfaceType.rid,\n apiName: interfaceType.apiName,\n displayName: interfaceType.displayName,\n description: interfaceType.description,\n implements: interfaceType.extendsInterfaces,\n properties: Object.fromEntries(\n Object.entries(interfaceType.properties).map((\n [key, value],\n ) => {\n return [\n key,\n wirePropertyV2ToSdkPropertyDefinition(\n value,\n true,\n log,\n ),\n ];\n }).filter(([key, value]) => value != null),\n ),\n links: {},\n implementedBy: interfaceType.implementedByObjectTypes,\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,SAASA,qCAAqC,QAAQ,4CAA4C;AAElG,OAAO,SAASC,mDAAmDA,CACjEC,aAA4B,EAC5BC,EAAW,EACXC,GAAqC,EAClB;EACnB,OAAO;IACLC,IAAI,EAAE,WAAW;IACjBC,GAAG,EAAEJ,aAAa,CAACI,GAAG;IACtBC,OAAO,EAAEL,aAAa,CAACK,OAAO;IAC9BC,WAAW,EAAEN,aAAa,CAACM,WAAW;IACtCC,WAAW,EAAEP,aAAa,CAACO,WAAW;IACtCC,UAAU,EAAER,aAAa,CAACS,iBAAiB;IAC3CC,UAAU,EAAEC,MAAM,CAACC,WAAW,CAC5BD,MAAM,CAACE,OAAO,CAACb,aAAa,CAACU,UAAU,CAAC,CAACI,GAAG,CAAC,CAC3C,CAACC,GAAG,EAAEC,KAAK,CAAC,KACT;MACH,OAAO,CACLD,GAAG,EACHjB,qCAAqC,CACnCkB,KAAK,EACL,IAAI,EACJd,GACF,CAAC,CACF;IACH,CAAC,CAAC,CAACe,MAAM,CAAC,CAAC,CAACF,GAAG,EAAEC,KAAK,CAAC,KAAKA,KAAK,IAAI,IAAI,CAC3C,CAAC;IACDE,KAAK,EAAE,CAAC,CAAC;IACTC,aAAa,EAAEnB,aAAa,CAACoB;EAC/B,CAAC;AACH","ignoreList":[]}
@@ -13,6 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
+
16
17
  import { describe, it } from "vitest";
17
18
  describe("nothing", () => {
18
19
  it("does nothing", () => {
@@ -1 +1 @@
1
- {"version":3,"file":"empty.test.js","names":["describe","it"],"sources":["empty.test.js"],"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 */\nimport { describe, it } from \"vitest\";\ndescribe(\"nothing\", () => {\n it(\"does nothing\", () => {\n return true;\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,QAAQ,EAAEC,EAAE,QAAQ,QAAQ;AACrCD,QAAQ,CAAC,SAAS,EAAE,MAAM;EACtBC,EAAE,CAAC,cAAc,EAAE,MAAM;IACrB,OAAO,IAAI;EACf,CAAC,CAAC;AACN,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"empty.test.js","names":["describe","it"],"sources":["empty.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 { describe, it } from \"vitest\";\n\ndescribe(\"nothing\", () => {\n it(\"does nothing\", () => {\n return true;\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,QAAQ,EAAEC,EAAE,QAAQ,QAAQ;AAErCD,QAAQ,CAAC,SAAS,EAAE,MAAM;EACxBC,EAAE,CAAC,cAAc,EAAE,MAAM;IACvB,OAAO,IAAI;EACb,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -13,6 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
+
16
17
  export function getModifiedEntityTypes(action) {
17
18
  const addedObjects = new Set();
18
19
  const modifiedObjects = new Set();
@@ -29,6 +30,7 @@ export function getModifiedEntityTypes(action) {
29
30
  case "deleteLink":
30
31
  case "createInterfaceObject":
31
32
  case "modifyInterfaceObject":
33
+ case "deleteInterfaceObject":
32
34
  break;
33
35
  default:
34
36
  }
@@ -1 +1 @@
1
- {"version":3,"file":"getEditedEntities.js","names":["getModifiedEntityTypes","action","addedObjects","Set","modifiedObjects","operation","operations","type","add","objectTypeApiName"],"sources":["getEditedEntities.js"],"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 */\nexport function getModifiedEntityTypes(action) {\n const addedObjects = new Set();\n const modifiedObjects = new Set();\n for (const operation of action.operations) {\n switch (operation.type) {\n case \"createObject\":\n addedObjects.add(operation.objectTypeApiName);\n break;\n case \"modifyObject\":\n modifiedObjects.add(operation.objectTypeApiName);\n break;\n case \"deleteObject\":\n case \"createLink\":\n case \"deleteLink\":\n case \"createInterfaceObject\":\n case \"modifyInterfaceObject\":\n break;\n default:\n const _ = operation;\n }\n }\n return { addedObjects, modifiedObjects };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,sBAAsBA,CAACC,MAAM,EAAE;EAC3C,MAAMC,YAAY,GAAG,IAAIC,GAAG,CAAC,CAAC;EAC9B,MAAMC,eAAe,GAAG,IAAID,GAAG,CAAC,CAAC;EACjC,KAAK,MAAME,SAAS,IAAIJ,MAAM,CAACK,UAAU,EAAE;IACvC,QAAQD,SAAS,CAACE,IAAI;MAClB,KAAK,cAAc;QACfL,YAAY,CAACM,GAAG,CAACH,SAAS,CAACI,iBAAiB,CAAC;QAC7C;MACJ,KAAK,cAAc;QACfL,eAAe,CAACI,GAAG,CAACH,SAAS,CAACI,iBAAiB,CAAC;QAChD;MACJ,KAAK,cAAc;MACnB,KAAK,YAAY;MACjB,KAAK,YAAY;MACjB,KAAK,uBAAuB;MAC5B,KAAK,uBAAuB;QACxB;MACJ;IAEJ;EACJ;EACA,OAAO;IAAEP,YAAY;IAAEE;EAAgB,CAAC;AAC5C","ignoreList":[]}
1
+ {"version":3,"file":"getEditedEntities.js","names":["getModifiedEntityTypes","action","addedObjects","Set","modifiedObjects","operation","operations","type","add","objectTypeApiName"],"sources":["getEditedEntities.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 { ActionTypeV2 } from \"@osdk/foundry.ontologies\";\n\nexport type ModifiedEntityTypes = {\n addedObjects: Set<string>;\n modifiedObjects: Set<string>;\n};\n\nexport function getModifiedEntityTypes(\n action: ActionTypeV2,\n): ModifiedEntityTypes {\n const addedObjects = new Set<string>();\n const modifiedObjects = new Set<string>();\n for (const operation of action.operations) {\n switch (operation.type) {\n case \"createObject\":\n addedObjects.add(operation.objectTypeApiName);\n break;\n case \"modifyObject\":\n modifiedObjects.add(operation.objectTypeApiName);\n break;\n case \"deleteObject\":\n case \"createLink\":\n case \"deleteLink\":\n case \"createInterfaceObject\":\n case \"modifyInterfaceObject\":\n case \"deleteInterfaceObject\":\n break;\n default:\n const _: never = operation;\n }\n }\n return { addedObjects, modifiedObjects };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AASA,OAAO,SAASA,sBAAsBA,CACpCC,MAAoB,EACC;EACrB,MAAMC,YAAY,GAAG,IAAIC,GAAG,CAAS,CAAC;EACtC,MAAMC,eAAe,GAAG,IAAID,GAAG,CAAS,CAAC;EACzC,KAAK,MAAME,SAAS,IAAIJ,MAAM,CAACK,UAAU,EAAE;IACzC,QAAQD,SAAS,CAACE,IAAI;MACpB,KAAK,cAAc;QACjBL,YAAY,CAACM,GAAG,CAACH,SAAS,CAACI,iBAAiB,CAAC;QAC7C;MACF,KAAK,cAAc;QACjBL,eAAe,CAACI,GAAG,CAACH,SAAS,CAACI,iBAAiB,CAAC;QAChD;MACF,KAAK,cAAc;MACnB,KAAK,YAAY;MACjB,KAAK,YAAY;MACjB,KAAK,uBAAuB;MAC5B,KAAK,uBAAuB;MAC5B,KAAK,uBAAuB;QAC1B;MACF;IAEF;EACF;EACA,OAAO;IAAEP,YAAY;IAAEE;EAAgB,CAAC;AAC1C","ignoreList":[]}
@@ -13,6 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
+
16
17
  export { __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition } from "./__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.js";
17
18
  export { wireActionTypeV2ToSdkActionMetadata } from "./wireActionTypeV2ToSdkActionMetadata.js";
18
19
  export { wireObjectTypeFullMetadataToSdkObjectMetadata } from "./wireObjectTypeFullMetadataToSdkObjectMetadata.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition","wireActionTypeV2ToSdkActionMetadata","wireObjectTypeFullMetadataToSdkObjectMetadata","wirePropertyV2ToSdkPropertyDefinition","wireQueryDataTypeToQueryDataTypeDefinition","wireQueryTypeV2ToSdkQueryMetadata","wireQueryParameterV2ToQueryParameterDefinition","wireQueryTypeV2ToSdkQueryDefinitionNoParams"],"sources":["index.js"],"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 */\nexport { __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition } from \"./__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.js\";\nexport { wireActionTypeV2ToSdkActionMetadata } from \"./wireActionTypeV2ToSdkActionMetadata.js\";\nexport { wireObjectTypeFullMetadataToSdkObjectMetadata } from \"./wireObjectTypeFullMetadataToSdkObjectMetadata.js\";\nexport { wirePropertyV2ToSdkPropertyDefinition } from \"./wirePropertyV2ToSdkPropertyDefinition.js\";\nexport { wireQueryDataTypeToQueryDataTypeDefinition } from \"./wireQueryDataTypeToQueryDataTypeDefinition.js\";\nexport { wireQueryTypeV2ToSdkQueryMetadata } from \"./wireQueryTypeV2ToSdkQueryMetadata.js\";\nexport { wireQueryParameterV2ToQueryParameterDefinition } from \"./wireQueryTypeV2ToSdkQueryMetadata.js\";\nexport { wireQueryTypeV2ToSdkQueryDefinitionNoParams } from \"./wireQueryTypeV2ToSdkQueryMetadata.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,mDAAmD,QAAQ,0DAA0D;AAC9H,SAASC,mCAAmC,QAAQ,0CAA0C;AAC9F,SAASC,6CAA6C,QAAQ,oDAAoD;AAClH,SAASC,qCAAqC,QAAQ,4CAA4C;AAClG,SAASC,0CAA0C,QAAQ,iDAAiD;AAC5G,SAASC,iCAAiC,QAAQ,wCAAwC;AAC1F,SAASC,8CAA8C,QAAQ,wCAAwC;AACvG,SAASC,2CAA2C,QAAQ,wCAAwC","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition","wireActionTypeV2ToSdkActionMetadata","wireObjectTypeFullMetadataToSdkObjectMetadata","wirePropertyV2ToSdkPropertyDefinition","wireQueryDataTypeToQueryDataTypeDefinition","wireQueryTypeV2ToSdkQueryMetadata","wireQueryParameterV2ToQueryParameterDefinition","wireQueryTypeV2ToSdkQueryDefinitionNoParams"],"sources":["index.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\nexport { __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition } from \"./__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition.js\";\nexport { wireActionTypeV2ToSdkActionMetadata } from \"./wireActionTypeV2ToSdkActionMetadata.js\";\nexport { wireObjectTypeFullMetadataToSdkObjectMetadata } from \"./wireObjectTypeFullMetadataToSdkObjectMetadata.js\";\nexport { wirePropertyV2ToSdkPropertyDefinition } from \"./wirePropertyV2ToSdkPropertyDefinition.js\";\nexport { wireQueryDataTypeToQueryDataTypeDefinition } from \"./wireQueryDataTypeToQueryDataTypeDefinition.js\";\nexport { wireQueryTypeV2ToSdkQueryMetadata } from \"./wireQueryTypeV2ToSdkQueryMetadata.js\";\nexport { wireQueryParameterV2ToQueryParameterDefinition } from \"./wireQueryTypeV2ToSdkQueryMetadata.js\";\nexport { wireQueryTypeV2ToSdkQueryDefinitionNoParams } from \"./wireQueryTypeV2ToSdkQueryMetadata.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,mDAAmD,QAAQ,0DAA0D;AAC9H,SAASC,mCAAmC,QAAQ,0CAA0C;AAC9F,SAASC,6CAA6C,QAAQ,oDAAoD;AAClH,SAASC,qCAAqC,QAAQ,4CAA4C;AAClG,SAASC,0CAA0C,QAAQ,iDAAiD;AAC5G,SAASC,iCAAiC,QAAQ,wCAAwC;AAC1F,SAASC,8CAA8C,QAAQ,wCAAwC;AACvG,SAASC,2CAA2C,QAAQ,wCAAwC","ignoreList":[]}
@@ -13,6 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
+
16
17
  export function isNullableQueryDataType(input) {
17
18
  if (input.type === "null") {
18
19
  return true;
@@ -1 +1 @@
1
- {"version":3,"file":"isNullableQueryDataType.js","names":["isNullableQueryDataType","input","type","unionTypes","some","t"],"sources":["isNullableQueryDataType.js"],"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 */\nexport function isNullableQueryDataType(input) {\n if (input.type === \"null\") {\n return true;\n }\n if (input.type === \"union\") {\n return input.unionTypes.some(t => isNullableQueryDataType(t));\n }\n return false;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,uBAAuBA,CAACC,KAAK,EAAE;EAC3C,IAAIA,KAAK,CAACC,IAAI,KAAK,MAAM,EAAE;IACvB,OAAO,IAAI;EACf;EACA,IAAID,KAAK,CAACC,IAAI,KAAK,OAAO,EAAE;IACxB,OAAOD,KAAK,CAACE,UAAU,CAACC,IAAI,CAACC,CAAC,IAAIL,uBAAuB,CAACK,CAAC,CAAC,CAAC;EACjE;EACA,OAAO,KAAK;AAChB","ignoreList":[]}
1
+ {"version":3,"file":"isNullableQueryDataType.js","names":["isNullableQueryDataType","input","type","unionTypes","some","t"],"sources":["isNullableQueryDataType.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 { QueryDataType } from \"@osdk/foundry.ontologies\";\n\nexport function isNullableQueryDataType(input: QueryDataType): boolean {\n if (input.type === \"null\") {\n return true;\n }\n if (input.type === \"union\") {\n return input.unionTypes.some(t => isNullableQueryDataType(t));\n }\n return false;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,OAAO,SAASA,uBAAuBA,CAACC,KAAoB,EAAW;EACrE,IAAIA,KAAK,CAACC,IAAI,KAAK,MAAM,EAAE;IACzB,OAAO,IAAI;EACb;EACA,IAAID,KAAK,CAACC,IAAI,KAAK,OAAO,EAAE;IAC1B,OAAOD,KAAK,CAACE,UAAU,CAACC,IAAI,CAACC,CAAC,IAAIL,uBAAuB,CAACK,CAAC,CAAC,CAAC;EAC/D;EACA,OAAO,KAAK;AACd","ignoreList":[]}
@@ -13,6 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
+
16
17
  import { getModifiedEntityTypes } from "./getEditedEntities.js";
17
18
  export function wireActionTypeV2ToSdkActionMetadata(input) {
18
19
  const modifiedEntityTypes = getModifiedEntityTypes(input);
@@ -44,7 +45,9 @@ function actionPropertyToSdkPropertyDefinition(parameterType) {
44
45
  case "integer":
45
46
  case "long":
46
47
  case "timestamp":
48
+ case "mediaReference":
47
49
  case "marking":
50
+ case "objectType":
48
51
  return parameterType.type;
49
52
  case "date":
50
53
  return "datetime";
@@ -60,10 +63,25 @@ function actionPropertyToSdkPropertyDefinition(parameterType) {
60
63
  };
61
64
  case "array":
62
65
  return actionPropertyToSdkPropertyDefinition(parameterType.subType);
66
+ case "interfaceObject":
67
+ return {
68
+ type: "interface",
69
+ interface: parameterType.interfaceTypeApiName
70
+ };
71
+ case "struct":
72
+ return {
73
+ type: "struct",
74
+ struct: parameterType.fields.reduce((structMap, structField) => {
75
+ structMap[structField.name] = actionPropertyToSdkPropertyDefinition(structField.fieldType);
76
+ return structMap;
77
+ }, {})
78
+ };
79
+ default:
80
+ throw new Error(`Unsupported action parameter type: ${JSON.stringify(parameterType)}`);
63
81
  }
64
82
  }
65
83
  function createModifiedEntities(addedObjects, modifiedObjects) {
66
- let entities = {};
84
+ const entities = {};
67
85
  for (const key of addedObjects) {
68
86
  entities[key] = {
69
87
  created: true,
@@ -1 +1 @@
1
- {"version":3,"file":"wireActionTypeV2ToSdkActionMetadata.js","names":["getModifiedEntityTypes","wireActionTypeV2ToSdkActionMetadata","input","modifiedEntityTypes","type","apiName","parameters","Object","fromEntries","entries","map","key","value","wireActionParameterV2ToSdkParameterDefinition","displayName","description","modifiedEntities","createModifiedEntities","addedObjects","modifiedObjects","rid","status","multiplicity","dataType","actionPropertyToSdkPropertyDefinition","subType","nullable","required","parameterType","objectSet","objectTypeApiName","object","entities","created","modified"],"sources":["wireActionTypeV2ToSdkActionMetadata.js"],"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 */\nimport { getModifiedEntityTypes } from \"./getEditedEntities.js\";\nexport function wireActionTypeV2ToSdkActionMetadata(input) {\n const modifiedEntityTypes = getModifiedEntityTypes(input);\n return {\n type: \"action\",\n apiName: input.apiName,\n parameters: Object.fromEntries(Object.entries(input.parameters).map(([key, value]) => [key, wireActionParameterV2ToSdkParameterDefinition(value)])),\n displayName: input.displayName,\n description: input.description,\n modifiedEntities: createModifiedEntities(modifiedEntityTypes.addedObjects, modifiedEntityTypes.modifiedObjects),\n rid: input.rid,\n status: input.status,\n };\n}\nfunction wireActionParameterV2ToSdkParameterDefinition(value) {\n return {\n multiplicity: value.dataType.type === \"array\",\n type: actionPropertyToSdkPropertyDefinition(value.dataType.type === \"array\" ? value.dataType.subType : value.dataType),\n nullable: !value.required,\n description: value.description,\n };\n}\nfunction actionPropertyToSdkPropertyDefinition(parameterType) {\n switch (parameterType.type) {\n case \"string\":\n case \"boolean\":\n case \"attachment\":\n case \"double\":\n case \"integer\":\n case \"long\":\n case \"timestamp\":\n case \"marking\":\n return parameterType.type;\n case \"date\":\n return \"datetime\";\n case \"objectSet\":\n return { type: \"objectSet\", objectSet: parameterType.objectTypeApiName };\n case \"object\":\n return { type: \"object\", object: parameterType.objectTypeApiName };\n case \"array\":\n return actionPropertyToSdkPropertyDefinition(parameterType.subType);\n }\n}\nfunction createModifiedEntities(addedObjects, modifiedObjects) {\n let entities = {};\n for (const key of addedObjects) {\n entities[key] = { created: true, modified: false };\n }\n for (const key of modifiedObjects) {\n if (entities[key]) {\n entities[key].modified = true;\n }\n else {\n entities[key] = { created: false, modified: true };\n }\n }\n return entities;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,sBAAsB,QAAQ,wBAAwB;AAC/D,OAAO,SAASC,mCAAmCA,CAACC,KAAK,EAAE;EACvD,MAAMC,mBAAmB,GAAGH,sBAAsB,CAACE,KAAK,CAAC;EACzD,OAAO;IACHE,IAAI,EAAE,QAAQ;IACdC,OAAO,EAAEH,KAAK,CAACG,OAAO;IACtBC,UAAU,EAAEC,MAAM,CAACC,WAAW,CAACD,MAAM,CAACE,OAAO,CAACP,KAAK,CAACI,UAAU,CAAC,CAACI,GAAG,CAAC,CAAC,CAACC,GAAG,EAAEC,KAAK,CAAC,KAAK,CAACD,GAAG,EAAEE,6CAA6C,CAACD,KAAK,CAAC,CAAC,CAAC,CAAC;IACnJE,WAAW,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,EAAE;EAC3D,IAAIa,QAAQ,GAAG,CAAC,CAAC;EACjB,KAAK,MAAMrB,GAAG,IAAIO,YAAY,EAAE;IAC5Bc,QAAQ,CAACrB,GAAG,CAAC,GAAG;MAAEsB,OAAO,EAAE,IAAI;MAAEC,QAAQ,EAAE;IAAM,CAAC;EACtD;EACA,KAAK,MAAMvB,GAAG,IAAIQ,eAAe,EAAE;IAC/B,IAAIa,QAAQ,CAACrB,GAAG,CAAC,EAAE;MACfqB,QAAQ,CAACrB,GAAG,CAAC,CAACuB,QAAQ,GAAG,IAAI;IACjC,CAAC,MACI;MACDF,QAAQ,CAACrB,GAAG,CAAC,GAAG;QAAEsB,OAAO,EAAE,KAAK;QAAEC,QAAQ,EAAE;MAAK,CAAC;IACtD;EACJ;EACA,OAAOF,QAAQ;AACnB","ignoreList":[]}
1
+ {"version":3,"file":"wireActionTypeV2ToSdkActionMetadata.js","names":["getModifiedEntityTypes","wireActionTypeV2ToSdkActionMetadata","input","modifiedEntityTypes","type","apiName","parameters","Object","fromEntries","entries","map","key","value","wireActionParameterV2ToSdkParameterDefinition","displayName","description","modifiedEntities","createModifiedEntities","addedObjects","modifiedObjects","rid","status","multiplicity","dataType","actionPropertyToSdkPropertyDefinition","subType","nullable","required","parameterType","objectSet","objectTypeApiName","object","interface","interfaceTypeApiName","struct","fields","reduce","structMap","structField","name","fieldType","Error","JSON","stringify","entities","created","modified"],"sources":["wireActionTypeV2ToSdkActionMetadata.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 { ActionMetadata } from \"@osdk/api\";\nimport type {\n ActionParameterType,\n ActionParameterV2,\n ActionTypeV2,\n} from \"@osdk/foundry.ontologies\";\nimport { getModifiedEntityTypes } from \"./getEditedEntities.js\";\n\nexport function wireActionTypeV2ToSdkActionMetadata(\n input: ActionTypeV2,\n): ActionMetadata {\n const modifiedEntityTypes = getModifiedEntityTypes(input);\n return {\n type: \"action\",\n apiName: input.apiName,\n parameters: Object.fromEntries(\n Object.entries(input.parameters).map((\n [key, value],\n ) => [key, wireActionParameterV2ToSdkParameterDefinition(value)]),\n ),\n displayName: input.displayName,\n description: input.description,\n modifiedEntities: createModifiedEntities(\n modifiedEntityTypes.addedObjects,\n modifiedEntityTypes.modifiedObjects,\n ),\n rid: input.rid,\n status: input.status,\n };\n}\n\nfunction wireActionParameterV2ToSdkParameterDefinition(\n value: ActionParameterV2,\n): ActionMetadata.Parameter<any> {\n return {\n multiplicity: value.dataType.type === \"array\",\n type: actionPropertyToSdkPropertyDefinition(\n value.dataType.type === \"array\" ? value.dataType.subType : value.dataType,\n ),\n nullable: !value.required,\n description: value.description,\n };\n}\n\nfunction actionPropertyToSdkPropertyDefinition(\n parameterType: ActionParameterType,\n): ActionMetadata.Parameter[\"type\"] {\n switch (parameterType.type) {\n case \"string\":\n case \"boolean\":\n case \"attachment\":\n case \"double\":\n case \"integer\":\n case \"long\":\n case \"timestamp\":\n case \"mediaReference\":\n case \"marking\":\n case \"objectType\":\n return parameterType.type;\n case \"date\":\n return \"datetime\";\n case \"objectSet\":\n return { type: \"objectSet\", objectSet: parameterType.objectTypeApiName! };\n case \"object\":\n return { type: \"object\", object: parameterType.objectTypeApiName };\n case \"array\":\n return actionPropertyToSdkPropertyDefinition(parameterType.subType);\n case \"interfaceObject\":\n return {\n type: \"interface\",\n interface: parameterType.interfaceTypeApiName,\n };\n case \"struct\":\n return {\n type: \"struct\",\n struct: parameterType.fields.reduce(\n (\n structMap: Record<\n string,\n ActionMetadata.DataType.BaseActionParameterTypes\n >,\n structField,\n ) => {\n structMap[structField.name] = actionPropertyToSdkPropertyDefinition(\n structField.fieldType as ActionParameterType,\n ) as ActionMetadata.DataType.BaseActionParameterTypes;\n return structMap;\n },\n {},\n ),\n };\n default:\n throw new Error(\n `Unsupported action parameter type: ${JSON.stringify(parameterType)}`,\n );\n }\n}\n\nfunction createModifiedEntities<K extends string>(\n addedObjects: Set<K>,\n modifiedObjects: Set<K>,\n): ActionMetadata[\"modifiedEntities\"] {\n const entities = {} as Record<\n K,\n {\n created: boolean;\n modified: boolean;\n }\n >;\n\n for (const key of addedObjects) {\n entities[key] = { created: true, modified: false };\n }\n\n for (const key of modifiedObjects) {\n if (entities[key]) {\n entities[key].modified = true;\n } else {\n entities[key] = { created: false, modified: true };\n }\n }\n\n return entities;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAQA,SAASA,sBAAsB,QAAQ,wBAAwB;AAE/D,OAAO,SAASC,mCAAmCA,CACjDC,KAAmB,EACH;EAChB,MAAMC,mBAAmB,GAAGH,sBAAsB,CAACE,KAAK,CAAC;EACzD,OAAO;IACLE,IAAI,EAAE,QAAQ;IACdC,OAAO,EAAEH,KAAK,CAACG,OAAO;IACtBC,UAAU,EAAEC,MAAM,CAACC,WAAW,CAC5BD,MAAM,CAACE,OAAO,CAACP,KAAK,CAACI,UAAU,CAAC,CAACI,GAAG,CAAC,CACnC,CAACC,GAAG,EAAEC,KAAK,CAAC,KACT,CAACD,GAAG,EAAEE,6CAA6C,CAACD,KAAK,CAAC,CAAC,CAClE,CAAC;IACDE,WAAW,EAAEZ,KAAK,CAACY,WAAW;IAC9BC,WAAW,EAAEb,KAAK,CAACa,WAAW;IAC9BC,gBAAgB,EAAEC,sBAAsB,CACtCd,mBAAmB,CAACe,YAAY,EAChCf,mBAAmB,CAACgB,eACtB,CAAC;IACDC,GAAG,EAAElB,KAAK,CAACkB,GAAG;IACdC,MAAM,EAAEnB,KAAK,C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UACHD,SAAS,CAACC,WAAW,CAACC,IAAI,CAAC,GAAGf,qCAAqC,CACjEc,WAAW,CAACE,SACd,CAAqD;UACrD,OAAOH,SAAS;QAClB,CAAC,EACD,CAAC,CACH;MACF,CAAC;IACH;MACE,MAAM,IAAII,KAAK,CACb,sCAAsCC,IAAI,CAACC,SAAS,CAACf,aAAa,CAAC,EACrE,CAAC;EACL;AACF;AAEA,SAASX,sBAAsBA,CAC7BC,YAAoB,EACpBC,eAAuB,EACa;EACpC,MAAMyB,QAAQ,GAAG,CAAC,CAMjB;EAED,KAAK,MAAMjC,GAAG,IAAIO,YAAY,EAAE;IAC9B0B,QAAQ,CAACjC,GAAG,CAAC,GAAG;MAAEkC,OAAO,EAAE,IAAI;MAAEC,QAAQ,EAAE;IAAM,CAAC;EACpD;EAEA,KAAK,MAAMnC,GAAG,IAAIQ,eAAe,EAAE;IACjC,IAAIyB,QAAQ,CAACjC,GAAG,CAAC,EAAE;MACjBiC,QAAQ,CAACjC,GAAG,CAAC,CAACmC,QAAQ,GAAG,IAAI;IAC/B,CAAC,MAAM;MACLF,QAAQ,CAACjC,GAAG,CAAC,GAAG;QAAEkC,OAAO,EAAE,KAAK;QAAEC,QAAQ,EAAE;MAAK,CAAC;IACpD;EACF;EAEA,OAAOF,QAAQ;AACjB","ignoreList":[]}
@@ -13,12 +13,14 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
+
16
17
  import { wirePropertyV2ToSdkPrimaryKeyTypeDefinition } from "./wirePropertyV2ToSdkPrimaryKeyTypeDefinition.js";
17
18
  import { wirePropertyV2ToSdkPropertyDefinition } from "./wirePropertyV2ToSdkPropertyDefinition.js";
18
- export function wireObjectTypeFullMetadataToSdkObjectMetadata(objectTypeWithLink, v2) {
19
+ export function wireObjectTypeFullMetadataToSdkObjectMetadata(objectTypeWithLink, v2, log) {
19
20
  if (objectTypeWithLink.objectType.properties[objectTypeWithLink.objectType.primaryKey] === undefined) {
20
21
  throw new Error(`Primary key ${objectTypeWithLink.objectType.primaryKey} not found in ${objectTypeWithLink.objectType.apiName}`);
21
22
  }
23
+
22
24
  // saved ontology.json files may not have this implementsInterfaces2 so we need to handle
23
25
  if (objectTypeWithLink.implementsInterfaces2 == null && objectTypeWithLink.implementsInterfaces != null) {
24
26
  throw new Error("Your ontology.json file is missing the implementsInterfaces2 field. Please regenerate it.");
@@ -36,7 +38,7 @@ export function wireObjectTypeFullMetadataToSdkObjectMetadata(objectTypeWithLink
36
38
  targetType: linkType.objectTypeApiName
37
39
  }];
38
40
  })),
39
- properties: Object.fromEntries(Object.entries(objectTypeWithLink.objectType.properties).map(([key, value]) => [key, wirePropertyV2ToSdkPropertyDefinition(value, !(v2 && objectTypeWithLink.objectType.primaryKey === key))])),
41
+ properties: Object.fromEntries(Object.entries(objectTypeWithLink.objectType.properties).map(([key, value]) => [key, wirePropertyV2ToSdkPropertyDefinition(value, !(v2 && objectTypeWithLink.objectType.primaryKey === key), log)]).filter(([key, value]) => value != null)),
40
42
  implements: objectTypeWithLink.implementsInterfaces,
41
43
  interfaceMap,
42
44
  inverseInterfaceMap: Object.fromEntries(Object.entries(interfaceMap).map(([interfaceApiName, props]) => [interfaceApiName, invertProps(props)])),
@@ -1 +1 @@
1
- {"version":3,"file":"wireObjectTypeFullMetadataToSdkObjectMetadata.js","names":["wirePropertyV2ToSdkPrimaryKeyTypeDefinition","wirePropertyV2ToSdkPropertyDefinition","wireObjectTypeFullMetadataToSdkObjectMetadata","objectTypeWithLink","v2","objectType","properties","primaryKey","undefined","Error","apiName","implementsInterfaces2","implementsInterfaces","interfaceMap","Object","fromEntries","entries","map","interfaceApiName","impl","type","description","primaryKeyApiName","primaryKeyType","links","linkTypes","linkType","multiplicity","cardinality","targetType","objectTypeApiName","key","value","implements","inverseInterfaceMap","props","invertProps","icon","supportedIconTypes","includes","titleProperty","displayName","pluralDisplayName","status","rid","visibility","a","k","v"],"sources":["wireObjectTypeFullMetadataToSdkObjectMetadata.js"],"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 */\nimport { wirePropertyV2ToSdkPrimaryKeyTypeDefinition } from \"./wirePropertyV2ToSdkPrimaryKeyTypeDefinition.js\";\nimport { wirePropertyV2ToSdkPropertyDefinition } from \"./wirePropertyV2ToSdkPropertyDefinition.js\";\nexport function wireObjectTypeFullMetadataToSdkObjectMetadata(objectTypeWithLink, v2) {\n if (objectTypeWithLink.objectType\n .properties[objectTypeWithLink.objectType.primaryKey] === undefined) {\n throw new Error(`Primary key ${objectTypeWithLink.objectType.primaryKey} not found in ${objectTypeWithLink.objectType.apiName}`);\n }\n // saved ontology.json files may not have this implementsInterfaces2 so we need to handle\n if (objectTypeWithLink.implementsInterfaces2 == null\n && objectTypeWithLink.implementsInterfaces != null) {\n throw new Error(\"Your ontology.json file is missing the implementsInterfaces2 field. Please regenerate it.\");\n }\n const interfaceMap = objectTypeWithLink.implementsInterfaces2\n ? Object.fromEntries(Object.entries(objectTypeWithLink.implementsInterfaces2).map(([interfaceApiName, impl]) => [interfaceApiName, impl.properties]))\n : {};\n return {\n type: \"object\",\n apiName: objectTypeWithLink.objectType.apiName,\n description: objectTypeWithLink.objectType.description,\n primaryKeyApiName: objectTypeWithLink.objectType.primaryKey,\n primaryKeyType: wirePropertyV2ToSdkPrimaryKeyTypeDefinition(objectTypeWithLink.objectType\n .properties[objectTypeWithLink.objectType.primaryKey]),\n links: Object.fromEntries(objectTypeWithLink.linkTypes.map(linkType => {\n return [linkType.apiName, {\n multiplicity: linkType.cardinality === \"MANY\",\n targetType: linkType.objectTypeApiName,\n }];\n })),\n properties: Object.fromEntries(Object.entries(objectTypeWithLink.objectType.properties).map(([key, value]) => [\n key,\n wirePropertyV2ToSdkPropertyDefinition(value, !(v2 && objectTypeWithLink.objectType.primaryKey === key)),\n ])),\n implements: objectTypeWithLink.implementsInterfaces,\n interfaceMap,\n inverseInterfaceMap: Object.fromEntries(Object.entries(interfaceMap).map(([interfaceApiName, props]) => [interfaceApiName, invertProps(props)])),\n icon: supportedIconTypes.includes(objectTypeWithLink.objectType.icon.type)\n ? objectTypeWithLink.objectType.icon\n : undefined,\n titleProperty: objectTypeWithLink.objectType.titleProperty,\n displayName: objectTypeWithLink.objectType.displayName,\n pluralDisplayName: objectTypeWithLink.objectType.pluralDisplayName,\n status: objectTypeWithLink.objectType.status,\n rid: objectTypeWithLink.objectType.rid,\n visibility: objectTypeWithLink.objectType.visibility,\n };\n}\nfunction invertProps(a) {\n return (a\n ? Object.fromEntries(Object.entries(a).map(([k, v]) => [v, k]))\n : undefined);\n}\nconst supportedIconTypes = [\"blueprint\"];\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,2CAA2C,QAAQ,kDAAkD;AAC9G,SAASC,qCAAqC,QAAQ,4CAA4C;AAClG,OAAO,SAASC,6CAA6CA,CAACC,kBAAkB,EAAEC,EAAE,EAAE;EAClF,IAAID,kBAAkB,CAACE,UAAU,CAC5BC,UAAU,CAACH,kBAAkB,CAACE,UAAU,CAACE,UAAU,CAAC,KAAKC,SAAS,EAAE;IACrE,MAAM,IAAIC,KAAK,CAAC,eAAeN,kBAAkB,CAACE,UAAU,CAACE,UAAU,iBAAiBJ,kBAAkB,CAACE,UAAU,CAACK,OAAO,EAAE,CAAC;EACpI;EACA;EACA,IAAIP,kBAAkB,CAACQ,qBAAqB,IAAI,IAAI,IAC7CR,kBAAkB,CAACS,oBAAoB,IAAI,IAAI,EAAE;IACpD,MAAM,IAAIH,KAAK,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E9B,kBAAkB,CAACS,oBAAoB;IACnDC,YAAY;IACZqB,mBAAmB,EAAEpB,MAAM,CAACC,WAAW,CAACD,MAAM,CAACE,OAAO,CAACH,YAAY,CAAC,CAACI,GAAG,CAAC,CAAC,CAACC,gBAAgB,EAAEiB,KAAK,CAAC,KAAK,CAACjB,gBAAgB,EAAEkB,WAAW,CAACD,KAAK,CAAC,CAAC,CAAC,CAAC;IAChJE,IAAI,EAAEC,kBAAkB,CAACC,QAAQ,CAACpC,kBAAkB,CAACE,UAAU,CAACgC,IAAI,CAACjB,IAAI,CAAC,GACpEjB,kBAAkB,CAACE,UAAU,CAACgC,IAAI,GAClC7B,SAAS;IACfgC,aAAa,EAAErC,kBAAkB,CAACE,UAAU,CAACmC,aAAa;IAC1DC,WAAW,EAAEtC,kBAAkB,CAACE,UAAU,CAACoC,WAAW;IACtDC,iBAAiB,EAAEvC,kBAAkB,CAACE,UAAU,CAACqC,iBAAiB;IAClEC,MAAM,EAAExC,kBAAkB,CAACE,UAAU,CAACsC,MAAM;IAC5CC,GAAG,EAAEzC,kBAAkB,CAACE,UAAU,CAACuC,GAAG;IACtCC,UAAU,EAAE1C,kBAAkB,CAACE,UAAU,CAACwC;EAC9C,CAAC;AACL;AACA,SAAST,WAAWA,CAACU,CAAC,EAAE;EACpB,OAAQA,CAAC,GACHhC,MAAM,CAACC,WAAW,CAACD,MAAM,CAACE,OAAO,CAAC8B,CAAC,CAAC,CAAC7B,GAAG,CAAC,CAAC,CAAC8B,CAAC,EAAEC,CAAC,CAAC,KAAK,CAACA,CAAC,EAAED,CAAC,CAAC,CAAC,CAAC,GAC7DvC,SAAS;AACnB;AACA,MAAM8B,kBAAkB,GAAG,CAAC,WAAW,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"wireObjectTypeFullMetadataToSdkObjectMetadata.js","names":["wirePropertyV2ToSdkPrimaryKeyTypeDefinition","wirePropertyV2ToSdkPropertyDefinition","wireObjectTypeFullMetadataToSdkObjectMetadata","objectTypeWithLink","v2","log","objectType","properties","primaryKey","undefined","Error","apiName","implementsInterfaces2","implementsInterfaces","interfaceMap","Object","fromEntries","entries","map","interfaceApiName","impl","type","description","primaryKeyApiName","primaryKeyType","links","linkTypes","linkType","multiplicity","cardinality","targetType","objectTypeApiName","key","value","filter","implements","inverseInterfaceMap","props","invertProps","icon","supportedIconTypes","includes","titleProperty","displayName","pluralDisplayName","status","rid","visibility","a","k","v"],"sources":["wireObjectTypeFullMetadataToSdkObjectMetadata.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 { ObjectMetadata } from \"@osdk/api\";\nimport type {\n ObjectTypeFullMetadata,\n PropertyApiName,\n PropertyV2,\n} from \"@osdk/foundry.ontologies\";\nimport { wirePropertyV2ToSdkPrimaryKeyTypeDefinition } from \"./wirePropertyV2ToSdkPrimaryKeyTypeDefinition.js\";\nimport { wirePropertyV2ToSdkPropertyDefinition } from \"./wirePropertyV2ToSdkPropertyDefinition.js\";\n\nexport function wireObjectTypeFullMetadataToSdkObjectMetadata(\n objectTypeWithLink: ObjectTypeFullMetadata & {\n objectType: {\n properties: Record<PropertyApiName, PropertyV2 & { nullable?: boolean }>;\n };\n },\n v2: boolean,\n log?: { info: (msg: string) => void },\n): ObjectMetadata {\n if (\n objectTypeWithLink.objectType\n .properties[objectTypeWithLink.objectType.primaryKey] === undefined\n ) {\n throw new Error(\n `Primary key ${objectTypeWithLink.objectType.primaryKey} not found in ${objectTypeWithLink.objectType.apiName}`,\n );\n }\n\n // saved ontology.json files may not have this implementsInterfaces2 so we need to handle\n if (\n objectTypeWithLink.implementsInterfaces2 == null\n && objectTypeWithLink.implementsInterfaces != null\n ) {\n throw new Error(\n \"Your ontology.json file is missing the implementsInterfaces2 field. Please regenerate it.\",\n );\n }\n\n const interfaceMap = objectTypeWithLink.implementsInterfaces2\n ? Object.fromEntries(\n Object.entries(objectTypeWithLink.implementsInterfaces2).map(\n ([interfaceApiName, impl]) => [interfaceApiName, impl.properties],\n ),\n )\n : {};\n\n return {\n type: \"object\",\n apiName: objectTypeWithLink.objectType.apiName,\n description: objectTypeWithLink.objectType.description,\n primaryKeyApiName: objectTypeWithLink.objectType.primaryKey,\n primaryKeyType: wirePropertyV2ToSdkPrimaryKeyTypeDefinition(\n objectTypeWithLink.objectType\n .properties[objectTypeWithLink.objectType.primaryKey],\n ),\n links: Object.fromEntries(objectTypeWithLink.linkTypes.map(linkType => {\n return [linkType.apiName, {\n multiplicity: linkType.cardinality === \"MANY\",\n targetType: linkType.objectTypeApiName,\n }];\n })),\n properties: Object.fromEntries(\n Object.entries(objectTypeWithLink.objectType.properties).map((\n [key, value],\n ) => [\n key,\n wirePropertyV2ToSdkPropertyDefinition(\n value,\n !(v2 && objectTypeWithLink.objectType.primaryKey === key),\n log,\n ),\n ]).filter(([key, value]) => value != null),\n ),\n implements: objectTypeWithLink.implementsInterfaces as string[],\n interfaceMap,\n inverseInterfaceMap: Object.fromEntries(\n Object.entries(interfaceMap).map((\n [interfaceApiName, props],\n ) => [interfaceApiName, invertProps(props)]),\n ),\n icon: supportedIconTypes.includes(objectTypeWithLink.objectType.icon.type)\n ? objectTypeWithLink.objectType.icon\n : undefined,\n titleProperty: objectTypeWithLink.objectType.titleProperty,\n displayName: objectTypeWithLink.objectType.displayName,\n pluralDisplayName: objectTypeWithLink.objectType.pluralDisplayName,\n status: objectTypeWithLink.objectType.status,\n rid: objectTypeWithLink.objectType.rid,\n visibility: objectTypeWithLink.objectType.visibility,\n };\n}\n\nfunction invertProps(\n a?: Record<string, string>,\n): typeof a extends undefined ? typeof a : Record<string, string> {\n return (a\n ? Object.fromEntries(Object.entries(a).map(([k, v]) => [v, k]))\n : undefined) as typeof a extends undefined ? typeof a\n : Record<string, string>;\n}\n\nconst supportedIconTypes = [\"blueprint\"];\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAQA,SAASA,2CAA2C,QAAQ,kDAAkD;AAC9G,SAASC,qCAAqC,QAAQ,4CAA4C;AAElG,OAAO,SAASC,6CAA6CA,CAC3DC,kBAIC,EACDC,EAAW,EACXC,GAAqC,EACrB;EAChB,IACEF,kBAAkB,CAACG,UAAU,CAC1BC,UAAU,CAACJ,kBAAkB,CAACG,UAAU,CAACE,UAAU,CAAC,KAAKC,SAAS,EACrE;IACA,MAAM,IAAIC,KAAK,CACb,eAAeP,kBAAkB,CAACG,UAAU,CAACE,UAAU,iBAAiBL,kBAAkB,CAACG,UAAU,CAACK,OAAO,EAC/G,CAAC;EACH;;EAEA;EACA,IACER,kBAAkB,CAACS,qBAAqB,IAAI,IAAI,IAC7CT,kBAAkB,CAACU,oBAAoB,IAAI,IAAI,EAClD;IACA,MAAM,IAAIH,KAAK,CACb,2FACF,CAAC;EACH;EAEA,MAAMI,YAAY,GAAGX,kBAAkB,CAACS,qBAAqB,GACzDG,MAAM,CAACC,WAAW,CAClBD,MAAM,CAACE,OAAO,CAACd,kBAAkB,CAACS,qBAAqB,CAAC,CAACM,GAAG,CAC1D,CAAC,CAACC,gBAAgB,EAAEC,IAAI,CAAC,KAAK,CAACD,gBAAgB,EAAEC,IAAI,CAACb,UAAU,CAClE,CACF,CAAC,GACC,CAAC,CAAC;EAEN,OAAO;IACLc,IAAI,EAAE,QAAQ;IACdV,OAAO,EAAER,kBAAkB,CAACG,UAAU,CAACK,OAAO;IAC9CW,WAAW,EAAEnB,kBAAkB,CAACG,UAAU,CAACgB,WAAW;IACtDC,iBAAiB,EAAEpB,kBAAkB,CAACG,UAAU,CAAC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