@osdk/api 2.2.0-beta.16 → 2.2.0-beta.17

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 (77) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/build/browser/Logger.js +16 -1
  3. package/build/browser/Logger.js.map +1 -1
  4. package/build/browser/OsdkBase.js.map +1 -1
  5. package/build/browser/OsdkObjectFrom.js.map +1 -1
  6. package/build/browser/OsdkObjectFrom.test.js +3 -3
  7. package/build/browser/OsdkObjectFrom.test.js.map +1 -1
  8. package/build/browser/derivedProperties/DerivedProperty.js.map +1 -1
  9. package/build/browser/derivedProperties/Expressions.js +2 -0
  10. package/build/browser/derivedProperties/Expressions.js.map +1 -0
  11. package/build/browser/mapping/DataValueMapping.js.map +1 -1
  12. package/build/browser/object/FetchPageArgs.js +1 -0
  13. package/build/browser/object/FetchPageArgs.js.map +1 -1
  14. package/build/browser/objectSet/ObjectSet.js.map +1 -1
  15. package/build/browser/objectSet/ObjectSet.test.js +343 -31
  16. package/build/browser/objectSet/ObjectSet.test.js.map +1 -1
  17. package/build/browser/ontology/ActionDefinition.js.map +1 -1
  18. package/build/browser/ontology/ObjectOrInterface.js.map +1 -1
  19. package/build/browser/ontology/PrimaryKeyTypes.js.map +1 -1
  20. package/build/browser/ontology/SimplePropertyDef.js.map +1 -1
  21. package/build/browser/queries/Queries.js.map +1 -1
  22. package/build/browser/test/EmployeeApiTest.js.map +1 -1
  23. package/build/cjs/{FilteredPropertyKeys-CyOYr7Je.d.cts → ObjectSet-w3HV2UGC.d.cts} +174 -50
  24. package/build/cjs/index.d.cts +20 -14
  25. package/build/cjs/public/unstable.d.cts +2 -2
  26. package/build/esm/Logger.js +16 -1
  27. package/build/esm/Logger.js.map +1 -1
  28. package/build/esm/OsdkBase.js.map +1 -1
  29. package/build/esm/OsdkObjectFrom.js.map +1 -1
  30. package/build/esm/OsdkObjectFrom.test.js +3 -3
  31. package/build/esm/OsdkObjectFrom.test.js.map +1 -1
  32. package/build/esm/derivedProperties/DerivedProperty.js.map +1 -1
  33. package/build/esm/derivedProperties/Expressions.js +2 -0
  34. package/build/esm/derivedProperties/Expressions.js.map +1 -0
  35. package/build/esm/mapping/DataValueMapping.js.map +1 -1
  36. package/build/esm/object/FetchPageArgs.js +1 -0
  37. package/build/esm/object/FetchPageArgs.js.map +1 -1
  38. package/build/esm/objectSet/ObjectSet.js.map +1 -1
  39. package/build/esm/objectSet/ObjectSet.test.js +343 -31
  40. package/build/esm/objectSet/ObjectSet.test.js.map +1 -1
  41. package/build/esm/ontology/ActionDefinition.js.map +1 -1
  42. package/build/esm/ontology/ObjectOrInterface.js.map +1 -1
  43. package/build/esm/ontology/PrimaryKeyTypes.js.map +1 -1
  44. package/build/esm/ontology/SimplePropertyDef.js.map +1 -1
  45. package/build/esm/queries/Queries.js.map +1 -1
  46. package/build/esm/test/EmployeeApiTest.js.map +1 -1
  47. package/build/types/Logger.d.ts +11 -9
  48. package/build/types/Logger.d.ts.map +1 -1
  49. package/build/types/OsdkBase.d.ts +3 -1
  50. package/build/types/OsdkBase.d.ts.map +1 -1
  51. package/build/types/OsdkObjectFrom.d.ts +2 -2
  52. package/build/types/OsdkObjectFrom.d.ts.map +1 -1
  53. package/build/types/derivedProperties/DerivedProperty.d.ts +40 -13
  54. package/build/types/derivedProperties/DerivedProperty.d.ts.map +1 -1
  55. package/build/types/derivedProperties/Expressions.d.ts +54 -0
  56. package/build/types/derivedProperties/Expressions.d.ts.map +1 -0
  57. package/build/types/mapping/DataValueMapping.d.ts +4 -0
  58. package/build/types/mapping/DataValueMapping.d.ts.map +1 -1
  59. package/build/types/object/FetchPageArgs.d.ts +36 -6
  60. package/build/types/object/FetchPageArgs.d.ts.map +1 -1
  61. package/build/types/objectSet/ObjectSet.d.ts +137 -31
  62. package/build/types/objectSet/ObjectSet.d.ts.map +1 -1
  63. package/build/types/objectSet/ObjectSet.test.d.ts +2 -1
  64. package/build/types/objectSet/ObjectSet.test.d.ts.map +1 -1
  65. package/build/types/ontology/ActionDefinition.d.ts +1 -1
  66. package/build/types/ontology/ActionDefinition.d.ts.map +1 -1
  67. package/build/types/ontology/ObjectOrInterface.d.ts +1 -4
  68. package/build/types/ontology/ObjectOrInterface.d.ts.map +1 -1
  69. package/build/types/ontology/PrimaryKeyTypes.d.ts +1 -1
  70. package/build/types/ontology/PrimaryKeyTypes.d.ts.map +1 -1
  71. package/build/types/ontology/SimplePropertyDef.d.ts +4 -4
  72. package/build/types/ontology/SimplePropertyDef.d.ts.map +1 -1
  73. package/build/types/queries/Queries.d.ts +2 -2
  74. package/build/types/queries/Queries.d.ts.map +1 -1
  75. package/build/types/test/EmployeeApiTest.d.ts +13 -5
  76. package/build/types/test/EmployeeApiTest.d.ts.map +1 -1
  77. package/package.json +1 -1
@@ -251,7 +251,7 @@ interface OsdkMetadata {
251
251
  extraUserAgent: string;
252
252
  }
253
253
 
254
- type PrimaryKeyTypes = "string" | "datetime" | "double" | "boolean" | "integer" | "timestamp" | "short" | "long" | "byte";
254
+ type PrimaryKeyTypes = "string" | "datetime" | "double" | "integer" | "timestamp" | "short" | "long" | "byte";
255
255
 
256
256
  type VersionString<Major extends number, Minor extends number, Patch extends number> = `${Major}.${Minor}.${Patch}`;
257
257
 
@@ -347,8 +347,8 @@ interface InterfaceDefinition {
347
347
 
348
348
  type SimplePropertyDef = WirePropertyTypes | undefined | Array<WirePropertyTypes>;
349
349
  declare namespace SimplePropertyDef {
350
- type Make<T extends WirePropertyTypes, N extends boolean | undefined, M extends boolean | undefined> = M extends true ? N extends true ? Array<T> | undefined : Array<T> : N extends true ? T | undefined : T;
351
- type FromPropertyMetadata<P extends ObjectMetadata.Property> = Make<P["type"], P["nullable"], P["multiplicity"]>;
350
+ type Make<T extends WirePropertyTypes, N extends "nullable" | "non-nullable", M extends "array" | "single"> = M extends "array" ? N extends "nullable" ? Array<T> | undefined : Array<T> : N extends "nullable" ? T | undefined : T;
351
+ type FromPropertyMetadata<P extends ObjectMetadata.Property> = Make<P["type"], P["nullable"] extends true ? "nullable" : "non-nullable", P["multiplicity"] extends true ? "array" : "single">;
352
352
  type ExtractMultiplicity<T extends WirePropertyTypes | undefined | Array<WirePropertyTypes>> = NonNullable<T> extends Array<any> ? "array" : "single";
353
353
  type ExtractWirePropertyType<T extends SimplePropertyDef> = T extends Array<infer Z> ? NonNullable<Z> : NonNullable<T>;
354
354
  type ExtractNullable<T extends SimplePropertyDef> = [undefined] extends [T] ? "nullable" : [[undefined]] extends [T] ? "nullable" : "non-nullable";
@@ -370,7 +370,7 @@ declare namespace DerivedObjectOrInterfaceDefinition {
370
370
  };
371
371
  } & K;
372
372
  }
