@osdk/api 2.2.0-beta.2 → 2.2.0-beta.20

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 (166) hide show
  1. package/CHANGELOG.md +101 -0
  2. package/build/browser/Logger.js +17 -0
  3. package/build/browser/Logger.js.map +1 -0
  4. package/build/browser/OsdkBase.js.map +1 -1
  5. package/build/browser/OsdkObjectFrom.js +2 -4
  6. package/build/browser/OsdkObjectFrom.js.map +1 -1
  7. package/build/browser/OsdkObjectFrom.test.js +3 -3
  8. package/build/browser/OsdkObjectFrom.test.js.map +1 -1
  9. package/build/browser/actions/ActionResults.js.map +1 -1
  10. package/build/browser/actions/Actions.js.map +1 -1
  11. package/build/browser/aggregate/AggregatableKeys.js.map +1 -1
  12. package/build/browser/derivedProperties/DerivedProperty.js.map +1 -1
  13. package/build/browser/derivedProperties/Expressions.js +2 -0
  14. package/build/browser/derivedProperties/Expressions.js.map +1 -0
  15. package/build/browser/derivedProperties/WithPropertiesAggregationOptions.js.map +1 -1
  16. package/build/browser/experimental/createMediaReference.js +2 -2
  17. package/build/browser/experimental/createMediaReference.js.map +1 -1
  18. package/build/browser/experimental/fetchPageByRid.js +22 -0
  19. package/build/browser/experimental/fetchPageByRid.js.map +1 -0
  20. package/build/browser/groupby/GroupByClause.js.map +1 -1
  21. package/build/browser/index.js.map +1 -1
  22. package/build/browser/mapping/DataValueMapping.js.map +1 -1
  23. package/build/browser/object/FetchPageArgs.js +1 -0
  24. package/build/browser/object/FetchPageArgs.js.map +1 -1
  25. package/build/browser/object/FetchPageResult.js.map +1 -1
  26. package/build/browser/objectSet/BulkLinkResult.js.map +1 -1
  27. package/build/browser/objectSet/ObjectSet.js.map +1 -1
  28. package/build/browser/objectSet/ObjectSet.test.js +424 -9
  29. package/build/browser/objectSet/ObjectSet.test.js.map +1 -1
  30. package/build/browser/ontology/ActionDefinition.js.map +1 -1
  31. package/build/browser/ontology/ObjectOrInterface.js +1 -0
  32. package/build/browser/ontology/ObjectOrInterface.js.map +1 -1
  33. package/build/browser/ontology/ObjectSpecifier.js +2 -0
  34. package/build/browser/ontology/ObjectSpecifier.js.map +1 -0
  35. package/build/browser/ontology/ObjectSpecifier.test.js +53 -0
  36. package/build/browser/ontology/ObjectSpecifier.test.js.map +1 -0
  37. package/build/browser/ontology/ObjectTypeDefinition.js.map +1 -1
  38. package/build/browser/ontology/PrimaryKeyTypes.js.map +1 -1
  39. package/build/browser/ontology/QueryDefinition.js.map +1 -1
  40. package/build/browser/ontology/SimplePropertyDef.js.map +1 -1
  41. package/build/browser/public/unstable.js +1 -0
  42. package/build/browser/public/unstable.js.map +1 -1
  43. package/build/browser/queries/Queries.js.map +1 -1
  44. package/build/browser/test/EmployeeApiTest.js +21 -0
  45. package/build/browser/test/EmployeeApiTest.js.map +1 -0
  46. package/build/browser/test/FooInterfaceApiTest.js +22 -0
  47. package/build/browser/test/FooInterfaceApiTest.js.map +1 -0
  48. package/build/browser/util/IncludeValuesExtending.js +2 -0
  49. package/build/browser/util/IncludeValuesExtending.js.map +1 -0
  50. package/build/cjs/{ObjectSet-C2x3lIr7.d.cts → ObjectSet-DOR8vbgj.d.cts} +214 -59
  51. package/build/cjs/index.d.cts +40 -8
  52. package/build/cjs/public/unstable.cjs +8 -0
  53. package/build/cjs/public/unstable.cjs.map +1 -1
  54. package/build/cjs/public/unstable.d.cts +14 -9
  55. package/build/esm/Logger.js +17 -0
  56. package/build/esm/Logger.js.map +1 -0
  57. package/build/esm/OsdkBase.js.map +1 -1
  58. package/build/esm/OsdkObjectFrom.js +2 -4
  59. package/build/esm/OsdkObjectFrom.js.map +1 -1
  60. package/build/esm/OsdkObjectFrom.test.js +3 -3
  61. package/build/esm/OsdkObjectFrom.test.js.map +1 -1
  62. package/build/esm/actions/ActionResults.js.map +1 -1
  63. package/build/esm/actions/Actions.js.map +1 -1
  64. package/build/esm/aggregate/AggregatableKeys.js.map +1 -1
  65. package/build/esm/derivedProperties/DerivedProperty.js.map +1 -1
  66. package/build/esm/derivedProperties/Expressions.js +2 -0
  67. package/build/esm/derivedProperties/Expressions.js.map +1 -0
  68. package/build/esm/derivedProperties/WithPropertiesAggregationOptions.js.map +1 -1
  69. package/build/esm/experimental/createMediaReference.js +2 -2
  70. package/build/esm/experimental/createMediaReference.js.map +1 -1
  71. package/build/esm/experimental/fetchPageByRid.js +22 -0
  72. package/build/esm/experimental/fetchPageByRid.js.map +1 -0
  73. package/build/esm/groupby/GroupByClause.js.map +1 -1
  74. package/build/esm/index.js.map +1 -1
  75. package/build/esm/mapping/DataValueMapping.js.map +1 -1
  76. package/build/esm/object/FetchPageArgs.js +1 -0
  77. package/build/esm/object/FetchPageArgs.js.map +1 -1
  78. package/build/esm/object/FetchPageResult.js.map +1 -1
  79. package/build/esm/objectSet/BulkLinkResult.js.map +1 -1
  80. package/build/esm/objectSet/ObjectSet.js.map +1 -1
  81. package/build/esm/objectSet/ObjectSet.test.js +424 -9
  82. package/build/esm/objectSet/ObjectSet.test.js.map +1 -1
  83. package/build/esm/ontology/ActionDefinition.js.map +1 -1
  84. package/build/esm/ontology/ObjectOrInterface.js +1 -0
  85. package/build/esm/ontology/ObjectOrInterface.js.map +1 -1
  86. package/build/esm/ontology/ObjectSpecifier.js +2 -0
  87. package/build/esm/ontology/ObjectSpecifier.js.map +1 -0
  88. package/build/esm/ontology/ObjectSpecifier.test.js +53 -0
  89. package/build/esm/ontology/ObjectSpecifier.test.js.map +1 -0
  90. package/build/esm/ontology/ObjectTypeDefinition.js.map +1 -1
  91. package/build/esm/ontology/PrimaryKeyTypes.js.map +1 -1
  92. package/build/esm/ontology/QueryDefinition.js.map +1 -1
  93. package/build/esm/ontology/SimplePropertyDef.js.map +1 -1
  94. package/build/esm/public/unstable.js +1 -0
  95. package/build/esm/public/unstable.js.map +1 -1
  96. package/build/esm/queries/Queries.js.map +1 -1
  97. package/build/esm/test/EmployeeApiTest.js +21 -0
  98. package/build/esm/test/EmployeeApiTest.js.map +1 -0
  99. package/build/esm/test/FooInterfaceApiTest.js +22 -0
  100. package/build/esm/test/FooInterfaceApiTest.js.map +1 -0
  101. package/build/esm/util/IncludeValuesExtending.js +2 -0
  102. package/build/esm/util/IncludeValuesExtending.js.map +1 -0
  103. package/build/types/Logger.d.ts +19 -0
  104. package/build/types/Logger.d.ts.map +1 -0
  105. package/build/types/OsdkBase.d.ts +4 -0
  106. package/build/types/OsdkBase.d.ts.map +1 -1
  107. package/build/types/OsdkObjectFrom.d.ts +16 -10
  108. package/build/types/OsdkObjectFrom.d.ts.map +1 -1
  109. package/build/types/actions/ActionResults.d.ts +4 -0
  110. package/build/types/actions/ActionResults.d.ts.map +1 -1
  111. package/build/types/actions/Actions.d.ts +3 -3
  112. package/build/types/actions/Actions.d.ts.map +1 -1
  113. package/build/types/aggregate/AggregatableKeys.d.ts +10 -8
  114. package/build/types/aggregate/AggregatableKeys.d.ts.map +1 -1
  115. package/build/types/derivedProperties/DerivedProperty.d.ts +41 -14
  116. package/build/types/derivedProperties/DerivedProperty.d.ts.map +1 -1
  117. package/build/types/derivedProperties/Expressions.d.ts +53 -0
  118. package/build/types/derivedProperties/Expressions.d.ts.map +1 -0
  119. package/build/types/derivedProperties/WithPropertiesAggregationOptions.d.ts +6 -3
  120. package/build/types/derivedProperties/WithPropertiesAggregationOptions.d.ts.map +1 -1
  121. package/build/types/experimental/createMediaReference.d.ts +9 -5
  122. package/build/types/experimental/createMediaReference.d.ts.map +1 -1
  123. package/build/types/experimental/fetchPageByRid.d.ts +15 -0
  124. package/build/types/experimental/fetchPageByRid.d.ts.map +1 -0
  125. package/build/types/groupby/GroupByClause.d.ts +6 -0
  126. package/build/types/groupby/GroupByClause.d.ts.map +1 -1
  127. package/build/types/index.d.ts +43 -40
  128. package/build/types/index.d.ts.map +1 -1
  129. package/build/types/mapping/DataValueMapping.d.ts +4 -0
  130. package/build/types/mapping/DataValueMapping.d.ts.map +1 -1
  131. package/build/types/object/FetchPageArgs.d.ts +39 -6
  132. package/build/types/object/FetchPageArgs.d.ts.map +1 -1
  133. package/build/types/object/FetchPageResult.d.ts +6 -4
  134. package/build/types/object/FetchPageResult.d.ts.map +1 -1
  135. package/build/types/objectSet/BulkLinkResult.d.ts +1 -1
  136. package/build/types/objectSet/ObjectSet.d.ts +143 -34
  137. package/build/types/objectSet/ObjectSet.d.ts.map +1 -1
  138. package/build/types/objectSet/ObjectSet.test.d.ts +2 -1
  139. package/build/types/objectSet/ObjectSet.test.d.ts.map +1 -1
  140. package/build/types/ontology/ActionDefinition.d.ts +1 -1
  141. package/build/types/ontology/ActionDefinition.d.ts.map +1 -1
  142. package/build/types/ontology/ObjectOrInterface.d.ts +12 -5
  143. package/build/types/ontology/ObjectOrInterface.d.ts.map +1 -1
  144. package/build/types/ontology/ObjectSpecifier.d.ts +6 -0
  145. package/build/types/ontology/ObjectSpecifier.d.ts.map +1 -0
  146. package/build/types/ontology/ObjectSpecifier.test.d.ts +1 -0
  147. package/build/types/ontology/ObjectSpecifier.test.d.ts.map +1 -0
  148. package/build/types/ontology/ObjectTypeDefinition.d.ts +1 -1
  149. package/build/types/ontology/ObjectTypeDefinition.d.ts.map +1 -1
  150. package/build/types/ontology/PrimaryKeyTypes.d.ts +1 -1
  151. package/build/types/ontology/PrimaryKeyTypes.d.ts.map +1 -1
  152. package/build/types/ontology/QueryDefinition.d.ts +5 -1
  153. package/build/types/ontology/QueryDefinition.d.ts.map +1 -1
  154. package/build/types/ontology/SimplePropertyDef.d.ts +4 -4
  155. package/build/types/ontology/SimplePropertyDef.d.ts.map +1 -1
  156. package/build/types/public/unstable.d.ts +4 -3
  157. package/build/types/public/unstable.d.ts.map +1 -1
  158. package/build/types/queries/Queries.d.ts +2 -2
  159. package/build/types/queries/Queries.d.ts.map +1 -1
  160. package/build/types/test/EmployeeApiTest.d.ts +86 -0
  161. package/build/types/test/EmployeeApiTest.d.ts.map +1 -0
  162. package/build/types/test/FooInterfaceApiTest.d.ts +50 -0
  163. package/build/types/test/FooInterfaceApiTest.d.ts.map +1 -0
  164. package/build/types/util/IncludeValuesExtending.d.ts +4 -0
  165. package/build/types/util/IncludeValuesExtending.d.ts.map +1 -0
  166. package/package.json +2 -2
@@ -1,5 +1,5 @@
1
- import { A as Attachment, M as MediaReference, a as AttachmentUpload, O as ObjectTypeDefinition, b as OsdkBase, c as OsdkObjectPrimaryKeyType, d as ObjectSet, I as InterfaceDefinition, R as ReleaseStatus, e as OsdkMetadata, P as PropertyValueWireToClient, f as PrimaryKeyTypes } from './ObjectSet-C2x3lIr7.cjs';
2
- export { g as AggregateOpts, h as AggregateOptsThatErrorsAndDisallowsOrderingWithMultipleGroupBy, k as AggregationClause, i as AggregationResultsWithGroups, j as AggregationResultsWithoutGroups, l as AggregationsResults, t as AllGroupByValues, w as AsyncIterArgs, x as Augment, y as Augments, Q as BaseObjectSet, a1 as BaseWirePropertyTypes, Z as CompileTimeMetadata, a4 as ConvertProps, r as DerivedProperty, D as DistanceUnitMapping, s as DurationMapping, F as FetchPageArgs, C as FetchPageResult, G as GeoFilterOptions, m as GeoFilter_Intersects, n as GeoFilter_Within, a8 as GeotimeSeriesProperty, u as GroupByClause, v as GroupByRange, U as InterfaceMetadata, ad as LinkNames, ac as LinkedType, H as Media, J as MediaMetadata, N as NullabilityAdherence, _ as ObjectMetadata, X as ObjectOrInterfaceDefinition, T as ObjectSetSubscription, a5 as Osdk, q as OsdkObjectLinksObject, p as OsdkObjectPropertyType, a6 as PageResult, o as PossibleWhereClauseFilters, a3 as PrimaryKeyType, $ as PropertyDef, Y as PropertyKeys, L as Result, z as SelectArg, B as SelectArgToKeys, S as SingleLinkAccessor, E as SingleOsdkResult, a9 as TimeSeriesPoint, aa as TimeSeriesProperty, ab as TimeSeriesQuery, a7 as TimeseriesDurationMapping, V as ValidAggregationKeys, a0 as VersionBound, W as WhereClause, a2 as WirePropertyTypes, K as isOk } from './ObjectSet-C2x3lIr7.cjs';
1
+ import { A as AttachmentUpload, M as MediaReference, a as Attachment, O as ObjectTypeDefinition, b as OsdkBase, c as OsdkObjectPrimaryKeyType, d as ObjectSet, I as InterfaceDefinition, C as CompileTimeMetadata, e as OsdkMetadata, R as ReleaseStatus, P as PropertyValueWireToClient, f as PrimaryKeyTypes, g as OsdkBaseWithObjectSpecifier } from './ObjectSet-DOR8vbgj.cjs';
2
+ export { h as AggregateOpts, i as AggregateOptsThatErrorsAndDisallowsOrderingWithMultipleGroupBy, l as AggregationClause, j as AggregationResultsWithGroups, k as AggregationResultsWithoutGroups, m as AggregationsResults, u as AllGroupByValues, x as AsyncIterArgs, y as Augment, z as Augments, U as BaseObjectSet, a3 as BaseWirePropertyTypes, a6 as ConvertProps, s as DerivedProperty, D as DistanceUnitMapping, t as DurationMapping, F as FetchPageArgs, H as FetchPageResult, G as GeoFilterOptions, n as GeoFilter_Intersects, o as GeoFilter_Within, aa as GeotimeSeriesProperty, v as GroupByClause, w as GroupByRange, Y as InterfaceMetadata, af as LinkNames, ae as LinkedType, K as Media, L as MediaMetadata, N as NullabilityAdherence, a0 as ObjectMetadata, Z as ObjectOrInterfaceDefinition, X as ObjectSetSubscription, $ as ObjectSpecifier, a7 as Osdk, r as OsdkObjectLinksObject, q as OsdkObjectPropertyType, a8 as PageResult, p as PossibleWhereClauseFilters, a5 as PrimaryKeyType, a1 as PropertyDef, _ as PropertyKeys, T as Result, B as SelectArg, E as SelectArgToKeys, S as SingleLinkAccessor, J as SingleOsdkResult, ab as TimeSeriesPoint, ac as TimeSeriesProperty, ad as TimeSeriesQuery, a9 as TimeseriesDurationMapping, V as ValidAggregationKeys, a2 as VersionBound, W as WhereClause, a4 as WirePropertyTypes, Q as isOk } from './ObjectSet-DOR8vbgj.cjs';
3
3
  import 'type-fest';
