@osdk/client 0.8.0 → 0.10.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.
Files changed (79) hide show
  1. package/build/js/{chunk-V77HHGVZ.cjs → chunk-MVO52VHK.cjs} +82 -28
  2. package/build/js/chunk-MVO52VHK.cjs.map +1 -0
  3. package/build/js/{chunk-TJNTUGSE.mjs → chunk-XI2O777X.mjs} +83 -29
  4. package/build/js/chunk-XI2O777X.mjs.map +1 -0
  5. package/build/js/index.cjs +33 -15
  6. package/build/js/index.cjs.map +1 -1
  7. package/build/js/index.mjs +29 -11
  8. package/build/js/index.mjs.map +1 -1
  9. package/build/js/public/objects.cjs +3 -3
  10. package/build/js/public/objects.mjs +1 -1
  11. package/build/types/Client.d.ts +3 -3
  12. package/build/types/ObjectSetCreator.d.ts +3 -3
  13. package/build/types/OsdkObject.d.ts +1 -1
  14. package/build/types/OsdkObjectFrom.d.ts +18 -23
  15. package/build/types/actions/Actions.d.ts +17 -13
  16. package/build/types/actions/applyAction.d.ts +3 -10
  17. package/build/types/actions/createActionInvoker.d.ts +2 -1
  18. package/build/types/definitions/LinkDefinitions.d.ts +12 -13
  19. package/build/types/generatedNoCheck/Ontology.d.ts +13 -477
  20. package/build/types/generatedNoCheck/ontology/actions/actionTakesAttachment.d.ts +22 -10
  21. package/build/types/generatedNoCheck/ontology/actions/actionTakesObjectSet.d.ts +23 -13
  22. package/build/types/generatedNoCheck/ontology/actions/createOffice.d.ts +40 -28
  23. package/build/types/generatedNoCheck/ontology/actions/createOfficeAndEmployee.d.ts +46 -34
  24. package/build/types/generatedNoCheck/ontology/actions/index.d.ts +7 -7
  25. package/build/types/generatedNoCheck/ontology/actions/moveOffice.d.ts +40 -28
  26. package/build/types/generatedNoCheck/ontology/actions/promoteEmployee.d.ts +32 -20
  27. package/build/types/generatedNoCheck/ontology/actions/promoteEmployeeObject.d.ts +33 -23
  28. package/build/types/generatedNoCheck/ontology/objects/Employee.d.ts +20 -25
  29. package/build/types/generatedNoCheck/ontology/objects/ObjectWithTimestampPrimaryKey.d.ts +10 -7
  30. package/build/types/generatedNoCheck/ontology/objects/Office.d.ts +16 -15
  31. package/build/types/generatedNoCheck/ontology/objects/equipment.d.ts +10 -7
  32. package/build/types/generatedNoCheck/ontology/objects/objectTypeWithAllPropertyTypes.d.ts +38 -35
  33. package/build/types/index.d.ts +3 -1
  34. package/build/types/internal/conversions/legacyToModernSingleAggregationResult.d.ts +1 -1
  35. package/build/types/internal/conversions/modernToLegacyAggregationClause.d.ts +1 -2
  36. package/build/types/internal/conversions/modernToLegacyGroupByClause.d.ts +1 -2
  37. package/build/types/object/aggregateOrThrow.d.ts +3 -2
  38. package/build/types/object/fetchPageOrThrow.d.ts +10 -4
  39. package/build/types/object/getLinkedObjectByPkOrThrow.d.ts +3 -2
  40. package/build/types/object/getLinkedObjectOrThrow.d.ts +5 -2
  41. package/build/types/object/pageLinkedObjectsOrThrow.d.ts +4 -6
  42. package/build/types/objectSet/LinkTypesFrom.d.ts +2 -2
  43. package/build/types/objectSet/ObjectSet.d.ts +13 -11
  44. package/build/types/objectSet/ObjectSet.test.d.ts +1 -0
  45. package/build/types/objectSet/ObjectSetListener.d.ts +7 -7
  46. package/build/types/objectSet/ObjectSetListenerWebsocket.d.ts +2 -2
  47. package/build/types/objectSet/createObjectSet.d.ts +2 -2
  48. package/build/types/query/WhereClause.d.ts +12 -5
  49. package/build/types/query/aggregations/AggregatableKeys.d.ts +3 -3
  50. package/build/types/query/aggregations/AggregateOpts.d.ts +4 -4
  51. package/build/types/query/aggregations/AggregationResultsWithGroups.d.ts +5 -6
  52. package/build/types/query/aggregations/AggregationResultsWithoutGroups.d.ts +5 -5
  53. package/build/types/query/aggregations/AggregationsClause.d.ts +5 -5
  54. package/build/types/query/aggregations/AggregationsClause.test.d.ts +4 -2
  55. package/build/types/query/aggregations/AggregationsResults.d.ts +2 -2
  56. package/build/types/query/aggregations/GroupByClause.d.ts +4 -4
  57. package/build/types/query/aggregations/GroupByClause.test.d.ts +2 -1
  58. package/build/types/util/test/mockOntology.d.ts +50 -48
  59. package/changelog/0.10.0/pr-74.v2.yml +5 -0
  60. package/changelog/0.10.0/pr-78.v2.yml +5 -0
  61. package/changelog/0.10.0/pr-79.v2.yml +5 -0
  62. package/changelog/0.6.0/pr-9.v2.yml +5 -0
  63. package/changelog/0.7.0/pr-20.v2.yml +5 -0
  64. package/changelog/0.7.0/pr-24.v2.yml +5 -0
  65. package/changelog/0.7.0/pr-28.v2.yml +5 -0
  66. package/changelog/0.8.0/pr-30.v2.yml +5 -0
  67. package/changelog/0.9.0/pr-43.v2.yml +5 -0
  68. package/changelog/0.9.0/pr-45.v2.yml +5 -0
  69. package/changelog/0.9.0/pr-48.v2.yml +5 -0
  70. package/changelog/0.9.0/pr-59.v2.yml +5 -0
  71. package/changelog/0.9.0/pr-65.v2.yml +5 -0
  72. package/changelog/0.9.0/pr-72.v2.yml +5 -0
  73. package/changelog/0.9.0/pr-75.v2.yml +5 -0
  74. package/changelog/@unreleased/.gitkeep +0 -0
  75. package/package.json +11 -6
  76. package/build/js/chunk-TJNTUGSE.mjs.map +0 -1
  77. package/build/js/chunk-V77HHGVZ.cjs.map +0 -1
  78. package/build/types/object/followLinkOrThrow.d.ts +0 -5
  79. /package/{CHANGELOG.md → CHANGELOG_OLD.md} +0 -0