373
- type PropertyKeys<O extends ObjectOrInterfaceDefinition, RDPs extends Record<string, SimplePropertyDef> = {}> = (keyof NonNullable<O["__DefinitionMetadata"]>["properties"] | keyof RDPs) & string;
373
+ type PropertyKeys<O extends ObjectOrInterfaceDefinition> = (keyof NonNullable<O["__DefinitionMetadata"]>["properties"]) & string;
374
374
 
375
375
  type BaseAggregateOptions = "approximateDistinct" | "exactDistinct";
376
376
  type MinMaxAggregateOption = "min" | "max";
@@ -534,21 +534,37 @@ type NullabilityAdherence = false | "throw" | "drop";
534
534
  declare namespace NullabilityAdherence {
535
535
  type Default = "throw";
536
536
  }
537
+ declare namespace ObjectSetArgs {
538
+ interface Select<OBJECT_KEYS extends string = never, RDP_KEYS extends string = never> {
539
+ $select?: readonly (OBJECT_KEYS | RDP_KEYS)[];
540
+ $includeRid?: boolean;
541
+ }
542
+ interface OrderBy<L extends string = never> {
543
+ $orderBy?: {
544
+ [K in L]?: "asc" | "desc";
545
+ };
546
+ }
547
+ interface AsyncIter<Q extends ObjectOrInterfaceDefinition, K extends PropertyKeys<Q> = never, T extends boolean = false, RDP_KEYS extends string = never> extends Select<K, RDP_KEYS>, OrderBy<K> {
548
+ $__UNSTABLE_useOldInterfaceApis?: boolean;
549
+ $includeAllBaseObjectProperties?: PropertyKeys<Q> extends K ? T : never;
550
+ }
551
+ interface FetchPage<Q extends ObjectOrInterfaceDefinition, K extends PropertyKeys<Q> = never, T extends boolean = false, RDP_KEYS extends string = never> extends AsyncIter<Q, K, T, RDP_KEYS> {
552
+ $nextPageToken?: string;
553
+ $pageSize?: number;
554
+ }
555
+ }
537
556
  interface SelectArg<Q extends ObjectOrInterfaceDefinition, L extends PropertyKeys<Q> = PropertyKeys<Q>, R extends boolean = false, S extends NullabilityAdherence = NullabilityAdherence.Default> {
538
557
  $select?: readonly L[];
539
558
  $includeRid?: R;
540
559
  }