4
4
  import 'geojson';
5
5
 
@@ -37,6 +37,8 @@ interface DataValueWireToClient {
37
37
  struct: Record<string, any>;
38
38
  set: Set<any>;
39
39
  objectType: string;
40
+ geohash: GeoJSON.Point;
41
+ geoshape: GeoJSON.GeoJSON;
40
42
  }
41
43
  /**
42
44
  * Map from the DataValue type to the typescript type that we accept
@@ -74,6 +76,8 @@ interface DataValueClientToWire {
74
76
  }[];
75
77
  struct: Record<string, any>;
76
78
  objectType: string;
79
+ geohash: GeoJSON.Point;
80
+ geoshape: GeoJSON.GeoJSON;
77
81
  }
78
82
  type AllowedBucketTypes$1 = string | number | boolean;
79
83
  type AllowedBucketKeyTypes$1 = AllowedBucketTypes$1 | {
@@ -88,7 +92,9 @@ interface ObjectEdits {
88
92
  type: "edits";
89
93
  addedObjects: Array<ObjectReference>;
90
94
  modifiedObjects: Array<ObjectReference>;
95
+ deletedObjects?: Array<ObjectReference>;
91
96
  addedLinks: Array<LinkReference>;
97
+ deletedLinks?: Array<LinkReference>;
92
98
  deletedObjectsCount: number;
93
99
  deletedLinksCount: number;
94
100
  }
@@ -96,7 +102,9 @@ interface LargeScaleObjectEdits {
96
102
  type: "largeScaleEdits";
97
103
  addedObjects?: never;
98
104
  modifiedObjects?: never;
105
+ deletedObjects?: never;
99
106
  addedLinks?: never;
107
+ deletedLinks?: never;
100
108
  deletedObjectsCount?: never;
101
109
  deletedLinksCount?: never;
102
110
  }
@@ -191,9 +199,9 @@ declare namespace ActionParam {
191
199
  * Helper type to convert action definition parameter interface types to typescript types
192
200
  */
193
201
  type InterfaceType<T extends InterfaceDefinition> = {
194
- $objectType: NonNullable<T["__DefinitionMetadata"]> extends {
202
+ $objectType: CompileTimeMetadata<T> extends {
195
203
  implementedBy: infer U;
196
- } ? (U extends ReadonlyArray<string> ? U[number] : string) : string;
204
+ } ? (U extends ReadonlyArray<never> ? string : U extends ReadonlyArray<string> ? U[number] : string) : string;
197
205
  $primaryKey: string | number;
198
206
  };