@@ -1,158 +1,161 @@
1
- export declare const objectTypeWithAllPropertyTypes: {
2
- apiName: "objectTypeWithAllPropertyTypes";
3
- description: string;
4
- primaryKeyType: "integer";
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: "integer";
11
+ type: 'integer';
10
12
  nullable: false;
11
13
  };
12
14
  string: {
13
15
  multiplicity: false;
14
- type: "string";
16
+ type: 'string';
15
17
  nullable: true;
16
18
  };
17
19
  boolean: {
18
20
  multiplicity: false;
19
- type: "boolean";
21
+ type: 'boolean';
20
22
  nullable: true;
21
23
  };
22
24
  date: {
23
25
  multiplicity: false;
24
- type: "datetime";
26
+ type: 'datetime';
25
27
  nullable: true;
26
28
  };
27
29
  dateTime: {
28
30
  multiplicity: false;
29
- type: "timestamp";
31
+ type: 'timestamp';
30
32
  nullable: true;
31
33
  };
32
34
  decimal: {
33
35
  multiplicity: false;
34
- type: "decimal";
36
+ type: 'decimal';
35
37
  nullable: true;
36
38
  };
37
39
  integer: {
38
40
  multiplicity: false;
39
- type: "integer";
41
+ type: 'integer';
40
42
  nullable: true;
41
43
  };
