@osdk/client 0.2.0 → 0.3.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 (93) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/build/js/{chunk-MT2HE6AQ.mjs → chunk-DVD5PAXO.mjs} +119 -8
  3. package/build/js/chunk-DVD5PAXO.mjs.map +1 -0
  4. package/build/js/{chunk-CCKGGMYW.cjs → chunk-YVZITKIQ.cjs} +117 -6
  5. package/build/js/chunk-YVZITKIQ.cjs.map +1 -0
  6. package/build/js/index.cjs +15 -13
  7. package/build/js/index.cjs.map +1 -1
  8. package/build/js/index.mjs +12 -10
  9. package/build/js/index.mjs.map +1 -1
  10. package/build/js/public/objects.cjs +3 -3
  11. package/build/js/public/objects.mjs +1 -1
  12. package/build/types/Client.d.ts +3 -3
  13. package/build/types/Definitions.d.ts +4 -4
  14. package/build/types/ObjectSetCreator.d.ts +2 -2
  15. package/build/types/OsdkObjectFrom.d.ts +2 -0
  16. package/build/types/definitions/LinkDefinitions.d.ts +19 -0
  17. package/build/types/definitions/LinkDefinitions.test.d.ts +1 -0
  18. package/build/types/generated/object-set-service/api/ObjectSetServiceV2/getLinks.d.ts +1 -1
  19. package/build/types/generated/ontology-metadata/api/GetFeatureConfigurationsResponse.d.ts +1 -0
  20. package/build/types/generated/ontology-metadata/api/OntologyMetadataGothamTypeMappingService/checkTranslationEligibility.d.ts +8 -0
  21. package/build/types/generated/ontology-metadata/api/OntologyMetadataGothamTypeMappingService.d.ts +1 -0
  22. package/build/types/generated/ontology-metadata/api/TypeGroupGetOrganizationsRequest.d.ts +7 -0
  23. package/build/types/generated/ontology-metadata/api/TypeGroupGetOrganizationsResponse.d.ts +9 -0
  24. package/build/types/generated/ontology-metadata/api/TypeGroupOrgsService/getOrganizationsForTypeGroups.d.ts +9 -0
  25. package/build/types/generated/ontology-metadata/api/TypeGroupOrgsService/setOrganizationsForTypeGroups.d.ts +9 -0
  26. package/build/types/generated/ontology-metadata/api/TypeGroupOrgsService.d.ts +2 -0
  27. package/build/types/generated/ontology-metadata/api/TypeGroupSetOrganizationsRequest.d.ts +11 -0
  28. package/build/types/generated/ontology-metadata/api/index.d.ts +4 -0
  29. package/build/types/generated/ontology-metadata/api/search/ActionTypeClause.d.ts +5 -1
  30. package/build/types/generated/ontology-metadata/api/typemapping/CaseSensitiveGothamObjectTypeUri.d.ts +6 -0
  31. package/build/types/generated/ontology-metadata/api/typemapping/CaseSensitiveGothamPropertyTypeUri.d.ts +6 -0
  32. package/build/types/generated/ontology-metadata/api/typemapping/CheckTranslationEligibilityRequest.d.ts +8 -0
  33. package/build/types/generated/ontology-metadata/api/typemapping/CheckTranslationEligibilityResponse.d.ts +7 -0
  34. package/build/types/generated/ontology-metadata/api/typemapping/ClientTranslationEligibilityResult.d.ts +10 -0
  35. package/build/types/generated/ontology-metadata/api/typemapping/GothamDatasourceDelegateId.d.ts +5 -0
  36. package/build/types/generated/ontology-metadata/api/typemapping/IntegrationClientType.d.ts +4 -0
  37. package/build/types/generated/ontology-metadata/api/typemapping/LoadGothamTypeInstallationStatusesResponse.d.ts +4 -4
  38. package/build/types/generated/ontology-metadata/api/typemapping/TranslatableDatasource.d.ts +5 -0
  39. package/build/types/generated/ontology-metadata/api/typemapping/TranslationEligibility.d.ts +11 -0
  40. package/build/types/generated/ontology-metadata/api/typemapping/UntranslatableSecurity.d.ts +7 -0
  41. package/build/types/generated/ontology-metadata/api/typemapping/UntranslatableSecurityFailureType.d.ts +1 -0
  42. package/build/types/generated/ontology-metadata/api/typemapping/index.d.ts +11 -0
  43. package/build/types/generated/ontology-metadata/branch/api/BranchStatus.d.ts +11 -1
  44. package/build/types/generated/ontology-metadata/branch/api/LoadOntologyBranchMarkingsRequest.d.ts +2 -0
  45. package/build/types/generated/ontology-metadata/branch/api/LoadOntologyBranchMarkingsResponse.d.ts +4 -0
  46. package/build/types/generated/ontology-metadata/branch/api/MediaReferencePropertyTypeConstraintError.d.ts +9 -0
  47. package/build/types/generated/ontology-metadata/branch/api/MediaReferencePropertyTypeHasNoDatasourcesError.d.ts +9 -0
  48. package/build/types/generated/ontology-metadata/branch/api/OntologyBranchService/loadOntologyBranchMarkings.d.ts +9 -0
  49. package/build/types/generated/ontology-metadata/branch/api/OntologyBranchService/setOntologyBranchOrganizationMarkings.d.ts +2 -2
  50. package/build/types/generated/ontology-metadata/branch/api/OntologyBranchService.d.ts +1 -0
  51. package/build/types/generated/ontology-metadata/branch/api/ValidationError.d.ts +6 -1
  52. package/build/types/generated/ontology-metadata/branch/api/index.d.ts +4 -0
  53. package/build/types/generatedNoCheck/Ontology.d.ts +483 -0
  54. package/build/types/generatedNoCheck/OntologyMetadata.d.ts +5 -0
  55. package/build/types/generatedNoCheck/index.d.ts +1 -0
  56. package/build/types/generatedNoCheck/ontology/actions/actionTakesObjectSet.d.ts +15 -0
  57. package/build/types/generatedNoCheck/ontology/actions/createOffice.d.ts +35 -0
  58. package/build/types/generatedNoCheck/ontology/actions/createOfficeAndEmployee.d.ts +45 -0
  59. package/build/types/generatedNoCheck/ontology/actions/index.d.ts +6 -0
  60. package/build/types/generatedNoCheck/ontology/actions/moveOffice.d.ts +35 -0
  61. package/build/types/generatedNoCheck/ontology/actions/promoteEmployee.d.ts +27 -0
  62. package/build/types/generatedNoCheck/ontology/actions/promoteEmployeeObject.d.ts +30 -0
  63. package/build/types/generatedNoCheck/ontology/interfaces.d.ts +1 -0
  64. package/build/types/generatedNoCheck/ontology/objects/Employee.d.ts +49 -0
  65. package/build/types/generatedNoCheck/ontology/objects/ObjectWithTimestampPrimaryKey.d.ts +18 -0
  66. package/build/types/generatedNoCheck/ontology/objects/Office.d.ts +35 -0
  67. package/build/types/generatedNoCheck/ontology/objects/equipment.d.ts +18 -0
  68. package/build/types/generatedNoCheck/ontology/objects/objectTypeWithAllPropertyTypes.d.ts +158 -0
  69. package/build/types/generatedNoCheck/ontology/objects.d.ts +5 -0
  70. package/build/types/index.d.ts +1 -1
  71. package/build/types/internal/conversions/legacyToModernSingleAggregationResult.d.ts +2 -2
  72. package/build/types/internal/conversions/modernToLegacyWhereClause.d.ts +3 -3
  73. package/build/types/object/Attachment.d.ts +8 -0
  74. package/build/types/object/ObjectDefinitions.test.d.ts +1 -0
  75. package/build/types/object/convertWireToOsdkObjects.d.ts +5 -3
  76. package/build/types/object/convertWireToOsdkObjects.test.d.ts +1 -0
  77. package/build/types/object/fetchPageOrThrow.d.ts +7 -5
  78. package/build/types/object/getLinkedObjectByPkOrThrow.d.ts +4 -0
  79. package/build/types/object/getLinkedObjectOrThrow.d.ts +4 -0
  80. package/build/types/object/object.test.d.ts +1 -0
  81. package/build/types/object/pageLinkedObjectsOrThrow.d.ts +9 -0
  82. package/build/types/objectSet/ObjectSet.d.ts +7 -10
  83. package/build/types/objectSet/ObjectSetListenerWebsocket.d.ts +3 -3
  84. package/build/types/objectSet/createObjectSet.d.ts +4 -4
  85. package/build/types/objectSet/toConjureObjectSet.d.ts +3 -3
  86. package/build/types/query/WhereClause.d.ts +7 -7
  87. package/build/types/util/test/mockOntology.d.ts +59 -0
  88. package/package.json +11 -6
  89. package/build/js/chunk-CCKGGMYW.cjs.map +0 -1
  90. package/build/js/chunk-MT2HE6AQ.mjs.map +0 -1
  91. package/build/types/internal/net/V2_BASE.d.ts +0 -1
  92. package/build/types/internal/net/index.d.ts +0 -1
  93. package/build/types/internal/net/types.d.ts +0 -357
