@osdk/client 0.8.0 → 0.9.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-TJNTUGSE.mjs → chunk-BQNFWSLL.mjs} +48 -22
- package/build/js/chunk-BQNFWSLL.mjs.map +1 -0
- package/build/js/{chunk-V77HHGVZ.cjs → chunk-KAL57TC5.cjs} +47 -21
- package/build/js/chunk-KAL57TC5.cjs.map +1 -0
- package/build/js/index.cjs +32 -14
- package/build/js/index.cjs.map +1 -1
- package/build/js/index.mjs +28 -10
- package/build/js/index.mjs.map +1 -1
- package/build/js/public/objects.cjs +3 -3
- package/build/js/public/objects.mjs +1 -1
- package/build/types/Client.d.ts +3 -3
- package/build/types/ObjectSetCreator.d.ts +3 -3
- package/build/types/OsdkObjectFrom.d.ts +11 -17
- package/build/types/actions/Actions.d.ts +17 -13
- package/build/types/actions/applyAction.d.ts +3 -10
- package/build/types/actions/createActionInvoker.d.ts +2 -1
- package/build/types/definitions/LinkDefinitions.d.ts +12 -13
- package/build/types/generatedNoCheck/Ontology.d.ts +13 -477
- package/build/types/generatedNoCheck/ontology/actions/actionTakesAttachment.d.ts +22 -10
- package/build/types/generatedNoCheck/ontology/actions/actionTakesObjectSet.d.ts +23 -13
- package/build/types/generatedNoCheck/ontology/actions/createOffice.d.ts +40 -28
- package/build/types/generatedNoCheck/ontology/actions/createOfficeAndEmployee.d.ts +46 -34
- package/build/types/generatedNoCheck/ontology/actions/index.d.ts +7 -7
- package/build/types/generatedNoCheck/ontology/actions/moveOffice.d.ts +40 -28
- package/build/types/generatedNoCheck/ontology/actions/promoteEmployee.d.ts +32 -20
- package/build/types/generatedNoCheck/ontology/actions/promoteEmployeeObject.d.ts +33 -23
- package/build/types/generatedNoCheck/ontology/objects/Employee.d.ts +20 -25
- package/build/types/generatedNoCheck/ontology/objects/ObjectWithTimestampPrimaryKey.d.ts +10 -7
- package/build/types/generatedNoCheck/ontology/objects/Office.d.ts +16 -15
- package/build/types/generatedNoCheck/ontology/objects/equipment.d.ts +10 -7
- package/build/types/generatedNoCheck/ontology/objects/objectTypeWithAllPropertyTypes.d.ts +38 -35
- package/build/types/index.d.ts +3 -1
- package/build/types/internal/conversions/legacyToModernSingleAggregationResult.d.ts +1 -1
- package/build/types/internal/conversions/modernToLegacyAggregationClause.d.ts +1 -2
- package/build/types/internal/conversions/modernToLegacyGroupByClause.d.ts +1 -2
- package/build/types/object/aggregateOrThrow.d.ts +3 -2
- package/build/types/object/fetchPageOrThrow.d.ts +4 -4
- package/build/types/object/followLinkOrThrow.d.ts +1 -1
- package/build/types/object/getLinkedObjectByPkOrThrow.d.ts +1 -1
- package/build/types/object/getLinkedObjectOrThrow.d.ts +5 -2
- package/build/types/object/pageLinkedObjectsOrThrow.d.ts +4 -6
- package/build/types/objectSet/LinkTypesFrom.d.ts +2 -2
- package/build/types/objectSet/ObjectSet.d.ts +13 -11
- package/build/types/objectSet/ObjectSet.test.d.ts +1 -0
- package/build/types/objectSet/ObjectSetListener.d.ts +7 -7
- package/build/types/objectSet/ObjectSetListenerWebsocket.d.ts +2 -2
- package/build/types/objectSet/createObjectSet.d.ts +2 -2
- package/build/types/query/WhereClause.d.ts +12 -5
- package/build/types/query/aggregations/AggregatableKeys.d.ts +3 -3
- package/build/types/query/aggregations/AggregateOpts.d.ts +4 -4
- package/build/types/query/aggregations/AggregationResultsWithGroups.d.ts +4 -4
- package/build/types/query/aggregations/AggregationResultsWithoutGroups.d.ts +5 -5
- package/build/types/query/aggregations/AggregationsClause.d.ts +5 -5
- package/build/types/query/aggregations/AggregationsClause.test.d.ts +4 -2
- package/build/types/query/aggregations/AggregationsResults.d.ts +2 -2
- package/build/types/query/aggregations/GroupByClause.d.ts +4 -4
- package/build/types/query/aggregations/GroupByClause.test.d.ts +2 -1
- package/build/types/util/test/mockOntology.d.ts +50 -48
- package/changelog/0.6.0/pr-9.v2.yml +5 -0
- package/changelog/0.7.0/pr-20.v2.yml +5 -0
- package/changelog/0.7.0/pr-24.v2.yml +5 -0
- package/changelog/0.7.0/pr-28.v2.yml +5 -0
- package/changelog/0.8.0/pr-30.v2.yml +5 -0
- package/changelog/0.9.0/pr-43.v2.yml +5 -0
- package/changelog/0.9.0/pr-45.v2.yml +5 -0
- package/changelog/0.9.0/pr-48.v2.yml +5 -0
- package/changelog/0.9.0/pr-59.v2.yml +5 -0
- package/changelog/0.9.0/pr-65.v2.yml +5 -0
- package/changelog/0.9.0/pr-72.v2.yml +5 -0
- package/changelog/0.9.0/pr-75.v2.yml +5 -0
- package/changelog/@unreleased/.gitkeep +0 -0
- package/package.json +11 -6
- package/build/js/chunk-TJNTUGSE.mjs.map +0 -1
- package/build/js/chunk-V77HHGVZ.cjs.map +0 -1
- /package/{CHANGELOG.md → CHANGELOG_OLD.md} +0 -0
|
@@ -1,158 +1,161 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import type { ObjectTypeDefinition } from '@osdk/api';
|
|
2
|
+
export interface objectTypeWithAllPropertyTypesDef extends ObjectTypeDefinition<'objectTypeWithAllPropertyTypes'> {
|
|
3
|
+
type: 'object';
|
|
4
|
+
apiName: 'objectTypeWithAllPropertyTypes';
|
|
5
|
+
description: 'An object type with all property types';
|
|
6
|
+
primaryKeyType: 'integer';
|
|
5
7
|
links: {};
|
|
6
8
|
properties: {
|
|
7
9
|
id: {
|
|
8
10
|
multiplicity: false;
|
|
9
|
-
type:
|
|
11
|
+
type: 'integer';
|
|
10
12
|
nullable: false;
|
|
11
13
|
};
|
|
12
14
|
string: {
|
|
13
15
|
multiplicity: false;
|
|
14
|
-
type:
|
|
16
|
+
type: 'string';
|
|
15
17
|
nullable: true;
|
|
16
18
|
};
|
|
17
19
|
boolean: {
|
|
18
20
|
multiplicity: false;
|
|
19
|
-
type:
|
|
21
|
+
type: 'boolean';
|
|
20
22
|
nullable: true;
|
|
21
23
|
};
|
|
22
24
|
date: {
|
|
23
25
|
multiplicity: false;
|
|
24
|
-
type:
|
|
26
|
+
type: 'datetime';
|
|
25
27
|
nullable: true;
|
|
26
28
|
};
|
|
27
29
|
dateTime: {
|
|
28
30
|
multiplicity: false;
|
|
29
|
-
type:
|
|
31
|
+
type: 'timestamp';
|
|
30
32
|
nullable: true;
|
|
31
33
|
};
|
|
32
34
|
decimal: {
|
|
33
35
|
multiplicity: false;
|
|
34
|
-
type:
|
|
36
|
+
type: 'decimal';
|
|
35
37
|
nullable: true;
|
|
36
38
|
};
|
|
37
39
|
integer: {
|
|
38
40
|
multiplicity: false;
|
|
39
|
-
type:
|
|
41
|
+
type: 'integer';
|
|
40
42
|
nullable: true;
|
|
41
43
|
};
|
|
42
44
|
long: {
|
|
43
45
|
multiplicity: false;
|
|
44
|
-
type:
|
|
46
|
+
type: 'long';
|
|
45
47
|
nullable: true;
|
|
46
48
|
};
|
|
47
49
|
short: {
|
|
48
50
|
multiplicity: false;
|
|
49
|
-
type:
|
|
51
|
+
type: 'short';
|
|
50
52
|
nullable: true;
|
|
51
53
|
};
|
|
52
54
|
float: {
|
|
53
55
|
multiplicity: false;
|
|
54
|
-
type:
|
|
56
|
+
type: 'float';
|
|
55
57
|
nullable: true;
|
|
56
58
|
};
|
|
57
59
|
double: {
|
|
58
60
|
multiplicity: false;
|
|
59
|
-
type:
|
|
61
|
+
type: 'double';
|
|
60
62
|
nullable: true;
|
|
61
63
|
};
|
|
62
64
|
byte: {
|
|
63
65
|
multiplicity: false;
|
|
64
|
-
type:
|
|
66
|
+
type: 'byte';
|
|
65
67
|
nullable: true;
|
|
66
68
|
};
|
|
67
69
|
attachment: {
|
|
68
70
|
multiplicity: false;
|
|
69
|
-
type:
|
|
71
|
+
type: 'attachment';
|
|
70
72
|
nullable: true;
|
|
71
73
|
};
|
|
72
74
|
attachment2: {
|
|
73
75
|
multiplicity: false;
|
|
74
|
-
type:
|
|
76
|
+
type: 'attachment';
|
|
75
77
|
nullable: true;
|
|
76
78
|
};
|
|
77
79
|
geoPoint: {
|
|
78
80
|
multiplicity: false;
|
|
79
|
-
type:
|
|
81
|
+
type: 'geopoint';
|
|
80
82
|
nullable: true;
|
|
81
83
|
};
|
|
82
84
|
geoShape: {
|
|
83
85
|
multiplicity: false;
|
|
84
|
-
type:
|
|
86
|
+
type: 'geoshape';
|
|
85
87
|
nullable: true;
|
|
86
88
|
};
|
|
87
89
|
stringArray: {
|
|
88
90
|
multiplicity: true;
|
|
89
|
-
type:
|
|
91
|
+
type: 'string';
|
|
90
92
|
nullable: true;
|
|
91
93
|
};
|
|
92
94
|
booleanArray: {
|
|
93
95
|
multiplicity: true;
|
|
94
|
-
type:
|
|
96
|
+
type: 'boolean';
|
|
95
97
|
nullable: true;
|
|
96
98
|
};
|
|
97
99
|
dateArray: {
|
|
98
100
|
multiplicity: true;
|
|
99
|
-
type:
|
|
101
|
+
type: 'datetime';
|
|
100
102
|
nullable: true;
|
|
101
103
|
};
|
|
102
104
|
dateTimeArray: {
|
|
103
105
|
multiplicity: true;
|
|
104
|
-
type:
|
|
106
|
+
type: 'timestamp';
|
|
105
107
|
nullable: true;
|
|
106
108
|
};
|
|
107
109
|
decimalArray: {
|
|
108
110
|
multiplicity: true;
|
|
109
|
-
type:
|
|
111
|
+
type: 'decimal';
|
|
110
112
|
nullable: true;
|
|
111
113
|
};
|
|
112
114
|
integerArray: {
|
|
113
115
|
multiplicity: true;
|
|
114
|
-
type:
|
|
116
|
+
type: 'integer';
|
|
115
117
|
nullable: true;
|
|
116
118
|
};
|
|
117
119
|
longArray: {
|
|
118
120
|
multiplicity: true;
|
|
119
|
-
type:
|
|
121
|
+
type: 'long';
|
|
120
122
|
nullable: true;
|
|
121
123
|
};
|
|
122
124
|
shortArray: {
|
|
123
125
|
multiplicity: true;
|
|
124
|
-
type:
|
|
126
|
+
type: 'short';
|
|
125
127
|
nullable: true;
|
|
126
128
|
};
|
|
127
129
|
floatArray: {
|
|
128
130
|
multiplicity: true;
|
|
129
|
-
type:
|
|
131
|
+
type: 'float';
|
|
130
132
|
nullable: true;
|
|
131
133
|
};
|
|
132
134
|
doubleArray: {
|
|
133
135
|
multiplicity: true;
|
|
134
|
-
type:
|
|
136
|
+
type: 'double';
|
|
135
137
|
nullable: true;
|
|
136
138
|
};
|
|
137
139
|
byteArray: {
|
|
138
140
|
multiplicity: true;
|
|
139
|
-
type:
|
|
141
|
+
type: 'byte';
|
|
140
142
|
nullable: true;
|
|
141
143
|
};
|
|
142
144
|
attachmentArray: {
|
|
143
145
|
multiplicity: true;
|
|
144
|
-
type:
|
|
146
|
+
type: 'attachment';
|
|
145
147
|
nullable: true;
|
|
146
148
|
};
|
|
147
149
|
geoPointArray: {
|
|
148
150
|
multiplicity: true;
|
|
149
|
-
type:
|
|
151
|
+
type: 'geopoint';
|
|
150
152
|
nullable: true;
|
|
151
153
|
};
|
|
152
154
|
geoShapeArray: {
|
|
153
155
|
multiplicity: true;
|
|
154
|
-
type:
|
|
156
|
+
type: 'geoshape';
|
|
155
157
|
nullable: true;
|
|
156
158
|
};
|
|
157
159
|
};
|
|
158
|
-
}
|
|
160
|
+
}
|
|
161
|
+
export declare const objectTypeWithAllPropertyTypes: objectTypeWithAllPropertyTypesDef;
|
package/build/types/index.d.ts
CHANGED
|
@@ -10,5 +10,7 @@ export { createClientContext } from "@osdk/shared.net";
|
|
|
10
10
|
export { isOk } from "@osdk/shared.net";
|
|
11
11
|
export type { ResultOrError } from "@osdk/shared.net";
|
|
12
12
|
export type { ClientContext } from "@osdk/shared.net";
|
|
13
|
-
export type { ActionEditResponse, ActionValidationResponse, } from "./actions/Actions.js";
|
|
13
|
+
export type { ActionEditResponse, ActionValidationResponse, ApplyActionOptions, OsdkActionParameters, } from "./actions/Actions.js";
|
|
14
14
|
export { ActionValidationError } from "./actions/ActionValidationError.js";
|
|
15
|
+
export type { ActionReturnTypeForOptions } from "./actions/applyAction.js";
|
|
16
|
+
export type { NOOP } from "./util/NOOP.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { AggregateObjectsResponseV2 } from "@osdk/gateway/types";
|
|
2
2
|
import type { AggregationClause, AggregationResultsWithoutGroups } from "../../query/index.js";
|
|
3
3
|
import type { ArrayElement } from "../../util/ArrayElement.js";
|
|
4
|
-
export declare function legacyToModernSingleAggregationResult<AC extends AggregationClause<any
|
|
4
|
+
export declare function legacyToModernSingleAggregationResult<AC extends AggregationClause<any>>(entry: ArrayElement<AggregateObjectsResponseV2["data"]>): AggregationResultsWithoutGroups<any, AC>;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { ObjectTypeKeysFrom, OntologyDefinition } from "@osdk/api";
|
|
2
1
|
import type { Aggregation } from "@osdk/gateway/types";
|
|
3
2
|
import type { AggregationClause } from "../../query/index.js";
|
|
4
|
-
export declare function modernToLegacyAggregationClause<
|
|
3
|
+
export declare function modernToLegacyAggregationClause<AC extends AggregationClause<any>>(select: AC): Aggregation[];
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { ObjectTypeKeysFrom, OntologyDefinition } from "@osdk/api";
|
|
2
1
|
import type { AggregationGroupByV2 } from "@osdk/gateway/types";
|
|
3
2
|
import type { GroupByClause } from "../../query/index.js";
|
|
4
|
-
export declare function modernToLegacyGroupByClause
|
|
3
|
+
export declare function modernToLegacyGroupByClause(groupByClause: GroupByClause<any> | undefined): AggregationGroupByV2[];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ObjectOrInterfaceDefinition } from "@osdk/api";
|
|
2
|
+
import type { ObjectSet } from "@osdk/gateway/types";
|
|
2
3
|
import type { ClientContext } from "@osdk/shared.net";
|
|
3
4
|
import type { AggregateOpts } from "../query/aggregations/AggregateOpts.js";
|
|
4
5
|
import type { AggregationsResults } from "../query/index.js";
|
|
5
|
-
export declare function aggregateOrThrow<
|
|
6
|
+
export declare function aggregateOrThrow<Q extends ObjectOrInterfaceDefinition, const AO extends AggregateOpts<Q, any>>(clientCtx: ClientContext<any>, objectType: Q, objectSet: ObjectSet | undefined, req: AO): Promise<AggregationsResults<Q, AO>>;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ObjectOrInterfaceDefinition, ObjectOrInterfacePropertyKeysFrom2, ObjectTypeDefinition } from "@osdk/api";
|
|
2
2
|
import type { ObjectSet } from "@osdk/gateway/types";
|
|
3
3
|
import type { ClientContext } from "@osdk/shared.net";
|
|
4
4
|
import type { OsdkObjectFrom } from "../OsdkObjectFrom.js";
|
|
5
5
|
import type { PageResult } from "../PageResult.js";
|
|
6
|
-
export interface SelectArg<O extends
|
|
6
|
+
export interface SelectArg<O extends ObjectOrInterfaceDefinition<any, any>, L = ObjectOrInterfacePropertyKeysFrom2<O>> {
|
|
7
7
|
select?: readonly L[];
|
|
8
8
|
}
|
|
9
|
-
export interface FetchPageOrThrowArgs<O extends
|
|
9
|
+
export interface FetchPageOrThrowArgs<O extends ObjectOrInterfaceDefinition<any, any>, L = ObjectOrInterfacePropertyKeysFrom2<O>> extends SelectArg<O, L> {
|
|
10
10
|
nextPageToken?: string;
|
|
11
11
|
pageSize?: number;
|
|
12
12
|
}
|
|
13
|
-
export declare function fetchPageOrThrow<
|
|
13
|
+
export declare function fetchPageOrThrow<Q extends ObjectOrInterfaceDefinition, const A extends FetchPageOrThrowArgs<Q>>(client: ClientContext<any>, objectType: Q, args: A, objectSet?: ObjectSet): Promise<PageResult<OsdkObjectFrom<Q extends ObjectTypeDefinition<any> ? Q : never, A["select"] extends readonly string[] ? A["select"][number] : ObjectOrInterfacePropertyKeysFrom2<Q>>>>;
|
|
@@ -2,4 +2,4 @@ import { type ObjectTypeKeysFrom, type ObjectTypeLinkKeysFrom, type ObjectTypeLi
|
|
|
2
2
|
import { type ClientContext } from "@osdk/shared.net";
|
|
3
3
|
import type { OsdkObjectFrom } from "../OsdkObjectFrom.js";
|
|
4
4
|
import type { PageResult } from "../PageResult.js";
|
|
5
|
-
export declare function followLinkOrThrow<O extends OntologyDefinition<any>, K extends ObjectTypeKeysFrom<O>, L extends ObjectTypeLinkKeysFrom<O, K>>(clientCtx: ClientContext<O>, sourceObject: OsdkObjectFrom<K
|
|
5
|
+
export declare function followLinkOrThrow<O extends OntologyDefinition<any>, K extends ObjectTypeKeysFrom<O>, L extends ObjectTypeLinkKeysFrom<O, K>>(clientCtx: ClientContext<O>, sourceObject: OsdkObjectFrom<O["objects"][K]>, link: L): Promise<PageResult<OsdkObjectFrom<ObjectTypeLinkTargetTypeFrom<O, K, L>>>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { ObjectOrInterfacePropertyKeysFrom, ObjectTypeKeysFrom, ObjectTypeLinkKeysFrom, ObjectTypeLinkTargetTypeFrom, OntologyDefinition } from "@osdk/api";
|
|
2
2
|
import type { ClientContext } from "@osdk/shared.net";
|
|
3
3
|
import type { OsdkObjectFrom } from "../OsdkObjectFrom.js";
|
|
4
|
-
export declare function getLinkedObjectByPkOrThrow<O extends OntologyDefinition<any>, T extends ObjectTypeKeysFrom<O> & string, L extends ObjectTypeLinkKeysFrom<O, T> & string, S = ReadonlyArray<ObjectOrInterfacePropertyKeysFrom<O, ObjectTypeLinkTargetTypeFrom<O, T, L>>>>(client: ClientContext<O>, sourceApiName: T, primaryKey: any, linkTypeApiName: L, linkedObjectPrimaryKey: any, select?: S): Promise<OsdkObjectFrom<T
|
|
4
|
+
export declare function getLinkedObjectByPkOrThrow<O extends OntologyDefinition<any>, T extends ObjectTypeKeysFrom<O> & string, L extends ObjectTypeLinkKeysFrom<O, T> & string, S = ReadonlyArray<ObjectOrInterfacePropertyKeysFrom<O, ObjectTypeLinkTargetTypeFrom<O, T, L>>>>(client: ClientContext<O>, sourceApiName: T, primaryKey: any, linkTypeApiName: L, linkedObjectPrimaryKey: any, select?: S): Promise<OsdkObjectFrom<O["objects"][T]>>;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import type { ObjectTypeKeysFrom,
|
|
1
|
+
import type { ObjectTypeKeysFrom, ObjectTypeLinkKeysFrom2, OntologyDefinition } from "@osdk/api";
|
|
2
2
|
import { type ClientContext } from "@osdk/shared.net";
|
|
3
3
|
import type { SelectArg } from "./fetchPageOrThrow.js";
|
|
4
|
-
export declare function getLinkedObjectOrThrow<O extends OntologyDefinition<any>, T extends ObjectTypeKeysFrom<O> & string, L extends
|
|
4
|
+
export declare function getLinkedObjectOrThrow<O extends OntologyDefinition<any>, T extends ObjectTypeKeysFrom<O> & string, L extends ObjectTypeLinkKeysFrom2<O["objects"][T]> & string, S extends SelectArg<O["objects"][T]>["select"]>(client: ClientContext<O>, sourceApiName: T, primaryKey: any, linkTypeApiName: L, select?: S): Promise<import("../OsdkObjectFrom.js").OsdkObjectFrom<O["objects"][T]["links"][ObjectTypeLinkKeysFrom2<O["objects"][T]>]["__Mark"], import("./pageLinkedObjectsOrThrow.js").SelectArgToKeys<{
|
|
5
|
+
readonly pageSize: 1;
|
|
6
|
+
readonly select: S | undefined;
|
|
7
|
+
}>>>;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ObjectOrInterfacePropertyKeysFrom2, ObjectTypeKeysFrom, ObjectTypeLinkKeysFrom2, OntologyDefinition } from "@osdk/api";
|
|
2
2
|
import { type ClientContext } from "@osdk/shared.net";
|
|
3
3
|
import type { OsdkObjectFrom } from "../OsdkObjectFrom.js";
|
|
4
4
|
import type { PageResult } from "../PageResult.js";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
select?: S;
|
|
9
|
-
}): Promise<PageResult<OsdkObjectFrom<T, O, S extends readonly string[] ? S[number] : ObjectOrInterfacePropertyKeysFrom<O, T>>>>;
|
|
5
|
+
import type { FetchPageOrThrowArgs, SelectArg } from "./fetchPageOrThrow.js";
|
|
6
|
+
export type SelectArgToKeys<A extends SelectArg<any>> = A["select"] extends readonly string[] ? A["select"][number] : A extends SelectArg<infer Q> ? ObjectOrInterfacePropertyKeysFrom2<Q> : never;
|
|
7
|
+
export declare function pageLinkedObjectsOrThrow<O extends OntologyDefinition<any>, T_SourceTypeKey extends ObjectTypeKeysFrom<O>, T_LinkApiName extends ObjectTypeLinkKeysFrom2<O["objects"][T_SourceTypeKey]>, Q extends O["objects"][T_SourceTypeKey]["links"][T_LinkApiName]["__Mark"], const A extends FetchPageOrThrowArgs<Q>>(client: ClientContext<O>, sourceApiName: T_SourceTypeKey & string, primaryKey: any, linkTypeApiName: string, options: A): Promise<PageResult<OsdkObjectFrom<Q, SelectArgToKeys<A>>>>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export type LinkTypesFrom<
|
|
1
|
+
import type { ObjectOrInterfaceDefinition } from "@osdk/api";
|
|
2
|
+
export type LinkTypesFrom<Q extends ObjectOrInterfaceDefinition> = keyof Q["links"];
|
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ObjectOrInterfaceDefinition, ObjectOrInterfaceDefinitionFrom, ObjectOrInterfaceKeysFrom, ObjectOrInterfacePropertyKeysFrom2, OntologyDefinition } from "@osdk/api";
|
|
2
2
|
import type { ObjectSet as WireObjectSet } from "@osdk/gateway/types";
|
|
3
3
|
import type { FetchPageOrThrowArgs } from "../object/fetchPageOrThrow.js";
|
|
4
|
-
import type {
|
|
4
|
+
import type { OsdkObjectOrInterfaceFrom } from "../OsdkObjectFrom.js";
|
|
5
5
|
import type { PageResult } from "../PageResult.js";
|
|
6
6
|
import type { AggregateOpts } from "../query/aggregations/AggregateOpts.js";
|
|
7
7
|
import type { AggregationsResults, WhereClause } from "../query/index.js";
|
|
8
|
-
import type { LinkTypesFrom } from "./LinkTypesFrom.js";
|
|
9
8
|
import type { ObjectSetListener } from "./ObjectSetListener.js";
|
|
10
|
-
export type ObjectSet<
|
|
11
|
-
export interface BaseObjectSet<
|
|
9
|
+
export type ObjectSet<Q extends ObjectOrInterfaceDefinition> = BaseObjectSet<Q>;
|
|
10
|
+
export interface BaseObjectSet<Q extends ObjectOrInterfaceDefinition> {
|
|
12
11
|
definition: WireObjectSet;
|
|
13
|
-
fetchPageOrThrow: <L extends
|
|
14
|
-
aggregateOrThrow: <const AO extends AggregateOpts<
|
|
15
|
-
where: (clause: WhereClause<
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
fetchPageOrThrow: <L extends ObjectOrInterfacePropertyKeysFrom2<Q>>(args?: FetchPageOrThrowArgs<Q, L>) => Promise<PageResult<OsdkObjectOrInterfaceFrom<Q, L>>>;
|
|
13
|
+
aggregateOrThrow: <const AO extends AggregateOpts<Q, any>>(req: AO) => Promise<AggregationsResults<Q, AO>>;
|
|
14
|
+
where: (clause: WhereClause<Q>) => ObjectSet<Q>;
|
|
15
|
+
union: (...objectSets: ReadonlyArray<ObjectSet<Q>>) => ObjectSet<Q>;
|
|
16
|
+
intersect: (...objectSets: ReadonlyArray<ObjectSet<Q>>) => ObjectSet<Q>;
|
|
17
|
+
subtract: (...objectSets: ReadonlyArray<ObjectSet<Q>>) => ObjectSet<Q>;
|
|
18
|
+
pivotTo: <T extends keyof Q["links"]>(type: T & string) => ObjectSet<NonNullable<Q["links"][T]["__Mark"]>>;
|
|
19
|
+
subscribe: (listener: ObjectSetListener<Q>) => () => void;
|
|
18
20
|
}
|
|
19
|
-
export type ObjectSetFactory<O extends OntologyDefinition<any>> = <K extends ObjectOrInterfaceKeysFrom<O>>(type: K & string) => ObjectSet<O, K
|
|
21
|
+
export type ObjectSetFactory<O extends OntologyDefinition<any>> = <K extends ObjectOrInterfaceKeysFrom<O>>(type: K & string) => ObjectSet<ObjectOrInterfaceDefinitionFrom<O, K>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
export
|
|
1
|
+
import type { InterfaceDefinition, ObjectTypeDefinition } from "@osdk/api";
|
|
2
|
+
import type { OsdkObjectOrInterfaceFrom } from "../OsdkObjectFrom.js";
|
|
3
|
+
export interface ObjectSetListener<O extends ObjectTypeDefinition<any> | InterfaceDefinition<any, any>> {
|
|
4
4
|
/**
|
|
5
5
|
* Specific objects have changed and can be immediately updated
|
|
6
6
|
*/
|
|
7
|
-
onChange
|
|
7
|
+
onChange?: (objects: Array<OsdkObjectOrInterfaceFrom<O>>) => void;
|
|
8
8
|
/**
|
|
9
9
|
* The ObjectSet has become outdated and should be re-fetched in its entirety.
|
|
10
10
|
* This is also sent when the subscription is first initialized.
|
|
11
11
|
*/
|
|
12
|
-
onOutOfDate
|
|
12
|
+
onOutOfDate?: () => void;
|
|
13
13
|
/**
|
|
14
14
|
* There was a fatal error with the subscription process
|
|
15
15
|
*/
|
|
16
|
-
onError
|
|
17
|
-
}
|
|
16
|
+
onError?: (error: unknown) => void;
|
|
17
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ObjectOrInterfaceDefinition, OntologyDefinition } from "@osdk/api";
|
|
2
2
|
import type { ObjectSet } from "@osdk/gateway/types";
|
|
3
3
|
import { type ClientContext } from "@osdk/shared.net";
|
|
4
4
|
import type { ObjectSetListener } from "./ObjectSetListener.js";
|
|
@@ -6,7 +6,7 @@ export declare class ObjectSetListenerWebsocket<O extends OntologyDefinition<any
|
|
|
6
6
|
#private;
|
|
7
7
|
static getInstance<O extends OntologyDefinition<any, any, any>>(client: ClientContext<O>): ObjectSetListenerWebsocket<O>;
|
|
8
8
|
private constructor();
|
|
9
|
-
subscribe<
|
|
9
|
+
subscribe<Q extends ObjectOrInterfaceDefinition>(objectSet: ObjectSet, listener: ObjectSetListener<Q>): () => void;
|
|
10
10
|
}
|
|
11
11
|
export type ObjectPropertyMapping = {
|
|
12
12
|
apiName: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ObjectOrInterfaceDefinition } from "@osdk/api";
|
|
2
2
|
import type { ObjectSet as WireObjectSet } from "@osdk/gateway/types";
|
|
3
3
|
import type { ClientContext } from "@osdk/shared.net";
|
|
4
4
|
import type { ObjectSet } from "./ObjectSet.js";
|
|
5
|
-
export declare function createObjectSet<
|
|
5
|
+
export declare function createObjectSet<Q extends ObjectOrInterfaceDefinition>(objectType: Q, clientCtx: ClientContext<any>, objectSet?: WireObjectSet): ObjectSet<Q>;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { BBox, Point, Polygon } from "geojson";
|
|
2
2
|
import type { ObjectOrInterfaceDefinition, ObjectTypePropertyDefinition } from "@osdk/api";
|
|
3
|
-
export type PossibleWhereClauseFilters = "gt" | "eq" | "ne" | "isNull" | "contains" | "gte" | "lt" | "lte" | "$within";
|
|
3
|
+
export type PossibleWhereClauseFilters = "$gt" | "$eq" | "$ne" | "$isNull" | "$contains" | "$gte" | "$lt" | "$lte" | "$within" | "$intersects";
|
|
4
4
|
type MakeFilter<K extends PossibleWhereClauseFilters, V> = K extends string ? {
|
|
5
5
|
[k in K]: V;
|
|
6
6
|
} : never;
|
|
7
|
-
type BaseFilter<T> = T | MakeFilter<"eq" | "ne" | "contains", T> | MakeFilter<"isNull", boolean>;
|
|
7
|
+
type BaseFilter<T> = T | MakeFilter<"$eq" | "$ne" | "$contains", T> | MakeFilter<"$isNull", boolean>;
|
|
8
8
|
type StringFilter = BaseFilter<string>;
|
|
9
|
-
type NumberFilter = BaseFilter<number> | MakeFilter<"gt" | "gte" | "lt" | "lte", number>;
|
|
9
|
+
type NumberFilter = BaseFilter<number> | MakeFilter<"$gt" | "$gte" | "$lt" | "$lte", number>;
|
|
10
10
|
export declare const DistanceUnitMapping: {
|
|
11
11
|
centimeter: "CENTIMETERS";
|
|
12
12
|
centimeters: "CENTIMETERS";
|
|
@@ -39,8 +39,15 @@ export type GeoFilter_Within = {
|
|
|
39
39
|
polygon: Polygon["coordinates"];
|
|
40
40
|
} | Polygon;
|
|
41
41
|
};
|
|
42
|
-
export type
|
|
43
|
-
|
|
42
|
+
export type GeoFilter_Intersects = {
|
|
43
|
+
"$intersects": {
|
|
44
|
+
bbox: BBox;
|
|
45
|
+
} | BBox | {
|
|
46
|
+
polygon: Polygon["coordinates"];
|
|
47
|
+
} | Polygon;
|
|
48
|
+
};
|
|
49
|
+
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;
|
|
44
51
|
export interface AndWhereClause<T extends ObjectOrInterfaceDefinition<any, any>> {
|
|
45
52
|
$and: WhereClause<T>[];
|
|
46
53
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export type AggregatableKeys<
|
|
3
|
-
[P in
|
|
1
|
+
import type { ObjectOrInterfaceDefinition } from "@osdk/api";
|
|
2
|
+
export type AggregatableKeys<Q extends ObjectOrInterfaceDefinition<any, any>> = keyof {
|
|
3
|
+
[P in keyof Q["properties"]]: any;
|
|
4
4
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ObjectOrInterfaceDefinition } from "@osdk/api";
|
|
2
2
|
import type { AggregationClause, GroupByClause, WhereClause } from "../../query/index.js";
|
|
3
|
-
export type AggregateOpts<
|
|
3
|
+
export type AggregateOpts<Q extends ObjectOrInterfaceDefinition<any, any>, AC extends AggregationClause<Q>> = {
|
|
4
4
|
select: AC;
|
|
5
|
-
where?: WhereClause<
|
|
6
|
-
groupBy?: GroupByClause<
|
|
5
|
+
where?: WhereClause<Q>;
|
|
6
|
+
groupBy?: GroupByClause<Q>;
|
|
7
7
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ObjectOrInterfaceDefinition } from "@osdk/api";
|
|
2
2
|
import type { OsdkObjectPropertyType } from "../../Definitions.js";
|
|
3
3
|
import type { AggregationResultsWithoutGroups } from "./AggregationResultsWithoutGroups.js";
|
|
4
4
|
import type { AggregationClause } from "./AggregationsClause.js";
|
|
5
5
|
import type { GroupByClause } from "./GroupByClause.js";
|
|
6
|
-
export type AggregationResultsWithGroups<
|
|
6
|
+
export type AggregationResultsWithGroups<Q extends ObjectOrInterfaceDefinition<any, any>, A extends AggregationClause<Q>, G extends GroupByClause<Q> | undefined> = {
|
|
7
7
|
group: {
|
|
8
|
-
[P in keyof G &
|
|
8
|
+
[P in keyof G & keyof Q["properties"]]: OsdkObjectPropertyType<Q["properties"][P]>;
|
|
9
9
|
};
|
|
10
|
-
values: AggregationResultsWithoutGroups<
|
|
10
|
+
values: AggregationResultsWithoutGroups<Q, A>;
|
|
11
11
|
}[];
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ObjectOrInterfaceDefinition } from "@osdk/api";
|
|
2
2
|
import type { OsdkObjectPropertyType } from "../../Definitions.js";
|
|
3
3
|
import type { StringArrayToUnion } from "../../util/StringArrayToUnion.js";
|
|
4
4
|
import type { AggregationClause } from "./AggregationsClause.js";
|
|
5
|
-
type SubselectKeys<AC extends AggregationClause<any
|
|
6
|
-
export type AggregationResultsWithoutGroups<
|
|
7
|
-
[P in
|
|
8
|
-
[Z in StringArrayToUnion<AC[P]>]: Z extends "approximateDistinct" ? number : OsdkObjectPropertyType<
|
|
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<any>> = {
|
|
7
|
+
[P in keyof Q["properties"] as SubselectKeys<AC, P>]: AC[P] extends readonly string[] | string ? {
|
|
8
|
+
[Z in StringArrayToUnion<AC[P]>]: Z extends "approximateDistinct" ? number : OsdkObjectPropertyType<Q["properties"][P]>;
|
|
9
9
|
} : never;
|
|
10
10
|
};
|
|
11
11
|
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ObjectOrInterfaceDefinition } from "@osdk/api";
|
|
2
2
|
import type { AggregatableKeys } from "./AggregatableKeys.js";
|
|
3
|
-
type StringAggregateOption = "approximateDistinct";
|
|
4
|
-
type NumericAggregateOption = "min" | "max" | "sum" | "avg" | "approximateDistinct";
|
|
5
|
-
export type AggregationClause<
|
|
6
|
-
[P in AggregatableKeys<
|
|
3
|
+
type StringAggregateOption = "approximateDistinct" | "count";
|
|
4
|
+
type NumericAggregateOption = "count" | "min" | "max" | "sum" | "avg" | "approximateDistinct";
|
|
5
|
+
export type AggregationClause<Q extends ObjectOrInterfaceDefinition<any, any>> = {
|
|
6
|
+
[P in AggregatableKeys<Q>]?: Q["properties"][P]["type"] extends "string" ? StringAggregateOption | StringAggregateOption[] : Q["properties"][P]["type"] extends "double" | "integer" | "float" | "decimal" | "byte" | "long" | "short" ? NumericAggregateOption | NumericAggregateOption[] : never;
|
|
7
7
|
};
|
|
8
8
|
export {};
|
|
@@ -4,6 +4,7 @@ export type huh = AggregatableKeys<{
|
|
|
4
4
|
metadata: any;
|
|
5
5
|
objects: {
|
|
6
6
|
Todo: {
|
|
7
|
+
type: "object";
|
|
7
8
|
apiName: "Todo";
|
|
8
9
|
primaryKeyType: "double";
|
|
9
10
|
links: {};
|
|
@@ -19,11 +20,12 @@ export type huh = AggregatableKeys<{
|
|
|
19
20
|
};
|
|
20
21
|
actions: {};
|
|
21
22
|
queries: {};
|
|
22
|
-
}
|
|
23
|
+
}["objects"]["Todo"]>;
|
|
23
24
|
export type Q = AggregationClause<{
|
|
24
25
|
metadata: any;
|
|
25
26
|
objects: {
|
|
26
27
|
Todo: {
|
|
28
|
+
type: "object";
|
|
27
29
|
apiName: "Todo";
|
|
28
30
|
primaryKeyType: "double";
|
|
29
31
|
links: {};
|
|
@@ -39,4 +41,4 @@ export type Q = AggregationClause<{
|
|
|
39
41
|
};
|
|
40
42
|
actions: {};
|
|
41
43
|
queries: {};
|
|
42
|
-
}
|
|
44
|
+
}["objects"]["Todo"]>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ObjectOrInterfaceDefinition } from "@osdk/api";
|
|
2
2
|
import type { AggregateOpts } from "./AggregateOpts.js";
|
|
3
3
|
import type { AggregationResultsWithGroups } from "./AggregationResultsWithGroups.js";
|
|
4
4
|
import type { AggregationResultsWithoutGroups } from "./AggregationResultsWithoutGroups.js";
|
|
5
|
-
export type AggregationsResults<
|
|
5
|
+
export type AggregationsResults<Q extends ObjectOrInterfaceDefinition, AO extends AggregateOpts<Q, any>> = unknown extends AO["groupBy"] ? AggregationResultsWithoutGroups<Q, AO["select"]> : Exclude<AO["groupBy"], undefined> extends never ? AggregationResultsWithoutGroups<Q, AO["select"]> : AggregationResultsWithGroups<Q, AO["select"], AO["groupBy"]>;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ObjectOrInterfaceDefinition } from "@osdk/api";
|
|
2
2
|
import type { AggregatableKeys } from "./AggregatableKeys.js";
|
|
3
3
|
import type { GroupByMapper } from "./GroupByMapper.js";
|
|
4
|
-
export type GroupByClause<
|
|
5
|
-
[P in AggregatableKeys<
|
|
4
|
+
export type GroupByClause<Q extends ObjectOrInterfaceDefinition<any, any>> = {
|
|
5
|
+
[P in AggregatableKeys<Q>]?: GroupByEntry<Q, P>;
|
|
6
6
|
};
|
|
7
7
|
export type StringGroupByValue = "exact" | {
|
|
8
8
|
exactWithLimit: number;
|
|
9
9
|
};
|
|
10
|
-
type GroupByEntry<
|
|
10
|
+
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
11
|
export type AllGroupByValues = GroupByMapper[keyof GroupByMapper];
|
|
12
12
|
export {};
|
|
@@ -3,6 +3,7 @@ export type F = GroupByClause<{
|
|
|
3
3
|
metadata: any;
|
|
4
4
|
objects: {
|
|
5
5
|
Todo: {
|
|
6
|
+
type: "object";
|
|
6
7
|
apiName: "Todo";
|
|
7
8
|
primaryKeyType: "double";
|
|
8
9
|
links: {};
|
|
@@ -18,4 +19,4 @@ export type F = GroupByClause<{
|
|
|
18
19
|
};
|
|
19
20
|
actions: {};
|
|
20
21
|
queries: {};
|
|
21
|
-
}
|
|
22
|
+
}["objects"]["Todo"]>;
|