Skip to content

Commit

Permalink
More interface args cleanup (#949)
Browse files Browse the repository at this point in the history
* clean up args

* add changeset'
  • Loading branch information
ssanjay1 authored Nov 1, 2024
1 parent f5dfdde commit 27866a8
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 12 deletions.
6 changes: 6 additions & 0 deletions .changeset/rare-brooms-move.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@osdk/client": patch
"@osdk/api": patch
---

Removing interface argument for selecting object types. This is not supported in the new apis, and is not being used internally anywhere with the old apis.
2 changes: 0 additions & 2 deletions etc/api.report.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,6 @@ export type ApplyBatchActionOptions = {
//
// @public (undocumented)
export interface AsyncIterArgs<Q extends ObjectOrInterfaceDefinition, K extends PropertyKeys<Q> = PropertyKeys<Q>, R extends boolean = false, A extends Augments = never, S extends NullabilityAdherence = NullabilityAdherence.Default> extends SelectArg<Q, K, R, S>, OrderByArg<Q, PropertyKeys<Q>> {
// (undocumented)
$__EXPERIMENTAL_selectedObjectTypes?: string[];
}

// @public (undocumented)
Expand Down
1 change: 0 additions & 1 deletion packages/api/src/object/FetchPageArgs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ export interface AsyncIterArgs<
A extends Augments = never,
S extends NullabilityAdherence = NullabilityAdherence.Default,
> extends SelectArg<Q, K, R, S>, OrderByArg<Q, PropertyKeys<Q>> {
$__EXPERIMENTAL_selectedObjectTypes?: string[];
}

export type Augment<
Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/object/fetchPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ async function fetchInterfacePage<
augmentedProperties: {},
augmentedSharedPropertyTypes: {},
otherInterfaceTypes: [],
selectedObjectTypes: args.$__EXPERIMENTAL_selectedObjectTypes ?? [],
selectedObjectTypes: [],
selectedSharedPropertyTypes: args.$select as undefined | string[] ?? [],
where: objectSetToSearchJsonV2(objectSet, interfaceType.apiName),
}),
Expand Down
16 changes: 8 additions & 8 deletions packages/e2e.sandbox.catchall/src/runInterfacesTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ export async function runInterfacesTest() {

const qqq = await client(FooInterface).where({ name: { $ne: "Patti" } });

const fooLimitedToEmployees = await client(FooInterface).fetchPage({
$__EXPERIMENTAL_selectedObjectTypes: ["Employee"],
});
invariant(fooLimitedToEmployees.data.length > 0);
// const fooLimitedToEmployees = await client(FooInterface).fetchPage({
// $__EXPERIMENTAL_selectedObjectTypes: ["Employee"],
// });
// invariant(fooLimitedToEmployees.data.length > 0);

const fooLimitedToOther = await client(FooInterface).fetchPage({
$__EXPERIMENTAL_selectedObjectTypes: ["Other"],
});
invariant(fooLimitedToOther.data.length === 0);
// const fooLimitedToOther = await client(FooInterface).fetchPage({
// $__EXPERIMENTAL_selectedObjectTypes: ["Other"],
// });
// invariant(fooLimitedToOther.data.length === 0);

const r = await client(FooInterface)
.where({ name: { $ne: "Patti" } })
Expand Down

0 comments on commit 27866a8

Please sign in to comment.