541
- interface OrderByArg<Q extends ObjectOrInterfaceDefinition, L extends PropertyKeys<Q> = PropertyKeys<Q>> {
542
- $orderBy?: {
543
- [K in L]?: "asc" | "desc";
544
- };
560
+ interface OrderByArg<Q extends ObjectOrInterfaceDefinition, L extends PropertyKeys<Q> = PropertyKeys<Q>> extends ObjectSetArgs.OrderBy<L> {
545
561
  }
546
562
  type SelectArgToKeys<Q extends ObjectOrInterfaceDefinition, A extends SelectArg<Q, any, any>> = A extends SelectArg<Q, never> ? PropertyKeys<Q> : A["$select"] extends readonly string[] ? A["$select"][number] : PropertyKeys<Q>;
547
- interface FetchPageArgs<Q extends ObjectOrInterfaceDefinition, K extends PropertyKeys<Q> = PropertyKeys<Q>, R extends boolean = false, A extends Augments = never, S extends NullabilityAdherence = NullabilityAdherence.Default, T extends boolean = false> extends AsyncIterArgs<Q, K, R, A, S, T> {
563
+ interface FetchPageArgs<Q extends ObjectOrInterfaceDefinition, K extends PropertyKeys<Q> = PropertyKeys<Q>, R extends boolean = false, A extends Augments = never, S extends NullabilityAdherence = NullabilityAdherence.Default, T extends boolean = false, RDP_KEYS extends string = never> extends AsyncIterArgs<Q, K, R, A, S, T, RDP_KEYS> {
548
564
  $nextPageToken?: string;
549
565
  $pageSize?: number;
550
566
  }
551
- interface AsyncIterArgs<Q extends ObjectOrInterfaceDefinition, K extends PropertyKeys<Q> = PropertyKeys<Q>, R extends boolean = false, A extends Augments = never, S extends NullabilityAdherence = NullabilityAdherence.Default, T extends boolean = false> extends SelectArg<Q, K, R, S>, OrderByArg<Q, PropertyKeys<Q>> {
567
+ interface AsyncIterArgs<Q extends ObjectOrInterfaceDefinition, K extends PropertyKeys<Q> = PropertyKeys<Q>, R extends boolean = false, A extends Augments = never, S extends NullabilityAdherence = NullabilityAdherence.Default, T extends boolean = false, RDP_KEYS extends string = never> extends SelectArg<Q, K, R, S>, OrderByArg<Q, PropertyKeys<Q>> {
552
568
  $__UNSTABLE_useOldInterfaceApis?: boolean;
553
569
  $includeAllBaseObjectProperties?: PropertyKeys<Q> extends K ? T : never;
554
570
  }
@@ -618,8 +634,10 @@ type OsdkBase<Q extends ObjectOrInterfaceDefinition> = {
618
634
  readonly $objectType: string;
619
635
  readonly $primaryKey: PrimaryKeyType<Q>;
620
636
  readonly $title: string | undefined;
621
- readonly $objectSpecifier: ObjectSpecifier<Q>;
622
637
  };
638
+ interface OsdkBaseWithObjectSpecifier<Q extends ObjectOrInterfaceDefinition> extends OsdkBase<Q> {
639
+ readonly $objectSpecifier: ObjectSpecifier<Q>;
640
+ }
623
641
  type PrimaryKeyType<Q extends ObjectOrInterfaceDefinition> = (Q extends ObjectTypeDefinition ? OsdkObjectPrimaryKeyType<Q> : unknown) & PropertyValueWireToClient[PrimaryKeyTypes];
624
642
 
625
643
  type SpecialOsdkPropParams = "$all" | "$rid" | "$strict" | "$notStrict";
@@ -647,7 +665,7 @@ type GetPropsKeys<Q extends ObjectOrInterfaceDefinition, P extends PropertyKeys<
647
665
  */
648
666
  type Osdk<Q extends ObjectOrInterfaceDefinition, OPTIONS extends string = never, P extends PropertyKeys<Q> = PropertyKeys<Q>> = IsNever<OPTIONS> extends true ? Osdk.Instance<Q, never, P> : IsAny<OPTIONS> extends true ? Osdk.Instance<Q, never, P> : (IsNever<Exclude<OPTIONS, "$rid">>) extends true ? Osdk.Instance<Q, OPTIONS & "$rid", P> : Osdk.Instance<Q, ("$rid" extends OPTIONS ? "$rid" : never), ExtractPropsKeysFromOldPropsStyle<Q, OPTIONS>>;
649
667
  declare namespace Osdk {
650
- type Instance<Q extends ObjectOrInterfaceDefinition, OPTIONS extends never | "$rid" | "$allBaseProperties" = never, P extends PropertyKeys<Q> = PropertyKeys<Q>, R extends Record<string, SimplePropertyDef> = {}> = OsdkBase<Q> & Pick<CompileTimeMetadata<Q>["props"], GetPropsKeys<Q, P, [R] extends [{}] ? false : true>> & ([R] extends [never] ? {} : {
668
+ type Instance<Q extends ObjectOrInterfaceDefinition, OPTIONS extends never | "$rid" | "$allBaseProperties" = never, P extends PropertyKeys<Q> = PropertyKeys<Q>, R extends Record<string, SimplePropertyDef> = {}> = OsdkBaseWithObjectSpecifier<Q> & Pick<CompileTimeMetadata<Q>["props"], GetPropsKeys<Q, P, [R] extends [{}] ? false : true>> & ([R] extends [never] ? {} : {
651
669
  [A in keyof R]: SimplePropertyDef.ToRuntimeProperty<R[A]>;
652
670
  }) & {
653
671
  readonly $link: Q extends {
@@ -917,20 +935,57 @@ type WhereClause<T extends ObjectOrInterfaceDefinition> = OrWhereClause<T> | And
917
935
  type LinkNames<Q extends ObjectOrInterfaceDefinition> = keyof CompileTimeMetadata<Q>["links"] & string;
918
936
  type LinkedType<Q extends ObjectOrInterfaceDefinition, L extends LinkNames<Q>> = NonNullable<CompileTimeMetadata<Q>["links"][L]["__OsdkLinkTargetType"]>;
919
937
 
938
+ type FilteredPropertyKeys<O extends ObjectOrInterfaceDefinition, T extends WirePropertyTypes> = {
939
+ [K in keyof NonNullable<O["__DefinitionMetadata"]>["properties"]]: NonNullable<O["__DefinitionMetadata"]>["properties"][K]["type"] extends T ? K : never;
940
+ }[keyof NonNullable<O["__DefinitionMetadata"]>["properties"]];
941
+
942
+ type WithPropertiesNumerics = "integer" | "double" | "float" | "short" | "long";
943
+ type WithPropertiesDatetime = "datetime" | "timestamp";
944
+ type DefinitionForType<Q extends ObjectOrInterfaceDefinition, T extends SimplePropertyDef> = SimplePropertyDef.ExtractMultiplicity<T> extends "array" ? DerivedProperty.Definition<T, Q> : SimplePropertyDef.ExtractWirePropertyType<T> extends WithPropertiesNumerics ? DerivedProperty.NumericPropertyDefinition<T, Q> : SimplePropertyDef.ExtractWirePropertyType<T> extends WithPropertiesDatetime ? DerivedProperty.DatetimePropertyDefinition<T, Q> : DerivedProperty.Definition<T, Q>;
945
+ type NumericExpressionArg<Q extends ObjectOrInterfaceDefinition> = number | DerivedProperty.NumericPropertyDefinition<any, Q>;
946
+ type ReturnTypeForNumericMethod<Q extends ObjectOrInterfaceDefinition, LEFT extends WirePropertyTypes, RIGHT extends WirePropertyTypes> = "double" extends (LEFT | RIGHT) ? DerivedProperty.NumericPropertyDefinition<SimplePropertyDef.Make<"double", "non-nullable", "single">, Q> : "float" extends (LEFT | RIGHT) ? DerivedProperty.NumericPropertyDefinition<SimplePropertyDef.Make<"double", "non-nullable", "single">, Q> : "long" extends (LEFT | RIGHT) ? DerivedProperty.NumericPropertyDefinition<SimplePropertyDef.Make<"long", "non-nullable", "single">, Q> : DerivedProperty.NumericPropertyDefinition<SimplePropertyDef.Make<"integer", "non-nullable", "single">, Q>;
947
+ type ReturnTypeForDatetimeMethod<Q extends ObjectOrInterfaceDefinition, LEFT extends WirePropertyTypes, RIGHT extends WirePropertyTypes> = "timestamp" extends (LEFT | RIGHT) ? DerivedProperty.DatetimePropertyDefinition<SimplePropertyDef.Make<"timestamp", "non-nullable", "single">, Q> : DerivedProperty.DatetimePropertyDefinition<SimplePropertyDef.Make<"datetime", "non-nullable", "single">, Q>;
948
+ type ExtractWirePropertyTypeFromNumericArg<Q extends ObjectOrInterfaceDefinition, ARG extends NumericExpressionArg<Q>> = ARG extends number ? "double" : ARG extends DerivedProperty.NumericPropertyDefinition<infer T, Q> ? T extends SimplePropertyDef ? SimplePropertyDef.ExtractWirePropertyType<T> : never : ARG extends FilteredPropertyKeys<Q, WithPropertiesNumerics> ? NonNullable<CompileTimeMetadata<Q>["properties"][ARG]["type"]> : never;
949
+ type NumericExpressions<Q extends ObjectOrInterfaceDefinition, LEFT_PROPERTY_TYPE extends SimplePropertyDef> = {
950
+ readonly add: <A extends NumericExpressionArg<Q>>(value: A) => ReturnTypeForNumericMethod<Q, SimplePropertyDef.ExtractWirePropertyType<LEFT_PROPERTY_TYPE>, ExtractWirePropertyTypeFromNumericArg<Q, A>>;
951
+ readonly subtract: <A extends NumericExpressionArg<Q>>(value: A) => ReturnTypeForNumericMethod<Q, SimplePropertyDef.ExtractWirePropertyType<LEFT_PROPERTY_TYPE>, ExtractWirePropertyTypeFromNumericArg<Q, A>>;
952
+ readonly multiply: <A extends NumericExpressionArg<Q>>(value: A) => ReturnTypeForNumericMethod<Q, SimplePropertyDef.ExtractWirePropertyType<LEFT_PROPERTY_TYPE>, ExtractWirePropertyTypeFromNumericArg<Q, A>>;
953
+ readonly divide: <A extends NumericExpressionArg<Q>>(value: A) => ReturnTypeForNumericMethod<Q, SimplePropertyDef.ExtractWirePropertyType<LEFT_PROPERTY_TYPE>, ExtractWirePropertyTypeFromNumericArg<Q, A>>;
954
+ readonly abs: () => DerivedProperty.NumericPropertyDefinition<LEFT_PROPERTY_TYPE, Q>;
955
+ readonly negate: () => DerivedProperty.NumericPropertyDefinition<LEFT_PROPERTY_TYPE, Q>;
956
+ readonly max: <A extends NumericExpressionArg<Q>>(value: A) => ReturnTypeForNumericMethod<Q, SimplePropertyDef.ExtractWirePropertyType<LEFT_PROPERTY_TYPE>, ExtractWirePropertyTypeFromNumericArg<Q, A>>;
957
+ readonly min: <A extends NumericExpressionArg<Q>>(value: A) => ReturnTypeForNumericMethod<Q, SimplePropertyDef.ExtractWirePropertyType<LEFT_PROPERTY_TYPE>, ExtractWirePropertyTypeFromNumericArg<Q, A>>;
958
+ };
959
+ type DatetimeExpressionArg<Q extends ObjectOrInterfaceDefinition> = DerivedProperty.DatetimePropertyDefinition<any, Q>;
960
+ type ExtractPropertyTypeFromDatetimeArg<Q extends ObjectOrInterfaceDefinition, ARG extends DatetimeExpressionArg<Q>> = ARG extends DerivedProperty.DatetimePropertyDefinition<infer T, Q> ? T extends SimplePropertyDef ? SimplePropertyDef.ExtractWirePropertyType<T> : never : ARG extends FilteredPropertyKeys<Q, WithPropertiesDatetime> ? NonNullable<CompileTimeMetadata<Q>["properties"][ARG]["type"]> : never;
961
+ type DatetimeExpressions<Q extends ObjectOrInterfaceDefinition, LEFT_PROPERTY_TYPE extends SimplePropertyDef> = {
962
+ readonly min: <A extends DatetimeExpressionArg<Q>>(value: A) => ReturnTypeForDatetimeMethod<Q, SimplePropertyDef.ExtractWirePropertyType<LEFT_PROPERTY_TYPE>, ExtractPropertyTypeFromDatetimeArg<Q, A>>;
963
+ readonly max: (value: DatetimeExpressionArg<Q>) => ReturnTypeForDatetimeMethod<Q, SimplePropertyDef.ExtractWirePropertyType<LEFT_PROPERTY_TYPE>, ExtractPropertyTypeFromDatetimeArg<Q, typeof value>>;
964
+ readonly extractPart: (value: DerivedProperty.ValidParts) => DerivedProperty.Definition<SimplePropertyDef.Make<"string", "non-nullable", "single">, Q>;
965
+ };
966
+
920
967
  declare namespace DerivedProperty {
921
- type SelectorResult<T extends SimplePropertyDef> = {
968
+ export interface Definition<T extends SimplePropertyDef, Q extends ObjectOrInterfaceDefinition> {
922
969
  type: T;
970
+ }
971
+ export interface NumericPropertyDefinition<T extends SimplePropertyDef, Q extends ObjectOrInterfaceDefinition> extends Definition<T, Q>, NumericExpressions<Q, T> {
972
+ }
973
+ export interface DatetimePropertyDefinition<T extends SimplePropertyDef, Q extends ObjectOrInterfaceDefinition> extends Definition<T, Q>, DatetimeExpressions<Q, T> {
974
+ }
975
+ export type Clause<Q extends ObjectOrInterfaceDefinition> = {
976
+ [key: string]: Creator<Q, SimplePropertyDef>;
923
977
  };
924
- type Clause<Q extends ObjectOrInterfaceDefinition> = {
925
- [key: string]: Selector<Q, SimplePropertyDef>;
926
- };
927
- type Selector<Q extends ObjectOrInterfaceDefinition, T extends SimplePropertyDef> = (baseObjectSet: DerivedProperty.Builder<Q, false>) => SelectorResult<T>;
928
- interface Builder<Q extends ObjectOrInterfaceDefinition, CONSTRAINED extends boolean> extends Filterable<Q, CONSTRAINED>, Pivotable<Q, CONSTRAINED> {
978
+ export type Creator<Q extends ObjectOrInterfaceDefinition, T extends SimplePropertyDef> = (baseObjectSet: Builder<Q, false>) => Definition<T, Q> | NumericPropertyDefinition<T, Q> | DatetimePropertyDefinition<T, Q>;
979
+ interface BaseBuilder<Q extends ObjectOrInterfaceDefinition, CONSTRAINED extends boolean> extends Filterable<Q, CONSTRAINED>, Pivotable<Q, CONSTRAINED> {
980
+ }
981
+ export interface Builder<Q extends ObjectOrInterfaceDefinition, CONSTRAINED extends boolean> extends BaseBuilder<Q, CONSTRAINED>, Selectable<Q>, Constant<Q> {
929
982
  }
930
- interface AggregateBuilder<Q extends ObjectOrInterfaceDefinition, CONSTRAINED extends boolean> extends Builder<Q, CONSTRAINED>, Aggregatable<Q> {
983
+ export interface AggregateBuilder<Q extends ObjectOrInterfaceDefinition, CONSTRAINED extends boolean> extends BaseBuilder<Q, CONSTRAINED>, Aggregatable<Q> {
931
984
  }
932
- interface SelectPropertyBuilder<Q extends ObjectOrInterfaceDefinition, CONSTRAINED extends boolean> extends AggregateBuilder<Q, CONSTRAINED>, Selectable<Q> {
985
+ export interface SelectPropertyBuilder<Q extends ObjectOrInterfaceDefinition, CONSTRAINED extends boolean> extends AggregateBuilder<Q, CONSTRAINED>, Selectable<Q> {
933
986
  }
987
+ export type ValidParts = "DAYS" | "MONTHS" | "QUARTERS" | "YEARS";
988
+ export { };
934
989
  }
935
990
  type BuilderTypeFromConstraint<Q extends ObjectOrInterfaceDefinition, CONSTRAINED extends boolean> = CONSTRAINED extends true ? DerivedProperty.AggregateBuilder<Q, true> : DerivedProperty.SelectPropertyBuilder<Q, false>;
936
991
  type Filterable<Q extends ObjectOrInterfaceDefinition, CONSTRAINED extends boolean> = {
@@ -939,15 +994,24 @@ type Filterable<Q extends ObjectOrInterfaceDefinition, CONSTRAINED extends boole
939
994
  type Pivotable<Q extends ObjectOrInterfaceDefinition, CONSTRAINED extends boolean> = {
940
995
  readonly pivotTo: <L extends LinkNames<Q>>(type: L) => CONSTRAINED extends true ? DerivedProperty.AggregateBuilder<LinkedType<Q, L>, true> : NonNullable<CompileTimeMetadata<Q>["links"][L]["multiplicity"]> extends true ? DerivedProperty.AggregateBuilder<LinkedType<Q, L>, true> : DerivedProperty.SelectPropertyBuilder<LinkedType<Q, L>, false>;
941
996
  };
997
+ type Constant<Q extends ObjectOrInterfaceDefinition> = {
998
+ readonly constant: {
999
+ readonly double: (value: number) => DerivedProperty.NumericPropertyDefinition<SimplePropertyDef.Make<"double", "non-nullable", "single">, Q>;
1000
+ readonly integer: (value: number) => DerivedProperty.NumericPropertyDefinition<SimplePropertyDef.Make<"integer", "non-nullable", "single">, Q>;
1001
+ readonly long: (value: string) => DerivedProperty.NumericPropertyDefinition<SimplePropertyDef.Make<"long", "non-nullable", "single">, Q>;
1002
+ readonly datetime: (value: string) => DerivedProperty.DatetimePropertyDefinition<SimplePropertyDef.Make<"datetime", "non-nullable", "single">, Q>;
1003
+ readonly timestamp: (value: string) => DerivedProperty.DatetimePropertyDefinition<SimplePropertyDef.Make<"timestamp", "non-nullable", "single">, Q>;
1004
+ };
1005
+ };
942
1006
  type Aggregatable<Q extends ObjectOrInterfaceDefinition> = {
943
1007
  readonly aggregate: <V extends ValidAggregationKeys<Q, "withPropertiesAggregate">>(aggregationSpecifier: V, opts?: V extends `${any}:${infer P}` ? P extends CollectWithPropAggregations ? {
944
1008
  limit: number;
945
1009
  } : P extends "approximatePercentile" ? {
946
1010
  percentile: number;
947
- } : never : never) => DerivedProperty.SelectorResult<V extends `${infer N}:${infer P}` ? P extends CollectWithPropAggregations ? Array<CompileTimeMetadata<Q>["properties"][N]["type"]> | undefined : P extends MinMaxWithPropAggregateOption ? CompileTimeMetadata<Q>["properties"][N]["type"] | undefined : P extends "approximateDistinct" | "exactDistinct" | "$count" ? "integer" : "double" | undefined : V extends "$count" ? "integer" : never>;
1011
+ } : never : never) => DefinitionForType<Q, V extends `${infer N}:${infer P}` ? P extends CollectWithPropAggregations ? SimplePropertyDef.Make<CompileTimeMetadata<Q>["properties"][N]["type"], "nullable", "array"> : P extends MinMaxWithPropAggregateOption ? SimplePropertyDef.Make<CompileTimeMetadata<Q>["properties"][N]["type"], "nullable", "single"> : P extends "approximateDistinct" | "exactDistinct" ? SimplePropertyDef.Make<"integer", "non-nullable", "single"> : SimplePropertyDef.Make<"double", "nullable", "single"> : V extends "$count" ? SimplePropertyDef.Make<"integer", "non-nullable", "single"> : never>;
948
1012
  };
949
1013
  type Selectable<Q extends ObjectOrInterfaceDefinition> = {
950
- readonly selectProperty: <R extends PropertyKeys<Q>>(propertyName: R) => DerivedProperty.SelectorResult<SimplePropertyDef.Make<CompileTimeMetadata<Q>["properties"][R]["type"], CompileTimeMetadata<Q>["properties"][R]["nullable"], CompileTimeMetadata<Q>["properties"][R]["multiplicity"]>>;
1014
+ readonly selectProperty: <R extends PropertyKeys<Q>>(propertyName: R) => DefinitionForType<Q, SimplePropertyDef.Make<CompileTimeMetadata<Q>["properties"][R]["type"], CompileTimeMetadata<Q>["properties"][R]["nullable"] extends true ? "nullable" : "non-nullable", CompileTimeMetadata<Q>["properties"][R]["multiplicity"] extends true ? "array" : "single">>;
951
1015
  };
952
1016
 
953
1017
  interface BaseObjectSet<Q extends ObjectOrInterfaceDefinition> {
@@ -994,11 +1058,42 @@ type ObjectUpdate<O extends ObjectOrInterfaceDefinition, P extends PropertyKeys<
994
1058
  state: "ADDED_OR_UPDATED" | "REMOVED";
995
1059
  };
996
1060
 
997
- type MergeObjectSet<Q extends ObjectOrInterfaceDefinition, D extends ObjectSet<Q> | Record<string, SimplePropertyDef> = {}> = D extends Record<string, SimplePropertyDef> ? DerivedObjectOrInterfaceDefinition.WithDerivedProperties<Q, D> : Q;
998
- type ExtractRdp<D extends ObjectSet<any, any> | Record<string, SimplePropertyDef>> = D extends Record<string, SimplePropertyDef> ? D : {};
1061
+ type MergeObjectSet<Q extends ObjectOrInterfaceDefinition, D extends Record<string, SimplePropertyDef> = {}> = DerivedObjectOrInterfaceDefinition.WithDerivedProperties<Q, D>;
1062
+ type ExtractRdp<D extends BaseObjectSet<any> | Record<string, SimplePropertyDef>> = [D] extends [never] ? {} : D extends BaseObjectSet<any> ? {} : D extends Record<string, SimplePropertyDef> ? D : {};
1063
+ type MaybeSimplifyPropertyKeys<Q extends ObjectOrInterfaceDefinition, L extends PropertyKeys<Q>> = PropertyKeys<Q> extends L ? PropertyKeys<Q> : L;
1064
+ type SubSelectKeysHelper<Q extends ObjectOrInterfaceDefinition, L extends string> = [L] extends [never] ? PropertyKeys<Q> : PropertyKeys<Q> extends L ? PropertyKeys<Q> : L & PropertyKeys<Q>;
1065
+ type SubSelectKeys<Q extends ObjectOrInterfaceDefinition, X extends SelectArg<Q, PropertyKeys<Q>, any, any> = never> = SubSelectKeysHelper<Q, Extract$Select<X>>;
1066
+ type NOOP<T> = T extends (...args: any[]) => any ? T : T extends abstract new (...args: any[]) => any ? T : {
1067
+ [K in keyof T]: T[K];
1068
+ };
1069
+ type SubSelectRDPsHelper<X extends ValidFetchPageArgs<any, any> | ValidAsyncIterArgs<any, any>, DEFAULT extends string> = [X] extends [never] ? DEFAULT : (X["$select"] & string[])[number] & DEFAULT;
1070
+ type SubSelectRDPs<RDPs extends Record<string, SimplePropertyDef>, X extends ValidFetchPageArgs<any, RDPs> | ValidAsyncIterArgs<any, RDPs>> = [RDPs] extends [never] ? never : NOOP<{
1071
+ [K in SubSelectRDPsHelper<X, string & keyof RDPs>]: RDPs[K];
1072
+ }>;
999
1073
  interface MinimalObjectSet<Q extends ObjectOrInterfaceDefinition, RDPs extends Record<string, SimplePropertyDef> = {}> extends BaseObjectSet<Q>, FetchPage<Q, RDPs>, AsyncIter<Q, RDPs>, Where<Q, RDPs> {
1000
1074
  }
1075
+ type ExtractOptions2<X extends FetchPageArgs<any, any, any, any, any, any, any>> = [X] extends [never] ? never : ExtractRidOption<X["$includeRid"] extends true ? true : false> | ExtractAllPropertiesOption<X["$includeAllBaseObjectProperties"] extends true ? true : false>;
1076
+ type Extract$Select<X extends FetchPageArgs<any, any>> = NonNullable<X["$select"]>[number];
1001
1077
  interface FetchPage<Q extends ObjectOrInterfaceDefinition, RDPs extends Record<string, SimplePropertyDef> = {}> {
1078
+ readonly fetchPage: FetchPageSignature<Q, RDPs>;
1079
+ readonly fetchPageWithErrors: FetchPageWithErrorsSignature<Q, RDPs>;
1080
+ }
1081
+ type ValidFetchPageArgs<Q extends ObjectOrInterfaceDefinition, RDPs extends Record<string, SimplePropertyDef>> = ObjectSetArgs.FetchPage<Q, PropertyKeys<Q>, false, string & keyof RDPs> | ObjectSetArgs.FetchPage<Q, never, true, string & keyof RDPs>;
1082
+ type ValidAsyncIterArgs<Q extends ObjectOrInterfaceDefinition, RDPs extends Record<string, SimplePropertyDef>> = ObjectSetArgs.AsyncIter<Q, PropertyKeys<Q>, false, string & keyof RDPs> | AsyncIterArgs<Q, never, any, any, any, true, string & keyof RDPs>;
1083
+ interface FetchPageSignature<Q extends ObjectOrInterfaceDefinition, RDPs extends Record<string, SimplePropertyDef> = {}> {
1084
+ /**
1085
+ * Gets a page of objects of this type, with a result wrapper
1086
+ * @param args - Args to specify next page token and page size, if applicable
1087
+ * @example
1088
+ * const myObjs = await objectSet.fetchPage({
1089
+ $pageSize: 10,
1090
+ $nextPageToken: "nextPage"
1091
+ });
1092
+ const myObjsResult = myObjs.data;
1093
+
1094
+ * @returns a page of objects
1095
+ */
1096
+ <const X extends ValidFetchPageArgs<Q, RDPs> = never>(args?: X): Promise<PageResult<Osdk.Instance<Q, ExtractOptions2<X>, SubSelectKeys<Q, X>, SubSelectRDPs<RDPs, X>>>>;
1002
1097
  /**
1003
1098
  * Gets a page of objects of this type, with a result wrapper
1004
1099
  * @param args - Args to specify next page token and page size, if applicable
@@ -1011,9 +1106,9 @@ interface FetchPage<Q extends ObjectOrInterfaceDefinition, RDPs extends Record<s
1011
1106
 
1012
1107
  * @returns a page of objects
1013
1108
  */
1014
- readonly fetchPage: <L extends PropertyKeys<Q, RDPs>, R extends boolean, const A extends Augments, S extends NullabilityAdherence = NullabilityAdherence.Default, T extends boolean = false>(args?: FetchPageArgs<Q, L, R, A, S, T>) => Promise<PageResult<Osdk.Instance<Q, ExtractOptions<R, S, T>, PropertyKeys<Q> extends L ? PropertyKeys<Q> : PropertyKeys<Q> & L, {
1015
- [K in Extract<keyof RDPs, L>]: RDPs[K];
1016
- }>>>;
1109
+ <L extends PropertyKeys<Q>, R extends boolean, const A extends Augments, S extends NullabilityAdherence = NullabilityAdherence.Default, T extends boolean = false>(args?: FetchPageArgs<Q, L, R, A, S, T>): Promise<PageResult<Osdk.Instance<Q, ExtractOptions<R, S, T>, MaybeSimplifyPropertyKeys<Q, L>>>>;
1110
+ }
1111
+ interface FetchPageWithErrorsSignature<Q extends ObjectOrInterfaceDefinition, RDPs extends Record<string, SimplePropertyDef> = {}> {
1017
1112
  /**
1018
1113
  * Gets a page of objects of this type, with a result wrapper
1019
1114
  * @param args - Args to specify next page token and page size, if applicable
@@ -1028,9 +1123,22 @@ interface FetchPage<Q extends ObjectOrInterfaceDefinition, RDPs extends Record<s
1028
1123
  }
1029
1124
  * @returns a page of objects, wrapped in a result wrapper
1030
1125
  */
1031
- readonly fetchPageWithErrors: <L extends PropertyKeys<Q, RDPs>, R extends boolean, const A extends Augments, S extends NullabilityAdherence = NullabilityAdherence.Default, T extends boolean = false>(args?: FetchPageArgs<Q, L, R, A, S, T>) => Promise<Result<PageResult<Osdk.Instance<Q, ExtractOptions<R, S, T>, PropertyKeys<Q> extends L ? PropertyKeys<Q> : PropertyKeys<Q> & L, {
1032
- [K in Extract<keyof RDPs, L>]: RDPs[K];
1033
- }>>>>;
1126
+ <X extends ValidFetchPageArgs<Q, RDPs> = never>(args?: X): Promise<Result<PageResult<Osdk.Instance<Q, ExtractOptions2<X>, SubSelectKeys<Q, X>, SubSelectRDPs<RDPs, X>>>>>;
1127
+ /**
1128
+ * Gets a page of objects of this type, with a result wrapper
1129
+ * @param args - Args to specify next page token and page size, if applicable
1130
+ * @example
1131
+ * const myObjs = await objectSet.fetchPage({
1132
+ $pageSize: 10,
1133
+ $nextPageToken: "nextPage"
1134
+ });
1135
+
1136
+ if(isOk(myObjs)){
1137
+ const myObjsResult = myObjs.value.data;
1138
+ }
1139
+ * @returns a page of objects, wrapped in a result wrapper
1140
+ */
1141
+ <L extends PropertyKeys<Q>, R extends boolean, const A extends Augments, S extends NullabilityAdherence = NullabilityAdherence.Default, T extends boolean = false>(args?: FetchPageArgs<Q, L, R, A, S, T>): Promise<Result<PageResult<Osdk.Instance<Q, ExtractOptions<R, S, T>, MaybeSimplifyPropertyKeys<Q, L>>>>>;
1034
1142
  }
1035
1143
  interface Where<Q extends ObjectOrInterfaceDefinition, RDPs extends Record<string, SimplePropertyDef> = {}> {
1036
1144
  /**
@@ -1045,7 +1153,7 @@ interface Where<Q extends ObjectOrInterfaceDefinition, RDPs extends Record<strin
1045
1153
  */
1046
1154
  readonly where: (clause: WhereClause<MergeObjectSet<Q, RDPs>>) => this;
1047
1155
  }
1048
- interface AsyncIter<Q extends ObjectOrInterfaceDefinition, RDPs extends Record<string, SimplePropertyDef> = {}> {
1156
+ interface AsyncIterSignature<Q extends ObjectOrInterfaceDefinition, RDPs extends Record<string, SimplePropertyDef> = {}> {
1049
1157
  /**
1050
1158
  * Returns an async iterator to load all objects of this type
1051
1159
  * @example
@@ -1054,18 +1162,28 @@ interface AsyncIter<Q extends ObjectOrInterfaceDefinition, RDPs extends Record<s
1054
1162
  * }
1055
1163
  * @returns an async iterator to load all objects
1056
1164
  */
1057
- readonly asyncIter: <L extends PropertyKeys<Q, RDPs>, R extends boolean, const A extends Augments, S extends NullabilityAdherence = NullabilityAdherence.Default, T extends boolean = false>(args?: AsyncIterArgs<Q, L, R, A, S, T>) => AsyncIterableIterator<Osdk.Instance<Q, ExtractOptions<R, S, T>, PropertyKeys<Q> extends L ? PropertyKeys<Q> : PropertyKeys<Q> & L, {
1058
- [K in Extract<keyof RDPs, L>]: RDPs[K];
1059
- }>>;
1165
+ <X extends ValidAsyncIterArgs<Q, RDPs> = never>(args?: X): AsyncIterableIterator<Osdk.Instance<Q, ExtractOptions2<X>, SubSelectKeys<Q, X>, SubSelectRDPs<RDPs, X>>>;
1166
+ /**
1167
+ * Returns an async iterator to load all objects of this type
1168
+ * @example
1169
+ * for await (const obj of myObjectSet.asyncIter()){
1170
+ * // Handle obj
1171
+ * }
1172
+ * @returns an async iterator to load all objects
1173
+ */
1174
+ <L extends PropertyKeys<Q>, R extends boolean, const A extends Augments, S extends NullabilityAdherence = NullabilityAdherence.Default, T extends boolean = false>(args?: AsyncIterArgs<Q, L, R, A, S, T>): AsyncIterableIterator<Osdk.Instance<Q, ExtractOptions<R, S, T>, MaybeSimplifyPropertyKeys<Q, L>>>;
1175
+ }
1176
+ interface AsyncIter<Q extends ObjectOrInterfaceDefinition, RDPs extends Record<string, SimplePropertyDef> = {}> {
1177
+ asyncIter: AsyncIterSignature<Q, RDPs>;
1060
1178
  }
1061
1179
  interface WithProperties<Q extends ObjectOrInterfaceDefinition = any, RDPs extends Record<string, SimplePropertyDef> = {}> {
1062
1180
  readonly withProperties: <NEW extends Record<string, SimplePropertyDef>>(clause: {
1063
- [K in keyof NEW]: DerivedProperty.Selector<Q, NEW[K]>;
1181
+ [K in keyof NEW]: DerivedProperty.Creator<Q, NEW[K]>;
1064
1182
  }) => ObjectSet<Q, {
1065
1183
  [NN in keyof NEW | keyof RDPs]: NN extends keyof NEW ? NEW[NN] : NN extends keyof RDPs ? RDPs[NN] : never;
1066
1184
  }>;
1067
1185
  }
1068
- interface ObjectSet<Q extends ObjectOrInterfaceDefinition = any, UNUSED_OR_RDP extends ObjectSet<Q, any> | Record<string, SimplePropertyDef> = ObjectSet<Q, any>> extends ObjectSetCleanedTypes<Q, ExtractRdp<UNUSED_OR_RDP>, MergeObjectSet<Q, UNUSED_OR_RDP>> {
1186
+ interface ObjectSet<Q extends ObjectOrInterfaceDefinition = any, UNUSED_OR_RDP extends BaseObjectSet<Q> | Record<string, SimplePropertyDef> = never> extends ObjectSetCleanedTypes<Q, ExtractRdp<UNUSED_OR_RDP>, MergeObjectSet<Q, ExtractRdp<UNUSED_OR_RDP>>> {
1069
1187
  }
1070
1188
  interface Aggregate<Q extends ObjectOrInterfaceDefinition> {
1071
1189
  /**
@@ -1131,21 +1249,31 @@ interface PivotTo<Q extends ObjectOrInterfaceDefinition> {
1131
1249
  * @param type - The linked object type you want to pivot to
1132
1250
  * @returns an object set of the specified linked type
1133
1251
  */
1134
- readonly pivotTo: <L extends LinkNames<Q>>(type: L) => CompileTimeMetadata<LinkedType<Q, L>>["objectSet"];
1252
+ readonly pivotTo: <L extends LinkNames<Q>>(type: L) => ObjectSet<LinkedType<Q, L>>;
1135
1253
  }
1136
- interface FetchOne<Q extends ObjectOrInterfaceDefinition, RDPs extends Record<string, SimplePropertyDef>> {
1254
+ interface FetchOneSignature<Q extends ObjectTypeDefinition, RDPs extends Record<string, SimplePropertyDef>> {
1137
1255
  /**
1138
1256
  * Fetches one object with the specified primary key, without a result wrapper
1139
1257
  */
1140
- readonly fetchOne: Q extends ObjectTypeDefinition ? <const L extends PropertyKeys<Q, RDPs>, const R extends boolean, const S extends false | "throw" = NullabilityAdherence.Default>(primaryKey: PrimaryKeyType<Q>, options?: SelectArg<Q, L, R, S>) => Promise<Osdk.Instance<Q, ExtractOptions<R, S>, PropertyKeys<Q> extends L ? PropertyKeys<Q> : PropertyKeys<Q> & L, {
1141
- [K in Extract<keyof RDPs, L>]: RDPs[K];
1142
- }>> : never;
1258
+ <X extends ObjectSetArgs.Select<PropertyKeys<Q>, string & keyof RDPs> = never>(primaryKey: PrimaryKeyType<Q>, options?: X): Promise<Osdk.Instance<Q, ExtractOptions2<X>, SubSelectKeys<Q, X>, SubSelectRDPs<RDPs, X>>>;
1259
+ /**
1260
+ * Fetches one object with the specified primary key, without a result wrapper
1261
+ */
1262
+ <const L extends PropertyKeys<Q>, const R extends boolean, const S extends false | "throw" = NullabilityAdherence.Default>(primaryKey: PrimaryKeyType<Q>, options?: SelectArg<Q, L, R, S>): Promise<Osdk.Instance<Q, ExtractOptions<R, S>, MaybeSimplifyPropertyKeys<Q, L>>>;
1263
+ }
1264
+ interface FetchOneWithErrorsSignature<Q extends ObjectTypeDefinition, RDPs extends Record<string, SimplePropertyDef>> {
1143
1265
  /**
1144
1266
  * Fetches one object with the specified primary key, with a result wrapper
1145
1267
  */
1146
- readonly fetchOneWithErrors: Q extends ObjectTypeDefinition ? <L extends PropertyKeys<Q, RDPs>, R extends boolean, S extends false | "throw" = NullabilityAdherence.Default>(primaryKey: PrimaryKeyType<Q>, options?: SelectArg<Q, L, R, S>) => Promise<Result<Osdk.Instance<Q, ExtractOptions<R, S>, PropertyKeys<Q> extends L ? PropertyKeys<Q> : PropertyKeys<Q> & L, {
1147
- [K in Extract<keyof RDPs, L>]: RDPs[K];
1148
- }>>> : never;
1268
+ <X extends ObjectSetArgs.Select<PropertyKeys<Q>, string & keyof RDPs>>(primaryKey: PrimaryKeyType<Q>, options?: X): Promise<Result<Osdk.Instance<Q, ExtractOptions2<X>, SubSelectKeys<Q, X>, SubSelectRDPs<RDPs, X>>>>;
1269
+ /**
1270
+ * Fetches one object with the specified primary key, with a result wrapper
1271
+ */
1272
+ <const L extends PropertyKeys<Q>, const R extends boolean, const S extends false | "throw" = NullabilityAdherence.Default>(primaryKey: PrimaryKeyType<Q>, options?: SelectArg<Q, L, R, S>): Promise<Result<Osdk.Instance<Q, ExtractOptions<R, S>, MaybeSimplifyPropertyKeys<Q, L>>>>;
1273
+ }
1274
+ interface FetchOne<Q extends ObjectOrInterfaceDefinition, RDPs extends Record<string, SimplePropertyDef>> {
1275
+ fetchOne: Q extends ObjectTypeDefinition ? FetchOneSignature<Q, RDPs> : never;
1276
+ fetchOneWithErrors: Q extends ObjectTypeDefinition ? FetchOneWithErrorsSignature<Q, RDPs> : never;
1149
1277
  }
1150
1278
  interface Subscribe<Q extends ObjectOrInterfaceDefinition> {
1151
1279
  /**
@@ -1158,11 +1286,7 @@ interface Subscribe<Q extends ObjectOrInterfaceDefinition> {
1158
1286
  unsubscribe: () => void;
1159
1287
  };
1160
1288
  }
1161
- interface ObjectSetCleanedTypes<Q extends ObjectOrInterfaceDefinition, D extends Record<string, SimplePropertyDef>, MERGED extends ObjectOrInterfaceDefinition> extends MinimalObjectSet<Q, D>, WithProperties<Q, D>, Aggregate<MERGED>, SetArithmetic<MERGED>, PivotTo<MERGED>, FetchOne<Q, D>, Subscribe<MERGED> {
1289
+ interface ObjectSetCleanedTypes<Q extends ObjectOrInterfaceDefinition, D extends Record<string, SimplePropertyDef>, MERGED extends ObjectOrInterfaceDefinition & Q> extends MinimalObjectSet<Q, D>, WithProperties<Q, D>, Aggregate<MERGED>, SetArithmetic<MERGED>, PivotTo<Q>, FetchOne<Q, D>, Subscribe<MERGED> {
1162
1290
  }
1163
1291
 
1164
- type FilteredPropertyKeys<O extends ObjectOrInterfaceDefinition, T extends WirePropertyTypes> = {
1165
- [K in keyof NonNullable<O["__DefinitionMetadata"]>["properties"]]: NonNullable<O["__DefinitionMetadata"]>["properties"][K]["type"] extends T ? K : never;
1166
- }[keyof NonNullable<O["__DefinitionMetadata"]>["properties"]];
1167
-
1168
- export { type CompileTimeMetadata as $, type Attachment as A, type SelectArgToKeys as B, type FetchPageResult as C, DistanceUnitMapping as D, type SingleOsdkResult as E, type FetchPageArgs as F, type GeoFilterOptions as G, type Media as H, type InterfaceDefinition as I, type MediaMetadata as J, isOk as K, type Result as L, type MediaReference as M, NullabilityAdherence as N, type ObjectTypeDefinition as O, type PropertyValueWireToClient as P, type BaseObjectSet as Q, type ReleaseStatus as R, type SingleLinkAccessor as S, ObjectSetSubscription as T, type FilteredPropertyKeys as U, type ValidAggregationKeys as V, type WhereClause as W, type InterfaceMetadata as X, type ObjectOrInterfaceDefinition as Y, type PropertyKeys as Z, type ObjectSpecifier as _, type AttachmentUpload as a, ObjectMetadata as a0, type PropertyDef as a1, type VersionBound as a2, type BaseWirePropertyTypes as a3, type WirePropertyTypes as a4, type PrimaryKeyType as a5, type ConvertProps as a6, Osdk as a7, type PageResult as a8, TimeseriesDurationMapping as a9, type GeotimeSeriesProperty as aa, type TimeSeriesPoint as ab, type TimeSeriesProperty as ac, type TimeSeriesQuery as ad, type LinkedType as ae, type LinkNames as af, type ExtractOptions as ag, type MinimalObjectSet as ah, type OsdkBase as b, type OsdkObjectPrimaryKeyType as c, type ObjectSet as d, type OsdkMetadata as e, type PrimaryKeyTypes as f, type AggregateOpts as g, type AggregateOptsThatErrorsAndDisallowsOrderingWithMultipleGroupBy as h, type AggregationResultsWithGroups as i, type AggregationResultsWithoutGroups as j, type AggregationClause as k, type AggregationsResults as l, type GeoFilter_Intersects as m, type GeoFilter_Within as n, type PossibleWhereClauseFilters as o, type OsdkObjectPropertyType as p, type OsdkObjectLinksObject as q, DerivedProperty as r, DurationMapping as s, type AllGroupByValues as t, type GroupByClause as u, type GroupByRange as v, type AsyncIterArgs as w, type Augment as x, type Augments as y, type SelectArg as z };
1292
+ export { type ObjectSpecifier as $, type Attachment as A, type SelectArg as B, type SelectArgToKeys as C, DistanceUnitMapping as D, type FetchPageResult as E, type FetchPageArgs as F, type GeoFilterOptions as G, type SingleOsdkResult as H, type InterfaceDefinition as I, type Media as J, type MediaMetadata as K, isOk as L, type MediaReference as M, NullabilityAdherence as N, type ObjectTypeDefinition as O, type PropertyValueWireToClient as P, type Result as Q, type ReleaseStatus as R, type SingleLinkAccessor as S, type BaseObjectSet as T, ObjectSetSubscription as U, type ValidAggregationKeys as V, type WhereClause as W, type FilteredPropertyKeys as X, type InterfaceMetadata as Y, type ObjectOrInterfaceDefinition as Z, type PropertyKeys as _, type AttachmentUpload as a, type CompileTimeMetadata as a0, ObjectMetadata as a1, type PropertyDef as a2, type VersionBound as a3, type BaseWirePropertyTypes as a4, type WirePropertyTypes as a5, type PrimaryKeyType as a6, type ConvertProps as a7, Osdk as a8, type PageResult as a9, TimeseriesDurationMapping as aa, type GeotimeSeriesProperty as ab, type TimeSeriesPoint as ac, type TimeSeriesProperty as ad, type TimeSeriesQuery as ae, type LinkedType as af, type LinkNames as ag, type ExtractOptions as ah, type MinimalObjectSet as ai, type OsdkBase as b, type OsdkObjectPrimaryKeyType as c, type ObjectSet as d, type OsdkMetadata as e, type PrimaryKeyTypes as f, type OsdkBaseWithObjectSpecifier as g, type AggregateOpts as h, type AggregateOptsThatErrorsAndDisallowsOrderingWithMultipleGroupBy as i, type AggregationResultsWithGroups as j, type AggregationResultsWithoutGroups as k, type AggregationClause as l, type AggregationsResults as m, type GeoFilter_Intersects as n, type GeoFilter_Within as o, type PossibleWhereClauseFilters as p, type OsdkObjectPropertyType as q, type OsdkObjectLinksObject as r, DerivedProperty as s, DurationMapping as t, type AllGroupByValues as u, type GroupByClause as v, type GroupByRange as w, type AsyncIterArgs as x, type Augment as y, type Augments as z };
@@ -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 './FilteredPropertyKeys-CyOYr7Je.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, a3 as BaseWirePropertyTypes, $ as CompileTimeMetadata, a6 as ConvertProps, r as DerivedProperty, D as DistanceUnitMapping, s as DurationMapping, F as FetchPageArgs, C as FetchPageResult, U as FilteredPropertyKeys, G as GeoFilterOptions, m as GeoFilter_Intersects, n as GeoFilter_Within, aa as GeotimeSeriesProperty, u as GroupByClause, v as GroupByRange, X as InterfaceMetadata, af as LinkNames, ae as LinkedType, H as Media, J as MediaMetadata, N as NullabilityAdherence, a0 as ObjectMetadata, Y as ObjectOrInterfaceDefinition, T as ObjectSetSubscription, _ as ObjectSpecifier, a7 as Osdk, q as OsdkObjectLinksObject, p as OsdkObjectPropertyType, a8 as PageResult, o as PossibleWhereClauseFilters, a5 as PrimaryKeyType, a1 as PropertyDef, Z as PropertyKeys, L as Result, z as SelectArg, B as SelectArgToKeys, S as SingleLinkAccessor, E 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, K as isOk } from './FilteredPropertyKeys-CyOYr7Je.cjs';
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, g as OsdkBaseWithObjectSpecifier } from './ObjectSet-w3HV2UGC.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, T as BaseObjectSet, a4 as BaseWirePropertyTypes, a0 as CompileTimeMetadata, a7 as ConvertProps, s as DerivedProperty, D as DistanceUnitMapping, t as DurationMapping, F as FetchPageArgs, E as FetchPageResult, X as FilteredPropertyKeys, G as GeoFilterOptions, n as GeoFilter_Intersects, o as GeoFilter_Within, ab as GeotimeSeriesProperty, v as GroupByClause, w as GroupByRange, Y as InterfaceMetadata, ag as LinkNames, af as LinkedType, J as Media, K as MediaMetadata, N as NullabilityAdherence, a1 as ObjectMetadata, Z as ObjectOrInterfaceDefinition, U as ObjectSetSubscription, $ as ObjectSpecifier, a8 as Osdk, r as OsdkObjectLinksObject, q as OsdkObjectPropertyType, a9 as PageResult, p as PossibleWhereClauseFilters, a6 as PrimaryKeyType, a2 as PropertyDef, _ as PropertyKeys, Q as Result, B as SelectArg, C as SelectArgToKeys, S as SingleLinkAccessor, H as SingleOsdkResult, ac as TimeSeriesPoint, ad as TimeSeriesProperty, ae as TimeSeriesQuery, aa as TimeseriesDurationMapping, V as ValidAggregationKeys, a3 as VersionBound, W as WhereClause, a5 as WirePropertyTypes, L as isOk } from './ObjectSet-w3HV2UGC.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 | {
@@ -234,7 +238,7 @@ declare namespace ActionMetadata {
234
238
  nullable?: boolean;
235
239
  }
236
240
  namespace DataType {
237
- 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";
238
242
  interface Object<T_Target extends ObjectTypeDefinition = never> {
239
243
  __OsdkTargetType?: T_Target;
240
244
  type: "object";
@@ -411,7 +415,7 @@ declare namespace QueryResult {
411
415
  /**
412
416
  * Helper type to convert action definition parameter object types to typescript types
413
417
  */
414
- type ObjectType<T extends ObjectTypeDefinition> = OsdkBase<T>;
418
+ type ObjectType<T extends ObjectTypeDefinition> = OsdkBaseWithObjectSpecifier<T>;
415
419
  /**
416
420
  * Helper type to convert action definition parameter object sets to typescript types
417
421
  */
@@ -422,21 +426,23 @@ declare namespace QueryResult {
422
426
  }
423
427
 
424
428
  interface Logger {
425
- trace: LogFn;
426
- debug: LogFn;
427
- fatal: LogFn;
428
- error: LogFn;
429
- warn: LogFn;
430
- info: LogFn;
429
+ trace: Logger.LogFn;
430
+ debug: Logger.LogFn;
431
+ fatal: Logger.LogFn;
432
+ error: Logger.LogFn;
433
+ warn: Logger.LogFn;
434
+ info: Logger.LogFn;
431
435
  isLevelEnabled(level: string): boolean;
432
436
  child(bindings: Record<string, any>, options?: {
433
437
  level?: string;
434
438
  msgPrefix?: string;
435
439
  }): Logger;
436
440
  }
437
- interface LogFn {
438
- (obj: unknown, msg?: string, ...args: any[]): void;
439
- (msg: string, ...args: any[]): void;
441
+ declare namespace Logger {
442
+ interface LogFn {
443
+ (obj: unknown, msg?: string, ...args: any[]): void;
444
+ (msg: string, ...args: any[]): void;
445
+ }
440
446
  }
441
447
 
442
- 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, type 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 };
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, 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 };
@@ -1,5 +1,5 @@
1
- import { Y as ObjectOrInterfaceDefinition, U as FilteredPropertyKeys, M as MediaReference, O as ObjectTypeDefinition, Z as PropertyKeys, N as NullabilityAdherence, z as SelectArg, a7 as Osdk, ag as ExtractOptions, F as FetchPageArgs, C as FetchPageResult, b as OsdkBase } from '../FilteredPropertyKeys-CyOYr7Je.cjs';
2
- export { ah as MinimalObjectSet } from '../FilteredPropertyKeys-CyOYr7Je.cjs';
1
+ import { Z as ObjectOrInterfaceDefinition, X as FilteredPropertyKeys, M as MediaReference, O as ObjectTypeDefinition, _ as PropertyKeys, N as NullabilityAdherence, B as SelectArg, a8 as Osdk, ah as ExtractOptions, F as FetchPageArgs, E as FetchPageResult, b as OsdkBase } from '../ObjectSet-w3HV2UGC.cjs';
2
+ export { ai as MinimalObjectSet } from '../ObjectSet-w3HV2UGC.cjs';
3
3
  import 'type-fest';
4
4
  import 'geojson';
5
5
 
@@ -1,2 +1,17 @@
1
- export {};
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;
2
17
  //# sourceMappingURL=Logger.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Logger.js","names":[],"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: LogFn;\n debug: LogFn;\n fatal: LogFn;\n error: LogFn;\n warn: LogFn;\n info: 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 interface LogFn {\n (obj: unknown, msg?: string, ...args: any[]): void;\n (msg: string, ...args: any[]): void;\n}\n"],"mappings":"","ignoreList":[]}
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 { 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 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":[]}
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":[]}
@@ -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 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 * @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\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\" | \"$allBaseProperties\" = 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, 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;AAwBA;AAMA;AACA;AACA;AACA;AAiCA;AACA;AACA;AAFA,WAsBiBA,IAAI;AA6CrB;AACA;AACA;AACA;AACA;AACA;AACA;AAOA;AACA;AACA;AACA;AACA;AAWA","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 * @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\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\" | \"$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;AAwBA;AAMA;AACA;AACA;AACA;AAiCA;AACA;AACA;AAFA,WAsBiBA,IAAI;AA6CrB;AACA;AACA;AACA;AACA;AACA;AACA;AAOA;AACA;AACA;AACA;AACA;AAWA","ignoreList":[]}