@@ -0,0 +1,49 @@
1
+ export declare const Employee: {
2
+ apiName: "Employee";
3
+ description: string;
4
+ primaryKeyType: "integer";
5
+ links: {
6
+ peeps: {
7
+ multiplicity: true;
8
+ targetType: "Employee";
9
+ };
10
+ lead: {
11
+ multiplicity: false;
12
+ targetType: "Employee";
13
+ };
14
+ officeLink: {
15
+ multiplicity: false;
16
+ targetType: "Office";
17
+ };
18
+ };
19
+ properties: {
20
+ employeeId: {
21
+ multiplicity: false;
22
+ type: "integer";
23
+ nullable: false;
24
+ };
25
+ fullName: {
26
+ multiplicity: false;
27
+ type: "string";
28
+ nullable: true;
29
+ };
30
+ office: {
31
+ multiplicity: false;
32
+ description: string;
33
+ type: "string";
34
+ nullable: true;
35
+ };
36
+ startDate: {
37
+ multiplicity: false;
38
+ description: string;
39
+ type: "datetime";
40
+ nullable: true;
41
+ };
42
+ employeeStatus: {
43
+ multiplicity: false;
44
+ description: string;
45
+ type: "stringTimeseries";
46
+ nullable: true;
47
+ };
48
+ };
49
+ };
@@ -0,0 +1,18 @@
1
+ export declare const ObjectWithTimestampPrimaryKey: {
2
+ apiName: "ObjectWithTimestampPrimaryKey";
3
+ description: string;
4
+ primaryKeyType: "timestamp";
5
+ links: {};
6
+ properties: {
7
+ timestamp: {
8
+ multiplicity: false;
9
+ type: "timestamp";
10
+ nullable: false;
11
+ };
12
+ value: {
13
+ multiplicity: false;
14
+ type: "string";
15
+ nullable: true;
16
+ };
17
+ };
18
+ };
@@ -0,0 +1,35 @@
1
+ export declare const Office: {
2
+ apiName: "Office";
3
+ description: string;
4
+ primaryKeyType: "string";
5
+ links: {
6
+ occupants: {
7
+ multiplicity: true;
8
+ targetType: "Employee";
9
+ };
10
+ };
11
+ properties: {
12
+ officeId: {
13
+ multiplicity: false;
14
+ type: "string";
15
+ nullable: false;
16
+ };
17
+ entrance: {
18
+ multiplicity: false;
19
+ type: "geopoint";
20
+ nullable: true;
21
+ };
22
+ occupiedArea: {
23
+ multiplicity: false;
24
+ description: string;
25
+ type: "geoshape";
26
+ nullable: true;
27
+ };
28
+ name: {
29
+ multiplicity: false;
30
+ description: string;
31
+ type: "string";
32
+ nullable: true;
33
+ };
34
+ };
35
+ };
@@ -0,0 +1,18 @@
1
+ export declare const equipment: {
2
+ apiName: "equipment";
3
+ primaryKeyType: "string";
4
+ links: {};
5
+ properties: {
6
+ equipmentId: {
7
+ multiplicity: false;
8
+ description: string;
9
+ type: "string";
10
+ nullable: false;
11
+ };
12
+ type: {
13
+ multiplicity: false;
14
+ type: "string";
15
+ nullable: true;
16
+ };
17
+ };
18
+ };
@@ -0,0 +1,158 @@
1
+ export declare const objectTypeWithAllPropertyTypes: {
2
+ apiName: "objectTypeWithAllPropertyTypes";
3
+ description: string;
4
+ primaryKeyType: "integer";
5
+ links: {};
6
+ properties: {
7
+ id: {
8
+ multiplicity: false;
9
+ type: "integer";
10
+ nullable: false;
11
+ };
12
+ string: {
13
+ multiplicity: false;
14
+ type: "string";
15
+ nullable: true;
16
+ };
17
+ boolean: {
18
+ multiplicity: false;
19
+ type: "boolean";
20
+ nullable: true;
21
+ };
22
+ date: {
23
+ multiplicity: false;
24
+ type: "datetime";
25
+ nullable: true;
26
+ };
27
+ dateTime: {
28
+ multiplicity: false;
29
+ type: "timestamp";
30
+ nullable: true;
31
+ };
32
+ decimal: {
33
+ multiplicity: false;
34
+ type: "decimal";
35
+ nullable: true;
36
+ };
37
+ integer: {
38
+ multiplicity: false;
39
+ type: "integer";
40
+ nullable: true;
41
+ };
42
+ long: {
43
+ multiplicity: false;
44
+ type: "long";
45
+ nullable: true;
46
+ };
47
+ short: {
48
+ multiplicity: false;
49
+ type: "short";
50
+ nullable: true;
51
+ };
52
+ float: {
53
+ multiplicity: false;
54
+ type: "float";
55
+ nullable: true;
56
+ };
57
+ double: {
58
+ multiplicity: false;
59
+ type: "double";
60
+ nullable: true;
61
+ };
62
+ byte: {
63
+ multiplicity: false;
64
+ type: "byte";
65
+ nullable: true;
66
+ };
67
+ attachment: {
68
+ multiplicity: false;
69
+ type: "attachment";
70
+ nullable: true;
71
+ };
72
+ attachment2: {
73
+ multiplicity: false;
74
+ type: "attachment";
75
+ nullable: true;
76
+ };
77
+ geoPoint: {
78
+ multiplicity: false;
79
+ type: "geopoint";
80
+ nullable: true;
81
+ };
82
+ geoShape: {
83
+ multiplicity: false;
84
+ type: "geoshape";
85
+ nullable: true;
86
+ };
87
+ stringArray: {
88
+ multiplicity: true;
89
+ type: "string";
90
+ nullable: true;
91
+ };
92
+ booleanArray: {
93
+ multiplicity: true;
94
+ type: "boolean";
95
+ nullable: true;
96
+ };
97
+ dateArray: {
98
+ multiplicity: true;
99
+ type: "datetime";
100
+ nullable: true;
101
+ };
102
+ dateTimeArray: {
103
+ multiplicity: true;
104
+ type: "timestamp";
105
+ nullable: true;
106
+ };
107
+ decimalArray: {
108
+ multiplicity: true;
109
+ type: "decimal";
110
+ nullable: true;
111
+ };
112
+ integerArray: {
113
+ multiplicity: true;
114
+ type: "integer";
115
+ nullable: true;
116
+ };
117
+ longArray: {
118
+ multiplicity: true;
119
+ type: "long";
120
+ nullable: true;
121
+ };
122
+ shortArray: {
123
+ multiplicity: true;
124
+ type: "short";
125
+ nullable: true;
126
+ };
127
+ floatArray: {
128
+ multiplicity: true;
129
+ type: "float";
130
+ nullable: true;
131
+ };
132
+ doubleArray: {
133
+ multiplicity: true;
134
+ type: "double";
135
+ nullable: true;
136
+ };
137
+ byteArray: {
138
+ multiplicity: true;
139
+ type: "byte";
140
+ nullable: true;
141
+ };
142
+ attachmentArray: {
143
+ multiplicity: true;
144
+ type: "attachment";
145
+ nullable: true;
146
+ };
147
+ geoPointArray: {
148
+ multiplicity: true;
149
+ type: "geopoint";
150
+ nullable: true;
151
+ };
152
+ geoShapeArray: {
153
+ multiplicity: true;
154
+ type: "geoshape";
155
+ nullable: true;
156
+ };
157
+ };
158
+ };
@@ -0,0 +1,5 @@
1
+ export * from './objects/Employee.js';
2
+ export * from './objects/ObjectWithTimestampPrimaryKey.js';
3
+ export * from './objects/Office.js';
4
+ export * from './objects/equipment.js';
5
+ export * from './objects/objectTypeWithAllPropertyTypes.js';
@@ -5,7 +5,7 @@ export type { ObjectSetListener } from "./objectSet/ObjectSetListener.js";
5
5
  export type { PageResult } from "./PageResult.js";
