@osdk/api 2.2.0-beta.8 → 2.3.0-beta.1
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 +143 -0
- package/build/browser/Logger.js +17 -0
- package/build/browser/Logger.js.map +1 -0
- 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/aggregate/AggregatableKeys.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/derivedProperties/WithPropertiesAggregationOptions.js.map +1 -1
- package/build/browser/experimental/createMediaReference.js.map +1 -1
- package/build/browser/experimental/fetchPageByRid.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/object/FetchPageResult.js.map +1 -1
- package/build/browser/objectSet/BulkLinkResult.js.map +1 -1
- package/build/browser/objectSet/ObjectSet.js.map +1 -1
- package/build/browser/objectSet/ObjectSet.test.js +399 -5
- 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/QueryDefinition.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-D4ZQUqjG.d.cts → ObjectSet-6WzPM-IC.d.cts} +209 -68
- package/build/cjs/index.d.cts +33 -7
- package/build/cjs/public/unstable.d.cts +5 -5
- package/build/esm/Logger.js +17 -0
- package/build/esm/Logger.js.map +1 -0
- 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/aggregate/AggregatableKeys.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/derivedProperties/WithPropertiesAggregationOptions.js.map +1 -1
- package/build/esm/experimental/createMediaReference.js.map +1 -1
- package/build/esm/experimental/fetchPageByRid.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/object/FetchPageResult.js.map +1 -1
- package/build/esm/objectSet/BulkLinkResult.js.map +1 -1
- package/build/esm/objectSet/ObjectSet.js.map +1 -1
- package/build/esm/objectSet/ObjectSet.test.js +399 -5
- 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/QueryDefinition.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 +19 -0
- package/build/types/Logger.d.ts.map +1 -0
- package/build/types/OsdkBase.d.ts +9 -7
- package/build/types/OsdkBase.d.ts.map +1 -1
- package/build/types/OsdkObjectFrom.d.ts +14 -8
- package/build/types/OsdkObjectFrom.d.ts.map +1 -1
- package/build/types/actions/Actions.d.ts +4 -4
- package/build/types/actions/Actions.d.ts.map +1 -1
- package/build/types/aggregate/AggregatableKeys.d.ts +10 -8
- package/build/types/aggregate/AggregatableKeys.d.ts.map +1 -1
- package/build/types/derivedProperties/DerivedProperty.d.ts +44 -16
- 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/derivedProperties/WithPropertiesAggregationOptions.d.ts +6 -3
- package/build/types/derivedProperties/WithPropertiesAggregationOptions.d.ts.map +1 -1
- package/build/types/experimental/createMediaReference.d.ts +2 -3
- package/build/types/experimental/createMediaReference.d.ts.map +1 -1
- package/build/types/experimental/fetchPageByRid.d.ts +3 -2
- package/build/types/experimental/fetchPageByRid.d.ts.map +1 -1
- package/build/types/index.d.ts +43 -43
- 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 +39 -6
- package/build/types/object/FetchPageArgs.d.ts.map +1 -1
- package/build/types/object/FetchPageResult.d.ts +6 -4
- package/build/types/object/FetchPageResult.d.ts.map +1 -1
- package/build/types/objectSet/BulkLinkResult.d.ts +1 -1
- package/build/types/objectSet/ObjectSet.d.ts +144 -35
- 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/QueryDefinition.d.ts +2 -0
- package/build/types/ontology/QueryDefinition.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/public/unstable.d.ts +3 -3
- package/build/types/public/unstable.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 +25 -1
- 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 +4 -4
- 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
|
@@ -56,10 +56,13 @@ interface MediaMetadata {
|
|
|
56
56
|
mediaType: string;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
+
type DistinctWithPropAggregateOption = "approximateDistinct" | "exactDistinct";
|
|
59
60
|
type CollectWithPropAggregations = "collectSet" | "collectList";
|
|
60
|
-
type BaseWithPropAggregations =
|
|
61
|
-
type
|
|
62
|
-
type
|
|
61
|
+
type BaseWithPropAggregations = DistinctWithPropAggregateOption | CollectWithPropAggregations;
|
|
62
|
+
type MinMaxWithPropAggregateOption = "min" | "max";
|
|
63
|
+
type DatetimeWithPropAggregateOption = MinMaxWithPropAggregateOption | BaseWithPropAggregations;
|
|
64
|
+
type NumericWithPropAggregateOption = "sum" | "avg" | "approximatePercentile" | MinMaxWithPropAggregateOption | BaseWithPropAggregations;
|
|
65
|
+
type ValidCollectPropertyKeysForSpecialTypes = "attachment" | "geopoint" | "geoshape" | "boolean";
|
|
63
66
|
|
|
64
67
|
type TimeSeriesQuery = {
|
|
65
68
|
$before: number;
|
|
@@ -244,11 +247,15 @@ type GetWirePropertyValueFromClient<T extends keyof PropertyValueClientToWire |
|
|
|
244
247
|
[K in keyof T]: PropertyValueClientToWire[T[K]];
|
|
245
248
|
} : never;
|
|
246
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
|
+
|
|
247
254
|
interface OsdkMetadata {
|
|
248
255
|
extraUserAgent: string;
|
|
249
256
|
}
|
|
250
257
|
|
|
251
|
-
type PrimaryKeyTypes = "string" | "datetime" | "double" | "
|
|
258
|
+
type PrimaryKeyTypes = "string" | "datetime" | "double" | "integer" | "timestamp" | "short" | "long" | "byte";
|
|
252
259
|
|
|
253
260
|
type VersionString<Major extends number, Minor extends number, Patch extends number> = `${Major}.${Minor}.${Patch}`;
|
|
254
261
|
|
|
@@ -344,8 +351,8 @@ interface InterfaceDefinition {
|
|
|
344
351
|
|
|
345
352
|
type SimplePropertyDef = WirePropertyTypes | undefined | Array<WirePropertyTypes>;
|
|
346
353
|
declare namespace SimplePropertyDef {
|
|
347
|
-
type Make<T extends WirePropertyTypes, N extends
|
|
348
|
-
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">;
|
|
349
356
|
type ExtractMultiplicity<T extends WirePropertyTypes | undefined | Array<WirePropertyTypes>> = NonNullable<T> extends Array<any> ? "array" : "single";
|
|
350
357
|
type ExtractWirePropertyType<T extends SimplePropertyDef> = T extends Array<infer Z> ? NonNullable<Z> : NonNullable<T>;
|
|
351
358
|
type ExtractNullable<T extends SimplePropertyDef> = [undefined] extends [T] ? "nullable" : [[undefined]] extends [T] ? "nullable" : "non-nullable";
|
|
@@ -367,13 +374,22 @@ declare namespace DerivedObjectOrInterfaceDefinition {
|
|
|
367
374
|
};
|
|
368
375
|
} & K;
|
|
369
376
|
}
|
|
370
|
-
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
|
+
}
|
|
371
383
|
|
|
372
|
-
type
|
|
373
|
-
type
|
|
374
|
-
type
|
|
384
|
+
type BaseAggregateOptions = "approximateDistinct" | "exactDistinct";
|
|
385
|
+
type MinMaxAggregateOption = "min" | "max";
|
|
386
|
+
type DatetimeAggregateOption = MinMaxAggregateOption | BaseAggregateOptions;
|
|
387
|
+
type NumericAggregateOption = "sum" | "avg" | "approximateDistinct" | "exactDistinct" | MinMaxAggregateOption;
|
|
388
|
+
type AGG_FOR_TYPE<WIRE_TYPE extends WirePropertyTypes> = number extends GetWirePropertyValueFromClient<WIRE_TYPE> ? NumericAggregateOption : WIRE_TYPE extends "datetime" | "timestamp" ? DatetimeAggregateOption : BaseAggregateOptions;
|
|
389
|
+
type WITH_PROPERTIES_AGG_FOR_TYPE<WIRE_TYPE extends WirePropertyTypes> = number extends GetWirePropertyValueFromClient<WIRE_TYPE> ? NumericWithPropAggregateOption : WIRE_TYPE extends "datetime" | "timestamp" ? DatetimeWithPropAggregateOption : WIRE_TYPE extends "string" ? BaseWithPropAggregations : WITH_PROPERTIES_AGG_FOR_SPECIAL_WIRE_TYPE<WIRE_TYPE>;
|
|
390
|
+
type WITH_PROPERTIES_AGG_FOR_SPECIAL_WIRE_TYPE<WIRE_TYPE extends WirePropertyTypes> = WIRE_TYPE extends ValidCollectPropertyKeysForSpecialTypes ? BaseWithPropAggregations : DistinctWithPropAggregateOption;
|
|
375
391
|
type ValidAggregationKeys<Q extends ObjectOrInterfaceDefinition, R extends "aggregate" | "withPropertiesAggregate" = "aggregate"> = keyof ({
|
|
376
|
-
[KK in AggregatableKeys<Q> as `${KK & string}:${AGG_FOR_TYPE<
|
|
392
|
+
[KK in AggregatableKeys<Q> as `${KK & string}:${R extends "aggregate" ? AGG_FOR_TYPE<CompileTimeMetadata<Q>["properties"][KK]["type"]> : WITH_PROPERTIES_AGG_FOR_TYPE<CompileTimeMetadata<Q>["properties"][KK]["type"]>}`]?: any;
|
|
377
393
|
} & {
|
|
378
394
|
$count?: any;
|
|
379
395
|
});
|
|
@@ -527,22 +543,39 @@ type NullabilityAdherence = false | "throw" | "drop";
|
|
|
527
543
|
declare namespace NullabilityAdherence {
|
|
528
544
|
type Default = "throw";
|
|
529
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
|
+
}
|
|
530
565
|
interface SelectArg<Q extends ObjectOrInterfaceDefinition, L extends PropertyKeys<Q> = PropertyKeys<Q>, R extends boolean = false, S extends NullabilityAdherence = NullabilityAdherence.Default> {
|
|
531
566
|
$select?: readonly L[];
|
|
532
567
|
$includeRid?: R;
|
|
533
568
|
}
|
|
534
|
-
interface OrderByArg<Q extends ObjectOrInterfaceDefinition, L extends PropertyKeys<Q> = PropertyKeys<Q>> {
|
|
535
|
-
$orderBy?: {
|
|
536
|
-
[K in L]?: "asc" | "desc";
|
|
537
|
-
};
|
|
569
|
+
interface OrderByArg<Q extends ObjectOrInterfaceDefinition, L extends PropertyKeys<Q> = PropertyKeys<Q>> extends ObjectSetArgs.OrderBy<L> {
|
|
538
570
|
}
|
|
539
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>;
|
|
540
|
-
interface FetchPageArgs<Q extends ObjectOrInterfaceDefinition, K extends PropertyKeys<Q> = PropertyKeys<Q>, R extends boolean = false, A extends Augments = never, S extends NullabilityAdherence = NullabilityAdherence.Default> extends AsyncIterArgs<Q, K, R, A, S> {
|
|
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> {
|
|
541
573
|
$nextPageToken?: string;
|
|
542
574
|
$pageSize?: number;
|
|
543
575
|
}
|
|
544
|
-
interface AsyncIterArgs<Q extends ObjectOrInterfaceDefinition, K extends PropertyKeys<Q> = PropertyKeys<Q>, R extends boolean = false, A extends Augments = never, S extends NullabilityAdherence = NullabilityAdherence.Default> 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>> {
|
|
545
577
|
$__UNSTABLE_useOldInterfaceApis?: boolean;
|
|
578
|
+
$includeAllBaseObjectProperties?: PropertyKeys<Q> extends K ? T : never;
|
|
546
579
|
}
|
|
547
580
|
type Augment<X extends ObjectOrInterfaceDefinition, T extends string> = {
|
|
548
581
|
[K in CompileTimeMetadata<X>["apiName"]]: T[];
|
|
@@ -591,27 +624,29 @@ type UnionIfTrue<S extends string, UNION_IF_TRUE extends boolean, E extends stri
|
|
|
591
624
|
/**
|
|
592
625
|
* Helper type for converting fetch options into an Osdk object
|
|
593
626
|
*/
|
|
594
|
-
type FetchPageResult<Q extends ObjectOrInterfaceDefinition, L extends PropertyKeys<Q>, R extends boolean, S extends NullabilityAdherence> = PageResult<PropertyKeys<Q> extends L ? Osdk.Instance<Q, ExtractOptions<R, S>> : Osdk.Instance<Q, ExtractOptions<R, S>, L>>;
|
|
627
|
+
type FetchPageResult<Q extends ObjectOrInterfaceDefinition, L extends PropertyKeys<Q>, R extends boolean, S extends NullabilityAdherence, T extends boolean = false> = PageResult<PropertyKeys<Q> extends L ? Osdk.Instance<Q, ExtractOptions<R, S, T>> : Osdk.Instance<Q, ExtractOptions<R, S, T>, L>>;
|
|
595
628
|
/**
|
|
596
629
|
* Helper type for converting fetch options into an Osdk object
|
|
597
630
|
*/
|
|
598
|
-
type SingleOsdkResult<Q extends ObjectOrInterfaceDefinition, L extends PropertyKeys<Q> | (keyof RDPs & string), R extends boolean, S extends NullabilityAdherence, RDPs extends Record<string, SimplePropertyDef> = {}> = Osdk.Instance<Q, ExtractOptions<R, S>, PropertyKeys<Q> extends L ? PropertyKeys<Q> : PropertyKeys<Q> & L, {
|
|
631
|
+
type SingleOsdkResult<Q extends ObjectOrInterfaceDefinition, L extends PropertyKeys<Q> | (keyof RDPs & string), R extends boolean, S extends NullabilityAdherence, RDPs extends Record<string, SimplePropertyDef> = {}, T extends boolean = false> = Osdk.Instance<Q, ExtractOptions<R, S, T>, PropertyKeys<Q> extends L ? PropertyKeys<Q> : PropertyKeys<Q> & L, {
|
|
599
632
|
[K in Extract<keyof RDPs, L>]: RDPs[K];
|
|
600
633
|
}>;
|
|
601
634
|
|
|
602
635
|
type ObjectSpecifier<Q extends ObjectOrInterfaceDefinition> = string & {
|
|
603
|
-
__apiName: Q["apiName"] | (Q extends InterfaceDefinition ?
|
|
636
|
+
__apiName: Q["apiName"] | (Q extends InterfaceDefinition ? CompileTimeMetadata<Q> extends InterfaceMetadata ? NonNullable<CompileTimeMetadata<Q>["implementedBy"]>[number] : never : never);
|
|
604
637
|
};
|
|
605
638
|
|
|
606
639
|
type OsdkObjectPrimaryKeyType<Q extends ObjectTypeDefinition> = PropertyValueWireToClient[CompileTimeMetadata<Q>["primaryKeyType"]];
|
|
607
640
|
|
|
608
|
-
|
|
641
|
+
interface ObjectIdentifiers<Q extends ObjectOrInterfaceDefinition> {
|
|
609
642
|
readonly $apiName: Q["apiName"];
|
|
610
|
-
readonly $objectType: string;
|
|
611
643
|
readonly $primaryKey: PrimaryKeyType<Q>;
|
|
612
|
-
|
|
644
|
+
}
|
|
645
|
+
interface OsdkBase<Q extends ObjectOrInterfaceDefinition> extends ObjectIdentifiers<Q> {
|
|
613
646
|
readonly $objectSpecifier: ObjectSpecifier<Q>;
|
|
614
|
-
|
|
647
|
+
readonly $objectType: string;
|
|
648
|
+
readonly $title: string | undefined;
|
|
649
|
+
}
|
|
615
650
|
type PrimaryKeyType<Q extends ObjectOrInterfaceDefinition> = (Q extends ObjectTypeDefinition ? OsdkObjectPrimaryKeyType<Q> : unknown) & PropertyValueWireToClient[PrimaryKeyTypes];
|
|
616
651
|
|
|
617
652
|
type SpecialOsdkPropParams = "$all" | "$rid" | "$strict" | "$notStrict";
|
|
@@ -619,15 +654,17 @@ type ValidOsdkPropParams<Q extends ObjectOrInterfaceDefinition> = SpecialOsdkPro
|
|
|
619
654
|
type ApiNameAsString<T extends ObjectOrInterfaceDefinition> = CompileTimeMetadata<T>["apiName"];
|
|
620
655
|
type JustProps<T extends ObjectOrInterfaceDefinition, P extends ValidOsdkPropParams<T>> = P extends "$all" ? PropertyKeys<T> : Exclude<P, SpecialOsdkPropParams>;
|
|
621
656
|
type PropMapToObject<FROM extends ObjectOrInterfaceDefinition, TO extends ObjectTypeDefinition> = NonNullable<CompileTimeMetadata<TO>["interfaceMap"]>[ApiNameAsString<FROM>];
|
|
622
|
-
type MapPropNamesToObjectType<FROM extends ObjectOrInterfaceDefinition, TO extends ObjectTypeDefinition, P extends ValidOsdkPropParams<FROM
|
|
657
|
+
type MapPropNamesToObjectType<FROM extends ObjectOrInterfaceDefinition, TO extends ObjectTypeDefinition, P extends ValidOsdkPropParams<FROM>, OPTIONS extends never | "$rid" | "$allBaseProperties" = never> = "$allBaseProperties" extends OPTIONS ? PropertyKeys<FROM> extends P ? PropertyKeys<TO> : PropMapToObject<FROM, TO>[JustProps<FROM, P> & keyof PropMapToObject<FROM, TO>] : PropMapToObject<FROM, TO>[JustProps<FROM, P> & keyof PropMapToObject<FROM, TO>];
|
|
623
658
|
type PropMapToInterface<FROM extends ObjectTypeDefinition, TO extends InterfaceDefinition> = NonNullable<CompileTimeMetadata<FROM>["inverseInterfaceMap"]>[ApiNameAsString<TO>];
|
|
624
659
|
type MapPropNamesToInterface<FROM extends ObjectTypeDefinition, TO extends InterfaceDefinition, P extends ValidOsdkPropParams<FROM>> = PropMapToInterface<FROM, TO>[JustProps<FROM, P> & keyof PropMapToInterface<FROM, TO>];
|
|
625
660
|
/**
|
|
661
|
+
* Older version of this helper that allows for `$rid` and co in
|
|
662
|
+
* the properties field.
|
|
626
663
|
* @param FROM - the interface or object type to convert from
|
|
627
664
|
* @param TO - the interface or object type to convert to
|
|
628
665
|
* @param P - the property(s) to convert
|
|
629
666
|
*/
|
|
630
|
-
type ConvertProps<FROM extends ObjectOrInterfaceDefinition, TO extends ValidToFrom<FROM>, P extends ValidOsdkPropParams<FROM
|
|
667
|
+
type ConvertProps<FROM extends ObjectOrInterfaceDefinition, TO extends ValidToFrom<FROM>, P extends ValidOsdkPropParams<FROM>, OPTIONS extends never | "$rid" | "$allBaseProperties" = never> = TO extends FROM ? P : TO extends ObjectTypeDefinition ? (UnionIfTrue<MapPropNamesToObjectType<FROM, TO, P, OPTIONS>, P extends "$rid" ? true : false, "$rid">) : TO extends InterfaceDefinition ? FROM extends ObjectTypeDefinition ? (UnionIfTrue<MapPropNamesToInterface<FROM, TO, P>, P extends "$rid" ? true : false, "$rid">) : never : never;
|
|
631
668
|
/** DO NOT EXPORT FROM PACKAGE */
|
|
632
669
|
type ValidToFrom<FROM extends ObjectOrInterfaceDefinition> = FROM extends InterfaceDefinition ? ObjectOrInterfaceDefinition : InterfaceDefinition;
|
|
633
670
|
type IsNever<T> = [T] extends [never] ? true : false;
|
|
@@ -639,13 +676,13 @@ type GetPropsKeys<Q extends ObjectOrInterfaceDefinition, P extends PropertyKeys<
|
|
|
639
676
|
*/
|
|
640
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>>;
|
|
641
678
|
declare namespace Osdk {
|
|
642
|
-
type Instance<Q extends ObjectOrInterfaceDefinition, OPTIONS extends never | "$rid" = 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] ? {} : {
|
|
679
|
+
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] ? {} : {
|
|
643
680
|
[A in keyof R]: SimplePropertyDef.ToRuntimeProperty<R[A]>;
|
|
644
681
|
}) & {
|
|
645
682
|
readonly $link: Q extends {
|
|
646
683
|
linksType?: any;
|
|
647
684
|
} ? Q["linksType"] : Q extends ObjectTypeDefinition ? OsdkObjectLinksObject<Q> : never;
|
|
648
|
-
readonly $as: <NEW_Q extends ValidToFrom<Q>>(type: NEW_Q | string) => Osdk.Instance<NEW_Q, OPTIONS, ConvertProps<Q, NEW_Q, P>>;
|
|
685
|
+
readonly $as: <NEW_Q extends ValidToFrom<Q>>(type: NEW_Q | string) => Osdk.Instance<NEW_Q, OPTIONS, ConvertProps<Q, NEW_Q, P, OPTIONS>>;
|
|
649
686
|
readonly $clone: <NEW_PROPS extends PropertyKeys<Q>>(updatedObject?: Osdk.Instance<Q, any, NEW_PROPS> | {
|
|
650
687
|
[K in NEW_PROPS]?: CompileTimeMetadata<Q>["props"][K];
|
|
651
688
|
}) => Osdk.Instance<Q, OPTIONS, P | NEW_PROPS>;
|
|
@@ -659,7 +696,8 @@ declare namespace Osdk {
|
|
|
659
696
|
* Anything you throw at this that is not exactly `true` should always be `never`.
|
|
660
697
|
*/
|
|
661
698
|
type ExtractRidOption<R extends boolean> = IsNever<R> extends true ? never : DefaultToFalse<R> extends false ? never : "$rid";
|
|
662
|
-
type
|
|
699
|
+
type ExtractAllPropertiesOption<T extends boolean> = IsNever<T> extends true ? never : DefaultToFalse<T> extends false ? never : "$allBaseProperties";
|
|
700
|
+
type ExtractOptions<R extends boolean, S extends NullabilityAdherence = NullabilityAdherence.Default, T extends boolean = false> = ExtractRidOption<R> | ExtractAllPropertiesOption<T>;
|
|
663
701
|
|
|
664
702
|
type Just<Z extends keyof V, V> = {
|
|
665
703
|
[k in Z]: V[k];
|
|
@@ -908,21 +946,55 @@ type WhereClause<T extends ObjectOrInterfaceDefinition> = OrWhereClause<T> | And
|
|
|
908
946
|
type LinkNames<Q extends ObjectOrInterfaceDefinition> = keyof CompileTimeMetadata<Q>["links"] & string;
|
|
909
947
|
type LinkedType<Q extends ObjectOrInterfaceDefinition, L extends LinkNames<Q>> = NonNullable<CompileTimeMetadata<Q>["links"][L]["__OsdkLinkTargetType"]>;
|
|
910
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
|
+
|
|
974
|
+
declare const DerivedPropertyDefinitionBrand: unique symbol;
|
|
911
975
|
declare namespace DerivedProperty {
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
}
|
|
915
|
-
|
|
916
|
-
|
|
976
|
+
export interface Definition<T extends SimplePropertyDef, Q extends ObjectOrInterfaceDefinition> {
|
|
977
|
+
readonly [DerivedPropertyDefinitionBrand]: true;
|
|
978
|
+
}
|
|
979
|
+
export interface NumericPropertyDefinition<T extends SimplePropertyDef, Q extends ObjectOrInterfaceDefinition> extends Definition<T, Q>, NumericExpressions<Q, T> {
|
|
980
|
+
}
|
|
981
|
+
export interface DatetimePropertyDefinition<T extends SimplePropertyDef, Q extends ObjectOrInterfaceDefinition> extends Definition<T, Q>, DatetimeExpressions<Q, T> {
|
|
982
|
+
}
|
|
983
|
+
export type Clause<Q extends ObjectOrInterfaceDefinition> = {
|
|
984
|
+
[key: string]: DerivedPropertyCreator<Q, SimplePropertyDef>;
|
|
917
985
|
};
|
|
918
|
-
|
|
919
|
-
|
|
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> {
|
|
920
989
|
}
|
|
921
|
-
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> {
|
|
922
991
|
}
|
|
923
|
-
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> {
|
|
924
993
|
}
|
|
994
|
+
export type ValidParts = "DAYS" | "MONTHS" | "QUARTERS" | "YEARS";
|
|
995
|
+
export { };
|
|
925
996
|
}
|
|
997
|
+
type DerivedPropertyCreator<Q extends ObjectOrInterfaceDefinition, T extends SimplePropertyDef> = (baseObjectSet: DerivedProperty.Builder<Q, false>) => DerivedProperty.Definition<T, Q> | DerivedProperty.NumericPropertyDefinition<T, Q> | DerivedProperty.DatetimePropertyDefinition<T, Q>;
|
|
926
998
|
type BuilderTypeFromConstraint<Q extends ObjectOrInterfaceDefinition, CONSTRAINED extends boolean> = CONSTRAINED extends true ? DerivedProperty.AggregateBuilder<Q, true> : DerivedProperty.SelectPropertyBuilder<Q, false>;
|
|
927
999
|
type Filterable<Q extends ObjectOrInterfaceDefinition, CONSTRAINED extends boolean> = {
|
|
928
1000
|
readonly where: (clause: WhereClause<Q>) => BuilderTypeFromConstraint<Q, CONSTRAINED>;
|
|
@@ -930,15 +1002,24 @@ type Filterable<Q extends ObjectOrInterfaceDefinition, CONSTRAINED extends boole
|
|
|
930
1002
|
type Pivotable<Q extends ObjectOrInterfaceDefinition, CONSTRAINED extends boolean> = {
|
|
931
1003
|
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>;
|
|
932
1004
|
};
|
|
1005
|
+
type Constant<Q extends ObjectOrInterfaceDefinition> = {
|
|
1006
|
+
readonly constant: {
|
|
1007
|
+
readonly double: (value: number) => DerivedProperty.NumericPropertyDefinition<SimplePropertyDef.Make<"double", "non-nullable", "single">, Q>;
|
|
1008
|
+
readonly integer: (value: number) => DerivedProperty.NumericPropertyDefinition<SimplePropertyDef.Make<"integer", "non-nullable", "single">, Q>;
|
|
1009
|
+
readonly long: (value: string) => DerivedProperty.NumericPropertyDefinition<SimplePropertyDef.Make<"long", "non-nullable", "single">, Q>;
|
|
1010
|
+
readonly datetime: (value: string) => DerivedProperty.DatetimePropertyDefinition<SimplePropertyDef.Make<"datetime", "non-nullable", "single">, Q>;
|
|
1011
|
+
readonly timestamp: (value: string) => DerivedProperty.DatetimePropertyDefinition<SimplePropertyDef.Make<"timestamp", "non-nullable", "single">, Q>;
|
|
1012
|
+
};
|
|
1013
|
+
};
|
|
933
1014
|
type Aggregatable<Q extends ObjectOrInterfaceDefinition> = {
|
|
934
1015
|
readonly aggregate: <V extends ValidAggregationKeys<Q, "withPropertiesAggregate">>(aggregationSpecifier: V, opts?: V extends `${any}:${infer P}` ? P extends CollectWithPropAggregations ? {
|
|
935
1016
|
limit: number;
|
|
936
1017
|
} : P extends "approximatePercentile" ? {
|
|
937
1018
|
percentile: number;
|
|
938
|
-
} : never : never) =>
|
|
1019
|
+
} : 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>;
|
|
939
1020
|
};
|
|
940
1021
|
type Selectable<Q extends ObjectOrInterfaceDefinition> = {
|
|
941
|
-
readonly selectProperty: <R extends PropertyKeys<Q>>(propertyName: R) =>
|
|
1022
|
+
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">>;
|
|
942
1023
|
};
|
|
943
1024
|
|
|
944
1025
|
interface BaseObjectSet<Q extends ObjectOrInterfaceDefinition> {
|
|
@@ -985,11 +1066,42 @@ type ObjectUpdate<O extends ObjectOrInterfaceDefinition, P extends PropertyKeys<
|
|
|
985
1066
|
state: "ADDED_OR_UPDATED" | "REMOVED";
|
|
986
1067
|
};
|
|
987
1068
|
|
|
988
|
-
type MergeObjectSet<Q extends ObjectOrInterfaceDefinition, D extends
|
|
989
|
-
type ExtractRdp<D extends
|
|
1069
|
+
type MergeObjectSet<Q extends ObjectOrInterfaceDefinition, D extends Record<string, SimplePropertyDef> = {}> = DerivedObjectOrInterfaceDefinition.WithDerivedProperties<Q, D>;
|
|
1070
|
+
type ExtractRdp<D extends BaseObjectSet<any> | Record<string, SimplePropertyDef>> = [D] extends [never] ? {} : D extends BaseObjectSet<any> ? {} : D extends Record<string, SimplePropertyDef> ? D : {};
|
|
1071
|
+
type MaybeSimplifyPropertyKeys<Q extends ObjectOrInterfaceDefinition, L extends PropertyKeys<Q>> = PropertyKeys<Q> extends L ? PropertyKeys<Q> : L;
|
|
1072
|
+
type SubSelectKeysHelper<Q extends ObjectOrInterfaceDefinition, L extends string> = [L] extends [never] ? PropertyKeys<Q> : PropertyKeys<Q> extends L ? PropertyKeys<Q> : L & PropertyKeys<Q>;
|
|
1073
|
+
type SubSelectKeys<Q extends ObjectOrInterfaceDefinition, X extends SelectArg<Q, PropertyKeys<Q>, any, any> = never> = SubSelectKeysHelper<Q, Extract$Select<X>>;
|
|
1074
|
+
type NOOP<T> = T extends (...args: any[]) => any ? T : T extends abstract new (...args: any[]) => any ? T : {
|
|
1075
|
+
[K in keyof T]: T[K];
|
|
1076
|
+
};
|
|
1077
|
+
type SubSelectRDPsHelper<X extends ValidFetchPageArgs<any, any> | ValidAsyncIterArgs<any, any>, DEFAULT extends string> = [X] extends [never] ? DEFAULT : (X["$select"] & string[])[number] & DEFAULT;
|
|
1078
|
+
type SubSelectRDPs<RDPs extends Record<string, SimplePropertyDef>, X extends ValidFetchPageArgs<any, RDPs> | ValidAsyncIterArgs<any, RDPs>> = [RDPs] extends [never] ? never : NOOP<{
|
|
1079
|
+
[K in SubSelectRDPsHelper<X, string & keyof RDPs>]: RDPs[K];
|
|
1080
|
+
}>;
|
|
990
1081
|
interface MinimalObjectSet<Q extends ObjectOrInterfaceDefinition, RDPs extends Record<string, SimplePropertyDef> = {}> extends BaseObjectSet<Q>, FetchPage<Q, RDPs>, AsyncIter<Q, RDPs>, Where<Q, RDPs> {
|
|
991
1082
|
}
|
|
1083
|
+
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>;
|
|
1084
|
+
type Extract$Select<X extends FetchPageArgs<any, any>> = NonNullable<X["$select"]>[number];
|
|
992
1085
|
interface FetchPage<Q extends ObjectOrInterfaceDefinition, RDPs extends Record<string, SimplePropertyDef> = {}> {
|
|
1086
|
+
readonly fetchPage: FetchPageSignature<Q, RDPs>;
|
|
1087
|
+
readonly fetchPageWithErrors: FetchPageWithErrorsSignature<Q, RDPs>;
|
|
1088
|
+
}
|
|
1089
|
+
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>;
|
|
1090
|
+
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>;
|
|
1091
|
+
interface FetchPageSignature<Q extends ObjectOrInterfaceDefinition, RDPs extends Record<string, SimplePropertyDef> = {}> {
|
|
1092
|
+
/**
|
|
1093
|
+
* Gets a page of objects of this type, with a result wrapper
|
|
1094
|
+
* @param args - Args to specify next page token and page size, if applicable
|
|
1095
|
+
* @example
|
|
1096
|
+
* const myObjs = await objectSet.fetchPage({
|
|
1097
|
+
$pageSize: 10,
|
|
1098
|
+
$nextPageToken: "nextPage"
|
|
1099
|
+
});
|
|
1100
|
+
const myObjsResult = myObjs.data;
|
|
1101
|
+
|
|
1102
|
+
* @returns a page of objects
|
|
1103
|
+
*/
|
|
1104
|
+
<const X extends ValidFetchPageArgs<Q, RDPs> = never>(args?: X): Promise<PageResult<Osdk.Instance<Q, ExtractOptions2<X>, SubSelectKeys<Q, X>, SubSelectRDPs<RDPs, X>>>>;
|
|
993
1105
|
/**
|
|
994
1106
|
* Gets a page of objects of this type, with a result wrapper
|
|
995
1107
|
* @param args - Args to specify next page token and page size, if applicable
|
|
@@ -1002,9 +1114,9 @@ interface FetchPage<Q extends ObjectOrInterfaceDefinition, RDPs extends Record<s
|
|
|
1002
1114
|
|
|
1003
1115
|
* @returns a page of objects
|
|
1004
1116
|
*/
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1117
|
+
<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>>>>;
|
|
1118
|
+
}
|
|
1119
|
+
interface FetchPageWithErrorsSignature<Q extends ObjectOrInterfaceDefinition, RDPs extends Record<string, SimplePropertyDef> = {}> {
|
|
1008
1120
|
/**
|
|
1009
1121
|
* Gets a page of objects of this type, with a result wrapper
|
|
1010
1122
|
* @param args - Args to specify next page token and page size, if applicable
|
|
@@ -1019,9 +1131,22 @@ interface FetchPage<Q extends ObjectOrInterfaceDefinition, RDPs extends Record<s
|
|
|
1019
1131
|
}
|
|
1020
1132
|
* @returns a page of objects, wrapped in a result wrapper
|
|
1021
1133
|
*/
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1134
|
+
<X extends ValidFetchPageArgs<Q, RDPs> = never>(args?: X): Promise<Result<PageResult<Osdk.Instance<Q, ExtractOptions2<X>, SubSelectKeys<Q, X>, SubSelectRDPs<RDPs, X>>>>>;
|
|
1135
|
+
/**
|
|
1136
|
+
* Gets a page of objects of this type, with a result wrapper
|
|
1137
|
+
* @param args - Args to specify next page token and page size, if applicable
|
|
1138
|
+
* @example
|
|
1139
|
+
* const myObjs = await objectSet.fetchPage({
|
|
1140
|
+
$pageSize: 10,
|
|
1141
|
+
$nextPageToken: "nextPage"
|
|
1142
|
+
});
|
|
1143
|
+
|
|
1144
|
+
if(isOk(myObjs)){
|
|
1145
|
+
const myObjsResult = myObjs.value.data;
|
|
1146
|
+
}
|
|
1147
|
+
* @returns a page of objects, wrapped in a result wrapper
|
|
1148
|
+
*/
|
|
1149
|
+
<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>>>>>;
|
|
1025
1150
|
}
|
|
1026
1151
|
interface Where<Q extends ObjectOrInterfaceDefinition, RDPs extends Record<string, SimplePropertyDef> = {}> {
|
|
1027
1152
|
/**
|
|
@@ -1036,7 +1161,7 @@ interface Where<Q extends ObjectOrInterfaceDefinition, RDPs extends Record<strin
|
|
|
1036
1161
|
*/
|
|
1037
1162
|
readonly where: (clause: WhereClause<MergeObjectSet<Q, RDPs>>) => this;
|
|
1038
1163
|
}
|
|
1039
|
-
interface
|
|
1164
|
+
interface AsyncIterSignature<Q extends ObjectOrInterfaceDefinition, RDPs extends Record<string, SimplePropertyDef> = {}> {
|
|
1040
1165
|
/**
|
|
1041
1166
|
* Returns an async iterator to load all objects of this type
|
|
1042
1167
|
* @example
|
|
@@ -1045,18 +1170,28 @@ interface AsyncIter<Q extends ObjectOrInterfaceDefinition, RDPs extends Record<s
|
|
|
1045
1170
|
* }
|
|
1046
1171
|
* @returns an async iterator to load all objects
|
|
1047
1172
|
*/
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1173
|
+
<X extends ValidAsyncIterArgs<Q, RDPs> = never>(args?: X): AsyncIterableIterator<Osdk.Instance<Q, ExtractOptions2<X>, SubSelectKeys<Q, X>, SubSelectRDPs<RDPs, X>>>;
|
|
1174
|
+
/**
|
|
1175
|
+
* Returns an async iterator to load all objects of this type
|
|
1176
|
+
* @example
|
|
1177
|
+
* for await (const obj of myObjectSet.asyncIter()){
|
|
1178
|
+
* // Handle obj
|
|
1179
|
+
* }
|
|
1180
|
+
* @returns an async iterator to load all objects
|
|
1181
|
+
*/
|
|
1182
|
+
<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>>>;
|
|
1183
|
+
}
|
|
1184
|
+
interface AsyncIter<Q extends ObjectOrInterfaceDefinition, RDPs extends Record<string, SimplePropertyDef> = {}> {
|
|
1185
|
+
asyncIter: AsyncIterSignature<Q, RDPs>;
|
|
1051
1186
|
}
|
|
1052
1187
|
interface WithProperties<Q extends ObjectOrInterfaceDefinition = any, RDPs extends Record<string, SimplePropertyDef> = {}> {
|
|
1053
1188
|
readonly withProperties: <NEW extends Record<string, SimplePropertyDef>>(clause: {
|
|
1054
|
-
[K in keyof NEW]:
|
|
1189
|
+
[K in keyof NEW]: DerivedPropertyCreator<Q, NEW[K]>;
|
|
1055
1190
|
}) => ObjectSet<Q, {
|
|
1056
1191
|
[NN in keyof NEW | keyof RDPs]: NN extends keyof NEW ? NEW[NN] : NN extends keyof RDPs ? RDPs[NN] : never;
|
|
1057
1192
|
}>;
|
|
1058
1193
|
}
|
|
1059
|
-
interface ObjectSet<Q extends ObjectOrInterfaceDefinition = any, UNUSED_OR_RDP extends
|
|
1194
|
+
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>>> {
|
|
1060
1195
|
}
|
|
1061
1196
|
interface Aggregate<Q extends ObjectOrInterfaceDefinition> {
|
|
1062
1197
|
/**
|
|
@@ -1122,21 +1257,31 @@ interface PivotTo<Q extends ObjectOrInterfaceDefinition> {
|
|
|
1122
1257
|
* @param type - The linked object type you want to pivot to
|
|
1123
1258
|
* @returns an object set of the specified linked type
|
|
1124
1259
|
*/
|
|
1125
|
-
readonly pivotTo: <L extends LinkNames<Q>>(type: L) =>
|
|
1260
|
+
readonly pivotTo: <L extends LinkNames<Q>>(type: L) => ObjectSet<LinkedType<Q, L>>;
|
|
1126
1261
|
}
|
|
1127
|
-
interface
|
|
1262
|
+
interface FetchOneSignature<Q extends ObjectTypeDefinition, RDPs extends Record<string, SimplePropertyDef>> {
|
|
1128
1263
|
/**
|
|
1129
1264
|
* Fetches one object with the specified primary key, without a result wrapper
|
|
1130
1265
|
*/
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1266
|
+
<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>>>;
|
|
1267
|
+
/**
|
|
1268
|
+
* Fetches one object with the specified primary key, without a result wrapper
|
|
1269
|
+
*/
|
|
1270
|
+
<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>>>;
|
|
1271
|
+
}
|
|
1272
|
+
interface FetchOneWithErrorsSignature<Q extends ObjectTypeDefinition, RDPs extends Record<string, SimplePropertyDef>> {
|
|
1273
|
+
/**
|
|
1274
|
+
* Fetches one object with the specified primary key, with a result wrapper
|
|
1275
|
+
*/
|
|
1276
|
+
<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>>>>;
|
|
1134
1277
|
/**
|
|
1135
1278
|
* Fetches one object with the specified primary key, with a result wrapper
|
|
1136
1279
|
*/
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1280
|
+
<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>>>>;
|
|
1281
|
+
}
|
|
1282
|
+
interface FetchOne<Q extends ObjectOrInterfaceDefinition, RDPs extends Record<string, SimplePropertyDef>> {
|
|
1283
|
+
fetchOne: Q extends ObjectTypeDefinition ? FetchOneSignature<Q, RDPs> : never;
|
|
1284
|
+
fetchOneWithErrors: Q extends ObjectTypeDefinition ? FetchOneWithErrorsSignature<Q, RDPs> : never;
|
|
1140
1285
|
}
|
|
1141
1286
|
interface Subscribe<Q extends ObjectOrInterfaceDefinition> {
|
|
1142
1287
|
/**
|
|
@@ -1149,11 +1294,7 @@ interface Subscribe<Q extends ObjectOrInterfaceDefinition> {
|
|
|
1149
1294
|
unsubscribe: () => void;
|
|
1150
1295
|
};
|
|
1151
1296
|
}
|
|
1152
|
-
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<
|
|
1297
|
+
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> {
|
|
1153
1298
|
}
|
|
1154
1299
|
|
|
1155
|
-
type
|
|
1156
|
-
[K in keyof NonNullable<O["__DefinitionMetadata"]>["properties"]]: NonNullable<O["__DefinitionMetadata"]>["properties"][K]["type"] extends T ? K : never;
|
|
1157
|
-
}[keyof NonNullable<O["__DefinitionMetadata"]>["properties"]];
|
|
1158
|
-
|
|
1159
|
-
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 };
|
|
1300
|
+
export { type ObjectSpecifier as $, type AttachmentUpload 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 Attachment 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 ObjectIdentifiers as b, type OsdkObjectPrimaryKeyType as c, type ObjectSet as d, type OsdkMetadata as e, type PrimaryKeyTypes as f, type OsdkBase 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
|
|
2
|
-
export {
|
|
1
|
+
import { A as AttachmentUpload, M as MediaReference, a as Attachment, O as ObjectTypeDefinition, b as ObjectIdentifiers, c as OsdkObjectPrimaryKeyType, d as ObjectSet, I as InterfaceDefinition, C as CompileTimeMetadata, e as OsdkMetadata, R as ReleaseStatus, P as PropertyValueWireToClient, f as PrimaryKeyTypes, g as OsdkBase } from './ObjectSet-6WzPM-IC.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-6WzPM-IC.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 | {
|
|
@@ -186,7 +190,7 @@ declare namespace ActionParam {
|
|
|
186
190
|
/**
|
|
187
191
|
* Helper type to convert action definition parameter object types to typescript types
|
|
188
192
|
*/
|
|
189
|
-
type ObjectType<T extends ObjectTypeDefinition> =
|
|
193
|
+
type ObjectType<T extends ObjectTypeDefinition> = ObjectIdentifiers<T> | OsdkObjectPrimaryKeyType<T>;
|
|
190
194
|
/**
|
|
191
195
|
* Helper type to convert action definition parameter object sets to typescript types
|
|
192
196
|
*/
|
|
@@ -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";
|
|
@@ -289,6 +293,8 @@ interface QueryCompileTimeMetadata<T> {
|
|
|
289
293
|
interface QueryDefinition<T = any> {
|
|
290
294
|
type: "query";
|
|
291
295
|
apiName: string;
|
|
296
|
+
version?: string;
|
|
297
|
+
isFixedVersion?: boolean;
|
|
292
298
|
osdkMetadata?: OsdkMetadata;
|
|
293
299
|
__DefinitionMetadata?: QueryCompileTimeMetadata<T> & QueryMetadata;
|
|
294
300
|
}
|
|
@@ -391,7 +397,7 @@ declare namespace QueryParam {
|
|
|
391
397
|
/**
|
|
392
398
|
* Helper type to convert action definition parameter object types to typescript types
|
|
393
399
|
*/
|
|
394
|
-
type ObjectType<T extends ObjectTypeDefinition> =
|
|
400
|
+
type ObjectType<T extends ObjectTypeDefinition> = ObjectIdentifiers<T> | OsdkObjectPrimaryKeyType<T>;
|
|
395
401
|
/**
|
|
396
402
|
* Helper type to convert action definition parameter object sets to typescript types
|
|
397
403
|
*/
|
|
@@ -421,4 +427,24 @@ declare namespace QueryResult {
|
|
|
421
427
|
type ThreeDimensionalAggregationType<OUT extends AggregationKeyTypes | RangeKey<any>, IN extends AggregationKeyTypes | RangeKey<any>, V extends AggregationValueTypes> = ThreeDimensionalAggregation<OUT extends AggregationKeyTypes ? AggKeyWireToClient<OUT> : OUT, IN extends AggregationKeyTypes ? AggKeyWireToClient<IN> : IN, AggValueWireToClient<V>>;
|
|
422
428
|
}
|
|
423
429
|
|
|
424
|
-
|
|
430
|
+
interface Logger {
|
|
431
|
+
trace: Logger.LogFn;
|
|
432
|
+
debug: Logger.LogFn;
|
|
433
|
+
fatal: Logger.LogFn;
|
|
434
|
+
error: Logger.LogFn;
|
|
435
|
+
warn: Logger.LogFn;
|
|
436
|
+
info: Logger.LogFn;
|
|
437
|
+
isLevelEnabled(level: string): boolean;
|
|
438
|
+
child(bindings: Record<string, any>, options?: {
|
|
439
|
+
level?: string;
|
|
440
|
+
msgPrefix?: string;
|
|
441
|
+
}): Logger;
|
|
442
|
+
}
|
|
443
|
+
declare namespace Logger {
|
|
444
|
+
interface LogFn {
|
|
445
|
+
(obj: unknown, msg?: string, ...args: any[]): void;
|
|
446
|
+
(msg: string, ...args: any[]): void;
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
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 };
|