42
44
  long: {
43
45
  multiplicity: false;
44
- type: "long";
46
+ type: 'long';
45
47
  nullable: true;
46
48
  };
47
49
  short: {
48
50
  multiplicity: false;
49
- type: "short";
51
+ type: 'short';
50
52
  nullable: true;
51
53
  };
52
54
  float: {
53
55
  multiplicity: false;
54
- type: "float";
56
+ type: 'float';
55
57
  nullable: true;
56
58
  };
57
59
  double: {
58
60
  multiplicity: false;
59
- type: "double";
61
+ type: 'double';
60
62
  nullable: true;
61
63
  };
62
64
  byte: {
63
65
  multiplicity: false;
64
- type: "byte";
66
+ type: 'byte';
65
67
  nullable: true;
66
68
  };
67
69
  attachment: {
68
70
  multiplicity: false;
69
- type: "attachment";
71
+ type: 'attachment';
70
72
  nullable: true;
71
73
  };
72
74
  attachment2: {
73
75
  multiplicity: false;
74
- type: "attachment";
76
+ type: 'attachment';
75
77
  nullable: true;
76
78
  };
77
79
  geoPoint: {
78
80
  multiplicity: false;
79
- type: "geopoint";
81
+ type: 'geopoint';
80
82
  nullable: true;
81
83
  };
82
84
  geoShape: {
83
85
  multiplicity: false;
84
- type: "geoshape";
86
+ type: 'geoshape';
85
87
  nullable: true;
86
88
  };
87
89
  stringArray: {
88
90
  multiplicity: true;
89
- type: "string";
91
+ type: 'string';
90
92
  nullable: true;
91
93
  };
92
94
  booleanArray: {
93
95
  multiplicity: true;
94
- type: "boolean";
96
+ type: 'boolean';
95
97
  nullable: true;
96
98
  };
97
99
  dateArray: {
98
100
  multiplicity: true;
99
- type: "datetime";
101
+ type: 'datetime';
100
102
  nullable: true;
101
103
  };
102
104
  dateTimeArray: {
103
105
  multiplicity: true;
104
- type: "timestamp";
106
+ type: 'timestamp';
105
107
  nullable: true;
106
108
  };
107
109
  decimalArray: {
108
110
  multiplicity: true;
109
- type: "decimal";
111
+ type: 'decimal';
110
112
  nullable: true;
111
113
  };
112
114
  integerArray: {
113
115
  multiplicity: true;
114
- type: "integer";
116
+ type: 'integer';
115
117
  nullable: true;
116
118
  };
117
119
  longArray: {
118
120
  multiplicity: true;
119
- type: "long";
121
+ type: 'long';
120
122
  nullable: true;
121
123
  };
122
124
  shortArray: {
123
125
  multiplicity: true;
124
- type: "short";
126
+ type: 'short';
125
127
  nullable: true;
126
128
  };
127
129
  floatArray: {
128
130
  multiplicity: true;
129
- type: "float";
131
+ type: 'float';
130
132
  nullable: true;
131
133
  };
132
134
  doubleArray: {
133
135
  multiplicity: true;
134
- type: "double";
136
+ type: 'double';
135
137
  nullable: true;
136
138
  };
137
139
  byteArray: {
138
140
  multiplicity: true;
139
- type: "byte";
141
+ type: 'byte';
140
142
  nullable: true;
141
143
  };
142
144
  attachmentArray: {
143
145
  multiplicity: true;
144
- type: "attachment";
146
+ type: 'attachment';
145
147
  nullable: true;
146
148
  };
147
149
  geoPointArray: {
148
150
  multiplicity: true;
149
- type: "geopoint";
151
+ type: 'geopoint';
150
152
  nullable: true;
151
153
  };