6
6
  export * as Objects from "./object/index.js";
7
7
  export type { OsdkObject } from "./OsdkObject.js";
8
- export type { OsdkObjectFrom } from "./OsdkObjectFrom.js";
8
+ export type { OsdkInterfaceFrom, OsdkObjectFrom } from "./OsdkObjectFrom.js";
9
9
  export { createClientContext } from "@osdk/shared.net";
10
10
  export { isOk } from "@osdk/shared.net";
11
11
  export type { ResultOrError } from "@osdk/shared.net";
@@ -1,4 +1,4 @@
1
+ import type { AggregateObjectsResponseV2 } from "@osdk/gateway/types";
1
2
  import type { AggregationClause, AggregationResultsWithoutGroups } from "../../query/index.js";
2
3
  import type { ArrayElement } from "../../util/ArrayElement.js";
3
- import type { Wire } from "../net/index.js";
4
- export declare function legacyToModernSingleAggregationResult<AC extends AggregationClause<any, any>>(entry: ArrayElement<Wire.AggregateObjectsResponseV2["data"]>): AggregationResultsWithoutGroups<any, any, AC>;
4
+ export declare function legacyToModernSingleAggregationResult<AC extends AggregationClause<any, any>>(entry: ArrayElement<AggregateObjectsResponseV2["data"]>): AggregationResultsWithoutGroups<any, any, AC>;
@@ -1,4 +1,4 @@
1
- import type { ObjectTypeDefinition } from "@osdk/api";
1
+ import type { ObjectOrInterfaceDefinition } from "@osdk/api";
2
+ import type { SearchJsonQueryV2 } from "@osdk/gateway/types";
2
3
  import type { WhereClause } from "../../query/index.js";
