@osdk/api 2.2.0-beta.16 → 2.2.0-beta.18
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.
- package/CHANGELOG.md +15 -0
- package/build/browser/Logger.js +16 -1
- package/build/browser/Logger.js.map +1 -1
- package/build/browser/OsdkBase.js.map +1 -1
- package/build/browser/OsdkObjectFrom.js +2 -4
- package/build/browser/OsdkObjectFrom.js.map +1 -1
- package/build/browser/OsdkObjectFrom.test.js +3 -3
- package/build/browser/OsdkObjectFrom.test.js.map +1 -1
- package/build/browser/actions/Actions.js.map +1 -1
- package/build/browser/derivedProperties/DerivedProperty.js.map +1 -1
- package/build/browser/derivedProperties/Expressions.js +2 -0
- package/build/browser/derivedProperties/Expressions.js.map +1 -0
- package/build/browser/experimental/createMediaReference.js.map +1 -1
- package/build/browser/index.js.map +1 -1
- package/build/browser/mapping/DataValueMapping.js.map +1 -1
- package/build/browser/object/FetchPageArgs.js +1 -0
- package/build/browser/object/FetchPageArgs.js.map +1 -1
- package/build/browser/objectSet/ObjectSet.js.map +1 -1
- package/build/browser/objectSet/ObjectSet.test.js +343 -31
- package/build/browser/objectSet/ObjectSet.test.js.map +1 -1
- package/build/browser/ontology/ActionDefinition.js.map +1 -1
- package/build/browser/ontology/ObjectOrInterface.js +1 -0
- package/build/browser/ontology/ObjectOrInterface.js.map +1 -1
- package/build/browser/ontology/ObjectSpecifier.js.map +1 -1
- package/build/browser/ontology/PrimaryKeyTypes.js.map +1 -1
- package/build/browser/ontology/SimplePropertyDef.js.map +1 -1
- package/build/browser/queries/Queries.js.map +1 -1
- package/build/browser/test/EmployeeApiTest.js.map +1 -1
- package/build/browser/util/IncludeValuesExtending.js +2 -0
- package/build/browser/util/IncludeValuesExtending.js.map +1 -0
- package/build/cjs/{FilteredPropertyKeys-CyOYr7Je.d.cts → ObjectSet-CTMK80LD.d.cts} +182 -51
- package/build/cjs/index.d.cts +21 -15
- package/build/cjs/public/unstable.d.cts +3 -3
- package/build/esm/Logger.js +16 -1
- package/build/esm/Logger.js.map +1 -1
- package/build/esm/OsdkBase.js.map +1 -1
- package/build/esm/OsdkObjectFrom.js +2 -4
- package/build/esm/OsdkObjectFrom.js.map +1 -1
- package/build/esm/OsdkObjectFrom.test.js +3 -3
- package/build/esm/OsdkObjectFrom.test.js.map +1 -1
- package/build/esm/actions/Actions.js.map +1 -1
- package/build/esm/derivedProperties/DerivedProperty.js.map +1 -1
- package/build/esm/derivedProperties/Expressions.js +2 -0
- package/build/esm/derivedProperties/Expressions.js.map +1 -0
- package/build/esm/experimental/createMediaReference.js.map +1 -1
- package/build/esm/index.js.map +1 -1
- package/build/esm/mapping/DataValueMapping.js.map +1 -1
- package/build/esm/object/FetchPageArgs.js +1 -0
- package/build/esm/object/FetchPageArgs.js.map +1 -1
- package/build/esm/objectSet/ObjectSet.js.map +1 -1
- package/build/esm/objectSet/ObjectSet.test.js +343 -31
- package/build/esm/objectSet/ObjectSet.test.js.map +1 -1
- package/build/esm/ontology/ActionDefinition.js.map +1 -1
- package/build/esm/ontology/ObjectOrInterface.js +1 -0
- package/build/esm/ontology/ObjectOrInterface.js.map +1 -1
- package/build/esm/ontology/ObjectSpecifier.js.map +1 -1
- package/build/esm/ontology/PrimaryKeyTypes.js.map +1 -1
- package/build/esm/ontology/SimplePropertyDef.js.map +1 -1
- package/build/esm/queries/Queries.js.map +1 -1
- package/build/esm/test/EmployeeApiTest.js.map +1 -1
- package/build/esm/util/IncludeValuesExtending.js +2 -0
- package/build/esm/util/IncludeValuesExtending.js.map +1 -0
- package/build/types/Logger.d.ts +11 -9
- package/build/types/Logger.d.ts.map +1 -1
- package/build/types/OsdkBase.d.ts +3 -1
- package/build/types/OsdkBase.d.ts.map +1 -1
- package/build/types/OsdkObjectFrom.d.ts +4 -2
- package/build/types/OsdkObjectFrom.d.ts.map +1 -1
- package/build/types/actions/Actions.d.ts +2 -2
- package/build/types/actions/Actions.d.ts.map +1 -1
- package/build/types/derivedProperties/DerivedProperty.d.ts +40 -13
- package/build/types/derivedProperties/DerivedProperty.d.ts.map +1 -1
- package/build/types/derivedProperties/Expressions.d.ts +53 -0
- package/build/types/derivedProperties/Expressions.d.ts.map +1 -0
- package/build/types/experimental/createMediaReference.d.ts +2 -3
- package/build/types/experimental/createMediaReference.d.ts.map +1 -1
- package/build/types/index.d.ts +0 -1
- package/build/types/index.d.ts.map +1 -1
- package/build/types/mapping/DataValueMapping.d.ts +4 -0
- package/build/types/mapping/DataValueMapping.d.ts.map +1 -1
- package/build/types/object/FetchPageArgs.d.ts +36 -6
- package/build/types/object/FetchPageArgs.d.ts.map +1 -1
- package/build/types/objectSet/ObjectSet.d.ts +137 -31
- package/build/types/objectSet/ObjectSet.d.ts.map +1 -1
- package/build/types/objectSet/ObjectSet.test.d.ts +2 -1
- package/build/types/objectSet/ObjectSet.test.d.ts.map +1 -1
- package/build/types/ontology/ActionDefinition.d.ts +1 -1
- package/build/types/ontology/ActionDefinition.d.ts.map +1 -1
- package/build/types/ontology/ObjectOrInterface.d.ts +12 -5
- package/build/types/ontology/ObjectOrInterface.d.ts.map +1 -1
- package/build/types/ontology/ObjectSpecifier.d.ts +2 -1
- package/build/types/ontology/ObjectSpecifier.d.ts.map +1 -1
- package/build/types/ontology/PrimaryKeyTypes.d.ts +1 -1
- package/build/types/ontology/PrimaryKeyTypes.d.ts.map +1 -1
- package/build/types/ontology/SimplePropertyDef.d.ts +4 -4
- package/build/types/ontology/SimplePropertyDef.d.ts.map +1 -1
- package/build/types/queries/Queries.d.ts +2 -2
- package/build/types/queries/Queries.d.ts.map +1 -1
- package/build/types/test/EmployeeApiTest.d.ts +13 -5
- package/build/types/test/EmployeeApiTest.d.ts.map +1 -1
- package/build/types/util/IncludeValuesExtending.d.ts +4 -0
- package/build/types/util/IncludeValuesExtending.d.ts.map +1 -0
- package/package.json +1 -1
- package/build/browser/ontology/FilteredPropertyKeys.js +0 -2
- package/build/browser/ontology/FilteredPropertyKeys.js.map +0 -1
- package/build/esm/ontology/FilteredPropertyKeys.js +0 -2
- package/build/esm/ontology/FilteredPropertyKeys.js.map +0 -1
- package/build/types/ontology/FilteredPropertyKeys.d.ts +0 -6
- package/build/types/ontology/FilteredPropertyKeys.d.ts.map +0 -1
|
@@ -247,11 +247,15 @@ type GetWirePropertyValueFromClient<T extends keyof PropertyValueClientToWire |
|
|
|
247
247
|
[K in keyof T]: PropertyValueClientToWire[T[K]];
|
|
248
248
|
} : never;
|
|
249
249
|
|
|
250
|
+
type IncludeValuesExtending<T extends Record<keyof any, any>, M> = {
|
|
251
|
+
[K in keyof T as T[K] extends M ? K : never]: T[K];
|
|
252
|
+
};
|
|
253
|
+
|
|
250
254
|
interface OsdkMetadata {
|
|
251
255
|
extraUserAgent: string;
|
|
252
256
|
}
|
|
253
257
|
|
|
254
|
-
type PrimaryKeyTypes = "string" | "datetime" | "double" | "
|
|
258
|
+
type PrimaryKeyTypes = "string" | "datetime" | "double" | "integer" | "timestamp" | "short" | "long" | "byte";
|
|
255
259
|
|
|
256
260
|
type VersionString<Major extends number, Minor extends number, Patch extends number> = `${Major}.${Minor}.${Patch}`;
|
|
257
261
|
|
|
@@ -347,8 +351,8 @@ interface InterfaceDefinition {
|
|
|
347
351
|
|
|
348
352
|
type SimplePropertyDef = WirePropertyTypes | undefined | Array<WirePropertyTypes>;
|
|
349
353
|
declare namespace SimplePropertyDef {
|
|
350
|
-
type Make<T extends WirePropertyTypes, N extends
|
|
351
|
-
type FromPropertyMetadata<P extends ObjectMetadata.Property> = Make<P["type"], P["nullable"], P["multiplicity"]>;
|
|
354
|
+
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;
|
|
355
|
+
type FromPropertyMetadata<P extends ObjectMetadata.Property> = Make<P["type"], P["nullable"] extends true ? "nullable" : "non-nullable", P["multiplicity"] extends true ? "array" : "single">;
|
|
352
356
|
type ExtractMultiplicity<T extends WirePropertyTypes | undefined | Array<WirePropertyTypes>> = NonNullable<T> extends Array<any> ? "array" : "single";
|
|
353
357
|
type ExtractWirePropertyType<T extends SimplePropertyDef> = T extends Array<infer Z> ? NonNullable<Z> : NonNullable<T>;
|
|
354
358
|
type ExtractNullable<T extends SimplePropertyDef> = [undefined] extends [T] ? "nullable" : [[undefined]] extends [T] ? "nullable" : "non-nullable";
|
|
@@ -370,7 +374,12 @@ declare namespace DerivedObjectOrInterfaceDefinition {
|
|
|
370
374
|
};
|
|
371
375
|
} & K;
|
|
372
376
|
}
|
|
373
|
-
type PropertyKeys<O extends ObjectOrInterfaceDefinition
|
|
377
|
+
type PropertyKeys<O extends ObjectOrInterfaceDefinition> = (keyof CompileTimeMetadata<O>["properties"]) & string;
|
|
378
|
+
declare namespace PropertyKeys {
|
|
379
|
+
type Filtered<Q extends ObjectOrInterfaceDefinition, T extends WirePropertyTypes> = keyof IncludeValuesExtending<CompileTimeMetadata<Q>["properties"], {
|
|
380
|
+
type: T;
|
|
381
|
+
}>;
|
|
382
|
+
}
|
|
374
383
|
|
|
375
384
|
type BaseAggregateOptions = "approximateDistinct" | "exactDistinct";
|
|
376
385
|
type MinMaxAggregateOption = "min" | "max";
|
|
@@ -534,21 +543,37 @@ type NullabilityAdherence = false | "throw" | "drop";
|
|
|
534
543
|
declare namespace NullabilityAdherence {
|
|
535
544
|
type Default = "throw";
|
|
536
545
|
}
|
|
546
|
+
declare namespace ObjectSetArgs {
|
|
547
|
+
interface Select<OBJECT_KEYS extends string = never, RDP_KEYS extends string = never> {
|
|
548
|
+
$select?: readonly (OBJECT_KEYS | RDP_KEYS)[];
|
|
549
|
+
$includeRid?: boolean;
|
|
550
|
+
}
|
|
551
|
+
interface OrderBy<L extends string = never> {
|
|
552
|
+
$orderBy?: {
|
|
553
|
+
[K in L]?: "asc" | "desc";
|
|
554
|
+
};
|
|
555
|
+
}
|
|
556
|
+
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> {
|
|
557
|
+
$__UNSTABLE_useOldInterfaceApis?: boolean;
|
|
558
|
+
$includeAllBaseObjectProperties?: PropertyKeys<Q> extends K ? T : never;
|
|
559
|
+
}
|
|
560
|
+
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> {
|
|
561
|
+
$nextPageToken?: string;
|
|
562
|
+
$pageSize?: number;
|
|
563
|
+
}
|
|
564
|
+
}
|
|
537
565
|
interface SelectArg<Q extends ObjectOrInterfaceDefinition, L extends PropertyKeys<Q> = PropertyKeys<Q>, R extends boolean = false, S extends NullabilityAdherence = NullabilityAdherence.Default> {
|
|
538
566
|
$select?: readonly L[];
|
|
539
567
|
$includeRid?: R;
|
|
540
568
|
}
|
|
541
|
-
interface OrderByArg<Q extends ObjectOrInterfaceDefinition, L extends PropertyKeys<Q> = PropertyKeys<Q>> {
|
|
542
|
-
$orderBy?: {
|
|
543
|
-
[K in L]?: "asc" | "desc";
|
|
544
|
-
};
|
|
569
|
+
interface OrderByArg<Q extends ObjectOrInterfaceDefinition, L extends PropertyKeys<Q> = PropertyKeys<Q>> extends ObjectSetArgs.OrderBy<L> {
|
|
545
570
|
}
|
|
546
571
|
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> {
|
|
572
|
+
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
573
|
$nextPageToken?: string;
|
|
549
574
|
$pageSize?: number;
|
|
550
575
|
}
|
|
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>> {
|
|
576
|
+
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
577
|
$__UNSTABLE_useOldInterfaceApis?: boolean;
|
|
553
578
|
$includeAllBaseObjectProperties?: PropertyKeys<Q> extends K ? T : never;
|
|
554
579
|
}
|
|
@@ -608,7 +633,7 @@ type SingleOsdkResult<Q extends ObjectOrInterfaceDefinition, L extends PropertyK
|
|
|
608
633
|
}>;
|
|
609
634
|
|
|
610
635
|
type ObjectSpecifier<Q extends ObjectOrInterfaceDefinition> = string & {
|
|
611
|
-
__apiName: Q["apiName"] | (Q extends InterfaceDefinition ?
|
|
636
|
+
__apiName: Q["apiName"] | (Q extends InterfaceDefinition ? CompileTimeMetadata<Q> extends InterfaceMetadata ? NonNullable<CompileTimeMetadata<Q>["implementedBy"]>[number] : never : never);
|
|
612
637
|
};
|
|
613
638
|
|
|
614
639
|
type OsdkObjectPrimaryKeyType<Q extends ObjectTypeDefinition> = PropertyValueWireToClient[CompileTimeMetadata<Q>["primaryKeyType"]];
|
|
@@ -618,8 +643,10 @@ type OsdkBase<Q extends ObjectOrInterfaceDefinition> = {
|
|
|
618
643
|
readonly $objectType: string;
|
|
619
644
|
readonly $primaryKey: PrimaryKeyType<Q>;
|
|
620
645
|
readonly $title: string | undefined;
|
|
621
|
-
readonly $objectSpecifier: ObjectSpecifier<Q>;
|
|
622
646
|
};
|
|
647
|
+
interface OsdkBaseWithObjectSpecifier<Q extends ObjectOrInterfaceDefinition> extends OsdkBase<Q> {
|
|
648
|
+
readonly $objectSpecifier: ObjectSpecifier<Q>;
|
|
649
|
+
}
|
|
623
650
|
type PrimaryKeyType<Q extends ObjectOrInterfaceDefinition> = (Q extends ObjectTypeDefinition ? OsdkObjectPrimaryKeyType<Q> : unknown) & PropertyValueWireToClient[PrimaryKeyTypes];
|
|
624
651
|
|
|
625
652
|
type SpecialOsdkPropParams = "$all" | "$rid" | "$strict" | "$notStrict";
|
|
@@ -631,6 +658,8 @@ type MapPropNamesToObjectType<FROM extends ObjectOrInterfaceDefinition, TO exten
|
|
|
631
658
|
type PropMapToInterface<FROM extends ObjectTypeDefinition, TO extends InterfaceDefinition> = NonNullable<CompileTimeMetadata<FROM>["inverseInterfaceMap"]>[ApiNameAsString<TO>];
|
|
632
659
|
type MapPropNamesToInterface<FROM extends ObjectTypeDefinition, TO extends InterfaceDefinition, P extends ValidOsdkPropParams<FROM>> = PropMapToInterface<FROM, TO>[JustProps<FROM, P> & keyof PropMapToInterface<FROM, TO>];
|
|
633
660
|
/**
|
|
661
|
+
* Older version of this helper that allows for `$rid` and co in
|
|
662
|
+
* the properties field.
|
|
634
663
|
* @param FROM - the interface or object type to convert from
|
|
635
664
|
* @param TO - the interface or object type to convert to
|
|
636
665
|
* @param P - the property(s) to convert
|
|
@@ -647,7 +676,7 @@ type GetPropsKeys<Q extends ObjectOrInterfaceDefinition, P extends PropertyKeys<
|
|
|
647
676
|
*/
|
|
648
677
|
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
678
|
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> = {}> =
|
|
679
|
+
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
680
|
[A in keyof R]: SimplePropertyDef.ToRuntimeProperty<R[A]>;
|
|
652
681
|
}) & {
|
|
653
682
|
readonly $link: Q extends {
|
|
@@ -917,20 +946,53 @@ type WhereClause<T extends ObjectOrInterfaceDefinition> = OrWhereClause<T> | And
|
|
|
917
946
|
type LinkNames<Q extends ObjectOrInterfaceDefinition> = keyof CompileTimeMetadata<Q>["links"] & string;
|
|
918
947
|
type LinkedType<Q extends ObjectOrInterfaceDefinition, L extends LinkNames<Q>> = NonNullable<CompileTimeMetadata<Q>["links"][L]["__OsdkLinkTargetType"]>;
|
|
919
948
|
|
|
949
|
+
type WithPropertiesNumerics = "integer" | "double" | "float" | "short" | "long";
|
|
950
|
+
type WithPropertiesDatetime = "datetime" | "timestamp";
|
|
951
|
+
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>;
|
|
952
|
+
type NumericExpressionArg<Q extends ObjectOrInterfaceDefinition> = number | DerivedProperty.NumericPropertyDefinition<any, Q>;
|
|
953
|
+
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>;
|
|
954
|
+
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>;
|
|
955
|
+
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 PropertyKeys.Filtered<Q, WithPropertiesNumerics> ? NonNullable<CompileTimeMetadata<Q>["properties"][ARG]["type"]> : never;
|
|
956
|
+
type NumericExpressions<Q extends ObjectOrInterfaceDefinition, LEFT_PROPERTY_TYPE extends SimplePropertyDef> = {
|
|
957
|
+
readonly add: <A extends NumericExpressionArg<Q>>(value: A) => ReturnTypeForNumericMethod<Q, SimplePropertyDef.ExtractWirePropertyType<LEFT_PROPERTY_TYPE>, ExtractWirePropertyTypeFromNumericArg<Q, A>>;
|
|
958
|
+
readonly subtract: <A extends NumericExpressionArg<Q>>(value: A) => ReturnTypeForNumericMethod<Q, SimplePropertyDef.ExtractWirePropertyType<LEFT_PROPERTY_TYPE>, ExtractWirePropertyTypeFromNumericArg<Q, A>>;
|
|
959
|
+
readonly multiply: <A extends NumericExpressionArg<Q>>(value: A) => ReturnTypeForNumericMethod<Q, SimplePropertyDef.ExtractWirePropertyType<LEFT_PROPERTY_TYPE>, ExtractWirePropertyTypeFromNumericArg<Q, A>>;
|
|
960
|
+
readonly divide: <A extends NumericExpressionArg<Q>>(value: A) => ReturnTypeForNumericMethod<Q, SimplePropertyDef.ExtractWirePropertyType<LEFT_PROPERTY_TYPE>, ExtractWirePropertyTypeFromNumericArg<Q, A>>;
|
|
961
|
+
readonly abs: () => DerivedProperty.NumericPropertyDefinition<LEFT_PROPERTY_TYPE, Q>;
|
|
962
|
+
readonly negate: () => DerivedProperty.NumericPropertyDefinition<LEFT_PROPERTY_TYPE, Q>;
|
|
963
|
+
readonly max: <A extends NumericExpressionArg<Q>>(value: A) => ReturnTypeForNumericMethod<Q, SimplePropertyDef.ExtractWirePropertyType<LEFT_PROPERTY_TYPE>, ExtractWirePropertyTypeFromNumericArg<Q, A>>;
|
|
964
|
+
readonly min: <A extends NumericExpressionArg<Q>>(value: A) => ReturnTypeForNumericMethod<Q, SimplePropertyDef.ExtractWirePropertyType<LEFT_PROPERTY_TYPE>, ExtractWirePropertyTypeFromNumericArg<Q, A>>;
|
|
965
|
+
};
|
|
966
|
+
type DatetimeExpressionArg<Q extends ObjectOrInterfaceDefinition> = DerivedProperty.DatetimePropertyDefinition<any, Q>;
|
|
967
|
+
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 PropertyKeys.Filtered<Q, WithPropertiesDatetime> ? NonNullable<CompileTimeMetadata<Q>["properties"][ARG]["type"]> : never;
|
|
968
|
+
type DatetimeExpressions<Q extends ObjectOrInterfaceDefinition, LEFT_PROPERTY_TYPE extends SimplePropertyDef> = {
|
|
969
|
+
readonly min: <A extends DatetimeExpressionArg<Q>>(value: A) => ReturnTypeForDatetimeMethod<Q, SimplePropertyDef.ExtractWirePropertyType<LEFT_PROPERTY_TYPE>, ExtractPropertyTypeFromDatetimeArg<Q, A>>;
|
|
970
|
+
readonly max: (value: DatetimeExpressionArg<Q>) => ReturnTypeForDatetimeMethod<Q, SimplePropertyDef.ExtractWirePropertyType<LEFT_PROPERTY_TYPE>, ExtractPropertyTypeFromDatetimeArg<Q, typeof value>>;
|
|
971
|
+
readonly extractPart: (value: DerivedProperty.ValidParts) => DerivedProperty.Definition<SimplePropertyDef.Make<"string", "non-nullable", "single">, Q>;
|
|
972
|
+
};
|
|
973
|
+
|
|
920
974
|
declare namespace DerivedProperty {
|
|
921
|
-
|
|
975
|
+
export interface Definition<T extends SimplePropertyDef, Q extends ObjectOrInterfaceDefinition> {
|
|
922
976
|
type: T;
|
|
977
|
+
}
|
|
978
|
+
export interface NumericPropertyDefinition<T extends SimplePropertyDef, Q extends ObjectOrInterfaceDefinition> extends Definition<T, Q>, NumericExpressions<Q, T> {
|
|
979
|
+
}
|
|
980
|
+
export interface DatetimePropertyDefinition<T extends SimplePropertyDef, Q extends ObjectOrInterfaceDefinition> extends Definition<T, Q>, DatetimeExpressions<Q, T> {
|
|
981
|
+
}
|
|
982
|
+
export type Clause<Q extends ObjectOrInterfaceDefinition> = {
|
|
983
|
+
[key: string]: Creator<Q, SimplePropertyDef>;
|
|
923
984
|
};
|
|
924
|
-
type
|
|
925
|
-
|
|
926
|
-
}
|
|
927
|
-
|
|
928
|
-
interface Builder<Q extends ObjectOrInterfaceDefinition, CONSTRAINED extends boolean> extends Filterable<Q, CONSTRAINED>, Pivotable<Q, CONSTRAINED> {
|
|
985
|
+
export type Creator<Q extends ObjectOrInterfaceDefinition, T extends SimplePropertyDef> = (baseObjectSet: Builder<Q, false>) => Definition<T, Q> | NumericPropertyDefinition<T, Q> | DatetimePropertyDefinition<T, Q>;
|
|
986
|
+
interface BaseBuilder<Q extends ObjectOrInterfaceDefinition, CONSTRAINED extends boolean> extends Filterable<Q, CONSTRAINED>, Pivotable<Q, CONSTRAINED> {
|
|
987
|
+
}
|
|
988
|
+
export interface Builder<Q extends ObjectOrInterfaceDefinition, CONSTRAINED extends boolean> extends BaseBuilder<Q, CONSTRAINED>, Selectable<Q>, Constant<Q> {
|
|
929
989
|
}
|
|
930
|
-
interface AggregateBuilder<Q extends ObjectOrInterfaceDefinition, CONSTRAINED extends boolean> extends
|
|
990
|
+
export interface AggregateBuilder<Q extends ObjectOrInterfaceDefinition, CONSTRAINED extends boolean> extends BaseBuilder<Q, CONSTRAINED>, Aggregatable<Q> {
|
|
931
991
|
}
|
|
932
|
-
interface SelectPropertyBuilder<Q extends ObjectOrInterfaceDefinition, CONSTRAINED extends boolean> extends AggregateBuilder<Q, CONSTRAINED>, Selectable<Q> {
|
|
992
|
+
export interface SelectPropertyBuilder<Q extends ObjectOrInterfaceDefinition, CONSTRAINED extends boolean> extends AggregateBuilder<Q, CONSTRAINED>, Selectable<Q> {
|
|
933
993
|
}
|
|
994
|
+
export type ValidParts = "DAYS" | "MONTHS" | "QUARTERS" | "YEARS";
|
|
995
|
+
export { };
|
|
934
996
|
}
|
|
935
997
|
type BuilderTypeFromConstraint<Q extends ObjectOrInterfaceDefinition, CONSTRAINED extends boolean> = CONSTRAINED extends true ? DerivedProperty.AggregateBuilder<Q, true> : DerivedProperty.SelectPropertyBuilder<Q, false>;
|
|
936
998
|
type Filterable<Q extends ObjectOrInterfaceDefinition, CONSTRAINED extends boolean> = {
|
|
@@ -939,15 +1001,24 @@ type Filterable<Q extends ObjectOrInterfaceDefinition, CONSTRAINED extends boole
|
|
|
939
1001
|
type Pivotable<Q extends ObjectOrInterfaceDefinition, CONSTRAINED extends boolean> = {
|
|
940
1002
|
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
1003
|
};
|
|
1004
|
+
type Constant<Q extends ObjectOrInterfaceDefinition> = {
|
|
1005
|
+
readonly constant: {
|
|
1006
|
+
readonly double: (value: number) => DerivedProperty.NumericPropertyDefinition<SimplePropertyDef.Make<"double", "non-nullable", "single">, Q>;
|
|
1007
|
+
readonly integer: (value: number) => DerivedProperty.NumericPropertyDefinition<SimplePropertyDef.Make<"integer", "non-nullable", "single">, Q>;
|
|
1008
|
+
readonly long: (value: string) => DerivedProperty.NumericPropertyDefinition<SimplePropertyDef.Make<"long", "non-nullable", "single">, Q>;
|
|
1009
|
+
readonly datetime: (value: string) => DerivedProperty.DatetimePropertyDefinition<SimplePropertyDef.Make<"datetime", "non-nullable", "single">, Q>;
|
|
1010
|
+
readonly timestamp: (value: string) => DerivedProperty.DatetimePropertyDefinition<SimplePropertyDef.Make<"timestamp", "non-nullable", "single">, Q>;
|
|
1011
|
+
};
|
|
1012
|
+
};
|
|
942
1013
|
type Aggregatable<Q extends ObjectOrInterfaceDefinition> = {
|
|
943
1014
|
readonly aggregate: <V extends ValidAggregationKeys<Q, "withPropertiesAggregate">>(aggregationSpecifier: V, opts?: V extends `${any}:${infer P}` ? P extends CollectWithPropAggregations ? {
|
|
944
1015
|
limit: number;
|
|
945
1016
|
} : P extends "approximatePercentile" ? {
|
|
946
1017
|
percentile: number;
|
|
947
|
-
} : never : never) =>
|
|
1018
|
+
} : 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
1019
|
};
|
|
949
1020
|
type Selectable<Q extends ObjectOrInterfaceDefinition> = {
|
|
950
|
-
readonly selectProperty: <R extends PropertyKeys<Q>>(propertyName: R) =>
|
|
1021
|
+
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
1022
|
};
|
|
952
1023
|
|
|
953
1024
|
interface BaseObjectSet<Q extends ObjectOrInterfaceDefinition> {
|
|
@@ -994,11 +1065,29 @@ type ObjectUpdate<O extends ObjectOrInterfaceDefinition, P extends PropertyKeys<
|
|
|
994
1065
|
state: "ADDED_OR_UPDATED" | "REMOVED";
|
|
995
1066
|
};
|
|
996
1067
|
|
|
997
|
-
type MergeObjectSet<Q extends ObjectOrInterfaceDefinition, D extends
|
|
998
|
-
type ExtractRdp<D extends
|
|
1068
|
+
type MergeObjectSet<Q extends ObjectOrInterfaceDefinition, D extends Record<string, SimplePropertyDef> = {}> = DerivedObjectOrInterfaceDefinition.WithDerivedProperties<Q, D>;
|
|
1069
|
+
type ExtractRdp<D extends BaseObjectSet<any> | Record<string, SimplePropertyDef>> = [D] extends [never] ? {} : D extends BaseObjectSet<any> ? {} : D extends Record<string, SimplePropertyDef> ? D : {};
|
|
1070
|
+
type MaybeSimplifyPropertyKeys<Q extends ObjectOrInterfaceDefinition, L extends PropertyKeys<Q>> = PropertyKeys<Q> extends L ? PropertyKeys<Q> : L;
|
|
1071
|
+
type SubSelectKeysHelper<Q extends ObjectOrInterfaceDefinition, L extends string> = [L] extends [never] ? PropertyKeys<Q> : PropertyKeys<Q> extends L ? PropertyKeys<Q> : L & PropertyKeys<Q>;
|
|
1072
|
+
type SubSelectKeys<Q extends ObjectOrInterfaceDefinition, X extends SelectArg<Q, PropertyKeys<Q>, any, any> = never> = SubSelectKeysHelper<Q, Extract$Select<X>>;
|
|
1073
|
+
type NOOP<T> = T extends (...args: any[]) => any ? T : T extends abstract new (...args: any[]) => any ? T : {
|
|
1074
|
+
[K in keyof T]: T[K];
|
|
1075
|
+
};
|
|
1076
|
+
type SubSelectRDPsHelper<X extends ValidFetchPageArgs<any, any> | ValidAsyncIterArgs<any, any>, DEFAULT extends string> = [X] extends [never] ? DEFAULT : (X["$select"] & string[])[number] & DEFAULT;
|
|
1077
|
+
type SubSelectRDPs<RDPs extends Record<string, SimplePropertyDef>, X extends ValidFetchPageArgs<any, RDPs> | ValidAsyncIterArgs<any, RDPs>> = [RDPs] extends [never] ? never : NOOP<{
|
|
1078
|
+
[K in SubSelectRDPsHelper<X, string & keyof RDPs>]: RDPs[K];
|
|
1079
|
+
}>;
|
|
999
1080
|
interface MinimalObjectSet<Q extends ObjectOrInterfaceDefinition, RDPs extends Record<string, SimplePropertyDef> = {}> extends BaseObjectSet<Q>, FetchPage<Q, RDPs>, AsyncIter<Q, RDPs>, Where<Q, RDPs> {
|
|
1000
1081
|
}
|
|
1082
|
+
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>;
|
|
1083
|
+
type Extract$Select<X extends FetchPageArgs<any, any>> = NonNullable<X["$select"]>[number];
|
|
1001
1084
|
interface FetchPage<Q extends ObjectOrInterfaceDefinition, RDPs extends Record<string, SimplePropertyDef> = {}> {
|
|
1085
|
+
readonly fetchPage: FetchPageSignature<Q, RDPs>;
|
|
1086
|
+
readonly fetchPageWithErrors: FetchPageWithErrorsSignature<Q, RDPs>;
|
|
1087
|
+
}
|
|
1088
|
+
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>;
|
|
1089
|
+
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>;
|
|
1090
|
+
interface FetchPageSignature<Q extends ObjectOrInterfaceDefinition, RDPs extends Record<string, SimplePropertyDef> = {}> {
|
|
1002
1091
|
/**
|
|
1003
1092
|
* Gets a page of objects of this type, with a result wrapper
|
|
1004
1093
|
* @param args - Args to specify next page token and page size, if applicable
|
|
@@ -1011,9 +1100,22 @@ interface FetchPage<Q extends ObjectOrInterfaceDefinition, RDPs extends Record<s
|
|
|
1011
1100
|
|
|
1012
1101
|
* @returns a page of objects
|
|
1013
1102
|
*/
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1103
|
+
<const X extends ValidFetchPageArgs<Q, RDPs> = never>(args?: X): Promise<PageResult<Osdk.Instance<Q, ExtractOptions2<X>, SubSelectKeys<Q, X>, SubSelectRDPs<RDPs, X>>>>;
|
|
1104
|
+
/**
|
|
1105
|
+
* Gets a page of objects of this type, with a result wrapper
|
|
1106
|
+
* @param args - Args to specify next page token and page size, if applicable
|
|
1107
|
+
* @example
|
|
1108
|
+
* const myObjs = await objectSet.fetchPage({
|
|
1109
|
+
$pageSize: 10,
|
|
1110
|
+
$nextPageToken: "nextPage"
|
|
1111
|
+
});
|
|
1112
|
+
const myObjsResult = myObjs.data;
|
|
1113
|
+
|
|
1114
|
+
* @returns a page of objects
|
|
1115
|
+
*/
|
|
1116
|
+
<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>>>>;
|
|
1117
|
+
}
|
|
1118
|
+
interface FetchPageWithErrorsSignature<Q extends ObjectOrInterfaceDefinition, RDPs extends Record<string, SimplePropertyDef> = {}> {
|
|
1017
1119
|
/**
|
|
1018
1120
|
* Gets a page of objects of this type, with a result wrapper
|
|
1019
1121
|
* @param args - Args to specify next page token and page size, if applicable
|
|
@@ -1028,9 +1130,22 @@ interface FetchPage<Q extends ObjectOrInterfaceDefinition, RDPs extends Record<s
|
|
|
1028
1130
|
}
|
|
1029
1131
|
* @returns a page of objects, wrapped in a result wrapper
|
|
1030
1132
|
*/
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1133
|
+
<X extends ValidFetchPageArgs<Q, RDPs> = never>(args?: X): Promise<Result<PageResult<Osdk.Instance<Q, ExtractOptions2<X>, SubSelectKeys<Q, X>, SubSelectRDPs<RDPs, X>>>>>;
|
|
1134
|
+
/**
|
|
1135
|
+
* Gets a page of objects of this type, with a result wrapper
|
|
1136
|
+
* @param args - Args to specify next page token and page size, if applicable
|
|
1137
|
+
* @example
|
|
1138
|
+
* const myObjs = await objectSet.fetchPage({
|
|
1139
|
+
$pageSize: 10,
|
|
1140
|
+
$nextPageToken: "nextPage"
|
|
1141
|
+
});
|
|
1142
|
+
|
|
1143
|
+
if(isOk(myObjs)){
|
|
1144
|
+
const myObjsResult = myObjs.value.data;
|
|
1145
|
+
}
|
|
1146
|
+
* @returns a page of objects, wrapped in a result wrapper
|
|
1147
|
+
*/
|
|
1148
|
+
<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
1149
|
}
|
|
1035
1150
|
interface Where<Q extends ObjectOrInterfaceDefinition, RDPs extends Record<string, SimplePropertyDef> = {}> {
|
|
1036
1151
|
/**
|
|
@@ -1045,7 +1160,16 @@ interface Where<Q extends ObjectOrInterfaceDefinition, RDPs extends Record<strin
|
|
|
1045
1160
|
*/
|
|
1046
1161
|
readonly where: (clause: WhereClause<MergeObjectSet<Q, RDPs>>) => this;
|
|
1047
1162
|
}
|
|
1048
|
-
interface
|
|
1163
|
+
interface AsyncIterSignature<Q extends ObjectOrInterfaceDefinition, RDPs extends Record<string, SimplePropertyDef> = {}> {
|
|
1164
|
+
/**
|
|
1165
|
+
* Returns an async iterator to load all objects of this type
|
|
1166
|
+
* @example
|
|
1167
|
+
* for await (const obj of myObjectSet.asyncIter()){
|
|
1168
|
+
* // Handle obj
|
|
1169
|
+
* }
|
|
1170
|
+
* @returns an async iterator to load all objects
|
|
1171
|
+
*/
|
|
1172
|
+
<X extends ValidAsyncIterArgs<Q, RDPs> = never>(args?: X): AsyncIterableIterator<Osdk.Instance<Q, ExtractOptions2<X>, SubSelectKeys<Q, X>, SubSelectRDPs<RDPs, X>>>;
|
|
1049
1173
|
/**
|
|
1050
1174
|
* Returns an async iterator to load all objects of this type
|
|
1051
1175
|
* @example
|
|
@@ -1054,18 +1178,19 @@ interface AsyncIter<Q extends ObjectOrInterfaceDefinition, RDPs extends Record<s
|
|
|
1054
1178
|
* }
|
|
1055
1179
|
* @returns an async iterator to load all objects
|
|
1056
1180
|
*/
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1181
|
+
<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>>>;
|
|
1182
|
+
}
|
|
1183
|
+
interface AsyncIter<Q extends ObjectOrInterfaceDefinition, RDPs extends Record<string, SimplePropertyDef> = {}> {
|
|
1184
|
+
asyncIter: AsyncIterSignature<Q, RDPs>;
|
|
1060
1185
|
}
|
|
1061
1186
|
interface WithProperties<Q extends ObjectOrInterfaceDefinition = any, RDPs extends Record<string, SimplePropertyDef> = {}> {
|
|
1062
1187
|
readonly withProperties: <NEW extends Record<string, SimplePropertyDef>>(clause: {
|
|
1063
|
-
[K in keyof NEW]: DerivedProperty.
|
|
1188
|
+
[K in keyof NEW]: DerivedProperty.Creator<Q, NEW[K]>;
|
|
1064
1189
|
}) => ObjectSet<Q, {
|
|
1065
1190
|
[NN in keyof NEW | keyof RDPs]: NN extends keyof NEW ? NEW[NN] : NN extends keyof RDPs ? RDPs[NN] : never;
|
|
1066
1191
|
}>;
|
|
1067
1192
|
}
|
|
1068
|
-
interface ObjectSet<Q extends ObjectOrInterfaceDefinition = any, UNUSED_OR_RDP extends
|
|
1193
|
+
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
1194
|
}
|
|
1070
1195
|
interface Aggregate<Q extends ObjectOrInterfaceDefinition> {
|
|
1071
1196
|
/**
|
|
@@ -1131,21 +1256,31 @@ interface PivotTo<Q extends ObjectOrInterfaceDefinition> {
|
|
|
1131
1256
|
* @param type - The linked object type you want to pivot to
|
|
1132
1257
|
* @returns an object set of the specified linked type
|
|
1133
1258
|
*/
|
|
1134
|
-
readonly pivotTo: <L extends LinkNames<Q>>(type: L) =>
|
|
1259
|
+
readonly pivotTo: <L extends LinkNames<Q>>(type: L) => ObjectSet<LinkedType<Q, L>>;
|
|
1135
1260
|
}
|
|
1136
|
-
interface
|
|
1261
|
+
interface FetchOneSignature<Q extends ObjectTypeDefinition, RDPs extends Record<string, SimplePropertyDef>> {
|
|
1137
1262
|
/**
|
|
1138
1263
|
* Fetches one object with the specified primary key, without a result wrapper
|
|
1139
1264
|
*/
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1265
|
+
<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>>>;
|
|
1266
|
+
/**
|
|
1267
|
+
* Fetches one object with the specified primary key, without a result wrapper
|
|
1268
|
+
*/
|
|
1269
|
+
<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>>>;
|
|
1270
|
+
}
|
|
1271
|
+
interface FetchOneWithErrorsSignature<Q extends ObjectTypeDefinition, RDPs extends Record<string, SimplePropertyDef>> {
|
|
1143
1272
|
/**
|
|
1144
1273
|
* Fetches one object with the specified primary key, with a result wrapper
|
|
1145
1274
|
*/
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1275
|
+
<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>>>>;
|
|
1276
|
+
/**
|
|
1277
|
+
* Fetches one object with the specified primary key, with a result wrapper
|
|
1278
|
+
*/
|
|
1279
|
+
<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>>>>;
|
|
1280
|
+
}
|
|
1281
|
+
interface FetchOne<Q extends ObjectOrInterfaceDefinition, RDPs extends Record<string, SimplePropertyDef>> {
|
|
1282
|
+
fetchOne: Q extends ObjectTypeDefinition ? FetchOneSignature<Q, RDPs> : never;
|
|
1283
|
+
fetchOneWithErrors: Q extends ObjectTypeDefinition ? FetchOneWithErrorsSignature<Q, RDPs> : never;
|
|
1149
1284
|
}
|
|
1150
1285
|
interface Subscribe<Q extends ObjectOrInterfaceDefinition> {
|
|
1151
1286
|
/**
|
|
@@ -1158,11 +1293,7 @@ interface Subscribe<Q extends ObjectOrInterfaceDefinition> {
|
|
|
1158
1293
|
unsubscribe: () => void;
|
|
1159
1294
|
};
|
|
1160
1295
|
}
|
|
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<
|
|
1296
|
+
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
1297
|
}
|
|
1163
1298
|
|
|
1164
|
-
type
|
|
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 };
|
|
1299
|
+
export { type ObjectSpecifier as $, type Attachment as A, type SelectArg as B, type CompileTimeMetadata as C, DistanceUnitMapping as D, type SelectArgToKeys as E, type FetchPageArgs as F, type GeoFilterOptions as G, type FetchPageResult as H, type InterfaceDefinition as I, type SingleOsdkResult as J, type Media as K, type MediaMetadata as L, type MediaReference as M, NullabilityAdherence as N, type ObjectTypeDefinition as O, type PropertyValueWireToClient as P, isOk as Q, type ReleaseStatus as R, type SingleLinkAccessor as S, type Result as T, type BaseObjectSet as U, type ValidAggregationKeys as V, type WhereClause as W, ObjectSetSubscription as X, type InterfaceMetadata as Y, type ObjectOrInterfaceDefinition as Z, PropertyKeys 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 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 };
|
package/build/cjs/index.d.cts
CHANGED
|
@@ -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 './
|
|
2
|
-
export {
|
|
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, C as CompileTimeMetadata, R as ReleaseStatus, e as OsdkMetadata, P as PropertyValueWireToClient, f as PrimaryKeyTypes, g as OsdkBaseWithObjectSpecifier } from './ObjectSet-CTMK80LD.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-CTMK80LD.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 | {
|
|
@@ -195,7 +199,7 @@ declare namespace ActionParam {
|
|
|
195
199
|
* Helper type to convert action definition parameter interface types to typescript types
|
|
196
200
|
*/
|
|
197
201
|
type InterfaceType<T extends InterfaceDefinition> = {
|
|
198
|
-
$objectType:
|
|
202
|
+
$objectType: CompileTimeMetadata<T> extends {
|
|
199
203
|
implementedBy: infer U;
|
|
200
204
|
} ? (U extends ReadonlyArray<never> ? string : U extends ReadonlyArray<string> ? U[number] : string) : string;
|
|
201
205
|
$primaryKey: string | number;
|
|
@@ -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> =
|
|
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
|
-
|
|
438
|
-
|
|
439
|
-
|
|
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,
|
|
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 };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { ah as MinimalObjectSet } from '../
|
|
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-CTMK80LD.cjs';
|
|
2
|
+
export { ah as MinimalObjectSet } from '../ObjectSet-CTMK80LD.cjs';
|
|
3
3
|
import 'type-fest';
|
|
4
4
|
import 'geojson';
|
|
5
5
|
|
|
@@ -23,7 +23,7 @@ type ExperimentFns<B extends Experiment<string, string>> = NonNullable<B["brande
|
|
|
23
23
|
*
|
|
24
24
|
* @returns media reference of the uploaded media item.
|
|
25
25
|
*/
|
|
26
|
-
type createMediaReference = <Q extends ObjectOrInterfaceDefinition, const L extends
|
|
26
|
+
type createMediaReference = <Q extends ObjectOrInterfaceDefinition, const L extends PropertyKeys.Filtered<Q, "mediaReference">>(args: {
|
|
27
27
|
data: Blob;
|
|
28
28
|
fileName: string;
|
|
29
29
|
objectType: Q;
|
package/build/esm/Logger.js
CHANGED
|
@@ -1,2 +1,17 @@
|
|
|
1
|
-
|
|
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
|
package/build/esm/Logger.js.map
CHANGED
|
@@ -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
|
|
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}
|
|
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
|
*/
|