152
154
  geoShapeArray: {
153
155
  multiplicity: true;
154
- type: "geoshape";
156
+ type: 'geoshape';
155
157
  nullable: true;
156
158
  };
157
159
  };
158
- };
160
+ }
161
+ export declare const objectTypeWithAllPropertyTypes: objectTypeWithAllPropertyTypesDef;
@@ -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, any>>(entry: ArrayElement<AggregateObjectsResponseV2["data"]>): AggregationResultsWithoutGroups<any, any, AC>;
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<T extends OntologyDefinition<any>, K extends ObjectTypeKeysFrom<T>, AC extends AggregationClause<T, K>>(select: AC): Aggregation[];
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<O extends OntologyDefinition<any>, K extends ObjectTypeKeysFrom<O>>(groupByClause: GroupByClause<O, K> | undefined): AggregationGroupByV2[];
3
+ export declare function modernToLegacyGroupByClause(groupByClause: GroupByClause<any> | undefined): AggregationGroupByV2[];
@@ -1,5 +1,6 @@
1
- import type { ObjectTypeKeysFrom, OntologyDefinition } from "@osdk/api";
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<T extends OntologyDefinition<any>, K extends ObjectTypeKeysFrom<T>, const AO extends AggregateOpts<T, K, any>>(clientCtx: ClientContext<T>, objectType: K & string, req: AO): Promise<AggregationsResults<T, K, AO>>;
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,19 @@
1
- import type { ObjectOrInterfaceKeysFrom, ObjectOrInterfacePropertyKeysFrom, OntologyDefinition } from "@osdk/api";
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 OntologyDefinition<any>, K extends ObjectOrInterfaceKeysFrom<O>, L = ObjectOrInterfacePropertyKeysFrom<O, K>> {
6
+ export interface SelectArg<Q extends ObjectOrInterfaceDefinition<any, any>, L = ObjectOrInterfacePropertyKeysFrom2<Q>, R extends boolean = false> {
7
7
  select?: readonly L[];
8
+ includeRid?: R;
8
9
  }
9
- export interface FetchPageOrThrowArgs<O extends OntologyDefinition<any>, K extends ObjectOrInterfaceKeysFrom<O>, L = ObjectOrInterfacePropertyKeysFrom<O, K>> extends SelectArg<O, K, L> {
10
+ export interface OrderByArg<Q extends ObjectOrInterfaceDefinition<any, any>, L extends ObjectOrInterfacePropertyKeysFrom2<Q> = ObjectOrInterfacePropertyKeysFrom2<Q>> {
11
+ orderBy?: {
12
+ [K in L]?: "asc" | "desc";
13
+ };
14
+ }
15
+ export interface FetchPageOrThrowArgs<Q extends ObjectOrInterfaceDefinition<any, any>, L = ObjectOrInterfacePropertyKeysFrom2<Q>, R extends boolean = false> extends SelectArg<Q, L, R>, OrderByArg<Q, ObjectOrInterfacePropertyKeysFrom2<Q>> {
10
16
  nextPageToken?: string;
11
17
  pageSize?: number;
12
18
  }
13
- export declare function fetchPageOrThrow<O extends OntologyDefinition<any>, T extends ObjectOrInterfaceKeysFrom<O>, const A extends FetchPageOrThrowArgs<O, T>>(client: ClientContext<O>, objectType: T & string, args: A, objectSet?: ObjectSet): Promise<PageResult<OsdkObjectFrom<T, O, A["select"] extends readonly string[] ? A["select"][number] : ObjectOrInterfacePropertyKeysFrom<O, T>>>>;
19
+ export declare function fetchPageOrThrow<Q extends ObjectOrInterfaceDefinition, const A extends FetchPageOrThrowArgs<Q, any, any>>(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>, A["includeRid"] extends true ? true : false>>>;
@@ -1,4 +1,5 @@
1
- import type { ObjectOrInterfacePropertyKeysFrom, ObjectTypeKeysFrom, ObjectTypeLinkKeysFrom, ObjectTypeLinkTargetTypeFrom, OntologyDefinition } from "@osdk/api";
1
+ import type { 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, O>>;
4
+ import type { SelectArg } from "./fetchPageOrThrow.js";
5
+ export declare function getLinkedObjectByPkOrThrow<O extends OntologyDefinition<any>, T extends ObjectTypeKeysFrom<O> & string, L extends ObjectTypeLinkKeysFrom<O, T> & string, S extends SelectArg<ObjectTypeLinkTargetTypeFrom<O, T, L>> = SelectArg<ObjectTypeLinkTargetTypeFrom<O, T, L>>>(client: ClientContext<O>, sourceApiName: T, primaryKey: any, linkTypeApiName: L, linkedObjectPrimaryKey: any, options?: S): Promise<OsdkObjectFrom<O["objects"][T]>>;
@@ -1,4 +1,7 @@
1
- import type { ObjectTypeKeysFrom, ObjectTypeLinkKeysFrom, OntologyDefinition } from "@osdk/api";
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 ObjectTypeLinkKeysFrom<O, T> & string, S extends SelectArg<O, T>["select"]>(client: ClientContext<O>, sourceApiName: T, primaryKey: any, linkTypeApiName: L, select?: S): Promise<import("../OsdkObjectFrom.js").OsdkObjectFrom<T, O, S extends readonly string[] ? S[number] : import("@osdk/api").ObjectOrInterfacePropertyKeysFrom<O, T>>>;
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 { ObjectOrInterfacePropertyKeysFrom, ObjectTypeKeysFrom, ObjectTypeLinkKeysFrom, ObjectTypeLinkTargetTypeFrom, OntologyDefinition } from "@osdk/api";
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
- export declare function pageLinkedObjectsOrThrow<O extends OntologyDefinition<any>, T extends ObjectTypeKeysFrom<O>, L extends ObjectTypeLinkKeysFrom<O, T>, S = ReadonlyArray<ObjectOrInterfacePropertyKeysFrom<O, ObjectTypeLinkTargetTypeFrom<O, T, L>>>>(client: ClientContext<O>, sourceApiName: T & string, primaryKey: any, linkTypeApiName: string, options?: {
6
- nextPageToken?: string;
7
- pageSize?: number;
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 { ObjectTypeKeysFrom, OntologyDefinition } from "@osdk/api";
2
- export type LinkTypesFrom<O extends OntologyDefinition<string>, K extends ObjectTypeKeysFrom<O>> = keyof O["objects"][K]["links"];
1
+ import type { ObjectOrInterfaceDefinition } from "@osdk/api";
2
+ export type LinkTypesFrom<Q extends ObjectOrInterfaceDefinition> = keyof Q["links"];
@@ -1,19 +1,21 @@
1
- import type { InterfaceKeysFrom, ObjectOrInterfaceDefinitionFrom, ObjectOrInterfaceKeysFrom, ObjectOrInterfacePropertyKeysFrom, OntologyDefinition } from "@osdk/api";
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 { OsdkInterfaceFrom, OsdkObjectFrom } from "../OsdkObjectFrom.js";
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<O extends OntologyDefinition<string>, K extends ObjectOrInterfaceKeysFrom<O>> = BaseObjectSet<O, K>;
11
- export interface BaseObjectSet<O extends OntologyDefinition<any>, K extends ObjectOrInterfaceKeysFrom<O>> {
9
+ export type ObjectSet<Q extends ObjectOrInterfaceDefinition> = BaseObjectSet<Q>;
10
+ export interface BaseObjectSet<Q extends ObjectOrInterfaceDefinition> {
12
11
  definition: WireObjectSet;
13
- fetchPageOrThrow: <L extends ObjectOrInterfacePropertyKeysFrom<O, K>>(args?: FetchPageOrThrowArgs<O, K, L>) => Promise<PageResult<K extends InterfaceKeysFrom<O> ? OsdkInterfaceFrom<K, O, L> : OsdkObjectFrom<K, O, L>>>;
14
- aggregateOrThrow: <const AO extends AggregateOpts<O, K, any>>(req: AO) => Promise<AggregationsResults<O, K, AO>>;
15
- where: (clause: WhereClause<ObjectOrInterfaceDefinitionFrom<O, K>>) => ObjectSet<O, K>;
16
- pivotTo: <T extends LinkTypesFrom<O, K>>(type: T & string) => ObjectSet<O, O["objects"][K]["links"][T]["targetType"]>;
17
- subscribe: (listener: ObjectSetListener<O, K>) => () => void;
12
+ fetchPageOrThrow: <L extends ObjectOrInterfacePropertyKeysFrom2<Q>, R extends boolean>(args?: FetchPageOrThrowArgs<Q, L, R>) => Promise<PageResult<OsdkObjectOrInterfaceFrom<Q, L, R>>>;
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 { ObjectTypeKeysFrom, OntologyDefinition } from "@osdk/api";
2
- import type { OsdkObjectFrom } from "../OsdkObjectFrom.js";
3
- export type ObjectSetListener<O extends OntologyDefinition<any>, K extends ObjectTypeKeysFrom<O>> = Partial<{
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: (objects: Array<OsdkObjectFrom<K, O>>) => void;
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: () => void;
12
+ onOutOfDate?: () => void;
13
13
  /**
14
14
  * There was a fatal error with the subscription process
15
15
  */
16
- onError: (error: unknown) => void;
17
- }>;
16
+ onError?: (error: unknown) => void;
17
+ }
@@ -1,4 +1,4 @@
1
- import type { ObjectOrInterfaceKeysFrom, OntologyDefinition } from "@osdk/api";
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<K extends ObjectOrInterfaceKeysFrom<O>>(objectSet: ObjectSet, listener: ObjectSetListener<O, K>): () => void;
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 { ObjectOrInterfaceKeysFrom, OntologyDefinition } from "@osdk/api";
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<O extends OntologyDefinition<any>, K extends ObjectOrInterfaceKeysFrom<O>>(objectType: K & string, clientCtx: ClientContext<O>, objectSet?: WireObjectSet): ObjectSet<O, K>;
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 GeoFilter = GeoFilter_Within;
43
- type FilterFor<PD extends ObjectTypePropertyDefinition> = PD["type"] extends "string" ? StringFilter : PD["type"] extends "geopoint" ? GeoFilter : NumberFilter;
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 { ObjectTypeKeysFrom, ObjectTypePropertyKeysFrom, OntologyDefinition } from "@osdk/api";
2
- export type AggregatableKeys<O extends OntologyDefinition<any>, K extends ObjectTypeKeysFrom<O>> = keyof {
3
- [P in ObjectTypePropertyKeysFrom<O, K>]: any;
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 { ObjectTypeDefinitionFrom, ObjectTypeKeysFrom, OntologyDefinition } from "@osdk/api";
1
+ import type { ObjectOrInterfaceDefinition } from "@osdk/api";
2
2
  import type { AggregationClause, GroupByClause, WhereClause } from "../../query/index.js";
3
- export type AggregateOpts<T extends OntologyDefinition<any>, K extends ObjectTypeKeysFrom<T>, AC extends AggregationClause<T, K>> = {
3
+ export type AggregateOpts<Q extends ObjectOrInterfaceDefinition<any, any>, AC extends AggregationClause<Q>> = {
4
4
  select: AC;
5
- where?: WhereClause<ObjectTypeDefinitionFrom<T, K>>;
6
- groupBy?: GroupByClause<T, K>;
5
+ where?: WhereClause<Q>;
6
+ groupBy?: GroupByClause<Q>;
7
7
  };
@@ -1,11 +1,10 @@
1
- import type { ObjectTypeKeysFrom, ObjectTypePropertyDefinitionFrom, ObjectTypePropertyKeysFrom, OntologyDefinition } from "@osdk/api";
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<O extends OntologyDefinition<any>, K extends ObjectTypeKeysFrom<O>, A extends AggregationClause<O, K>, G extends GroupByClause<O, K> | undefined> = {
7
- group: {
8
- [P in keyof G & ObjectTypePropertyKeysFrom<O, K>]: OsdkObjectPropertyType<ObjectTypePropertyDefinitionFrom<O, K, P>>;
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"]]: OsdkObjectPropertyType<Q["properties"][P]>;
9
9
  };
10
- values: AggregationResultsWithoutGroups<O, K, A>;
11
- }[];
10
+ } & AggregationResultsWithoutGroups<Q, A>)[];
@@ -1,11 +1,11 @@
1
- import type { ObjectTypeKeysFrom, ObjectTypePropertyDefinitionFrom, ObjectTypePropertyKeysFrom, OntologyDefinition } from "@osdk/api";
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, any>, P extends keyof AC> = AC[P] extends readonly string[] | string ? P : never;
6
- export type AggregationResultsWithoutGroups<O extends OntologyDefinition<any>, K extends ObjectTypeKeysFrom<O>, AC extends AggregationClause<O, K>> = {
7
- [P in ObjectTypePropertyKeysFrom<O, K> as SubselectKeys<AC, P>]: AC[P] extends readonly string[] | string ? {
8
- [Z in StringArrayToUnion<AC[P]>]: Z extends "approximateDistinct" ? number : OsdkObjectPropertyType<ObjectTypePropertyDefinitionFrom<O, K, P>>;
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 { ObjectTypeKeysFrom, ObjectTypePropertyDefinitionsFrom, OntologyDefinition } from "@osdk/api";
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<O extends OntologyDefinition<any>, K extends ObjectTypeKeysFrom<O>> = {
6
- [P in AggregatableKeys<O, K>]?: ObjectTypePropertyDefinitionsFrom<O, K>[P]["type"] extends "string" ? StringAggregateOption | StringAggregateOption[] : ObjectTypePropertyDefinitionsFrom<O, K>[P]["type"] extends "double" ? NumericAggregateOption | NumericAggregateOption[] : ObjectTypePropertyDefinitionsFrom<O, K>[P]["type"];
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
- }, "Todo">;
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
- }, "Todo">;
44
+ }["objects"]["Todo"]>;
@@ -1,5 +1,5 @@
1
- import type { ObjectTypeKeysFrom, OntologyDefinition } from "@osdk/api";
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<T extends OntologyDefinition<any>, K extends ObjectTypeKeysFrom<T>, AO extends AggregateOpts<T, K, any>> = unknown extends AO["groupBy"] ? AggregationResultsWithoutGroups<T, K, AO["select"]> : Exclude<AO["groupBy"], undefined> extends never ? AggregationResultsWithoutGroups<T, K, AO["select"]> : AggregationResultsWithGroups<T, K, AO["select"], AO["groupBy"]>;
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 { ObjectTypeKeysFrom, ObjectTypePropertyDefinitionFrom, OntologyDefinition } from "@osdk/api";
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<O extends OntologyDefinition<any>, K extends ObjectTypeKeysFrom<O>> = {
5
- [P in AggregatableKeys<O, K>]?: GroupByEntry<O, K, P>;
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<O extends OntologyDefinition<any>, K extends ObjectTypeKeysFrom<O>, P extends AggregatableKeys<O, K>> = ObjectTypePropertyDefinitionFrom<O, K, P>["type"] extends keyof GroupByMapper ? GroupByMapper[ObjectTypePropertyDefinitionFrom<O, K, P>["type"]] : never;
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
- }, "Todo">;
22
+ }["objects"]["Todo"]>;