3
- import type { Wire } from "../net/index.js";
4
- export declare function modernToLegacyWhereClause<T extends ObjectTypeDefinition<any, any>>(whereClause: WhereClause<T>): Wire.SearchJsonQueryV2;
4
+ export declare function modernToLegacyWhereClause<T extends ObjectOrInterfaceDefinition<any, any>>(whereClause: WhereClause<T>): SearchJsonQueryV2;
@@ -0,0 +1,8 @@
1
+ export interface Attachment {
2
+ rid: string;
3
+ }
4
+ export declare class Attachment implements Attachment {
5
+ rid: string;
6
+ constructor(rid: string);
7
+ }
8
+ export declare function isAttachment(o: any): o is Attachment;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,5 +1,7 @@
1
- import type { ObjectTypeKeysFrom, ObjectTypePropertyKeysFrom, OntologyDefinition } from "@osdk/api";
1
+ import type { OntologyDefinition } from "@osdk/api";
2
2
  import type { OntologyObjectV2 } from "@osdk/gateway/types";
3
3
  import type { ClientContext } from "@osdk/shared.net";
4
- import type { OsdkObjectFrom } from "../OsdkObjectFrom.js";
5
- export declare function convertWireToOsdkObjects<T_ClientApiName extends ObjectTypeKeysFrom<T_OntologyDefinition> & string, T_OntologyDefinition extends OntologyDefinition<any>>(client: ClientContext<T_OntologyDefinition>, apiName: T_ClientApiName, objs: OntologyObjectV2[]): OsdkObjectFrom<T_ClientApiName, T_OntologyDefinition, ObjectTypePropertyKeysFrom<T_OntologyDefinition, T_ClientApiName>>[];
4
+ /**
5
+ * @param objs the objects to be converted, the contents of this array will be mutated
6
+ */
7
+ export declare function convertWireToOsdkObjects<T_OntologyDefinition extends OntologyDefinition<any>>(client: ClientContext<T_OntologyDefinition>, objs: OntologyObjectV2[]): void;
@@ -1,11 +1,13 @@
1
- import type { ObjectTypeKeysFrom, ObjectTypePropertyKeysFrom, OntologyDefinition } from "@osdk/api";
1
+ import type { ObjectOrInterfaceKeysFrom, ObjectOrInterfacePropertyKeysFrom, OntologyDefinition } from "@osdk/api";
2
+ import type { ObjectSet } from "@osdk/gateway/types";
2
3
  import type { ClientContext } from "@osdk/shared.net";