199
207
  type StructType<T extends Record<string, keyof DataValueClientToWire>> = {
@@ -230,7 +238,7 @@ declare namespace ActionMetadata {
230
238
  nullable?: boolean;
231
239
  }
232
240
  namespace DataType {
233
- type BaseActionParameterTypes = "boolean" | "string" | "integer" | "long" | "double" | "datetime" | "timestamp" | "attachment" | "marking" | "mediaReference" | "objectType";
241
+ type BaseActionParameterTypes = "boolean" | "string" | "integer" | "long" | "double" | "datetime" | "timestamp" | "attachment" | "marking" | "mediaReference" | "objectType" | "geoshape" | "geohash";
234
242
  interface Object<T_Target extends ObjectTypeDefinition = never> {
235
243
  __OsdkTargetType?: T_Target;
236
244
  type: "object";
@@ -291,7 +299,7 @@ interface QueryDefinition<T = any> {
291
299
  type QueryParameterDefinition<T_Target extends ObjectTypeDefinition = any> = {
292
300
  description?: string;
293
301
  } & QueryDataTypeDefinition<T_Target>;
294
- type QueryDataTypeDefinition<T_Target extends ObjectTypeDefinition = any> = PrimitiveDataType | ObjectQueryDataType<T_Target> | ObjectSetQueryDataType<T_Target> | SetQueryDataType | UnionQueryDataType | StructQueryDataType | TwoDimensionalAggregationDataType | ThreeDimensionalAggregationDataType;
302
+ type QueryDataTypeDefinition<T_Target extends ObjectTypeDefinition = any> = PrimitiveDataType | ObjectQueryDataType<T_Target> | ObjectSetQueryDataType<T_Target> | SetQueryDataType | UnionQueryDataType | StructQueryDataType | TwoDimensionalAggregationDataType | ThreeDimensionalAggregationDataType | MapDataType;
295
303
  type BaseQueryDataTypeDefinition<T extends string> = {
296
304
  multiplicity?: boolean;
297
305
  nullable?: boolean;
@@ -322,6 +330,10 @@ interface TwoDimensionalAggregationDataType extends BaseQueryDataTypeDefinition<
322
330
  interface ThreeDimensionalAggregationDataType extends BaseQueryDataTypeDefinition<"threeDimensionalAggregation"> {
323
331
  threeDimensionalAggregation: ThreeDimensionalQueryAggregationDefinition;
324
332
  }
333
+ interface MapDataType extends BaseQueryDataTypeDefinition<"map"> {
334
+ keyType: QueryDataTypeDefinition;
335
+ valueType: QueryDataTypeDefinition;
336
+ }
325
337
  type AggregationKeyDataType<V = any> = SimpleAggregationKeyDataType<V> | RangeAggregationKeyDataType<V>;
326
338
  interface SimpleAggregationKeyDataType<V = any> {
327
339
  keyType: Exclude<AggregationKeyTypes, "range">;
@@ -403,7 +415,7 @@ declare namespace QueryResult {
403
415
  /**
404
416
  * Helper type to convert action definition parameter object types to typescript types
405
417
  */
406
- type ObjectType<T extends ObjectTypeDefinition> = OsdkBase<T>;
418
+ type ObjectType<T extends ObjectTypeDefinition> = OsdkBaseWithObjectSpecifier<T>;
407
419
  /**
408
420
  * Helper type to convert action definition parameter object sets to typescript types
409
421
  */
@@ -413,4 +425,24 @@ declare namespace QueryResult {
413
425
  type ThreeDimensionalAggregationType<OUT extends AggregationKeyTypes | RangeKey<any>, IN extends AggregationKeyTypes | RangeKey<any>, V extends AggregationValueTypes> = ThreeDimensionalAggregation<OUT extends AggregationKeyTypes ? AggKeyWireToClient<OUT> : OUT, IN extends AggregationKeyTypes ? AggKeyWireToClient<IN> : IN, AggValueWireToClient<V>>;
414
426
  }
415
427
 
416
- export { type ActionDefinition, type ActionEditResponse, ActionMetadata, ActionParam, type ActionReturnTypeForOptions, type ActionValidationResponse, type AllowedBucketKeyTypes$1 as AllowedBucketKeyTypes, type AllowedBucketTypes$1 as AllowedBucketTypes, type ApplyActionOptions, type ApplyBatchActionOptions, Attachment, AttachmentUpload, type DataValueClientToWire, type DataValueWireToClient, InterfaceDefinition, MediaReference, type ObjectQueryDataType, type ObjectSet, type ObjectSetQueryDataType, ObjectTypeDefinition, type OntologyMetadata, OsdkBase, type OsdkObject, PrimaryKeyTypes, PropertyValueWireToClient, type QueryDataTypeDefinition, type QueryDefinition, type QueryMetadata, QueryParam, type QueryParameterDefinition, QueryResult, type ThreeDimensionalQueryAggregationDefinition, type TwoDimensionalQueryAggregationDefinition };
428
+ interface Logger {
429
+ trace: Logger.LogFn;
430
+ debug: Logger.LogFn;
431
+ fatal: Logger.LogFn;
432
+ error: Logger.LogFn;
433
+ warn: Logger.LogFn;
434
+ info: Logger.LogFn;
435
+ isLevelEnabled(level: string): boolean;
436
+ child(bindings: Record<string, any>, options?: {
437
+ level?: string;
438
+ msgPrefix?: string;
439
+ }): Logger;
440
+ }
441
+ declare namespace Logger {
442
+ interface LogFn {
443
+ (obj: unknown, msg?: string, ...args: any[]): void;
444
+ (msg: string, ...args: any[]): void;
445
+ }
446
+ }
447
+
448
+ export { type ActionDefinition, type ActionEditResponse, ActionMetadata, ActionParam, type ActionReturnTypeForOptions, type ActionValidationResponse, type AllowedBucketKeyTypes$1 as AllowedBucketKeyTypes, type AllowedBucketTypes$1 as AllowedBucketTypes, type ApplyActionOptions, type ApplyBatchActionOptions, Attachment, AttachmentUpload, CompileTimeMetadata, type DataValueClientToWire, type DataValueWireToClient, InterfaceDefinition, Logger, MediaReference, type ObjectQueryDataType, type ObjectSet, type ObjectSetQueryDataType, ObjectTypeDefinition, type OntologyMetadata, OsdkBase, type OsdkObject, PrimaryKeyTypes, PropertyValueWireToClient, type QueryDataTypeDefinition, type QueryDefinition, type QueryMetadata, QueryParam, type QueryParameterDefinition, QueryResult, type Range, type ThreeDimensionalAggregation, type ThreeDimensionalQueryAggregationDefinition, type TwoDimensionalAggregation, type TwoDimensionalQueryAggregationDefinition };
@@ -14,6 +14,13 @@ var __EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid = {
14
14
  version: "2.1.0"
15
15
  };
16
16
 
17
+ // src/experimental/fetchPageByRid.ts
18
+ var __EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid = {
19
+ name: "__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid",
20
+ type: "experiment",
21
+ version: "2.2.0"
22
+ };
23
+
17
24
  // src/experimental/getBulkLinks.ts
18
25
  var __EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks = {
19
26
  name: "__EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks",
@@ -23,6 +30,7 @@ var __EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks = {
23
30
 
24
31
  exports.__EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference = __EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference;
25
32
  exports.__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid = __EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid;
33
+ exports.__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid = __EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid;
26
34
  exports.__EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks = __EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks;
27
35
  //# sourceMappingURL=unstable.cjs.map
28
36
  //# sourceMappingURL=unstable.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/experimental/createMediaReference.ts","../../../src/experimental/fetchOneByRid.ts","../../../src/experimental/getBulkLinks.ts"],"names":[],"mappings":";;;AA6BO,IAAM,uDAA0D,GAAA;AAAA,EACrE,IAAM,EAAA,yDAAA;AAAA,EACN,IAAM,EAAA,YAAA;AAAA,EACN,OAAS,EAAA;AACX;;;ACjBO,IAAM,gDAAmD,GAAA;AAAA,EAC9D,IAAM,EAAA,kDAAA;AAAA,EACN,IAAM,EAAA,YAAA;AAAA,EACN,OAAS,EAAA;AACX;;;ACJO,IAAM,+CAAkD,GAAA;AAAA,EAC7D,IAAM,EAAA,iDAAA;AAAA,EACN,IAAM,EAAA,YAAA;AAAA,EACN,OAAS,EAAA;AACX","file":"unstable.cjs","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\n/**\n * @experimental This feature is experimental and might change in the future.\n *\n * Uploads a media item to the media property of the specified object type.\n *\n * @param data - Data to upload as media item\n * @param fileName - Name that will be assigned as path to the uploaded media item.\n * @param objectTypeApi - Api name of the object type to which the media item will be uploaded.\n * @param propertyTypeApi - Api name of the media reference property of the corresponding object type to which the media item will be uploaded.\n *\n * @returns media reference of the uploaded media item.\n */\n\nexport const __EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference = {\n name: \"__EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference\",\n type: \"experiment\",\n version: \"2.1.0\"\n};","/*\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 const __EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid = {\n name: \"__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid\",\n type: \"experiment\",\n version: \"2.1.0\"\n};","/*\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 const __EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks = {\n name: \"__EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks\",\n type: \"experiment\",\n version: \"2.0.8\"\n};"]}
1
+ {"version":3,"sources":["../../../src/experimental/createMediaReference.ts","../../../src/experimental/fetchOneByRid.ts","../../../src/experimental/fetchPageByRid.ts","../../../src/experimental/getBulkLinks.ts"],"names":[],"mappings":";;;AA6BO,IAAM,uDAA0D,GAAA;AAAA,EACrE,IAAM,EAAA,yDAAA;AAAA,EACN,IAAM,EAAA,YAAA;AAAA,EACN,OAAS,EAAA;AACX;;;ACjBO,IAAM,gDAAmD,GAAA;AAAA,EAC9D,IAAM,EAAA,kDAAA;AAAA,EACN,IAAM,EAAA,YAAA;AAAA,EACN,OAAS,EAAA;AACX;;;ACJO,IAAM,iDAAoD,GAAA;AAAA,EAC/D,IAAM,EAAA,mDAAA;AAAA,EACN,IAAM,EAAA,YAAA;AAAA,EACN,OAAS,EAAA;AACX;;;ACJO,IAAM,+CAAkD,GAAA;AAAA,EAC7D,IAAM,EAAA,iDAAA;AAAA,EACN,IAAM,EAAA,YAAA;AAAA,EACN,OAAS,EAAA;AACX","file":"unstable.cjs","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\n/**\n * @experimental This feature is experimental and might change in the future.\n *\n * Uploads a media item to the media property of the specified object type.\n *\n * @param data - Data to upload as media item\n * @param fileName - Name that will be assigned as path to the uploaded media item.\n * @param objectType - Object type to which the media item will be uploaded.\n * @param propertyType - Media reference property of the corresponding object type to which the media item will be uploaded.\n *\n * @returns media reference of the uploaded media item.\n */\n\nexport const __EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference = {\n name: \"__EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference\",\n type: \"experiment\",\n version: \"2.1.0\"\n};","/*\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 const __EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid = {\n name: \"__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid\",\n type: \"experiment\",\n version: \"2.1.0\"\n};","/*\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 const __EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid = {\n name: \"__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid\",\n type: \"experiment\",\n version: \"2.2.0\"\n};","/*\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 const __EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks = {\n name: \"__EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks\",\n type: \"experiment\",\n version: \"2.0.8\"\n};"]}
@@ -1,5 +1,5 @@
1
- import { M as MediaReference, O as ObjectTypeDefinition, Y as PropertyKeys, N as NullabilityAdherence, z as SelectArg, a5 as Osdk, ae as ExtractOptions, b as OsdkBase, X as ObjectOrInterfaceDefinition } from '../ObjectSet-C2x3lIr7.cjs';
2
- export { af as MinimalObjectSet } from '../ObjectSet-C2x3lIr7.cjs';
1
+ import { Z as ObjectOrInterfaceDefinition, _ as PropertyKeys, M as MediaReference, O as ObjectTypeDefinition, N as NullabilityAdherence, B as SelectArg, a7 as Osdk, ag as ExtractOptions, F as FetchPageArgs, H as FetchPageResult, b as OsdkBase } from '../ObjectSet-DOR8vbgj.cjs';
2
+ export { ah as MinimalObjectSet } from '../ObjectSet-DOR8vbgj.cjs';
3
3
  import 'type-fest';
4
4
  import 'geojson';
5
5
 
@@ -18,16 +18,16 @@ type ExperimentFns<B extends Experiment<string, string>> = NonNullable<B["brande
18
18
  *
19
19
  * @param data - Data to upload as media item
20
20
  * @param fileName - Name that will be assigned as path to the uploaded media item.
21
- * @param objectTypeApi - Api name of the object type to which the media item will be uploaded.
22
- * @param propertyTypeApi - Api name of the media reference property of the corresponding object type to which the media item will be uploaded.
21
+ * @param objectType - Object type to which the media item will be uploaded.
22
+ * @param propertyType - Media reference property of the corresponding object type to which the media item will be uploaded.
23
23
  *
24
24
  * @returns media reference of the uploaded media item.
25
25
  */
26
- type createMediaReference = (args: {
26
+ type createMediaReference = <Q extends ObjectOrInterfaceDefinition, const L extends PropertyKeys.Filtered<Q, "mediaReference">>(args: {
27
27
  data: Blob;
28
28
  fileName: string;
29
- objectTypeApi: string;
30
- propertyTypeApi: string;
29
+ objectType: Q;
30
+ propertyType: L;
31
31
  }) => Promise<MediaReference>;
32
32
  declare const __EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference: Experiment<"2.1.0", "__EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference", {
33
33
  createMediaReference: createMediaReference;
@@ -38,10 +38,15 @@ declare const __EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid: Experiment<"2.1.
38
38
  fetchOneByRid: fetchOneByRidFn;
39
39
  }>;
40
40
 
41
+ type fetchPageByRidFn = <Q extends ObjectOrInterfaceDefinition, const L extends PropertyKeys<Q>, const R extends boolean, const S extends NullabilityAdherence, const T extends boolean>(objectType: Q, rids: string[], options?: FetchPageArgs<Q, L, R, any, S, T>) => Promise<FetchPageResult<Q, L, R, S, T>>;
42
+ declare const __EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid: Experiment<"2.2.0", "__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid", {
43
+ fetchPageByRid: fetchPageByRidFn;
44
+ }>;
45
+
41
46
  interface EXPERIMENTAL_BulkLinkResult {
42
47
  object: OsdkBase<any>;
43
48
  linkApiName: string;
44
- otherObjectApiName: string | undefined;
49
+ otherObjectApiName: string | null | undefined;
45
50
  otherObjectPk: unknown;
46
51
  }
47
52
 
@@ -50,4 +55,4 @@ declare const __EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks: Experiment<"2.0.8
50
55
  getBulkLinks: getBulkLinksFn;
51
56
  }>;
52
57
 
53
- export { type EXPERIMENTAL_BulkLinkResult, type Experiment, type ExperimentFns, __EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference, __EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid, __EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks };
58
+ export { type EXPERIMENTAL_BulkLinkResult, type Experiment, type ExperimentFns, __EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference, __EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid, __EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid, __EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks };
@@ -0,0 +1,17 @@
1
+ /*
2
+ * Copyright 2024 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export let Logger;
17
+ //# sourceMappingURL=Logger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Logger.js","names":["Logger"],"sources":["Logger.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 interface Logger {\n trace: Logger.LogFn;\n debug: Logger.LogFn;\n fatal: Logger.LogFn;\n error: Logger.LogFn;\n warn: Logger.LogFn;\n info: Logger.LogFn;\n\n isLevelEnabled(level: string): boolean;\n\n child(\n bindings: Record<string, any>,\n options?: { level?: string; msgPrefix?: string },\n ): Logger;\n}\n\nexport namespace Logger {\n export interface LogFn {\n (obj: unknown, msg?: string, ...args: any[]): void;\n (msg: string, ...args: any[]): void;\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAdA,WAgCiBA,MAAM","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"OsdkBase.js","names":[],"sources":["OsdkBase.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 { PropertyValueWireToClient } from \"./mapping/PropertyValueMapping.js\";\nimport type { ObjectOrInterfaceDefinition } from \"./ontology/ObjectOrInterface.js\";\nimport type { ObjectTypeDefinition } from \"./ontology/ObjectTypeDefinition.js\";\nimport type { PrimaryKeyTypes } from \"./ontology/PrimaryKeyTypes.js\";\nimport type { OsdkObjectPrimaryKeyType } from \"./OsdkObjectPrimaryKeyType.js\";\n\nexport type OsdkBase<\n Q extends ObjectOrInterfaceDefinition,\n> = {\n readonly $apiName: Q[\"apiName\"];\n\n readonly $objectType: string;\n\n readonly $primaryKey: PrimaryKeyType<Q>;\n\n readonly $title: string | undefined;\n};\n\nexport type PrimaryKeyType<Q extends ObjectOrInterfaceDefinition> =\n & (Q extends ObjectTypeDefinition ? OsdkObjectPrimaryKeyType<Q>\n : unknown)\n // if the type is `unknown` then the next line will\n // restrict it down to all valid primary key types\n & PropertyValueWireToClient[PrimaryKeyTypes];\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"OsdkBase.js","names":[],"sources":["OsdkBase.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 { PropertyValueWireToClient } from \"./mapping/PropertyValueMapping.js\";\nimport type { ObjectOrInterfaceDefinition } from \"./ontology/ObjectOrInterface.js\";\nimport type { ObjectSpecifier } from \"./ontology/ObjectSpecifier.js\";\nimport type { ObjectTypeDefinition } from \"./ontology/ObjectTypeDefinition.js\";\nimport type { PrimaryKeyTypes } from \"./ontology/PrimaryKeyTypes.js\";\nimport type { OsdkObjectPrimaryKeyType } from \"./OsdkObjectPrimaryKeyType.js\";\n\nexport type OsdkBase<\n Q extends ObjectOrInterfaceDefinition,\n> = {\n readonly $apiName: Q[\"apiName\"];\n\n readonly $objectType: string;\n\n readonly $primaryKey: PrimaryKeyType<Q>;\n\n readonly $title: string | undefined;\n};\n\nexport interface OsdkBaseWithObjectSpecifier<\n Q extends ObjectOrInterfaceDefinition,\n> extends OsdkBase<Q> {\n readonly $objectSpecifier: ObjectSpecifier<Q>;\n}\n\nexport type PrimaryKeyType<Q extends ObjectOrInterfaceDefinition> =\n & (Q extends ObjectTypeDefinition ? OsdkObjectPrimaryKeyType<Q>\n : unknown)\n // if the type is `unknown` then the next line will\n // restrict it down to all valid primary key types\n & PropertyValueWireToClient[PrimaryKeyTypes];\n"],"mappings":"","ignoreList":[]}
@@ -14,15 +14,13 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  /**
17
+ * Older version of this helper that allows for `$rid` and co in
18
+ * the properties field.
17
19
  * @param FROM - the interface or object type to convert from
18
20
  * @param TO - the interface or object type to convert to
19
21
  * @param P - the property(s) to convert
20
22
  */
21
23
  /** DO NOT EXPORT FROM PACKAGE */
22
- /**
23
- * @param P The properties to add from Q
24
- * @param Z The existing underlying properties
25
- */
26
24
  /**
27
25
  * Use `Osdk.Instance` or `YourType.OsdkInstance`
28
26
  */
@@ -1 +1 @@
1
- {"version":3,"file":"OsdkObjectFrom.js","names":["Osdk"],"sources":["OsdkObjectFrom.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 DefaultToFalse,\n OsdkObjectLinksObject,\n} from \"./definitions/LinkDefinitions.js\";\nimport type { NullabilityAdherence } from \"./object/FetchPageArgs.js\";\nimport type { UnionIfTrue } from \"./object/FetchPageResult.js\";\nimport type { InterfaceDefinition } from \"./ontology/InterfaceDefinition.js\";\nimport type {\n ObjectOrInterfaceDefinition,\n PropertyKeys,\n} from \"./ontology/ObjectOrInterface.js\";\nimport type {\n CompileTimeMetadata,\n ObjectTypeDefinition,\n} from \"./ontology/ObjectTypeDefinition.js\";\nimport type { SimplePropertyDef } from \"./ontology/SimplePropertyDef.js\";\nimport type { OsdkBase } from \"./OsdkBase.js\";\n\ntype DropDollarOptions<T extends string> = Exclude<\n T,\n \"$rid\" | \"$all\" | \"$notStrict\"\n>;\n\ntype DropDollarAll<T extends string> = Exclude<\n T,\n \"$all\"\n>;\n\ntype SpecialOsdkPropParams =\n | \"$all\"\n | \"$rid\"\n | \"$strict\"\n | \"$notStrict\";\n\ntype ValidOsdkPropParams<Q extends ObjectOrInterfaceDefinition> =\n | SpecialOsdkPropParams\n | PropertyKeys<Q>;\n\nexport type ApiNameAsString<\n T extends ObjectOrInterfaceDefinition,\n> = CompileTimeMetadata<T>[\"apiName\"];\n\nexport type JustProps<\n T extends ObjectOrInterfaceDefinition,\n P extends ValidOsdkPropParams<T>,\n> = P extends \"$all\" ? PropertyKeys<T>\n : Exclude<P, SpecialOsdkPropParams>;\n\nexport type PropMapToObject<\n FROM extends ObjectOrInterfaceDefinition,\n TO extends ObjectTypeDefinition,\n> = NonNullable<CompileTimeMetadata<TO>[\"interfaceMap\"]>[ApiNameAsString<FROM>];\n\nexport type MapPropNamesToObjectType<\n FROM extends ObjectOrInterfaceDefinition,\n TO extends ObjectTypeDefinition,\n P extends ValidOsdkPropParams<FROM>,\n> = PropMapToObject<\n FROM,\n TO\n>[JustProps<FROM, P> & keyof PropMapToObject<FROM, TO>];\n\nexport type PropMapToInterface<\n FROM extends ObjectTypeDefinition,\n TO extends InterfaceDefinition,\n> = NonNullable<\n CompileTimeMetadata<FROM>[\"inverseInterfaceMap\"]\n>[ApiNameAsString<TO>];\n\nexport type MapPropNamesToInterface<\n FROM extends ObjectTypeDefinition,\n TO extends InterfaceDefinition,\n P extends ValidOsdkPropParams<FROM>,\n> = PropMapToInterface<\n FROM,\n TO\n>[JustProps<FROM, P> & keyof PropMapToInterface<FROM, TO>];\n/**\n * @param FROM - the interface or object type to convert from\n * @param TO - the interface or object type to convert to\n * @param P - the property(s) to convert\n */\nexport type ConvertProps<\n FROM extends ObjectOrInterfaceDefinition,\n TO extends ValidToFrom<FROM>,\n P extends ValidOsdkPropParams<FROM>,\n> = TO extends FROM ? P\n : TO extends ObjectTypeDefinition ? (\n UnionIfTrue<\n MapPropNamesToObjectType<FROM, TO, P>,\n P extends \"$rid\" ? true : false,\n \"$rid\"\n >\n )\n : TO extends InterfaceDefinition ? FROM extends ObjectTypeDefinition ? (\n UnionIfTrue<\n MapPropNamesToInterface<FROM, TO, P>,\n P extends \"$rid\" ? true : false,\n \"$rid\"\n >\n )\n : never\n : never;\n\n/** DO NOT EXPORT FROM PACKAGE */\nexport type ValidToFrom<\n FROM extends ObjectOrInterfaceDefinition,\n> = FROM extends InterfaceDefinition ? ObjectOrInterfaceDefinition\n : InterfaceDefinition;\n\n/**\n * @param P The properties to add from Q\n * @param Z The existing underlying properties\n */\ntype UnderlyingProps<\n Q extends ObjectOrInterfaceDefinition,\n P extends string,\n Z extends string,\n NEW_Q extends ValidToFrom<Q>,\n> =\n & Z\n & Q extends InterfaceDefinition\n ? NEW_Q extends ObjectTypeDefinition ? ConvertProps<Q, NEW_Q, P>\n : Z\n : Z;\n\nexport type IsNever<T> = [T] extends [never] ? true : false;\n\ntype ExtractPropsKeysFromOldPropsStyle<\n Q extends ObjectOrInterfaceDefinition,\n P extends ValidOsdkPropParams<Q>,\n> = P extends \"$all\" ? PropertyKeys<Q>\n : Exclude<P, \"$strict\" | \"$notStrict\" | \"$rid\">;\n\nexport type IsAny<T> = unknown extends T\n ? [keyof T] extends [never] ? false : true\n : false;\n\nexport type GetPropsKeys<\n Q extends ObjectOrInterfaceDefinition,\n P extends PropertyKeys<Q>,\n N extends boolean = false,\n> = IsNever<P> extends true ? N extends true ? never : PropertyKeys<Q>\n : IsAny<P> extends true ? PropertyKeys<Q>\n : P;\n\n/**\n * Use `Osdk.Instance` or `YourType.OsdkInstance`\n */\nexport type Osdk<\n Q extends ObjectOrInterfaceDefinition,\n OPTIONS extends string = never,\n P extends PropertyKeys<Q> = PropertyKeys<Q>,\n> =\n // no middle options is simplest\n IsNever<OPTIONS> extends true ? Osdk.Instance<Q, never, P>\n : IsAny<OPTIONS> extends true ? Osdk.Instance<Q, never, P>\n // Options only includes the two allowed in the new style\n : (IsNever<Exclude<OPTIONS, \"$rid\">>) extends true\n ? Osdk.Instance<Q, OPTIONS & \"$rid\", P>\n // else we are in the old style which was just Q and OPTIONS\n // and OPTIONS was $things + prop names\n : Osdk.Instance<\n Q,\n (\"$rid\" extends OPTIONS ? \"$rid\" : never),\n ExtractPropsKeysFromOldPropsStyle<Q, OPTIONS>\n >;\n\nexport namespace Osdk {\n export type Instance<\n Q extends ObjectOrInterfaceDefinition,\n OPTIONS extends never | \"$rid\" = never,\n P extends PropertyKeys<Q> = PropertyKeys<Q>,\n R extends Record<string, SimplePropertyDef> = {},\n > =\n & OsdkBase<Q>\n & Pick<\n CompileTimeMetadata<Q>[\"props\"],\n // If there aren't any additional properties, then we want GetPropsKeys to default to PropertyKeys<Q>\n GetPropsKeys<Q, P, [R] extends [{}] ? false : true>\n >\n & ([R] extends [never] ? {}\n : { [A in keyof R]: SimplePropertyDef.ToRuntimeProperty<R[A]> })\n & {\n readonly $link: Q extends { linksType?: any } ? Q[\"linksType\"]\n : Q extends ObjectTypeDefinition ? OsdkObjectLinksObject<Q>\n : never;\n\n readonly $as: <NEW_Q extends ValidToFrom<Q>>(\n type: NEW_Q | string,\n ) => Osdk.Instance<\n NEW_Q,\n OPTIONS,\n ConvertProps<Q, NEW_Q, P>\n >;\n\n readonly $clone: <NEW_PROPS extends PropertyKeys<Q>>(\n updatedObject?:\n | Osdk.Instance<Q, any, NEW_PROPS>\n | {\n [K in NEW_PROPS]?: CompileTimeMetadata<\n Q\n >[\"props\"][K];\n },\n ) => Osdk.Instance<Q, OPTIONS, P | NEW_PROPS>;\n }\n // We are hiding the $rid field if it wasn't requested as we want to discourage its use\n & (IsNever<OPTIONS> extends true ? {}\n : IsAny<OPTIONS> extends true ? {}\n : \"$rid\" extends OPTIONS ? { readonly $rid: string }\n : {});\n}\n\n/**\n * NOT EXPORTED FROM PACKAGE\n *\n * Anything you throw at this that is not `false` should always be `never`.\n *\n * This is structured in a way that it should always short circuit to never early.\n */\nexport type ExtractStrictOption<S extends NullabilityAdherence> =\n IsNever<S> extends true ? never\n : \"throw\" extends S ? never // catches any time \"throw\" still exists (including any)\n : \"drop\" extends S ? never // catches any time \"drop\" still exists (including any)\n : \"$notStrict\";\n\n/**\n * NOT EXPORTED FROM PACKAGE\n *\n * Anything you throw at this that is not exactly `true` should always be `never`.\n */\nexport type ExtractRidOption<R extends boolean> = // comment for readability\n IsNever<R> extends true ? never\n : DefaultToFalse<R> extends false ? never\n : \"$rid\";\n\n// not exported from package\nexport type ExtractOptions<\n R extends boolean,\n S extends NullabilityAdherence = NullabilityAdherence.Default,\n> = ExtractRidOption<R>;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA+EA;AACA;AACA;AACA;AACA;AAuBA;AAMA;AACA;AACA;AACA;AAiCA;AACA;AACA;AAFA,WAsBiBA,IAAI;AA6CrB;AACA;AACA;AACA;AACA;AACA;AACA;AAOA;AACA;AACA;AACA;AACA;AAMA","ignoreList":[]}
1
+ {"version":3,"file":"OsdkObjectFrom.js","names":["Osdk"],"sources":["OsdkObjectFrom.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 DefaultToFalse,\n OsdkObjectLinksObject,\n} from \"./definitions/LinkDefinitions.js\";\nimport type { NullabilityAdherence } from \"./object/FetchPageArgs.js\";\nimport type { UnionIfTrue } from \"./object/FetchPageResult.js\";\nimport type { InterfaceDefinition } from \"./ontology/InterfaceDefinition.js\";\nimport type {\n ObjectOrInterfaceDefinition,\n PropertyKeys,\n} from \"./ontology/ObjectOrInterface.js\";\nimport type {\n CompileTimeMetadata,\n ObjectTypeDefinition,\n} from \"./ontology/ObjectTypeDefinition.js\";\nimport type { SimplePropertyDef } from \"./ontology/SimplePropertyDef.js\";\nimport type { OsdkBaseWithObjectSpecifier } from \"./OsdkBase.js\";\n\ntype DropDollarOptions<T extends string> = Exclude<\n T,\n \"$rid\" | \"$all\" | \"$notStrict\"\n>;\n\ntype DropDollarAll<T extends string> = Exclude<\n T,\n \"$all\"\n>;\n\ntype SpecialOsdkPropParams =\n | \"$all\"\n | \"$rid\"\n | \"$strict\"\n | \"$notStrict\";\n\ntype ValidOsdkPropParams<Q extends ObjectOrInterfaceDefinition> =\n | SpecialOsdkPropParams\n | PropertyKeys<Q>;\n\nexport type ApiNameAsString<\n T extends ObjectOrInterfaceDefinition,\n> = CompileTimeMetadata<T>[\"apiName\"];\n\nexport type JustProps<\n T extends ObjectOrInterfaceDefinition,\n P extends ValidOsdkPropParams<T>,\n> = P extends \"$all\" ? PropertyKeys<T>\n : Exclude<P, SpecialOsdkPropParams>;\n\nexport type PropMapToObject<\n FROM extends ObjectOrInterfaceDefinition,\n TO extends ObjectTypeDefinition,\n> = NonNullable<CompileTimeMetadata<TO>[\"interfaceMap\"]>[ApiNameAsString<FROM>];\n\nexport type MapPropNamesToObjectType<\n FROM extends ObjectOrInterfaceDefinition,\n TO extends ObjectTypeDefinition,\n P extends ValidOsdkPropParams<FROM>,\n OPTIONS extends never | \"$rid\" | \"$allBaseProperties\" = never,\n> = \"$allBaseProperties\" extends OPTIONS\n ? PropertyKeys<FROM> extends P ? PropertyKeys<TO>\n : PropMapToObject<\n FROM,\n TO\n >[JustProps<FROM, P> & keyof PropMapToObject<FROM, TO>]\n : PropMapToObject<\n FROM,\n TO\n >[JustProps<FROM, P> & keyof PropMapToObject<FROM, TO>];\n\nexport type PropMapToInterface<\n FROM extends ObjectTypeDefinition,\n TO extends InterfaceDefinition,\n> = NonNullable<\n CompileTimeMetadata<FROM>[\"inverseInterfaceMap\"]\n>[ApiNameAsString<TO>];\n\nexport type MapPropNamesToInterface<\n FROM extends ObjectTypeDefinition,\n TO extends InterfaceDefinition,\n P extends ValidOsdkPropParams<FROM>,\n> = PropMapToInterface<\n FROM,\n TO\n>[JustProps<FROM, P> & keyof PropMapToInterface<FROM, TO>];\n/**\n * Older version of this helper that allows for `$rid` and co in\n * the properties field.\n * @param FROM - the interface or object type to convert from\n * @param TO - the interface or object type to convert to\n * @param P - the property(s) to convert\n */\nexport type ConvertProps<\n FROM extends ObjectOrInterfaceDefinition,\n TO extends ValidToFrom<FROM>,\n P extends ValidOsdkPropParams<FROM>,\n OPTIONS extends never | \"$rid\" | \"$allBaseProperties\" = never,\n> = TO extends FROM ? P\n : TO extends ObjectTypeDefinition ? (\n UnionIfTrue<\n MapPropNamesToObjectType<FROM, TO, P, OPTIONS>,\n P extends \"$rid\" ? true : false,\n \"$rid\"\n >\n )\n : TO extends InterfaceDefinition ? FROM extends ObjectTypeDefinition ? (\n UnionIfTrue<\n MapPropNamesToInterface<FROM, TO, P>,\n P extends \"$rid\" ? true : false,\n \"$rid\"\n >\n )\n : never\n : never;\n\n/** DO NOT EXPORT FROM PACKAGE */\nexport type ValidToFrom<\n FROM extends ObjectOrInterfaceDefinition,\n> = FROM extends InterfaceDefinition ? ObjectOrInterfaceDefinition\n : InterfaceDefinition;\n\nexport type IsNever<T> = [T] extends [never] ? true : false;\n\ntype ExtractPropsKeysFromOldPropsStyle<\n Q extends ObjectOrInterfaceDefinition,\n P extends ValidOsdkPropParams<Q>,\n> = P extends \"$all\" ? PropertyKeys<Q>\n : Exclude<P, \"$strict\" | \"$notStrict\" | \"$rid\">;\n\nexport type IsAny<T> = unknown extends T\n ? [keyof T] extends [never] ? false : true\n : false;\n\nexport type GetPropsKeys<\n Q extends ObjectOrInterfaceDefinition,\n P extends PropertyKeys<Q>,\n N extends boolean = false,\n> = IsNever<P> extends true ? N extends true ? never : PropertyKeys<Q>\n : IsAny<P> extends true ? PropertyKeys<Q>\n : P;\n\n/**\n * Use `Osdk.Instance` or `YourType.OsdkInstance`\n */\nexport type Osdk<\n Q extends ObjectOrInterfaceDefinition,\n OPTIONS extends string = never,\n P extends PropertyKeys<Q> = PropertyKeys<Q>,\n> =\n // no middle options is simplest\n IsNever<OPTIONS> extends true ? Osdk.Instance<Q, never, P>\n : IsAny<OPTIONS> extends true ? Osdk.Instance<Q, never, P>\n // Options only includes the two allowed in the new style\n : (IsNever<Exclude<OPTIONS, \"$rid\">>) extends true\n ? Osdk.Instance<Q, OPTIONS & \"$rid\", P>\n // else we are in the old style which was just Q and OPTIONS\n // and OPTIONS was $things + prop names\n : Osdk.Instance<\n Q,\n (\"$rid\" extends OPTIONS ? \"$rid\" : never),\n ExtractPropsKeysFromOldPropsStyle<Q, OPTIONS>\n >;\n\nexport namespace Osdk {\n export type Instance<\n Q extends ObjectOrInterfaceDefinition,\n OPTIONS extends never | \"$rid\" | \"$allBaseProperties\" = never,\n P extends PropertyKeys<Q> = PropertyKeys<Q>,\n R extends Record<string, SimplePropertyDef> = {},\n > =\n & OsdkBaseWithObjectSpecifier<Q>\n & Pick<\n CompileTimeMetadata<Q>[\"props\"],\n // If there aren't any additional properties, then we want GetPropsKeys to default to PropertyKeys<Q>\n GetPropsKeys<Q, P, [R] extends [{}] ? false : true>\n >\n & ([R] extends [never] ? {}\n : { [A in keyof R]: SimplePropertyDef.ToRuntimeProperty<R[A]> })\n & {\n readonly $link: Q extends { linksType?: any } ? Q[\"linksType\"]\n : Q extends ObjectTypeDefinition ? OsdkObjectLinksObject<Q>\n : never;\n\n readonly $as: <NEW_Q extends ValidToFrom<Q>>(\n type: NEW_Q | string,\n ) => Osdk.Instance<\n NEW_Q,\n OPTIONS,\n ConvertProps<Q, NEW_Q, P, OPTIONS>\n >;\n\n readonly $clone: <NEW_PROPS extends PropertyKeys<Q>>(\n updatedObject?:\n | Osdk.Instance<Q, any, NEW_PROPS>\n | {\n [K in NEW_PROPS]?: CompileTimeMetadata<\n Q\n >[\"props\"][K];\n },\n ) => Osdk.Instance<Q, OPTIONS, P | NEW_PROPS>;\n }\n // We are hiding the $rid field if it wasn't requested as we want to discourage its use\n & (IsNever<OPTIONS> extends true ? {}\n : IsAny<OPTIONS> extends true ? {}\n : \"$rid\" extends OPTIONS ? { readonly $rid: string }\n : {});\n}\n\n/**\n * NOT EXPORTED FROM PACKAGE\n *\n * Anything you throw at this that is not `false` should always be `never`.\n *\n * This is structured in a way that it should always short circuit to never early.\n */\nexport type ExtractStrictOption<S extends NullabilityAdherence> =\n IsNever<S> extends true ? never\n : \"throw\" extends S ? never // catches any time \"throw\" still exists (including any)\n : \"drop\" extends S ? never // catches any time \"drop\" still exists (including any)\n : \"$notStrict\";\n\n/**\n * NOT EXPORTED FROM PACKAGE\n *\n * Anything you throw at this that is not exactly `true` should always be `never`.\n */\nexport type ExtractRidOption<R extends boolean> = // comment for readability\n IsNever<R> extends true ? never\n : DefaultToFalse<R> extends false ? never\n : \"$rid\";\n\nexport type ExtractAllPropertiesOption<T extends boolean> = // comment for readability\n IsNever<T> extends true ? never\n : DefaultToFalse<T> extends false ? never\n : \"$allBaseProperties\";\n\n// not exported from package\nexport type ExtractOptions<\n R extends boolean,\n S extends NullabilityAdherence = NullabilityAdherence.Default,\n T extends boolean = false,\n> = ExtractRidOption<R> | ExtractAllPropertiesOption<T>;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAsFA;AACA;AACA;AACA;AACA;AACA;AACA;AAwBA;AA0BA;AACA;AACA;AAFA,WAsBiBA,IAAI;AA6CrB;AACA;AACA;AACA;AACA;AACA;AACA;AAOA;AACA;AACA;AACA;AACA;AAWA","ignoreList":[]}
@@ -15,6 +15,7 @@
15
15
  */
16
16
 
17
17
  import { describe, expectTypeOf, it } from "vitest";
18
+ import { createMockObjectSet } from "./objectSet/ObjectSet.test.js";
18
19
  describe("ExtractOptions", () => {
19
20
  describe("NullabilityAdherence Generic", () => {
20
21
  it("does not add $notStrict for any", () => {
@@ -185,10 +186,9 @@ describe("ExtractOptions", () => {
185
186
  });
186
187
  });
187
188
  describe("Inferred return types from fetchPage work", () => {
188
- function createObjectSetChannel() {
189
- return {};
190
- }
189
+ const fauxObjectSet = createMockObjectSet();
191
190
  it("is not $notStrict", async () => {
191
+ await fauxObjectSet.fetchPage();
192
192
  expectTypeOf().branded.toEqualTypeOf();
193
193
  });
194
194
  });
@@ -1 +1 @@
1
- {"version":3,"file":"OsdkObjectFrom.test.js","names":["describe","expectTypeOf","it","toEqualTypeOf","branded","createObjectSetChannel"],"sources":["OsdkObjectFrom.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, expectTypeOf, it } from \"vitest\";\nimport type { NullabilityAdherence } from \"./object/FetchPageArgs.js\";\nimport type { ObjectSet } from \"./objectSet/ObjectSet.js\";\nimport type { ObjectOrInterfaceDefinition } from \"./ontology/ObjectOrInterface.js\";\nimport type { ExtractOptions, Osdk } from \"./OsdkObjectFrom.js\";\n\ndescribe(\"ExtractOptions\", () => {\n describe(\"NullabilityAdherence Generic\", () => {\n it(\"does not add $notStrict for any\", () => {\n expectTypeOf<ExtractOptions<any, any>>()\n .toEqualTypeOf<never>();\n });\n\n it(\"does not add $notStrict for never\", () => {\n expectTypeOf<ExtractOptions<any, never>>()\n .toEqualTypeOf<never>();\n });\n\n it(\"does not add $notStrict for false\", () => {\n expectTypeOf<ExtractOptions<any, false>>()\n .toEqualTypeOf<never>();\n });\n\n it(\"does not add $notStrict for throw\", () => {\n expectTypeOf<ExtractOptions<any, \"throw\">>()\n .toEqualTypeOf<never>();\n });\n\n it(\"does not add $notStrict for drop\", () => {\n expectTypeOf<ExtractOptions<any, \"drop\">>()\n .toEqualTypeOf<never>();\n });\n\n it(\"does not add $notStrict for drop | throw\", () => {\n expectTypeOf<ExtractOptions<any, \"drop\" | \"throw\">>()\n .toEqualTypeOf<never>();\n });\n\n it(\"does not add $notStrict for drop | false\", () => {\n expectTypeOf<ExtractOptions<any, \"drop\" | false>>()\n .toEqualTypeOf<never>();\n });\n it(\"does not add $notStrict for false | throw\", () => {\n expectTypeOf<ExtractOptions<any, false | \"throw\">>()\n .toEqualTypeOf<never>();\n });\n\n it(\"does not add $notStrict for drop | throw | false\", () => {\n expectTypeOf<ExtractOptions<any, \"drop\" | \"throw\" | false>>()\n .toEqualTypeOf<never>();\n });\n\n it(\"does not add $notStrict for NullabilityAdherence\", () => {\n expectTypeOf<ExtractOptions<any, NullabilityAdherence>>()\n .toEqualTypeOf<never>();\n });\n });\n\n describe(\"Rid Generic\", () => {\n it(\"does not add $rid for false\", () => {\n expectTypeOf<ExtractOptions<false, any>>().toEqualTypeOf<never>();\n });\n\n it(\"does add $rid for true\", () => {\n expectTypeOf<ExtractOptions<true, any>>().toEqualTypeOf<\"$rid\">();\n });\n\n it(\"does not add $rid for any\", () => {\n expectTypeOf<ExtractOptions<any, any>>().toEqualTypeOf<never>();\n });\n\n it(\"does not add $rid for never\", () => {\n expectTypeOf<ExtractOptions<never, any>>().toEqualTypeOf<never>();\n });\n\n it(\"does not add $rid for boolean\", () => {\n expectTypeOf<ExtractOptions<boolean, any>>().toEqualTypeOf<never>();\n });\n\n it(\"does not add $rid for true | false\", () => {\n expectTypeOf<ExtractOptions<true | false, any>>().toEqualTypeOf<never>();\n });\n });\n\n type quickAndDirty = {\n apiName: \"Foo\";\n type: \"object\";\n __DefinitionMetadata: {\n props: {\n name: string;\n foo: number | undefined;\n };\n strictProps: {\n name: string;\n foo: number;\n };\n apiName: \"Foo\";\n displayName: \"\";\n interfaceMap: {};\n inverseInterfaceMap: {};\n links: {};\n pluralDisplayName: \"\";\n primaryKeyApiName: \"\";\n primaryKeyType: \"string\";\n properties: {\n name: {\n type: \"string\";\n };\n foo: {\n type: \"integer\";\n };\n };\n rid: \"\";\n status: \"ACTIVE\";\n titleProperty: \"name\";\n type: \"object\";\n };\n };\n\n describe(\"Osdk.Instance\", () => {\n it(\"defaults to second argument never if omitted\", () => {\n type toCheck = Osdk.Instance<quickAndDirty>;\n expectTypeOf<toCheck>().toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never>\n >();\n\n // ensure its the normal props\n expectTypeOf<Pick<toCheck, \"name\" | \"foo\">>().toEqualTypeOf<\n quickAndDirty[\"__DefinitionMetadata\"][\"props\"]\n >();\n });\n\n it(\"defaults to second argument never if never\", () => {\n type toCheck = Osdk.Instance<quickAndDirty, never>;\n expectTypeOf<toCheck>().toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never>\n >();\n // ensure its the normal props\n expectTypeOf<Pick<toCheck, \"name\" | \"foo\">>().toEqualTypeOf<\n quickAndDirty[\"__DefinitionMetadata\"][\"props\"]\n >();\n });\n\n it(\"defaults to second argument never if any\", () => {\n type toCheck = Osdk.Instance<quickAndDirty, any>;\n expectTypeOf<toCheck>().branded.toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never>\n >();\n // ensure its the normal props\n expectTypeOf<Pick<toCheck, \"name\" | \"foo\">>().toEqualTypeOf<\n quickAndDirty[\"__DefinitionMetadata\"][\"props\"]\n >();\n });\n\n it(\"Cannot use $notStrict\", () => {\n // @ts-expect-error\n type toCheck = Osdk.Instance<quickAndDirty, \"$notStrict\">;\n\n expectTypeOf<toCheck>().branded\n // @ts-expect-error\n .toEqualTypeOf<Osdk.Instance<quickAndDirty, \"$notStrict\">>();\n // ensure its not the strict type\n expectTypeOf<Pick<toCheck, \"name\" | \"foo\">>().toEqualTypeOf<\n quickAndDirty[\"__DefinitionMetadata\"][\"props\"]\n >();\n });\n\n it(\"defaults to last argument all props if never\", () => {\n expectTypeOf<Osdk.Instance<quickAndDirty, never, never>>().branded\n .toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never, \"name\" | \"foo\">\n >();\n });\n\n it(\"defaults to last argument all props if any\", () => {\n expectTypeOf<Osdk.Instance<quickAndDirty, never, any>>().branded\n .toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never, \"name\" | \"foo\">\n >();\n });\n\n it(\"defaults to last argument exactly if specified\", () => {\n expectTypeOf<Osdk.Instance<quickAndDirty, never, \"name\">>().branded\n .toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never, \"name\">\n >();\n });\n });\n\n describe(\"Osdk<>\", () => {\n it(\"defaults to second argument never if omitted\", () => {\n type toCheck = Osdk<quickAndDirty>;\n expectTypeOf<toCheck>().toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never>\n >();\n\n // expect no rid\n expectTypeOf<keyof toCheck & \"$rid\">().toEqualTypeOf<never>();\n\n // ensure its the normal props\n expectTypeOf<Pick<toCheck, \"name\" | \"foo\">>().toEqualTypeOf<\n quickAndDirty[\"__DefinitionMetadata\"][\"props\"]\n >();\n });\n\n it(\"returns $rid if only thing specified\", () => {\n type toCheck = Osdk<quickAndDirty, \"$rid\">;\n expectTypeOf<toCheck>().toEqualTypeOf<\n Osdk.Instance<quickAndDirty, \"$rid\">\n >();\n\n // expect rid\n expectTypeOf<keyof toCheck & \"$rid\">().toEqualTypeOf<\"$rid\">();\n\n // ensure its the normal props\n expectTypeOf<Pick<toCheck, \"name\" | \"foo\">>().toEqualTypeOf<\n quickAndDirty[\"__DefinitionMetadata\"][\"props\"]\n >();\n });\n\n it(\"handles legacy properly: $rid and name\", () => {\n type toCheck = Osdk<quickAndDirty, \"$rid\" | \"name\">;\n expectTypeOf<toCheck>().toEqualTypeOf<\n Osdk.Instance<quickAndDirty, \"$rid\", \"name\">\n >();\n\n // expect rid\n expectTypeOf<keyof toCheck & \"$rid\">().toEqualTypeOf<\"$rid\">();\n\n // ensure its the strict type\n expectTypeOf<Pick<toCheck, \"name\">>().toEqualTypeOf<{\n name: quickAndDirty[\"__DefinitionMetadata\"][\"strictProps\"][\"name\"];\n }>();\n });\n\n it(\"handles legacy properly: $rid and $all\", () => {\n type toCheck = Osdk<quickAndDirty, \"$rid\" | \"$all\">;\n expectTypeOf<toCheck>().branded.toEqualTypeOf<\n Osdk.Instance<quickAndDirty, \"$rid\", \"name\" | \"foo\">\n >();\n\n // expect rid\n expectTypeOf<keyof toCheck & \"$rid\">().toEqualTypeOf<\"$rid\">();\n\n // ensure its the normal props\n expectTypeOf<Pick<toCheck, \"name\" | \"foo\">>().toEqualTypeOf<\n quickAndDirty[\"__DefinitionMetadata\"][\"props\"]\n >();\n });\n\n it(\"handles legacy properly: just $all\", () => {\n type toCheck = Osdk<quickAndDirty, \"$all\">;\n expectTypeOf<toCheck>().branded.toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never, \"name\" | \"foo\">\n >();\n\n // expect no rid\n expectTypeOf<keyof toCheck & \"$rid\">().toEqualTypeOf<never>();\n\n // ensure its the normal props\n expectTypeOf<Pick<toCheck, \"name\" | \"foo\">>().toEqualTypeOf<\n quickAndDirty[\"__DefinitionMetadata\"][\"props\"]\n >();\n });\n\n it(\"defaults to second argument never if never\", () => {\n type toCheck = Osdk<quickAndDirty, never>;\n expectTypeOf<toCheck>().toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never>\n >();\n // ensure its the normal props\n expectTypeOf<Pick<toCheck, \"name\" | \"foo\">>().toEqualTypeOf<\n quickAndDirty[\"__DefinitionMetadata\"][\"props\"]\n >();\n\n // expect no rid\n expectTypeOf<keyof toCheck & \"$rid\">().toEqualTypeOf<never>();\n });\n\n it(\"defaults to second argument never if any\", () => {\n type toCheck = Osdk<quickAndDirty, any>;\n expectTypeOf<toCheck>().branded.toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never>\n >();\n // ensure its the normal props\n expectTypeOf<Pick<toCheck, \"name\" | \"foo\">>().toEqualTypeOf<\n quickAndDirty[\"__DefinitionMetadata\"][\"props\"]\n >();\n\n // expect no rid\n expectTypeOf<keyof toCheck & \"$rid\">().toEqualTypeOf<never>();\n });\n\n it(\"Does not use $notStrict if requested with old type\", () => {\n type toCheck = Osdk<quickAndDirty, \"$notStrict\">;\n expectTypeOf<toCheck>().branded\n .toEqualTypeOf<Osdk.Instance<quickAndDirty, never>>();\n // ensure its not the strict type\n expectTypeOf<Pick<toCheck, \"name\" | \"foo\">>().toEqualTypeOf<\n quickAndDirty[\"__DefinitionMetadata\"][\"props\"]\n >();\n\n // expect no rid\n expectTypeOf<keyof toCheck & \"$rid\">().toEqualTypeOf<never>();\n });\n\n it(\"defaults to last argument all props if never\", () => {\n expectTypeOf<Osdk<quickAndDirty, never, never>>().branded\n .toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never, \"name\" | \"foo\">\n >();\n });\n\n it(\"defaults to last argument all props if any\", () => {\n expectTypeOf<Osdk<quickAndDirty, never, any>>().branded\n .toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never, \"name\" | \"foo\">\n >();\n });\n\n it(\"defaults to last argument exactly if specified\", () => {\n expectTypeOf<Osdk<quickAndDirty, never, \"name\">>()\n .toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never, \"name\">\n >();\n });\n });\n\n describe(\"Inferred return types from fetchPage work\", () => {\n function createObjectSetChannel<O extends ObjectOrInterfaceDefinition>(\n objectSet: ObjectSet<O>,\n ): Awaited<ReturnType<ObjectSet<O>[\"fetchPage\"]>>[\"data\"] {\n return {} as any;\n }\n\n class Helper<O extends ObjectOrInterfaceDefinition> {\n constructor(private objectSet: ObjectSet<O>) {}\n public go() {\n return createObjectSetChannel(this.objectSet);\n }\n }\n\n it(\"is not $notStrict\", async () => {\n expectTypeOf<ReturnType<Helper<quickAndDirty>[\"go\"]>>().branded\n .toEqualTypeOf<\n Osdk.Instance<quickAndDirty>[]\n >();\n });\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,QAAQ,EAAEC,YAAY,EAAEC,EAAE,QAAQ,QAAQ;AAMnDF,QAAQ,CAAC,gBAAgB,EAAE,MAAM;EAC/BA,QAAQ,CAAC,8BAA8B,EAAE,MAAM;IAC7CE,EAAE,CAAC,iCAAiC,EAAE,MAAM;MAC1CD,YAAY,CAA2B,CAAC,CACrCE,aAAa,CAAQ,CAAC;IAC3B,CAAC,CAAC;IAEFD,EAAE,CAAC,mCAAmC,EAAE,MAAM;MAC5CD,YAAY,CAA6B,CAAC,CACvCE,aAAa,CAAQ,CAAC;IAC3B,CAAC,CAAC;IAEFD,EAAE,CAAC,mCAAmC,EAAE,MAAM;MAC5CD,YAAY,CAA6B,CAAC,CACvCE,aAAa,CAAQ,CA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AQ,CAAC,2CAA2C,EAAE,MAAM;IAC1D,SAASK,sBAAsBA,CAAA,EAE2B;MACxD,OAAO,CAAC,CAAC;IACX;IASAH,EAAE,CAAC,mBAAmB,EAAE,YAAY;MAClCD,YAAY,CAA0C,CAAC,CAACG,OAAO,CAC5DD,aAAa,CAEZ,CAAC;IACP,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"OsdkObjectFrom.test.js","names":["describe","expectTypeOf","it","createMockObjectSet","toEqualTypeOf","branded","fauxObjectSet","fetchPage"],"sources":["OsdkObjectFrom.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, expectTypeOf, it } from \"vitest\";\nimport type { NullabilityAdherence } from \"./object/FetchPageArgs.js\";\nimport { createMockObjectSet } from \"./objectSet/ObjectSet.test.js\";\nimport type { ExtractOptions, Osdk } from \"./OsdkObjectFrom.js\";\n\ndescribe(\"ExtractOptions\", () => {\n describe(\"NullabilityAdherence Generic\", () => {\n it(\"does not add $notStrict for any\", () => {\n expectTypeOf<ExtractOptions<any, any>>()\n .toEqualTypeOf<never>();\n });\n\n it(\"does not add $notStrict for never\", () => {\n expectTypeOf<ExtractOptions<any, never>>()\n .toEqualTypeOf<never>();\n });\n\n it(\"does not add $notStrict for false\", () => {\n expectTypeOf<ExtractOptions<any, false>>()\n .toEqualTypeOf<never>();\n });\n\n it(\"does not add $notStrict for throw\", () => {\n expectTypeOf<ExtractOptions<any, \"throw\">>()\n .toEqualTypeOf<never>();\n });\n\n it(\"does not add $notStrict for drop\", () => {\n expectTypeOf<ExtractOptions<any, \"drop\">>()\n .toEqualTypeOf<never>();\n });\n\n it(\"does not add $notStrict for drop | throw\", () => {\n expectTypeOf<ExtractOptions<any, \"drop\" | \"throw\">>()\n .toEqualTypeOf<never>();\n });\n\n it(\"does not add $notStrict for drop | false\", () => {\n expectTypeOf<ExtractOptions<any, \"drop\" | false>>()\n .toEqualTypeOf<never>();\n });\n it(\"does not add $notStrict for false | throw\", () => {\n expectTypeOf<ExtractOptions<any, false | \"throw\">>()\n .toEqualTypeOf<never>();\n });\n\n it(\"does not add $notStrict for drop | throw | false\", () => {\n expectTypeOf<ExtractOptions<any, \"drop\" | \"throw\" | false>>()\n .toEqualTypeOf<never>();\n });\n\n it(\"does not add $notStrict for NullabilityAdherence\", () => {\n expectTypeOf<ExtractOptions<any, NullabilityAdherence>>()\n .toEqualTypeOf<never>();\n });\n });\n\n describe(\"Rid Generic\", () => {\n it(\"does not add $rid for false\", () => {\n expectTypeOf<ExtractOptions<false, any>>().toEqualTypeOf<never>();\n });\n\n it(\"does add $rid for true\", () => {\n expectTypeOf<ExtractOptions<true, any>>().toEqualTypeOf<\"$rid\">();\n });\n\n it(\"does not add $rid for any\", () => {\n expectTypeOf<ExtractOptions<any, any>>().toEqualTypeOf<never>();\n });\n\n it(\"does not add $rid for never\", () => {\n expectTypeOf<ExtractOptions<never, any>>().toEqualTypeOf<never>();\n });\n\n it(\"does not add $rid for boolean\", () => {\n expectTypeOf<ExtractOptions<boolean, any>>().toEqualTypeOf<never>();\n });\n\n it(\"does not add $rid for true | false\", () => {\n expectTypeOf<ExtractOptions<true | false, any>>().toEqualTypeOf<never>();\n });\n });\n\n type quickAndDirty = {\n apiName: \"Foo\";\n type: \"object\";\n __DefinitionMetadata: {\n props: {\n name: string;\n foo: number | undefined;\n };\n strictProps: {\n name: string;\n foo: number;\n };\n apiName: \"Foo\";\n displayName: \"\";\n interfaceMap: {};\n inverseInterfaceMap: {};\n links: {};\n pluralDisplayName: \"\";\n primaryKeyApiName: \"\";\n primaryKeyType: \"string\";\n properties: {\n name: {\n type: \"string\";\n };\n foo: {\n type: \"integer\";\n };\n };\n rid: \"\";\n status: \"ACTIVE\";\n titleProperty: \"name\";\n type: \"object\";\n };\n };\n\n describe(\"Osdk.Instance\", () => {\n it(\"defaults to second argument never if omitted\", () => {\n type toCheck = Osdk.Instance<quickAndDirty>;\n expectTypeOf<toCheck>().toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never>\n >();\n\n // ensure its the normal props\n expectTypeOf<Pick<toCheck, \"name\" | \"foo\">>().toEqualTypeOf<\n quickAndDirty[\"__DefinitionMetadata\"][\"props\"]\n >();\n });\n\n it(\"defaults to second argument never if never\", () => {\n type toCheck = Osdk.Instance<quickAndDirty, never>;\n expectTypeOf<toCheck>().toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never>\n >();\n // ensure its the normal props\n expectTypeOf<Pick<toCheck, \"name\" | \"foo\">>().toEqualTypeOf<\n quickAndDirty[\"__DefinitionMetadata\"][\"props\"]\n >();\n });\n\n it(\"defaults to second argument never if any\", () => {\n type toCheck = Osdk.Instance<quickAndDirty, any>;\n expectTypeOf<toCheck>().branded.toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never>\n >();\n // ensure its the normal props\n expectTypeOf<Pick<toCheck, \"name\" | \"foo\">>().toEqualTypeOf<\n quickAndDirty[\"__DefinitionMetadata\"][\"props\"]\n >();\n });\n\n it(\"Cannot use $notStrict\", () => {\n // @ts-expect-error\n type toCheck = Osdk.Instance<quickAndDirty, \"$notStrict\">;\n\n expectTypeOf<toCheck>().branded\n // @ts-expect-error\n .toEqualTypeOf<Osdk.Instance<quickAndDirty, \"$notStrict\">>();\n // ensure its not the strict type\n expectTypeOf<Pick<toCheck, \"name\" | \"foo\">>().toEqualTypeOf<\n quickAndDirty[\"__DefinitionMetadata\"][\"props\"]\n >();\n });\n\n it(\"defaults to last argument all props if never\", () => {\n expectTypeOf<Osdk.Instance<quickAndDirty, never, never>>().branded\n .toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never, \"name\" | \"foo\">\n >();\n });\n\n it(\"defaults to last argument all props if any\", () => {\n expectTypeOf<Osdk.Instance<quickAndDirty, never, any>>().branded\n .toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never, \"name\" | \"foo\">\n >();\n });\n\n it(\"defaults to last argument exactly if specified\", () => {\n expectTypeOf<Osdk.Instance<quickAndDirty, never, \"name\">>().branded\n .toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never, \"name\">\n >();\n });\n });\n\n describe(\"Osdk<>\", () => {\n it(\"defaults to second argument never if omitted\", () => {\n type toCheck = Osdk<quickAndDirty>;\n expectTypeOf<toCheck>().toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never>\n >();\n\n // expect no rid\n expectTypeOf<keyof toCheck & \"$rid\">().toEqualTypeOf<never>();\n\n // ensure its the normal props\n expectTypeOf<Pick<toCheck, \"name\" | \"foo\">>().toEqualTypeOf<\n quickAndDirty[\"__DefinitionMetadata\"][\"props\"]\n >();\n });\n\n it(\"returns $rid if only thing specified\", () => {\n type toCheck = Osdk<quickAndDirty, \"$rid\">;\n expectTypeOf<toCheck>().toEqualTypeOf<\n Osdk.Instance<quickAndDirty, \"$rid\">\n >();\n\n // expect rid\n expectTypeOf<keyof toCheck & \"$rid\">().toEqualTypeOf<\"$rid\">();\n\n // ensure its the normal props\n expectTypeOf<Pick<toCheck, \"name\" | \"foo\">>().toEqualTypeOf<\n quickAndDirty[\"__DefinitionMetadata\"][\"props\"]\n >();\n });\n\n it(\"handles legacy properly: $rid and name\", () => {\n type toCheck = Osdk<quickAndDirty, \"$rid\" | \"name\">;\n expectTypeOf<toCheck>().toEqualTypeOf<\n Osdk.Instance<quickAndDirty, \"$rid\", \"name\">\n >();\n\n // expect rid\n expectTypeOf<keyof toCheck & \"$rid\">().toEqualTypeOf<\"$rid\">();\n\n // ensure its the strict type\n expectTypeOf<Pick<toCheck, \"name\">>().toEqualTypeOf<{\n name: quickAndDirty[\"__DefinitionMetadata\"][\"strictProps\"][\"name\"];\n }>();\n });\n\n it(\"handles legacy properly: $rid and $all\", () => {\n type toCheck = Osdk<quickAndDirty, \"$rid\" | \"$all\">;\n expectTypeOf<toCheck>().branded.toEqualTypeOf<\n Osdk.Instance<quickAndDirty, \"$rid\", \"name\" | \"foo\">\n >();\n\n // expect rid\n expectTypeOf<keyof toCheck & \"$rid\">().toEqualTypeOf<\"$rid\">();\n\n // ensure its the normal props\n expectTypeOf<Pick<toCheck, \"name\" | \"foo\">>().toEqualTypeOf<\n quickAndDirty[\"__DefinitionMetadata\"][\"props\"]\n >();\n });\n\n it(\"handles legacy properly: just $all\", () => {\n type toCheck = Osdk<quickAndDirty, \"$all\">;\n expectTypeOf<toCheck>().branded.toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never, \"name\" | \"foo\">\n >();\n\n // expect no rid\n expectTypeOf<keyof toCheck & \"$rid\">().toEqualTypeOf<never>();\n\n // ensure its the normal props\n expectTypeOf<Pick<toCheck, \"name\" | \"foo\">>().toEqualTypeOf<\n quickAndDirty[\"__DefinitionMetadata\"][\"props\"]\n >();\n });\n\n it(\"defaults to second argument never if never\", () => {\n type toCheck = Osdk<quickAndDirty, never>;\n expectTypeOf<toCheck>().toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never>\n >();\n // ensure its the normal props\n expectTypeOf<Pick<toCheck, \"name\" | \"foo\">>().toEqualTypeOf<\n quickAndDirty[\"__DefinitionMetadata\"][\"props\"]\n >();\n\n // expect no rid\n expectTypeOf<keyof toCheck & \"$rid\">().toEqualTypeOf<never>();\n });\n\n it(\"defaults to second argument never if any\", () => {\n type toCheck = Osdk<quickAndDirty, any>;\n expectTypeOf<toCheck>().branded.toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never>\n >();\n // ensure its the normal props\n expectTypeOf<Pick<toCheck, \"name\" | \"foo\">>().toEqualTypeOf<\n quickAndDirty[\"__DefinitionMetadata\"][\"props\"]\n >();\n\n // expect no rid\n expectTypeOf<keyof toCheck & \"$rid\">().toEqualTypeOf<never>();\n });\n\n it(\"Does not use $notStrict if requested with old type\", () => {\n type toCheck = Osdk<quickAndDirty, \"$notStrict\">;\n expectTypeOf<toCheck>().branded\n .toEqualTypeOf<Osdk.Instance<quickAndDirty, never>>();\n // ensure its not the strict type\n expectTypeOf<Pick<toCheck, \"name\" | \"foo\">>().toEqualTypeOf<\n quickAndDirty[\"__DefinitionMetadata\"][\"props\"]\n >();\n\n // expect no rid\n expectTypeOf<keyof toCheck & \"$rid\">().toEqualTypeOf<never>();\n });\n\n it(\"defaults to last argument all props if never\", () => {\n expectTypeOf<Osdk<quickAndDirty, never, never>>().branded\n .toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never, \"name\" | \"foo\">\n >();\n });\n\n it(\"defaults to last argument all props if any\", () => {\n expectTypeOf<Osdk<quickAndDirty, never, any>>().branded\n .toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never, \"name\" | \"foo\">\n >();\n });\n\n it(\"defaults to last argument exactly if specified\", () => {\n expectTypeOf<Osdk<quickAndDirty, never, \"name\">>()\n .toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never, \"name\">\n >();\n });\n });\n\n describe(\"Inferred return types from fetchPage work\", () => {\n const fauxObjectSet = createMockObjectSet<quickAndDirty>();\n\n it(\"is not $notStrict\", async () => {\n const page = await fauxObjectSet.fetchPage();\n\n expectTypeOf<typeof page[\"data\"]>().branded\n .toEqualTypeOf<\n Osdk.Instance<quickAndDirty>[]\n >();\n });\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,QAAQ,EAAEC,YAAY,EAAEC,EAAE,QAAQ,QAAQ;AAEnD,SAASC,mBAAmB,QAAQ,+BAA+B;AAGnEH,QAAQ,CAAC,gBAAgB,EAAE,MAAM;EAC/BA,QAAQ,CAAC,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MACvDD,YAAY,CAAoC,CAAC,CAACI,OAAO,CACtDD,aAAa,CAEZ,CAAC;IACP,CAAC,CAAC;IAEFF,EAAE,CAAC,4CAA4C,EAAE,MAAM;MACrDD,YAAY,CAAkC,CAAC,CAACI,OAAO,CACpDD,aAAa,CAEZ,CAAC;IACP,CAAC,CAAC;IAEFF,EAAE,CAAC,gDAAgD,EAAE,MAAM;MACzDD,YAAY,CAAqC,CAAC,CAC/CG,aAAa,CAEZ,CAAC;IACP,CAAC,CAAC;EACJ,CAAC,CAAC;EAEFJ,QAAQ,CAAC,2CAA2C,EAAE,MAAM;IAC1D,MAAMM,aAAa,GAAGH,mBAAmB,CAAgB,CAAC;IAE1DD,EAAE,CAAC,mBAAmB,EAAE,YAAY;MACrB,MAAMI,aAAa,CAACC,SAAS,CAAC,CAAC;MAE5CN,YAAY,CAAsB,CAAC,CAACI,OAAO,CACxCD,aAAa,CAEZ,CAAC;IACP,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"ActionResults.js","names":[],"sources":["ActionResults.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\n// These are migrated from @osdk/foundry.internal to avoid coupling the apis\n\nexport type ActionResults =\n & (\n | ObjectEdits\n | LargeScaleObjectEdits\n )\n & { editedObjectTypes: Array<String> };\n\ninterface ObjectEdits {\n type: \"edits\";\n addedObjects: Array<ObjectReference>;\n modifiedObjects: Array<ObjectReference>;\n addedLinks: Array<LinkReference>;\n deletedObjectsCount: number;\n deletedLinksCount: number;\n}\ninterface LargeScaleObjectEdits {\n type: \"largeScaleEdits\";\n addedObjects?: never;\n modifiedObjects?: never;\n addedLinks?: never;\n deletedObjectsCount?: never;\n deletedLinksCount?: never;\n}\n\ntype LinkReference = {\n linkTypeApiNameAtoB: string;\n linkTypeApiNameBtoA: string;\n aSideObject: ObjectReference;\n bSideObject: ObjectReference;\n};\ninterface ObjectReference {\n primaryKey: string | number;\n objectType: string;\n}\nexport interface ValidateActionResponseV2 {\n result: \"VALID\" | \"INVALID\";\n submissionCriteria: Array<{\n configuredFailureMessage?: string;\n result: \"VALID\" | \"INVALID\";\n }>;\n parameters: Record<string, {\n result: \"VALID\" | \"INVALID\";\n evaluatedConstraints: Array<ParameterEvaluatedConstraint>;\n required: boolean;\n }>;\n}\ntype ParameterEvaluatedConstraint =\n | { type: \"arraySize\"; lt?: any; lte?: any; gt?: any; gte?: any }\n | { type: \"groupMember\" }\n | { type: \"objectPropertyValue\" }\n | { type: \"objectQueryResult\" }\n | {\n type: \"oneOf\";\n options: Array<{\n displayName?: string;\n value?: any;\n }>;\n otherValuesAllowed: boolean;\n }\n | { type: \"range\"; lt?: any; lte?: any; gt?: any; gte?: any }\n | { type: \"stringLength\"; lt?: any; lte?: any; gt?: any; gte?: any }\n | {\n type: \"stringRegexMatch\";\n regex: string;\n configuredFailureMessage?: string;\n }\n | { type: \"unevaluable\" };\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"ActionResults.js","names":[],"sources":["ActionResults.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\n// These are migrated from @osdk/foundry.internal to avoid coupling the apis\n\nexport type ActionResults =\n & (\n | ObjectEdits\n | LargeScaleObjectEdits\n )\n & { editedObjectTypes: Array<String> };\n\ninterface ObjectEdits {\n type: \"edits\";\n addedObjects: Array<ObjectReference>;\n modifiedObjects: Array<ObjectReference>;\n deletedObjects?: Array<ObjectReference>;\n addedLinks: Array<LinkReference>;\n deletedLinks?: Array<LinkReference>;\n deletedObjectsCount: number;\n deletedLinksCount: number;\n}\ninterface LargeScaleObjectEdits {\n type: \"largeScaleEdits\";\n addedObjects?: never;\n modifiedObjects?: never;\n deletedObjects?: never;\n addedLinks?: never;\n deletedLinks?: never;\n deletedObjectsCount?: never;\n deletedLinksCount?: never;\n}\n\ntype LinkReference = {\n linkTypeApiNameAtoB: string;\n linkTypeApiNameBtoA: string;\n aSideObject: ObjectReference;\n bSideObject: ObjectReference;\n};\ninterface ObjectReference {\n primaryKey: string | number;\n objectType: string;\n}\nexport interface ValidateActionResponseV2 {\n result: \"VALID\" | \"INVALID\";\n submissionCriteria: Array<{\n configuredFailureMessage?: string;\n result: \"VALID\" | \"INVALID\";\n }>;\n parameters: Record<string, {\n result: \"VALID\" | \"INVALID\";\n evaluatedConstraints: Array<ParameterEvaluatedConstraint>;\n required: boolean;\n }>;\n}\ntype ParameterEvaluatedConstraint =\n | { type: \"arraySize\"; lt?: any; lte?: any; gt?: any; gte?: any }\n | { type: \"groupMember\" }\n | { type: \"objectPropertyValue\" }\n | { type: \"objectQueryResult\" }\n | {\n type: \"oneOf\";\n options: Array<{\n displayName?: string;\n value?: any;\n }>;\n otherValuesAllowed: boolean;\n }\n | { type: \"range\"; lt?: any; lte?: any; gt?: any; gte?: any }\n | { type: \"stringLength\"; lt?: any; lte?: any; gt?: any; gte?: any }\n | {\n type: \"stringRegexMatch\";\n regex: string;\n configuredFailureMessage?: string;\n }\n | { type: \"unevaluable\" };\n"],"mappings":"","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"Actions.js","names":["ActionParam"],"sources":["Actions.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 { DataValueClientToWire } from \"../mapping/DataValueMapping.js\";\nimport type { ObjectSet } from \"../objectSet/ObjectSet.js\";\nimport type { InterfaceDefinition } from \"../ontology/InterfaceDefinition.js\";\nimport type { ObjectTypeDefinition } from \"../ontology/ObjectTypeDefinition.js\";\nimport type { OsdkBase } from \"../OsdkBase.js\";\nimport type { OsdkObjectPrimaryKeyType } from \"../OsdkObjectPrimaryKeyType.js\";\n\nimport type {\n ActionResults,\n ValidateActionResponseV2,\n} from \"./ActionResults.js\";\n\nexport type ApplyActionOptions =\n | { $returnEdits?: true; $validateOnly?: false }\n | {\n $validateOnly?: true;\n $returnEdits?: false;\n };\n\nexport type ApplyBatchActionOptions = { $returnEdits?: boolean };\n\n/**\n * Helper types for converting action definition parameter types to typescript types\n */\nexport namespace ActionParam {\n /**\n * Helper type to convert action definition parameter primitives to typescript types\n */\n export type PrimitiveType<T extends keyof DataValueClientToWire> =\n DataValueClientToWire[T];\n\n /**\n * Helper type to convert action definition parameter object types to typescript types\n */\n export type ObjectType<T extends ObjectTypeDefinition> =\n | OsdkBase<T>\n | OsdkObjectPrimaryKeyType<T>;\n\n /**\n * Helper type to convert action definition parameter object sets to typescript types\n */\n export type ObjectSetType<T extends ObjectTypeDefinition> = ObjectSet<T>;\n\n /**\n * Helper type to convert action definition parameter interface types to typescript types\n */\n export type InterfaceType<T extends InterfaceDefinition> = {\n $objectType: NonNullable<T[\"__DefinitionMetadata\"]> extends\n { implementedBy: infer U }\n ? (U extends ReadonlyArray<string> ? U[number] : string)\n : string;\n $primaryKey: string | number;\n };\n\n export type StructType<\n T extends Record<string, keyof DataValueClientToWire>,\n > = { [K in keyof T]: DataValueClientToWire[T[K]] };\n}\n\nexport type ActionEditResponse = ActionResults;\nexport type ActionValidationResponse = ValidateActionResponseV2;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAuBA;AACA;AACA;AAFA,WAGiBA,WAAW","ignoreList":[]}
1
+ {"version":3,"file":"Actions.js","names":["ActionParam"],"sources":["Actions.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 { DataValueClientToWire } from \"../mapping/DataValueMapping.js\";\nimport type { ObjectSet } from \"../objectSet/ObjectSet.js\";\nimport type { InterfaceDefinition } from \"../ontology/InterfaceDefinition.js\";\nimport type {\n CompileTimeMetadata,\n ObjectTypeDefinition,\n} from \"../ontology/ObjectTypeDefinition.js\";\nimport type { OsdkBase } from \"../OsdkBase.js\";\nimport type { OsdkObjectPrimaryKeyType } from \"../OsdkObjectPrimaryKeyType.js\";\n\nimport type {\n ActionResults,\n ValidateActionResponseV2,\n} from \"./ActionResults.js\";\n\nexport type ApplyActionOptions =\n | { $returnEdits?: true; $validateOnly?: false }\n | {\n $validateOnly?: true;\n $returnEdits?: false;\n };\n\nexport type ApplyBatchActionOptions = { $returnEdits?: boolean };\n\n/**\n * Helper types for converting action definition parameter types to typescript types\n */\nexport namespace ActionParam {\n /**\n * Helper type to convert action definition parameter primitives to typescript types\n */\n export type PrimitiveType<T extends keyof DataValueClientToWire> =\n DataValueClientToWire[T];\n\n /**\n * Helper type to convert action definition parameter object types to typescript types\n */\n export type ObjectType<T extends ObjectTypeDefinition> =\n | OsdkBase<T>\n | OsdkObjectPrimaryKeyType<T>;\n\n /**\n * Helper type to convert action definition parameter object sets to typescript types\n */\n export type ObjectSetType<T extends ObjectTypeDefinition> = ObjectSet<T>;\n\n /**\n * Helper type to convert action definition parameter interface types to typescript types\n */\n export type InterfaceType<T extends InterfaceDefinition> = {\n $objectType: CompileTimeMetadata<T> extends { implementedBy: infer U }\n ? (U extends ReadonlyArray<never> ? string\n : U extends ReadonlyArray<string> ? U[number]\n : string)\n : string;\n $primaryKey: string | number;\n };\n\n export type StructType<\n T extends Record<string, keyof DataValueClientToWire>,\n > = { [K in keyof T]: DataValueClientToWire[T[K]] };\n}\n\nexport type ActionEditResponse = ActionResults;\nexport type ActionValidationResponse = ValidateActionResponseV2;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA0BA;AACA;AACA;AAFA,WAGiBA,WAAW","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"AggregatableKeys.js","names":[],"sources":["AggregatableKeys.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 NumericWithPropAggregateOption,\n StringWithPropAggregateOption,\n} from \"../derivedProperties/WithPropertiesAggregationOptions.js\";\nimport type {\n GetWirePropertyValueFromClient,\n} from \"../mapping/PropertyValueMapping.js\";\nimport type {\n ObjectOrInterfaceDefinition,\n PropertyKeys,\n} from \"../ontology/ObjectOrInterface.js\";\nimport type { CompileTimeMetadata } from \"../ontology/ObjectTypeDefinition.js\";\n\nexport type StringAggregateOption = \"approximateDistinct\" | \"exactDistinct\";\nexport type NumericAggregateOption =\n | \"min\"\n | \"max\"\n | \"sum\"\n | \"avg\"\n | \"approximateDistinct\"\n | \"exactDistinct\";\n\ntype AGG_FOR_TYPE<T, U extends boolean> = number extends T\n ? U extends true ? NumericAggregateOption : NumericWithPropAggregateOption\n : string extends T\n ? U extends true ? StringAggregateOption : StringWithPropAggregateOption\n : never;\n\nexport type ValidAggregationKeys<\n Q extends ObjectOrInterfaceDefinition,\n R extends \"aggregate\" | \"withPropertiesAggregate\" = \"aggregate\",\n> = keyof (\n & {\n [\n KK in AggregatableKeys<Q> as `${KK & string}:${AGG_FOR_TYPE<\n GetWirePropertyValueFromClient<\n CompileTimeMetadata<Q>[\"properties\"][KK][\"type\"]\n >,\n R extends \"aggregate\" ? true : false\n >}`\n ]?: any;\n }\n & { $count?: any }\n);\n\nexport type AggregatableKeys<\n Q extends ObjectOrInterfaceDefinition,\n> = keyof {\n [P in PropertyKeys<Q>]: any;\n};\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"AggregatableKeys.js","names":[],"sources":["AggregatableKeys.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 BaseWithPropAggregations,\n DatetimeWithPropAggregateOption,\n DistinctWithPropAggregateOption,\n NumericWithPropAggregateOption,\n ValidCollectPropertyKeysForSpecialTypes,\n} from \"../derivedProperties/WithPropertiesAggregationOptions.js\";\nimport type {\n GetWirePropertyValueFromClient,\n} from \"../mapping/PropertyValueMapping.js\";\nimport type {\n ObjectOrInterfaceDefinition,\n PropertyKeys,\n} from \"../ontology/ObjectOrInterface.js\";\nimport type { CompileTimeMetadata } from \"../ontology/ObjectTypeDefinition.js\";\nimport type { WirePropertyTypes } from \"../ontology/WirePropertyTypes.js\";\n\nexport type BaseAggregateOptions = \"approximateDistinct\" | \"exactDistinct\";\n\nexport type MinMaxAggregateOption = \"min\" | \"max\";\n\nexport type DatetimeAggregateOption =\n | MinMaxAggregateOption\n | BaseAggregateOptions;\n\nexport type NumericAggregateOption =\n | \"sum\"\n | \"avg\"\n | \"approximateDistinct\"\n | \"exactDistinct\"\n | MinMaxAggregateOption;\n\ntype AGG_FOR_TYPE<WIRE_TYPE extends WirePropertyTypes> = number extends\n GetWirePropertyValueFromClient<WIRE_TYPE> ? NumericAggregateOption\n : WIRE_TYPE extends \"datetime\" | \"timestamp\" ? DatetimeAggregateOption\n : BaseAggregateOptions;\n\ntype WITH_PROPERTIES_AGG_FOR_TYPE<WIRE_TYPE extends WirePropertyTypes> =\n number extends GetWirePropertyValueFromClient<WIRE_TYPE>\n ? NumericWithPropAggregateOption\n : WIRE_TYPE extends \"datetime\" | \"timestamp\"\n ? DatetimeWithPropAggregateOption\n : WIRE_TYPE extends \"string\" ? BaseWithPropAggregations\n : WITH_PROPERTIES_AGG_FOR_SPECIAL_WIRE_TYPE<WIRE_TYPE>;\n\ntype WITH_PROPERTIES_AGG_FOR_SPECIAL_WIRE_TYPE<\n WIRE_TYPE extends WirePropertyTypes,\n> = WIRE_TYPE extends ValidCollectPropertyKeysForSpecialTypes\n ? BaseWithPropAggregations\n : DistinctWithPropAggregateOption;\n\nexport type ValidAggregationKeys<\n Q extends ObjectOrInterfaceDefinition,\n R extends \"aggregate\" | \"withPropertiesAggregate\" = \"aggregate\",\n> = keyof (\n & {\n [\n KK in AggregatableKeys<Q> as `${KK & string}:${R extends \"aggregate\"\n ? AGG_FOR_TYPE<\n CompileTimeMetadata<Q>[\"properties\"][KK][\"type\"]\n >\n : WITH_PROPERTIES_AGG_FOR_TYPE<\n CompileTimeMetadata<Q>[\"properties\"][KK][\"type\"]\n >}`\n ]?: any;\n }\n & { $count?: any }\n);\n\nexport type AggregatableKeys<\n Q extends ObjectOrInterfaceDefinition,\n> = keyof {\n [P in PropertyKeys<Q>]: any;\n};\n"],"mappings":"","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"DerivedProperty.js","names":["DerivedProperty"],"sources":["DerivedProperty.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 { ValidAggregationKeys } from \"../aggregate/AggregatableKeys.js\";\nimport type { WhereClause } from \"../aggregate/WhereClause.js\";\nimport type {\n ObjectOrInterfaceDefinition,\n PropertyKeys,\n} from \"../ontology/ObjectOrInterface.js\";\nimport type { CompileTimeMetadata } from \"../ontology/ObjectTypeDefinition.js\";\nimport type { SimplePropertyDef } from \"../ontology/SimplePropertyDef.js\";\nimport type { LinkedType, LinkNames } from \"../util/LinkUtils.js\";\nimport type { CollectWithPropAggregations } from \"./WithPropertiesAggregationOptions.js\";\n\nexport namespace DerivedProperty {\n export type SelectorResult<\n T extends SimplePropertyDef,\n > = {\n type: T;\n };\n\n export type Clause<\n Q extends ObjectOrInterfaceDefinition,\n > = {\n [key: string]: Selector<Q, SimplePropertyDef>;\n };\n\n export type Selector<\n Q extends ObjectOrInterfaceDefinition,\n T extends SimplePropertyDef,\n > = (\n baseObjectSet: DerivedProperty.Builder<Q, false>,\n ) => SelectorResult<T>;\n\n export interface Builder<\n Q extends ObjectOrInterfaceDefinition,\n CONSTRAINED extends boolean,\n > extends Filterable<Q, CONSTRAINED>, Pivotable<Q, CONSTRAINED> {\n }\n\n export interface AggregateBuilder<\n Q extends ObjectOrInterfaceDefinition,\n CONSTRAINED extends boolean,\n > extends Builder<Q, CONSTRAINED>, Aggregatable<Q> {\n }\n\n export interface SelectPropertyBuilder<\n Q extends ObjectOrInterfaceDefinition,\n CONSTRAINED extends boolean,\n > extends AggregateBuilder<Q, CONSTRAINED>, Selectable<Q> {\n }\n}\n\ntype BuilderTypeFromConstraint<\n Q extends ObjectOrInterfaceDefinition,\n CONSTRAINED extends boolean,\n> = CONSTRAINED extends true ? DerivedProperty.AggregateBuilder<Q, true>\n : DerivedProperty.SelectPropertyBuilder<Q, false>;\n\ntype Filterable<\n Q extends ObjectOrInterfaceDefinition,\n CONSTRAINED extends boolean,\n> = {\n readonly where: (\n clause: WhereClause<Q>,\n ) => BuilderTypeFromConstraint<Q, CONSTRAINED>;\n};\n\ntype Pivotable<\n Q extends ObjectOrInterfaceDefinition,\n CONSTRAINED extends boolean,\n> = {\n readonly pivotTo: <L extends LinkNames<Q>>(\n type: L,\n ) => CONSTRAINED extends true\n ? DerivedProperty.AggregateBuilder<LinkedType<Q, L>, true>\n : NonNullable<CompileTimeMetadata<Q>[\"links\"][L][\"multiplicity\"]> extends\n true ? DerivedProperty.AggregateBuilder<LinkedType<Q, L>, true>\n : DerivedProperty.SelectPropertyBuilder<LinkedType<Q, L>, false>;\n};\n\ntype Aggregatable<\n Q extends ObjectOrInterfaceDefinition,\n> = {\n readonly aggregate: <\n V extends ValidAggregationKeys<\n Q,\n \"withPropertiesAggregate\"\n >,\n >(\n aggregationSpecifier: V,\n opts?: V extends `${any}:${infer P}`\n ? P extends CollectWithPropAggregations ? { limit: number }\n : P extends \"approximatePercentile\" ? { percentile: number }\n : never\n : never,\n ) => DerivedProperty.SelectorResult<\n V extends `${infer N}:${infer P}`\n ? P extends CollectWithPropAggregations\n ? Array<CompileTimeMetadata<Q>[\"properties\"][N][\"type\"]> | undefined\n : P extends \"approximateDistinct\" | \"exactDistinct\" | \"$count\"\n ? \"integer\" | undefined\n : \"double\" | undefined\n : V extends \"$count\" ? \"integer\" | undefined\n : never\n >;\n};\n\ntype Selectable<Q extends ObjectOrInterfaceDefinition> = {\n readonly selectProperty: <R extends PropertyKeys<Q>>(\n propertyName: R,\n ) => DerivedProperty.SelectorResult<\n SimplePropertyDef.Make<\n CompileTimeMetadata<Q>[\"properties\"][R][\"type\"],\n CompileTimeMetadata<Q>[\"properties\"][R][\"nullable\"],\n CompileTimeMetadata<Q>[\"properties\"][R][\"multiplicity\"]\n >\n >;\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAdA,WA2BiBA,eAAe","ignoreList":[]}
1
+ {"version":3,"file":"DerivedProperty.js","names":["DerivedProperty"],"sources":["DerivedProperty.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 { ValidAggregationKeys } from \"../aggregate/AggregatableKeys.js\";\nimport type { WhereClause } from \"../aggregate/WhereClause.js\";\nimport type {\n ObjectOrInterfaceDefinition,\n PropertyKeys,\n} from \"../ontology/ObjectOrInterface.js\";\nimport type { CompileTimeMetadata } from \"../ontology/ObjectTypeDefinition.js\";\nimport type { SimplePropertyDef } from \"../ontology/SimplePropertyDef.js\";\nimport type { LinkedType, LinkNames } from \"../util/LinkUtils.js\";\nimport type {\n DatetimeExpressions,\n DefinitionForType,\n NumericExpressions,\n} from \"./Expressions.js\";\nimport type {\n CollectWithPropAggregations,\n MinMaxWithPropAggregateOption,\n} from \"./WithPropertiesAggregationOptions.js\";\n\nexport namespace DerivedProperty {\n export interface Definition<\n T extends SimplePropertyDef,\n Q extends ObjectOrInterfaceDefinition,\n > {\n type: T;\n }\n\n export interface NumericPropertyDefinition<\n T extends SimplePropertyDef,\n Q extends ObjectOrInterfaceDefinition,\n > extends Definition<T, Q>, NumericExpressions<Q, T> {}\n\n export interface DatetimePropertyDefinition<\n T extends SimplePropertyDef,\n Q extends ObjectOrInterfaceDefinition,\n > extends Definition<T, Q>, DatetimeExpressions<Q, T> {}\n\n export type Clause<\n Q extends ObjectOrInterfaceDefinition,\n > = {\n [key: string]: Creator<Q, SimplePropertyDef>;\n };\n\n export type Creator<\n Q extends ObjectOrInterfaceDefinition,\n T extends SimplePropertyDef,\n > = (\n baseObjectSet: Builder<Q, false>,\n ) =>\n | Definition<T, Q>\n | NumericPropertyDefinition<T, Q>\n | DatetimePropertyDefinition<T, Q>;\n\n interface BaseBuilder<\n Q extends ObjectOrInterfaceDefinition,\n CONSTRAINED extends boolean,\n > extends Filterable<Q, CONSTRAINED>, Pivotable<Q, CONSTRAINED> {\n }\n\n export interface Builder<\n Q extends ObjectOrInterfaceDefinition,\n CONSTRAINED extends boolean,\n > extends BaseBuilder<Q, CONSTRAINED>, Selectable<Q>, Constant<Q> {\n }\n\n export interface AggregateBuilder<\n Q extends ObjectOrInterfaceDefinition,\n CONSTRAINED extends boolean,\n > extends BaseBuilder<Q, CONSTRAINED>, Aggregatable<Q> {\n }\n\n export interface SelectPropertyBuilder<\n Q extends ObjectOrInterfaceDefinition,\n CONSTRAINED extends boolean,\n > extends AggregateBuilder<Q, CONSTRAINED>, Selectable<Q> {\n }\n\n export type ValidParts = \"DAYS\" | \"MONTHS\" | \"QUARTERS\" | \"YEARS\";\n}\n\ntype BuilderTypeFromConstraint<\n Q extends ObjectOrInterfaceDefinition,\n CONSTRAINED extends boolean,\n> = CONSTRAINED extends true ? DerivedProperty.AggregateBuilder<Q, true>\n : DerivedProperty.SelectPropertyBuilder<Q, false>;\n\ntype Filterable<\n Q extends ObjectOrInterfaceDefinition,\n CONSTRAINED extends boolean,\n> = {\n readonly where: (\n clause: WhereClause<Q>,\n ) => BuilderTypeFromConstraint<Q, CONSTRAINED>;\n};\n\ntype Pivotable<\n Q extends ObjectOrInterfaceDefinition,\n CONSTRAINED extends boolean,\n> = {\n readonly pivotTo: <L extends LinkNames<Q>>(\n type: L,\n ) => CONSTRAINED extends true\n ? DerivedProperty.AggregateBuilder<LinkedType<Q, L>, true>\n : NonNullable<CompileTimeMetadata<Q>[\"links\"][L][\"multiplicity\"]> extends\n true ? DerivedProperty.AggregateBuilder<LinkedType<Q, L>, true>\n : DerivedProperty.SelectPropertyBuilder<LinkedType<Q, L>, false>;\n};\n\ntype Constant<Q extends ObjectOrInterfaceDefinition> = {\n readonly constant: {\n readonly double: (\n value: number,\n ) => DerivedProperty.NumericPropertyDefinition<\n SimplePropertyDef.Make<\"double\", \"non-nullable\", \"single\">,\n Q\n >;\n\n readonly integer: (\n value: number,\n ) => DerivedProperty.NumericPropertyDefinition<\n SimplePropertyDef.Make<\"integer\", \"non-nullable\", \"single\">,\n Q\n >;\n readonly long: (\n value: string,\n ) => DerivedProperty.NumericPropertyDefinition<\n SimplePropertyDef.Make<\"long\", \"non-nullable\", \"single\">,\n Q\n >;\n\n readonly datetime: (\n value: string,\n ) => DerivedProperty.DatetimePropertyDefinition<\n SimplePropertyDef.Make<\"datetime\", \"non-nullable\", \"single\">,\n Q\n >;\n readonly timestamp: (\n value: string,\n ) => DerivedProperty.DatetimePropertyDefinition<\n SimplePropertyDef.Make<\"timestamp\", \"non-nullable\", \"single\">,\n Q\n >;\n };\n};\n\ntype Aggregatable<\n Q extends ObjectOrInterfaceDefinition,\n> = {\n readonly aggregate: <\n V extends ValidAggregationKeys<\n Q,\n \"withPropertiesAggregate\"\n >,\n >(\n aggregationSpecifier: V,\n opts?: V extends `${any}:${infer P}`\n ? P extends CollectWithPropAggregations ? { limit: number }\n : P extends \"approximatePercentile\" ? { percentile: number }\n : never\n : never,\n ) => DefinitionForType<\n Q,\n V extends `${infer N}:${infer P}`\n ? P extends CollectWithPropAggregations ? SimplePropertyDef.Make<\n CompileTimeMetadata<Q>[\"properties\"][N][\"type\"],\n \"nullable\",\n \"array\"\n >\n : P extends MinMaxWithPropAggregateOption ? SimplePropertyDef.Make<\n CompileTimeMetadata<Q>[\"properties\"][N][\"type\"],\n \"nullable\",\n \"single\"\n >\n : P extends \"approximateDistinct\" | \"exactDistinct\"\n ? SimplePropertyDef.Make<\n \"integer\",\n \"non-nullable\",\n \"single\"\n >\n : SimplePropertyDef.Make<\n \"double\",\n \"nullable\",\n \"single\"\n >\n : V extends \"$count\" ? SimplePropertyDef.Make<\n \"integer\",\n \"non-nullable\",\n \"single\"\n >\n : never\n >;\n};\n\ntype Selectable<Q extends ObjectOrInterfaceDefinition> = {\n readonly selectProperty: <R extends PropertyKeys<Q>>(\n propertyName: R,\n ) => DefinitionForType<\n Q,\n SimplePropertyDef.Make<\n CompileTimeMetadata<Q>[\"properties\"][R][\"type\"],\n CompileTimeMetadata<Q>[\"properties\"][R][\"nullable\"] extends true\n ? \"nullable\"\n : \"non-nullable\",\n CompileTimeMetadata<Q>[\"properties\"][R][\"multiplicity\"] extends true\n ? \"array\"\n : \"single\"\n >\n >;\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAdA,WAmCiBA,eAAe","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Expressions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Expressions.js","names":[],"sources":["Expressions.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n ObjectOrInterfaceDefinition,\n PropertyKeys,\n} from \"../ontology/ObjectOrInterface.js\";\nimport type { CompileTimeMetadata } from \"../ontology/ObjectTypeDefinition.js\";\nimport type { SimplePropertyDef } from \"../ontology/SimplePropertyDef.js\";\nimport type { WirePropertyTypes } from \"../ontology/WirePropertyTypes.js\";\nimport type { DerivedProperty } from \"./DerivedProperty.js\";\n\ntype WithPropertiesNumerics =\n | \"integer\"\n | \"double\"\n | \"float\"\n | \"short\"\n | \"long\";\n\ntype WithPropertiesDatetime =\n | \"datetime\"\n | \"timestamp\";\n\nexport type DefinitionForType<\n Q extends ObjectOrInterfaceDefinition,\n T extends SimplePropertyDef,\n> = SimplePropertyDef.ExtractMultiplicity<T> extends \"array\"\n ? DerivedProperty.Definition<T, Q>\n : SimplePropertyDef.ExtractWirePropertyType<T> extends WithPropertiesNumerics\n ? DerivedProperty.NumericPropertyDefinition<T, Q>\n : SimplePropertyDef.ExtractWirePropertyType<T> extends WithPropertiesDatetime\n ? DerivedProperty.DatetimePropertyDefinition<T, Q>\n : DerivedProperty.Definition<T, Q>;\n\ntype NumericExpressionArg<Q extends ObjectOrInterfaceDefinition> =\n | number\n | DerivedProperty.NumericPropertyDefinition<any, Q>;\n\ntype ReturnTypeForNumericMethod<\n Q extends ObjectOrInterfaceDefinition,\n LEFT extends WirePropertyTypes,\n RIGHT extends WirePropertyTypes,\n> = \"double\" extends (LEFT | RIGHT) ? DerivedProperty.NumericPropertyDefinition<\n SimplePropertyDef.Make<\"double\", \"non-nullable\", \"single\">,\n Q\n >\n : \"float\" extends (LEFT | RIGHT) ? DerivedProperty.NumericPropertyDefinition<\n SimplePropertyDef.Make<\"double\", \"non-nullable\", \"single\">,\n Q\n >\n : \"long\" extends (LEFT | RIGHT) ? DerivedProperty.NumericPropertyDefinition<\n SimplePropertyDef.Make<\"long\", \"non-nullable\", \"single\">,\n Q\n >\n : DerivedProperty.NumericPropertyDefinition<\n SimplePropertyDef.Make<\"integer\", \"non-nullable\", \"single\">,\n Q\n >;\n\ntype ReturnTypeForDatetimeMethod<\n Q extends ObjectOrInterfaceDefinition,\n LEFT extends WirePropertyTypes,\n RIGHT extends WirePropertyTypes,\n> = \"timestamp\" extends (LEFT | RIGHT)\n ? DerivedProperty.DatetimePropertyDefinition<\n SimplePropertyDef.Make<\"timestamp\", \"non-nullable\", \"single\">,\n Q\n >\n : DerivedProperty.DatetimePropertyDefinition<\n SimplePropertyDef.Make<\"datetime\", \"non-nullable\", \"single\">,\n Q\n >;\n\ntype ExtractWirePropertyTypeFromNumericArg<\n Q extends ObjectOrInterfaceDefinition,\n ARG extends NumericExpressionArg<Q>,\n> = ARG extends number ? \"double\"\n : ARG extends DerivedProperty.NumericPropertyDefinition<infer T, Q>\n ? T extends SimplePropertyDef ? SimplePropertyDef.ExtractWirePropertyType<T>\n : never\n : ARG extends PropertyKeys.Filtered<Q, WithPropertiesNumerics>\n ? NonNullable<CompileTimeMetadata<Q>[\"properties\"][ARG][\"type\"]>\n : never;\n\nexport type NumericExpressions<\n Q extends ObjectOrInterfaceDefinition,\n LEFT_PROPERTY_TYPE extends SimplePropertyDef,\n> = {\n readonly add: <A extends NumericExpressionArg<Q>>(\n value: A,\n ) => ReturnTypeForNumericMethod<\n Q,\n SimplePropertyDef.ExtractWirePropertyType<LEFT_PROPERTY_TYPE>,\n ExtractWirePropertyTypeFromNumericArg<Q, A>\n >;\n\n readonly subtract: <A extends NumericExpressionArg<Q>>(\n value: A,\n ) => ReturnTypeForNumericMethod<\n Q,\n SimplePropertyDef.ExtractWirePropertyType<LEFT_PROPERTY_TYPE>,\n ExtractWirePropertyTypeFromNumericArg<Q, A>\n >;\n\n readonly multiply: <A extends NumericExpressionArg<Q>>(\n value: A,\n ) => ReturnTypeForNumericMethod<\n Q,\n SimplePropertyDef.ExtractWirePropertyType<LEFT_PROPERTY_TYPE>,\n ExtractWirePropertyTypeFromNumericArg<Q, A>\n >;\n\n readonly divide: <A extends NumericExpressionArg<Q>>(\n value: A,\n ) => ReturnTypeForNumericMethod<\n Q,\n SimplePropertyDef.ExtractWirePropertyType<LEFT_PROPERTY_TYPE>,\n ExtractWirePropertyTypeFromNumericArg<Q, A>\n >;\n\n readonly abs: () => DerivedProperty.NumericPropertyDefinition<\n LEFT_PROPERTY_TYPE,\n Q\n >;\n\n readonly negate: () => DerivedProperty.NumericPropertyDefinition<\n LEFT_PROPERTY_TYPE,\n Q\n >;\n\n readonly max: <A extends NumericExpressionArg<Q>>(\n value: A,\n ) => ReturnTypeForNumericMethod<\n Q,\n SimplePropertyDef.ExtractWirePropertyType<LEFT_PROPERTY_TYPE>,\n ExtractWirePropertyTypeFromNumericArg<Q, A>\n >;\n\n readonly min: <A extends NumericExpressionArg<Q>>(\n value: A,\n ) => ReturnTypeForNumericMethod<\n Q,\n SimplePropertyDef.ExtractWirePropertyType<LEFT_PROPERTY_TYPE>,\n ExtractWirePropertyTypeFromNumericArg<Q, A>\n >;\n};\n\ntype DatetimeExpressionArg<Q extends ObjectOrInterfaceDefinition> =\n DerivedProperty.DatetimePropertyDefinition<any, Q>;\n\ntype ExtractPropertyTypeFromDatetimeArg<\n Q extends ObjectOrInterfaceDefinition,\n ARG extends DatetimeExpressionArg<Q>,\n> = ARG extends DerivedProperty.DatetimePropertyDefinition<infer T, Q>\n ? T extends SimplePropertyDef ? SimplePropertyDef.ExtractWirePropertyType<T>\n : never\n : ARG extends PropertyKeys.Filtered<Q, WithPropertiesDatetime>\n ? NonNullable<CompileTimeMetadata<Q>[\"properties\"][ARG][\"type\"]>\n : never;\n\nexport type DatetimeExpressions<\n Q extends ObjectOrInterfaceDefinition,\n LEFT_PROPERTY_TYPE extends SimplePropertyDef,\n> = {\n readonly min: <A extends DatetimeExpressionArg<Q>>(\n value: A,\n ) => ReturnTypeForDatetimeMethod<\n Q,\n SimplePropertyDef.ExtractWirePropertyType<LEFT_PROPERTY_TYPE>,\n ExtractPropertyTypeFromDatetimeArg<Q, A>\n >;\n readonly max: (\n value: DatetimeExpressionArg<Q>,\n ) => ReturnTypeForDatetimeMethod<\n Q,\n SimplePropertyDef.ExtractWirePropertyType<LEFT_PROPERTY_TYPE>,\n ExtractPropertyTypeFromDatetimeArg<Q, typeof value>\n >;\n readonly extractPart: (\n value: DerivedProperty.ValidParts,\n ) => DerivedProperty.Definition<\n SimplePropertyDef.Make<\"string\", \"non-nullable\", \"single\">,\n Q\n >;\n};\n"],"mappings":"","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"WithPropertiesAggregationOptions.js","names":[],"sources":["WithPropertiesAggregationOptions.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport type CollectWithPropAggregations = \"collectSet\" | \"collectList\";\n\nexport type BaseWithPropAggregations =\n | \"approximateDistinct\"\n | \"exactDistinct\";\n\nexport type StringWithPropAggregateOption =\n | BaseWithPropAggregations\n | CollectWithPropAggregations;\n\nexport type NumericWithPropAggregateOption =\n | \"min\"\n | \"max\"\n | \"sum\"\n | \"avg\"\n | \"approximatePercentile\"\n | BaseWithPropAggregations\n | CollectWithPropAggregations;\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"WithPropertiesAggregationOptions.js","names":[],"sources":["WithPropertiesAggregationOptions.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport type DistinctWithPropAggregateOption =\n | \"approximateDistinct\"\n | \"exactDistinct\";\n\nexport type CollectWithPropAggregations = \"collectSet\" | \"collectList\";\n\nexport type BaseWithPropAggregations =\n | DistinctWithPropAggregateOption\n | CollectWithPropAggregations;\n\nexport type MinMaxWithPropAggregateOption = \"min\" | \"max\";\n\nexport type DatetimeWithPropAggregateOption =\n | MinMaxWithPropAggregateOption\n | BaseWithPropAggregations;\n\nexport type NumericWithPropAggregateOption =\n | \"sum\"\n | \"avg\"\n | \"approximatePercentile\"\n | MinMaxWithPropAggregateOption\n | BaseWithPropAggregations;\n\nexport type ValidCollectPropertyKeysForSpecialTypes =\n | \"attachment\"\n | \"geopoint\"\n | \"geoshape\"\n | \"boolean\";\n"],"mappings":"","ignoreList":[]}
@@ -21,8 +21,8 @@
21
21
  *
22
22
  * @param data - Data to upload as media item
23
23
  * @param fileName - Name that will be assigned as path to the uploaded media item.
24
- * @param objectTypeApi - Api name of the object type to which the media item will be uploaded.
25
- * @param propertyTypeApi - Api name of the media reference property of the corresponding object type to which the media item will be uploaded.
24
+ * @param objectType - Object type to which the media item will be uploaded.
25
+ * @param propertyType - Media reference property of the corresponding object type to which the media item will be uploaded.
26
26
  *
27
27
  * @returns media reference of the uploaded media item.
28
28
  */