@osdk/client 0.9.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/js/chunk-GOBQUVQZ.mjs +1138 -0
- package/build/js/chunk-GOBQUVQZ.mjs.map +1 -0
- package/build/js/chunk-LK4VDWCG.cjs +1151 -0
- package/build/js/chunk-LK4VDWCG.cjs.map +1 -0
- package/build/js/index.cjs +101 -636
- package/build/js/index.cjs.map +1 -1
- package/build/js/index.mjs +99 -634
- package/build/js/index.mjs.map +1 -1
- package/build/js/public/objects.cjs +5 -5
- package/build/js/public/objects.mjs +1 -1
- package/build/types/Client.d.ts +11 -5
- package/build/types/MinimalClientContext.d.ts +13 -0
- package/build/types/ObjectSetCreator.d.ts +6 -4
- package/build/types/OsdkObject.d.ts +1 -1
- package/build/types/OsdkObjectFrom.d.ts +17 -16
- package/build/types/actions/Actions.d.ts +5 -4
- package/build/types/actions/applyAction.d.ts +2 -2
- package/build/types/actions/createActionInvoker.d.ts +5 -4
- package/build/types/createClient.d.ts +5 -2
- package/build/types/createMinimalClient.d.ts +3 -0
- package/build/types/definitions/LinkDefinitions.d.ts +8 -12
- package/build/types/generatedNoCheck/Ontology.d.ts +5 -5
- package/build/types/generatedNoCheck/index.d.ts +3 -0
- package/build/types/generatedNoCheck/ontology/actions/actionTakesAttachment.d.ts +1 -1
- package/build/types/generatedNoCheck/ontology/actions/actionTakesObjectSet.d.ts +2 -2
- package/build/types/generatedNoCheck/ontology/actions/createOffice.d.ts +4 -4
- package/build/types/generatedNoCheck/ontology/actions/createOfficeAndEmployee.d.ts +5 -5
- package/build/types/generatedNoCheck/ontology/actions/moveOffice.d.ts +4 -4
- package/build/types/generatedNoCheck/ontology/actions/promoteEmployee.d.ts +3 -3
- package/build/types/generatedNoCheck/ontology/actions/promoteEmployeeObject.d.ts +4 -4
- package/build/types/generatedNoCheck/ontology/objects/Employee.d.ts +13 -37
- package/build/types/generatedNoCheck/ontology/objects/ObjectWithTimestampPrimaryKey.d.ts +6 -15
- package/build/types/generatedNoCheck/ontology/objects/Office.d.ts +10 -29
- package/build/types/generatedNoCheck/ontology/objects/equipment.d.ts +6 -16
- package/build/types/generatedNoCheck/ontology/objects/objectTypeWithAllPropertyTypes.d.ts +34 -155
- package/build/types/index.d.ts +3 -1
- package/build/types/object/Cache.d.ts +33 -0
- package/build/types/object/aggregate.d.ts +11 -0
- package/build/types/object/convertWireToOsdkObjects.d.ts +2 -3
- package/build/types/object/fetchPage.d.ts +22 -0
- package/build/types/object/fetchPage.test.d.ts +1 -0
- package/build/types/object/fetchSingle.d.ts +6 -0
- package/build/types/object/index.d.ts +2 -2
- package/build/types/objectSet/LinkUtils.d.ts +3 -0
- package/build/types/objectSet/ObjectSet.d.ts +18 -10
- package/build/types/objectSet/ObjectSetListenerWebsocket.d.ts +4 -4
- package/build/types/objectSet/createObjectSet.d.ts +4 -3
- package/build/types/ontology/OntologyProvider.d.ts +20 -0
- package/build/types/ontology/loadFullObjectMetadata.d.ts +3 -0
- package/build/types/ontology/providers/StandardOntologyProvider.d.ts +5 -0
- package/build/types/ontology/providers/StandardOntologyProvider.test.d.ts +1 -0
- package/build/types/query/WhereClause.d.ts +2 -1
- package/build/types/query/aggregations/AggregatableKeys.d.ts +1 -1
- package/build/types/query/aggregations/AggregateOpts.d.ts +3 -3
- package/build/types/query/aggregations/AggregationResultsWithGroups.d.ts +11 -7
- package/build/types/query/aggregations/AggregationResultsWithoutGroups.d.ts +4 -1
- package/build/types/query/aggregations/AggregationsClause.d.ts +5 -2
- package/build/types/query/aggregations/AggregationsClause.test.d.ts +2 -0
- package/build/types/query/aggregations/AggregationsResults.d.ts +3 -2
- package/build/types/query/aggregations/GroupByClause.d.ts +8 -0
- package/build/types/query/aggregations/GroupByClause.test.d.ts +1 -0
- package/build/types/query/aggregations/GroupByMapper.d.ts +7 -1
- package/build/types/util/test/mockOntology.d.ts +3 -0
- package/changelog/0.10.0/pr-74.v2.yml +5 -0
- package/changelog/0.10.0/pr-78.v2.yml +5 -0
- package/changelog/0.10.0/pr-79.v2.yml +5 -0
- package/changelog/0.11.0/pr-100.v2.yml +5 -0
- package/changelog/0.11.0/pr-67.v2.yml +5 -0
- package/changelog/0.11.0/pr-83.v2.yml +5 -0
- package/changelog/0.11.0/pr-84.v2.yml +5 -0
- package/changelog/0.11.0/pr-86.v2.yml +5 -0
- package/changelog/0.11.0/pr-88.v2.yml +5 -0
- package/changelog/0.11.0/pr-89.v2.yml +5 -0
- package/changelog/0.11.0/pr-91.v2.yml +5 -0
- package/changelog/0.11.0/pr-95.v2.yml +5 -0
- package/changelog/0.11.0/pr-96.v2.yml +5 -0
- package/changelog/0.11.0/pr-99.v2.yml +5 -0
- package/package.json +7 -5
- package/build/js/chunk-BQNFWSLL.mjs +0 -419
- package/build/js/chunk-BQNFWSLL.mjs.map +0 -1
- package/build/js/chunk-KAL57TC5.cjs +0 -430
- package/build/js/chunk-KAL57TC5.cjs.map +0 -1
- package/build/types/createCachedOntologyTransform.d.ts +0 -7
- package/build/types/object/aggregateOrThrow.d.ts +0 -6
- package/build/types/object/fetchPageOrThrow.d.ts +0 -13
- package/build/types/object/followLinkOrThrow.d.ts +0 -5
- package/build/types/object/getLinkedObjectByPkOrThrow.d.ts +0 -4
- package/build/types/object/getLinkedObjectOrThrow.d.ts +0 -7
- package/build/types/object/pageLinkedObjectsOrThrow.d.ts +0 -7
- package/build/types/objectSet/LinkTypesFrom.d.ts +0 -2
- /package/build/types/object/{aggregateOrThrow.test.d.ts → aggregate.test.d.ts} +0 -0
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { ObjectOrInterfaceDefinition } from "@osdk/api";
|
|
2
|
+
export type LinkNames<Q extends ObjectOrInterfaceDefinition> = keyof Q["links"] & string;
|
|
3
|
+
export type LinkedType<Q extends ObjectOrInterfaceDefinition, L extends keyof Q["links"] & string> = NonNullable<Q["links"][L]["__OsdkLinkTargetType"]>;
|
|
@@ -1,21 +1,29 @@
|
|
|
1
|
-
import type { ObjectOrInterfaceDefinition, ObjectOrInterfaceDefinitionFrom, ObjectOrInterfaceKeysFrom, ObjectOrInterfacePropertyKeysFrom2, OntologyDefinition } from "@osdk/api";
|
|
1
|
+
import type { ObjectOrInterfaceDefinition, ObjectOrInterfaceDefinitionFrom, ObjectOrInterfaceKeysFrom, ObjectOrInterfacePropertyKeysFrom2, ObjectTypeDefinition, OntologyDefinition, WirePropertyTypes } from "@osdk/api";
|
|
2
2
|
import type { ObjectSet as WireObjectSet } from "@osdk/gateway/types";
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
5
|
-
import type {
|
|
3
|
+
import type { AggregateOptsThatErrors } from "../object/aggregate.js";
|
|
4
|
+
import type { FetchPageArgs, FetchPageResult, SelectArg } from "../object/fetchPage.js";
|
|
5
|
+
import type { Osdk, OsdkObjectOrInterfaceFrom } from "../OsdkObjectFrom.js";
|
|
6
6
|
import type { AggregateOpts } from "../query/aggregations/AggregateOpts.js";
|
|
7
7
|
import type { AggregationsResults, WhereClause } from "../query/index.js";
|
|
8
|
+
import type { LinkedType, LinkNames } from "./LinkUtils.js";
|
|
8
9
|
import type { ObjectSetListener } from "./ObjectSetListener.js";
|
|
9
|
-
export
|
|
10
|
-
export interface BaseObjectSet<Q extends ObjectOrInterfaceDefinition> {
|
|
10
|
+
export interface ObjectSet<Q extends ObjectOrInterfaceDefinition> {
|
|
11
11
|
definition: WireObjectSet;
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
/** @deprecated */
|
|
13
|
+
fetchPageOrThrow: <L extends ObjectOrInterfacePropertyKeysFrom2<Q>, R extends boolean>(args?: FetchPageArgs<Q, L, R>) => FetchPageResult<Q, L, R>;
|
|
14
|
+
fetchPage: <L extends ObjectOrInterfacePropertyKeysFrom2<Q>, R extends boolean>(args?: FetchPageArgs<Q, L, R>) => FetchPageResult<Q, L, R>;
|
|
15
|
+
asyncIter: () => AsyncIterableIterator<Osdk<Q, "$all">>;
|
|
16
|
+
/** @deprecated use `aggregate` */
|
|
17
|
+
aggregateOrThrow: <AO extends AggregateOpts<Q>>(req: AggregateOptsThatErrors<Q, AO>) => Promise<AggregationsResults<Q, AO>>;
|
|
18
|
+
aggregate: <AO extends AggregateOpts<Q>>(req: AggregateOptsThatErrors<Q, AO>) => Promise<AggregationsResults<Q, AO>>;
|
|
14
19
|
where: (clause: WhereClause<Q>) => ObjectSet<Q>;
|
|
15
20
|
union: (...objectSets: ReadonlyArray<ObjectSet<Q>>) => ObjectSet<Q>;
|
|
16
21
|
intersect: (...objectSets: ReadonlyArray<ObjectSet<Q>>) => ObjectSet<Q>;
|
|
17
22
|
subtract: (...objectSets: ReadonlyArray<ObjectSet<Q>>) => ObjectSet<Q>;
|
|
18
|
-
pivotTo: <
|
|
23
|
+
pivotTo: <L extends LinkNames<Q>>(type: L) => BaseObjectSet<LinkedType<Q, L>>;
|
|
19
24
|
subscribe: (listener: ObjectSetListener<Q>) => () => void;
|
|
20
25
|
}
|
|
21
|
-
export
|
|
26
|
+
export interface BaseObjectSet<Q extends ObjectOrInterfaceDefinition> extends ObjectSet<Q> {
|
|
27
|
+
get: Q extends ObjectTypeDefinition<any> ? <L extends ObjectOrInterfacePropertyKeysFrom2<Q>>(primaryKey: WirePropertyTypes[Q["primaryKeyType"]], options?: SelectArg<Q, L>) => Promise<OsdkObjectOrInterfaceFrom<Q, L>> : never;
|
|
28
|
+
}
|
|
29
|
+
export type ObjectSetFactory<O extends OntologyDefinition<any>> = <K extends ObjectOrInterfaceKeysFrom<O>>(type: K) => ObjectSet<ObjectOrInterfaceDefinitionFrom<O, K>>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { ObjectOrInterfaceDefinition
|
|
1
|
+
import type { ObjectOrInterfaceDefinition } from "@osdk/api";
|
|
2
2
|
import type { ObjectSet } from "@osdk/gateway/types";
|
|
3
|
-
import {
|
|
3
|
+
import type { MinimalClient } from "../MinimalClientContext.js";
|
|
4
4
|
import type { ObjectSetListener } from "./ObjectSetListener.js";
|
|
5
|
-
export declare class ObjectSetListenerWebsocket
|
|
5
|
+
export declare class ObjectSetListenerWebsocket {
|
|
6
6
|
#private;
|
|
7
|
-
static getInstance
|
|
7
|
+
static getInstance(client: MinimalClient): ObjectSetListenerWebsocket;
|
|
8
8
|
private constructor();
|
|
9
9
|
subscribe<Q extends ObjectOrInterfaceDefinition>(objectSet: ObjectSet, listener: ObjectSetListener<Q>): () => void;
|
|
10
10
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ObjectOrInterfaceDefinition } from "@osdk/api";
|
|
2
2
|
import type { ObjectSet as WireObjectSet } from "@osdk/gateway/types";
|
|
3
|
-
import type {
|
|
4
|
-
import type { ObjectSet } from "./ObjectSet.js";
|
|
5
|
-
export declare function createObjectSet<Q extends ObjectOrInterfaceDefinition>(objectType: Q, clientCtx:
|
|
3
|
+
import type { MinimalClient } from "../MinimalClientContext.js";
|
|
4
|
+
import type { BaseObjectSet, ObjectSet } from "./ObjectSet.js";
|
|
5
|
+
export declare function createObjectSet<Q extends ObjectOrInterfaceDefinition>(objectType: Q, clientCtx: MinimalClient, objectSet?: WireObjectSet): ObjectSet<Q>;
|
|
6
|
+
export declare function createBaseObjectSet<Q extends ObjectOrInterfaceDefinition>(objectType: Q, clientCtx: MinimalClient, objectSet?: WireObjectSet): BaseObjectSet<Q>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ActionDefinition, ObjectOrInterfaceDefinition } from "@osdk/api";
|
|
2
|
+
import type { MinimalClient } from "../MinimalClientContext.js";
|
|
3
|
+
export interface OntologyProvider {
|
|
4
|
+
/**
|
|
5
|
+
* Returns the current known definition for the object or interface.
|
|
6
|
+
*
|
|
7
|
+
* May result in mulitiple network calls. May cache results. May invalidate results
|
|
8
|
+
* @param apiName
|
|
9
|
+
* @returns
|
|
10
|
+
*/
|
|
11
|
+
getObjectOrInterfaceDefinition: (apiName: string) => Promise<ObjectOrInterfaceDefinition>;
|
|
12
|
+
/**
|
|
13
|
+
* If the OntologyProvider supports seeding, this method will seed the provider with the given definition.
|
|
14
|
+
*
|
|
15
|
+
* @param definition
|
|
16
|
+
* @returns
|
|
17
|
+
*/
|
|
18
|
+
maybeSeed: (definition: ObjectOrInterfaceDefinition | ActionDefinition<string, string, any>) => void;
|
|
19
|
+
}
|
|
20
|
+
export type OntologyProviderFactory<T extends OntologyProvider = OntologyProvider> = (client: MinimalClient) => T;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -7,6 +7,7 @@ type MakeFilter<K extends PossibleWhereClauseFilters, V> = K extends string ? {
|
|
|
7
7
|
type BaseFilter<T> = T | MakeFilter<"$eq" | "$ne" | "$contains", T> | MakeFilter<"$isNull", boolean>;
|
|
8
8
|
type StringFilter = BaseFilter<string>;
|
|
9
9
|
type NumberFilter = BaseFilter<number> | MakeFilter<"$gt" | "$gte" | "$lt" | "$lte", number>;
|
|
10
|
+
type DatetimeFilter = BaseFilter<string> | MakeFilter<"$gt" | "$gte" | "$lt" | "$lte", string>;
|
|
10
11
|
export declare const DistanceUnitMapping: {
|
|
11
12
|
centimeter: "CENTIMETERS";
|
|
12
13
|
centimeters: "CENTIMETERS";
|
|
@@ -47,7 +48,7 @@ export type GeoFilter_Intersects = {
|
|
|
47
48
|
} | Polygon;
|
|
48
49
|
};
|
|
49
50
|
export type GeoFilter = GeoFilter_Within | GeoFilter_Intersects;
|
|
50
|
-
type FilterFor<PD extends ObjectTypePropertyDefinition> = PD["type"] extends "string" ? StringFilter : PD["type"] extends "geopoint" | "geoshape" ? GeoFilter : NumberFilter;
|
|
51
|
+
type FilterFor<PD extends ObjectTypePropertyDefinition> = PD["type"] extends "string" ? StringFilter : PD["type"] extends "geopoint" | "geoshape" ? GeoFilter : PD["type"] extends "datetime" | "timestamp" ? DatetimeFilter : NumberFilter;
|
|
51
52
|
export interface AndWhereClause<T extends ObjectOrInterfaceDefinition<any, any>> {
|
|
52
53
|
$and: WhereClause<T>[];
|
|
53
54
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { ObjectOrInterfaceDefinition } from "@osdk/api";
|
|
2
|
-
export type AggregatableKeys<Q extends ObjectOrInterfaceDefinition
|
|
2
|
+
export type AggregatableKeys<Q extends ObjectOrInterfaceDefinition> = keyof {
|
|
3
3
|
[P in keyof Q["properties"]]: any;
|
|
4
4
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ObjectOrInterfaceDefinition } from "@osdk/api";
|
|
2
|
-
import type { AggregationClause, GroupByClause, WhereClause } from "../../query/index.js";
|
|
3
|
-
export type AggregateOpts<Q extends ObjectOrInterfaceDefinition
|
|
4
|
-
select:
|
|
2
|
+
import type { AggregatableKeys, AggregationClause, GroupByClause, WhereClause } from "../../query/index.js";
|
|
3
|
+
export type AggregateOpts<Q extends ObjectOrInterfaceDefinition, KK extends AggregatableKeys<Q> = AggregatableKeys<Q>> = {
|
|
4
|
+
select: AggregationClause<Q, KK>;
|
|
5
5
|
where?: WhereClause<Q>;
|
|
6
6
|
groupBy?: GroupByClause<Q>;
|
|
7
7
|
};
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import type { ObjectOrInterfaceDefinition } from "@osdk/api";
|
|
2
2
|
import type { OsdkObjectPropertyType } from "../../Definitions.js";
|
|
3
|
-
import type { AggregationResultsWithoutGroups } from "./AggregationResultsWithoutGroups.js";
|
|
3
|
+
import type { AggregationCountResult, AggregationResultsWithoutGroups } from "./AggregationResultsWithoutGroups.js";
|
|
4
4
|
import type { AggregationClause } from "./AggregationsClause.js";
|
|
5
|
-
import type { GroupByClause } from "./GroupByClause.js";
|
|
6
|
-
export type AggregationResultsWithGroups<Q extends ObjectOrInterfaceDefinition<any, any>, A extends AggregationClause<Q>, G extends GroupByClause<Q> | undefined> = {
|
|
7
|
-
group: {
|
|
8
|
-
[P in keyof G & keyof Q["properties"]]:
|
|
5
|
+
import type { GroupByClause, GroupByRange } from "./GroupByClause.js";
|
|
6
|
+
export type AggregationResultsWithGroups<Q extends ObjectOrInterfaceDefinition<any, any>, A extends AggregationClause<Q>, G extends GroupByClause<Q> | undefined> = ({
|
|
7
|
+
$group: {
|
|
8
|
+
[P in keyof G & keyof Q["properties"]]: G[P] extends {
|
|
9
|
+
ranges: GroupByRange[];
|
|
10
|
+
} ? {
|
|
11
|
+
startValue: number;
|
|
12
|
+
endValue: number;
|
|
13
|
+
} : OsdkObjectPropertyType<Q["properties"][P]>;
|
|
9
14
|
};
|
|
10
|
-
|
|
11
|
-
}[];
|
|
15
|
+
} & AggregationCountResult<Q, A> & AggregationResultsWithoutGroups<Q, A>)[];
|
|
@@ -3,9 +3,12 @@ import type { OsdkObjectPropertyType } from "../../Definitions.js";
|
|
|
3
3
|
import type { StringArrayToUnion } from "../../util/StringArrayToUnion.js";
|
|
4
4
|
import type { AggregationClause } from "./AggregationsClause.js";
|
|
5
5
|
type SubselectKeys<AC extends AggregationClause<any>, P extends keyof AC> = AC[P] extends readonly string[] | string ? P : never;
|
|
6
|
-
export type AggregationResultsWithoutGroups<Q extends ObjectOrInterfaceDefinition<any, any>, AC extends AggregationClause<
|
|
6
|
+
export type AggregationResultsWithoutGroups<Q extends ObjectOrInterfaceDefinition<any, any>, AC extends AggregationClause<Q>> = {
|
|
7
7
|
[P in keyof Q["properties"] as SubselectKeys<AC, P>]: AC[P] extends readonly string[] | string ? {
|
|
8
8
|
[Z in StringArrayToUnion<AC[P]>]: Z extends "approximateDistinct" ? number : OsdkObjectPropertyType<Q["properties"][P]>;
|
|
9
9
|
} : never;
|
|
10
10
|
};
|
|
11
|
+
export type AggregationCountResult<Q extends ObjectOrInterfaceDefinition<any, any>, A extends AggregationClause<Q>> = "$count" extends keyof A ? {
|
|
12
|
+
$count: number;
|
|
13
|
+
} : {};
|
|
11
14
|
export {};
|
|
@@ -2,7 +2,10 @@ import type { ObjectOrInterfaceDefinition } from "@osdk/api";
|
|
|
2
2
|
import type { AggregatableKeys } from "./AggregatableKeys.js";
|
|
3
3
|
type StringAggregateOption = "approximateDistinct" | "count";
|
|
4
4
|
type NumericAggregateOption = "count" | "min" | "max" | "sum" | "avg" | "approximateDistinct";
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
type totalCountOption = {
|
|
6
|
+
$count?: true;
|
|
7
7
|
};
|
|
8
|
+
export type AggregationClause<Q extends ObjectOrInterfaceDefinition, K extends AggregatableKeys<Q> = AggregatableKeys<Q>> = {
|
|
9
|
+
[P in K]?: Q["properties"][P]["type"] extends "string" ? StringAggregateOption | StringAggregateOption[] : Q["properties"][P]["type"] extends "double" | "integer" | "float" | "decimal" | "byte" | "long" | "short" ? NumericAggregateOption | NumericAggregateOption[] : never;
|
|
10
|
+
} & totalCountOption;
|
|
8
11
|
export {};
|
|
@@ -6,6 +6,7 @@ export type huh = AggregatableKeys<{
|
|
|
6
6
|
Todo: {
|
|
7
7
|
type: "object";
|
|
8
8
|
apiName: "Todo";
|
|
9
|
+
primaryKeyApiName: "id";
|
|
9
10
|
primaryKeyType: "double";
|
|
10
11
|
links: {};
|
|
11
12
|
properties: {
|
|
@@ -27,6 +28,7 @@ export type Q = AggregationClause<{
|
|
|
27
28
|
Todo: {
|
|
28
29
|
type: "object";
|
|
29
30
|
apiName: "Todo";
|
|
31
|
+
primaryKeyApiName: "id";
|
|
30
32
|
primaryKeyType: "double";
|
|
31
33
|
links: {};
|
|
32
34
|
properties: {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ObjectOrInterfaceDefinition } from "@osdk/api";
|
|
2
|
+
import type { AggregatableKeys } from "./AggregatableKeys.js";
|
|
2
3
|
import type { AggregateOpts } from "./AggregateOpts.js";
|
|
3
4
|
import type { AggregationResultsWithGroups } from "./AggregationResultsWithGroups.js";
|
|
4
|
-
import type { AggregationResultsWithoutGroups } from "./AggregationResultsWithoutGroups.js";
|
|
5
|
-
export type AggregationsResults<Q extends ObjectOrInterfaceDefinition, AO extends AggregateOpts<Q
|
|
5
|
+
import type { AggregationCountResult, AggregationResultsWithoutGroups } from "./AggregationResultsWithoutGroups.js";
|
|
6
|
+
export type AggregationsResults<Q extends ObjectOrInterfaceDefinition, AO extends AggregateOpts<Q>> = Exclude<keyof AO["select"], AggregatableKeys<Q> | "$count"> extends never ? unknown extends AO["groupBy"] ? AggregationResultsWithoutGroups<Q, AO["select"]> & AggregationCountResult<Q, AO["select"]> : Exclude<AO["groupBy"], undefined> extends never ? AggregationResultsWithoutGroups<Q, AO["select"]> & AggregationCountResult<Q, AO["select"]> : AggregationResultsWithGroups<Q, AO["select"], AO["groupBy"]> : `Sorry, the following are not valid selectors for an aggregation: ${Exclude<keyof AO["select"] & string, AggregatableKeys<Q> | "$count">}`;
|
|
@@ -7,6 +7,14 @@ export type GroupByClause<Q extends ObjectOrInterfaceDefinition<any, any>> = {
|
|
|
7
7
|
export type StringGroupByValue = "exact" | {
|
|
8
8
|
exactWithLimit: number;
|
|
9
9
|
};
|
|
10
|
+
export type GroupByRange = [number, number];
|
|
11
|
+
export type NumericGroupByValue = "exact" | {
|
|
12
|
+
exactWithLimit: number;
|
|
13
|
+
} | {
|
|
14
|
+
fixedWidth: number;
|
|
15
|
+
} | {
|
|
16
|
+
ranges: GroupByRange[];
|
|
17
|
+
};
|
|
10
18
|
type GroupByEntry<Q extends ObjectOrInterfaceDefinition<any, any>, P extends AggregatableKeys<Q>> = Q["properties"][P]["type"] extends keyof GroupByMapper ? GroupByMapper[Q["properties"][P]["type"]] : never;
|
|
11
19
|
export type AllGroupByValues = GroupByMapper[keyof GroupByMapper];
|
|
12
20
|
export {};
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import type { StringGroupByValue } from "./GroupByClause.js";
|
|
1
|
+
import type { NumericGroupByValue, StringGroupByValue } from "./GroupByClause.js";
|
|
2
2
|
export interface GroupByMapper {
|
|
3
3
|
string: StringGroupByValue;
|
|
4
|
+
short: NumericGroupByValue;
|
|
5
|
+
float: NumericGroupByValue;
|
|
6
|
+
decimal: NumericGroupByValue;
|
|
7
|
+
byte: NumericGroupByValue;
|
|
8
|
+
double: NumericGroupByValue;
|
|
9
|
+
integer: NumericGroupByValue;
|
|
4
10
|
}
|
|
@@ -2,6 +2,7 @@ import type { ObjectTypeDefinition, ObjectTypeLinkDefinition } from "@osdk/api";
|
|
|
2
2
|
interface TaskDef extends ObjectTypeDefinition<"Task"> {
|
|
3
3
|
type: "object";
|
|
4
4
|
apiName: "Task";
|
|
5
|
+
primaryKeyApiName: "id";
|
|
5
6
|
primaryKeyType: "integer";
|
|
6
7
|
properties: {
|
|
7
8
|
id: {
|
|
@@ -19,6 +20,7 @@ interface TaskDef extends ObjectTypeDefinition<"Task"> {
|
|
|
19
20
|
interface TodoDef extends ObjectTypeDefinition<"Todo"> {
|
|
20
21
|
type: "object";
|
|
21
22
|
apiName: "Todo";
|
|
23
|
+
primaryKeyApiName: "id";
|
|
22
24
|
primaryKeyType: "integer";
|
|
23
25
|
properties: {
|
|
24
26
|
id: {
|
|
@@ -33,6 +35,7 @@ interface TodoDef extends ObjectTypeDefinition<"Todo"> {
|
|
|
33
35
|
interface PersonDef extends ObjectTypeDefinition<"Person"> {
|
|
34
36
|
type: "object";
|
|
35
37
|
apiName: "Person";
|
|
38
|
+
primaryKeyApiName: "id";
|
|
36
39
|
primaryKeyType: "integer";
|
|
37
40
|
properties: {
|
|
38
41
|
id: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@osdk/client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"access": "public",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -22,21 +22,23 @@
|
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"conjure-lite": "^0.3.3",
|
|
25
|
+
"fast-deep-equal": "^3.1.3",
|
|
25
26
|
"fetch-retry": "^5.0.6",
|
|
26
27
|
"isomorphic-ws": "^5.0.0",
|
|
27
28
|
"tiny-invariant": "^1.3.1",
|
|
28
29
|
"ws": "^8.14.2",
|
|
29
|
-
"@osdk/api": "1.
|
|
30
|
+
"@osdk/api": "1.3.0",
|
|
30
31
|
"@osdk/gateway": "1.2.0",
|
|
31
|
-
"@osdk/
|
|
32
|
+
"@osdk/generator-converters": "0.1.0",
|
|
33
|
+
"@osdk/shared.net": "1.5.0"
|
|
32
34
|
},
|
|
33
35
|
"devDependencies": {
|
|
34
36
|
"@types/geojson": "^7946.0.14",
|
|
35
37
|
"@types/ws": "^8.5.10",
|
|
36
38
|
"ts-expect": "^1.3.0",
|
|
37
39
|
"typescript": "^5.2.2",
|
|
38
|
-
"@osdk/generator": "1.
|
|
39
|
-
"@osdk/shared.test": "1.
|
|
40
|
+
"@osdk/generator": "1.6.0",
|
|
41
|
+
"@osdk/shared.test": "1.2.0"
|
|
40
42
|
},
|
|
41
43
|
"publishConfig": {
|
|
42
44
|
"access": "public"
|