3
- import type { Wire } from "../internal/net/index.js";
4
4
  import type { OsdkObjectFrom } from "../OsdkObjectFrom.js";
5
5
  import type { PageResult } from "../PageResult.js";
6
- import type { NOOP } from "../util/NOOP.js";
7
- export interface FetchPageOrThrowArgs<O extends OntologyDefinition<any>, K extends ObjectTypeKeysFrom<O>, L extends ObjectTypePropertyKeysFrom<O, K>> {
6
+ export interface SelectArg<O extends OntologyDefinition<any>, K extends ObjectOrInterfaceKeysFrom<O>, L = ObjectOrInterfacePropertyKeysFrom<O, K>> {
8
7
  select?: readonly L[];
8
+ }
9
+ export interface FetchPageOrThrowArgs<O extends OntologyDefinition<any>, K extends ObjectOrInterfaceKeysFrom<O>, L = ObjectOrInterfacePropertyKeysFrom<O, K>> extends SelectArg<O, K, L> {
9
10
  nextPageToken?: string;
11
+ pageSize?: number;
10
12
  }
11
- export declare function fetchPageOrThrow<O extends OntologyDefinition<any>, T extends ObjectTypeKeysFrom<O>, const A extends FetchPageOrThrowArgs<O, T, ObjectTypePropertyKeysFrom<O, T>>>(client: ClientContext<O>, objectType: T & string, args: A, objectSet?: Wire.ObjectSet): Promise<PageResult<NOOP<OsdkObjectFrom<T, O, A["select"] extends readonly string[] ? A["select"][number] : ObjectTypePropertyKeysFrom<O, T>>>>>;
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>>>>;
@@ -0,0 +1,4 @@
1
+ import type { ObjectOrInterfacePropertyKeysFrom, ObjectTypeKeysFrom, ObjectTypeLinkKeysFrom, ObjectTypeLinkTargetTypeFrom, OntologyDefinition } from "@osdk/api";
2
+ import type { ClientContext } from "@osdk/shared.net";
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>>;
@@ -0,0 +1,4 @@
1
+ import type { ObjectTypeKeysFrom, ObjectTypeLinkKeysFrom, OntologyDefinition } from "@osdk/api";
2
+ import { type ClientContext } from "@osdk/shared.net";
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>>>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,9 @@
1
+ import type { ObjectOrInterfacePropertyKeysFrom, ObjectTypeKeysFrom, ObjectTypeLinkKeysFrom, ObjectTypeLinkTargetTypeFrom, OntologyDefinition } from "@osdk/api";
2
+ import { type ClientContext } from "@osdk/shared.net";
3
+ import type { OsdkObjectFrom } from "../OsdkObjectFrom.js";
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>>>>;
@@ -1,4 +1,4 @@
1
- import type { InterfaceKeysFrom, InterfacePropertyKeysFrom, ObjectTypeDefinitionFrom, ObjectTypeKeysFrom, ObjectTypePropertyKeysFrom, OntologyDefinition } from "@osdk/api";
1
+ import type { InterfaceKeysFrom, ObjectOrInterfaceDefinitionFrom, ObjectOrInterfaceKeysFrom, ObjectOrInterfacePropertyKeysFrom, OntologyDefinition } from "@osdk/api";
2
2
  import type { FetchPageOrThrowArgs } from "../object/fetchPageOrThrow.js";
3
3
  import type { OsdkInterfaceFrom, OsdkObjectFrom } from "../OsdkObjectFrom.js";
4
4
  import type { PageResult } from "../PageResult.js";
@@ -6,15 +6,12 @@ import type { AggregateOpts } from "../query/aggregations/AggregateOpts.js";
6
6
  import type { AggregationsResults, WhereClause } from "../query/index.js";
7
7
  import type { LinkTypesFrom } from "./LinkTypesFrom.js";
8
8
  import type { ObjectSetListener } from "./ObjectSetListener.js";
9
- export type ObjectSet<O extends OntologyDefinition<string>, K extends ObjectTypeKeysFrom<O> | InterfaceKeysFrom<O>> = BaseObjectSet<O, K>;
10
- export interface BaseObjectSet<O extends OntologyDefinition<any>, K extends ObjectTypeKeysFrom<O> | InterfaceKeysFrom<O>> {
11
- fetchPageOrThrow: <L extends (K extends InterfaceKeysFrom<O> ? InterfacePropertyKeysFrom<O, K> : ObjectTypePropertyKeysFrom<O, K>)>(args?: FetchPageOrThrowArgs<O, K, L>) => Promise<PageResult<K extends InterfaceKeysFrom<O> ? OsdkInterfaceFrom<K, O, L> : OsdkObjectFrom<K, O, L>>>;
9
+ export type ObjectSet<O extends OntologyDefinition<string>, K extends ObjectOrInterfaceKeysFrom<O>> = BaseObjectSet<O, K>;
10
+ export interface BaseObjectSet<O extends OntologyDefinition<any>, K extends ObjectOrInterfaceKeysFrom<O>> {
11
+ 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>>>;
12
12
  aggregateOrThrow: <const AO extends AggregateOpts<O, K, any>>(req: AO) => Promise<AggregationsResults<O, K, AO>>;
13
- where: (clause: WhereClause<ObjectTypeDefinitionFrom<O, K>>) => ObjectSet<O, K>;
14
- pivotTo: <T extends LinkTypesFrom<O, K>>(type: T & string, opts?: ObjectSetOptions<O, O["objects"][K]["links"][T]["targetType"]>) => ObjectSet<O, O["objects"][K]["links"][T]["targetType"]>;
13
+ where: (clause: WhereClause<ObjectOrInterfaceDefinitionFrom<O, K>>) => ObjectSet<O, K>;
14
+ pivotTo: <T extends LinkTypesFrom<O, K>>(type: T & string) => ObjectSet<O, O["objects"][K]["links"][T]["targetType"]>;
15
15
  subscribe: (listener: ObjectSetListener<O, K>) => () => void;
16
16
  }
17
- export interface ObjectSetOptions<O extends OntologyDefinition<any>, K extends ObjectTypeKeysFrom<O>> {
18
- $where?: WhereClause<ObjectTypeDefinitionFrom<O, K>>;
19
- }
20
- export type ObjectSetFactory<O extends OntologyDefinition<any>> = <K extends ObjectTypeKeysFrom<O>>(type: K & string, opts?: ObjectSetOptions<O, K>) => ObjectSet<O, K>;
17
+ export type ObjectSetFactory<O extends OntologyDefinition<any>> = <K extends ObjectOrInterfaceKeysFrom<O>>(type: K & string) => ObjectSet<O, K>;
@@ -1,12 +1,12 @@
1
- import type { InterfaceKeysFrom, ObjectTypeKeysFrom, OntologyDefinition } from "@osdk/api";
1
+ import type { ObjectOrInterfaceKeysFrom, OntologyDefinition } from "@osdk/api";
2
+ import type { ObjectSet } from "@osdk/gateway/types";
2
3
  import { type ClientContext } from "@osdk/shared.net";
3
- import type { Wire } from "../internal/net/index.js";
4
4
  import type { ObjectSetListener } from "./ObjectSetListener.js";
5
5
  export declare class ObjectSetListenerWebsocket<O extends OntologyDefinition<any, any, 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 ObjectTypeKeysFrom<O> | InterfaceKeysFrom<O>>(objectSet: Wire.ObjectSet, listener: ObjectSetListener<O, K>): () => void;
9
+ subscribe<K extends ObjectOrInterfaceKeysFrom<O>>(objectSet: ObjectSet, listener: ObjectSetListener<O, K>): () => void;
10
10
  }
11
11
  export type ObjectPropertyMapping = {
12
12
  apiName: string;
@@ -1,5 +1,5 @@
1
- import type { ObjectTypeKeysFrom, OntologyDefinition } from "@osdk/api";
1
+ import type { ObjectOrInterfaceKeysFrom, OntologyDefinition } from "@osdk/api";
2
+ import type { ObjectSet as WireObjectSet } from "@osdk/gateway/types";
2
3
  import type { ClientContext } from "@osdk/shared.net";
3
- import type { Wire } from "../internal/net/index.js";
4
- import type { ObjectSet, ObjectSetOptions } from "./ObjectSet.js";
5
- export declare function createObjectSet<O extends OntologyDefinition<any>, K extends ObjectTypeKeysFrom<O>>(objectType: K & string, clientCtx: ClientContext<O>, opts: ObjectSetOptions<O, K> | undefined, objectSet?: Wire.ObjectSet): ObjectSet<O, K>;
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>;
@@ -1,6 +1,6 @@
1
1
  import type { ObjectTypeKeysFrom, OntologyDefinition } from "@osdk/api";
2
+ import type { ObjectSet } from "@osdk/gateway/types";
2
3
  import type { ObjectSet as OssObjectSet } from "../generated/object-set-service/api/index.js";
3
- import type { Wire } from "../internal/net/index.js";
4
4
  import type { ObjectPropertyMapping } from "./ObjectSetListenerWebsocket.js";
5
- export declare function toConjureObjectSet<O extends OntologyDefinition<any>, K extends ObjectTypeKeysFrom<O>>(objectSet: Wire.ObjectSet, objectPropertyMapping: ObjectPropertyMapping): OssObjectSet;
6
- export declare function getObjectSetBaseType(objectSet: Wire.ObjectSet): Promise<string>;
5
+ export declare function toConjureObjectSet<O extends OntologyDefinition<any>, K extends ObjectTypeKeysFrom<O>>(objectSet: ObjectSet, objectPropertyMapping: ObjectPropertyMapping): OssObjectSet;
6
+ export declare function getObjectSetBaseType(objectSet: ObjectSet): Promise<string>;
@@ -1,24 +1,24 @@
1
- import type { ObjectTypeDefinition, ObjectTypePropertyDefinition } from "@osdk/api";
2
- export type PossibleWhereClauseFilters = "gt" | "eq" | "ne" | "isNull" | "gte" | "lt" | "lte";
1
+ import type { ObjectOrInterfaceDefinition, ObjectTypePropertyDefinition } from "@osdk/api";
2
+ export type PossibleWhereClauseFilters = "gt" | "eq" | "ne" | "isNull" | "contains" | "gte" | "lt" | "lte";
3
3
  type MakeFilter<K extends PossibleWhereClauseFilters, V> = K extends string ? Omit<{
4
4
  [k in PossibleWhereClauseFilters]?: undefined;
5
5
  }, K> & {
6
6
  [k in K]: V;
7
7
  } : never;
8
- type BaseFilter<T> = T | MakeFilter<"eq" | "ne", T> | MakeFilter<"isNull", boolean>;
8
+ type BaseFilter<T> = T | MakeFilter<"eq" | "ne" | "contains", T> | MakeFilter<"isNull", boolean>;
9
9
  type StringFilter = BaseFilter<string>;
10
10
  type NumberFilter = BaseFilter<number> | MakeFilter<"gt" | "gte" | "lt" | "lte", number>;
11
11
  type FilterFor<PD extends ObjectTypePropertyDefinition> = PD["type"] extends "string" ? StringFilter : NumberFilter;
12
- export interface AndWhereClause<T extends ObjectTypeDefinition<any, any>> {
12
+ export interface AndWhereClause<T extends ObjectOrInterfaceDefinition<any, any>> {
13
13
  $and: WhereClause<T>[];
14
14
  }
15
- export interface OrWhereClause<T extends ObjectTypeDefinition<any, any>> {
15
+ export interface OrWhereClause<T extends ObjectOrInterfaceDefinition<any, any>> {
16
16
  $or: WhereClause<T>[];
17
17
  }
18
- export interface NotWhereClause<T extends ObjectTypeDefinition<any, any>> {
18
+ export interface NotWhereClause<T extends ObjectOrInterfaceDefinition<any, any>> {
19
19
  $not: WhereClause<T>;
20
20
  }
21
- export type WhereClause<T extends ObjectTypeDefinition<any, any>> = OrWhereClause<T> | AndWhereClause<T> | NotWhereClause<T> | {
21
+ export type WhereClause<T extends ObjectOrInterfaceDefinition<any, any>> = OrWhereClause<T> | AndWhereClause<T> | NotWhereClause<T> | {
22
22
  [P in keyof T["properties"]]?: FilterFor<T["properties"][P]>;
23
23
  };
24
24
  export {};
@@ -0,0 +1,59 @@
1
+ export declare const MockOntology: {
2
+ metadata: {
3
+ ontologyRid: string;
4
+ ontologyApiName: string;
5
+ userAgent: string;
6
+ };
7
+ objects: {
8
+ Task: {
9
+ apiName: "Task";
10
+ primaryKeyType: "integer";
11
+ properties: {
12
+ id: {
13
+ type: "integer";
14
+ };
15
+ name: {
16
+ type: "string";
17
+ };
18
+ };
19
+ links: {
20
+ Todos: {
21
+ targetType: "Todo";
22
+ multiplicity: true;
23
+ };
24
+ RP: {
25
+ targetType: "Person";
26
+ multiplicity: false;
27
+ };
28
+ };
29
+ };
30
+ Todo: {
31
+ apiName: "Todo";
32
+ primaryKeyType: "integer";
33
+ properties: {
34
+ id: {
35
+ type: "integer";
36
+ };
37
+ text: {
38
+ type: "string";
39
+ };
40
+ };
41
+ links: {};
42
+ };
43
+ Person: {
44
+ apiName: "Person";
45
+ primaryKeyType: "integer";
46
+ properties: {
47
+ id: {
48
+ type: "integer";
49
+ };
50
+ name: {
51
+ type: "string";
52
+ };
53
+ };
54
+ links: {};
55
+ };
56
+ };
57
+ actions: {};
58
+ queries: {};
59
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@osdk/client",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "",
5
5
  "access": "public",
6
6
  "license": "Apache-2.0",
@@ -22,14 +22,16 @@
22
22
  "isomorphic-ws": "^5.0.0",
23
23
  "tiny-invariant": "^1.3.1",
24
24
  "ws": "^8.14.2",
25
- "@osdk/api": "1.0.1",
26
- "@osdk/gateway": "1.0.1",
27
- "@osdk/shared.net": "1.0.1"
25
+ "@osdk/api": "1.0.2",
26
+ "@osdk/gateway": "1.0.2",
27
+ "@osdk/shared.net": "1.0.2"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@types/ws": "^8.5.10",
31
31
  "ts-expect": "^1.3.0",
32
- "typescript": "^5.2.2"
32
+ "typescript": "^5.2.2",
33
+ "@osdk/generator": "1.0.4",
34
+ "@osdk/shared.test": "1.0.3"
33
35
  },
34
36
  "publishConfig": {
35
37
  "access": "public"
@@ -42,15 +44,18 @@
42
44
  "package.json",
43
45
  "*.d.ts"
44
46
  ],
45
- "main": "./build/js/index.js",
47
+ "main": "./build/js/index.cjs",
46
48
  "module": "./build/js/index.mjs",
47
49
  "types": "./build/types/index.d.ts",
48
50
  "type": "module",
49
51
  "scripts": {
50
52
  "clean": "rm -rf lib dist types build tsconfig.tsbuildinfo",
53
+ "codegen": "node ./generateMockOntology.js",
51
54
  "dev:transpile": "tsup --watch",
52
55
  "fix-lint": "eslint . --fix && dprint fmt --config $(find-up dprint.json)",
53
56
  "lint": "eslint . && dprint check --config $(find-up dprint.json)",
57
+ "test": "vitest run --pool=forks",
58
+ "test:watch": "vitest",
54
59
  "transpile": "tsup",
55
60
  "transpileWatch": "tsup --watch",
56
61
  "typecheck": "tsc-absolute --build"