diff --git a/.changeset/lovely-eels-attend.md b/.changeset/lovely-eels-attend.md new file mode 100644 index 000000000..7012418ae --- /dev/null +++ b/.changeset/lovely-eels-attend.md @@ -0,0 +1,6 @@ +--- +"@osdk/client": patch +"@osdk/api": patch +--- + +Fix where clause types so we don't accept more than one key in the clauses. diff --git a/etc/api.report.api.md b/etc/api.report.api.md index 07f7d95b7..84dcada46 100644 --- a/etc/api.report.api.md +++ b/etc/api.report.api.md @@ -961,8 +961,8 @@ export interface VersionBound> { // Warning: (ae-forgotten-export) The symbol "FilterFor" needs to be exported by the entry point index.d.ts // // @public (undocumented) -export type WhereClause = OrWhereClause | AndWhereClause | NotWhereClause | (IsNever> extends true ? Record : { - [P in PropertyKeys]?: FilterFor["properties"][P]>; +export type WhereClause = OrWhereClause | AndWhereClause | NotWhereClause | (IsNever["properties"]> extends true ? Record : { + [P in keyof CompileTimeMetadata["properties"]]?: FilterFor["properties"][P]>; }); // @public (undocumented) diff --git a/packages/api/src/aggregate/ArrayFilter.ts b/packages/api/src/aggregate/ArrayFilter.ts new file mode 100644 index 000000000..cbfea2ba9 --- /dev/null +++ b/packages/api/src/aggregate/ArrayFilter.ts @@ -0,0 +1,32 @@ +/* + * Copyright 2024 Palantir Technologies, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import type { Just } from "./Just.js"; + +interface ArrayFilterOptions { + "$contains": T; + "$isNull": boolean; +} +namespace ArrayFilter { + export interface $contains + extends Just<"$contains", ArrayFilterOptions> + {} + export interface $isNull extends Just<"$isNull", ArrayFilterOptions> {} +} + +export type ArrayFilter = + | ArrayFilter.$contains + | ArrayFilter.$isNull; diff --git a/packages/api/src/aggregate/BaseFilter.ts b/packages/api/src/aggregate/BaseFilter.ts new file mode 100644 index 000000000..65e5b253b --- /dev/null +++ b/packages/api/src/aggregate/BaseFilter.ts @@ -0,0 +1,46 @@ +/* + * Copyright 2024 Palantir Technologies, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import type { Just } from "./Just.js"; + +export type BaseFilterOptions = { + "$eq": T; + "$ne": T; + "$isNull": boolean; + "$in": ReadonlyArray; +}; + +export namespace BaseFilter { + export interface $eq extends Just<"$eq", BaseFilterOptions> {} + export interface $ne extends Just<"$ne", BaseFilterOptions> {} + export interface $in extends Just<"$in", BaseFilterOptions> {} + export interface $isNull extends Just<"$isNull", BaseFilterOptions> {} +} + +export type BaseFilter = + | BaseFilter.$eq + | BaseFilter.$ne + | BaseFilter.$in + | BaseFilter.$isNull; + +/** @internal */ +export type CatchThemAll = CatchThemAllInternal; + +// extends for union distribution +/** @internal */ +type CatchThemAllInternal = K extends keyof T + ? { [k in K]: T[k] } + : never; diff --git a/packages/api/src/aggregate/BooleanFilter.ts b/packages/api/src/aggregate/BooleanFilter.ts new file mode 100644 index 000000000..57f196fc9 --- /dev/null +++ b/packages/api/src/aggregate/BooleanFilter.ts @@ -0,0 +1,38 @@ +/* + * Copyright 2024 Palantir Technologies, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import type { BaseFilterOptions, CatchThemAll } from "./BaseFilter.js"; +import type { Just } from "./Just.js"; + +interface BooleanFilterOptions extends BaseFilterOptions {} + +export namespace BooleanFilter { + export interface $eq extends Just<"$eq", BooleanFilterOptions> {} + export interface $ne extends Just<"$ne", BooleanFilterOptions> {} + export interface $isNull extends Just<"$isNull", BooleanFilterOptions> {} + export interface $in extends Just<"$in", BooleanFilterOptions> {} +} +export type BooleanFilter = + | boolean + | BooleanFilter.$eq + | BooleanFilter.$ne + | BooleanFilter.$in + | BooleanFilter.$isNull; + +/** @internal */ +function _typeCheck() { + const b: BooleanFilter = {} as CatchThemAll; +} diff --git a/packages/api/src/aggregate/DatetimeFilter.ts b/packages/api/src/aggregate/DatetimeFilter.ts new file mode 100644 index 000000000..454000871 --- /dev/null +++ b/packages/api/src/aggregate/DatetimeFilter.ts @@ -0,0 +1,51 @@ +/* + * Copyright 2024 Palantir Technologies, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import type { BaseFilterOptions, CatchThemAll } from "./BaseFilter.js"; +import type { Just } from "./Just.js"; + +export interface DatetimeFilterOptions extends BaseFilterOptions { + "$gt": string; + "$gte": string; + "$lt": string; + "$lte": string; +} + +export namespace DatetimeFilter { + export interface $eq extends Just<"$eq", DatetimeFilterOptions> {} + export interface $ne extends Just<"$ne", DatetimeFilterOptions> {} + export interface $isNull extends Just<"$isNull", DatetimeFilterOptions> {} + export interface $gt extends Just<"$gt", DatetimeFilterOptions> {} + export interface $gte extends Just<"$gte", DatetimeFilterOptions> {} + export interface $lt extends Just<"$lt", DatetimeFilterOptions> {} + export interface $lte extends Just<"$lte", DatetimeFilterOptions> {} + export interface $in extends Just<"$in", DatetimeFilterOptions> {} +} +export type DatetimeFilter = + | string + | DatetimeFilter.$eq + | DatetimeFilter.$ne + | DatetimeFilter.$isNull + | DatetimeFilter.$in + | DatetimeFilter.$gt + | DatetimeFilter.$gte + | DatetimeFilter.$lt + | DatetimeFilter.$lte; + +/** @internal */ +function _typeCheck() { + const b: DatetimeFilter = {} as CatchThemAll; +} diff --git a/packages/api/src/aggregate/GeoFilter.ts b/packages/api/src/aggregate/GeoFilter.ts new file mode 100644 index 000000000..c9cb06d76 --- /dev/null +++ b/packages/api/src/aggregate/GeoFilter.ts @@ -0,0 +1,66 @@ +/* + * Copyright 2024 Palantir Technologies, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import type { BBox, Point, Polygon } from "geojson"; +import type { Just } from "./Just.js"; +import type { DistanceUnitMapping } from "./WhereClause.js"; + +interface GeoFilterOptions { + "$within": + | { + $distance: [number, keyof typeof DistanceUnitMapping]; + $of: [number, number] | Readonly; + $bbox?: never; + $polygon?: never; + } + | { + $bbox: BBox; + $distance?: never; + $of?: never; + $polygon?: never; + } + | BBox + | { + $polygon: Polygon["coordinates"]; + $bbox?: never; + $distance?: never; + $of?: never; + } + | Polygon; + "$intersects": + | { + $bbox: BBox; + $polygon?: never; + } + | BBox + | { + $polygon: Polygon["coordinates"]; + $bbox?: never; + } + | Polygon; + "$isNull": boolean; +} + +export namespace GeoFilter { + export interface $within extends Just<"$within", GeoFilterOptions> {} + export interface $intersects extends Just<"$intersects", GeoFilterOptions> {} + export interface $isNull extends Just<"$isNull", GeoFilterOptions> {} +} + +export type GeoFilter = + | GeoFilter.$within + | GeoFilter.$intersects + | GeoFilter.$isNull; diff --git a/packages/api/src/aggregate/Just.ts b/packages/api/src/aggregate/Just.ts new file mode 100644 index 000000000..73c9118ad --- /dev/null +++ b/packages/api/src/aggregate/Just.ts @@ -0,0 +1,27 @@ +/* + * Copyright 2024 Palantir Technologies, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export type Just = + & { + [k in Z]: V[k]; + } + & { + [k in keyof V as k extends Z ? never : k]?: never; + }; + +export type NeverThese = { + [k in V]?: never; +}; diff --git a/packages/api/src/aggregate/NumberFilter.ts b/packages/api/src/aggregate/NumberFilter.ts new file mode 100644 index 000000000..99c1f75f5 --- /dev/null +++ b/packages/api/src/aggregate/NumberFilter.ts @@ -0,0 +1,51 @@ +/* + * Copyright 2024 Palantir Technologies, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import type { BaseFilterOptions, CatchThemAll } from "./BaseFilter.js"; +import type { Just } from "./Just.js"; + +interface NumberFilterOptions extends BaseFilterOptions { + "$gt": number; + "$gte": number; + "$lt": number; + "$lte": number; +} + +export namespace NumberFilter { + export interface $eq extends Just<"$eq", NumberFilterOptions> {} + export interface $ne extends Just<"$ne", NumberFilterOptions> {} + export interface $isNull extends Just<"$isNull", NumberFilterOptions> {} + export interface $gt extends Just<"$gt", NumberFilterOptions> {} + export interface $gte extends Just<"$gte", NumberFilterOptions> {} + export interface $lt extends Just<"$lt", NumberFilterOptions> {} + export interface $lte extends Just<"$lte", NumberFilterOptions> {} + export interface $in extends Just<"$in", NumberFilterOptions> {} +} +export type NumberFilter = + | number + | NumberFilter.$eq + | NumberFilter.$ne + | NumberFilter.$isNull + | NumberFilter.$in + | NumberFilter.$gt + | NumberFilter.$gte + | NumberFilter.$lt + | NumberFilter.$lte; + +/** @internal */ +function _typeCheck() { + const b: NumberFilter = {} as CatchThemAll; +} diff --git a/packages/api/src/aggregate/StringFilter.ts b/packages/api/src/aggregate/StringFilter.ts new file mode 100644 index 000000000..7b65d7fa3 --- /dev/null +++ b/packages/api/src/aggregate/StringFilter.ts @@ -0,0 +1,65 @@ +/* + * Copyright 2024 Palantir Technologies, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import type { BaseFilterOptions, CatchThemAll } from "./BaseFilter.js"; +import type { Just } from "./Just.js"; + +interface StringFilterOptions extends BaseFilterOptions { + "$startsWith": string; + "$containsAllTermsInOrder": string; + "$containsAnyTerm": string; + "$containsAllTerms": string; + "$in": ReadonlyArray; +} + +export namespace StringFilter { + export interface $eq extends Just<"$eq", StringFilterOptions> {} + export interface $ne extends Just<"$ne", StringFilterOptions> {} + export interface $isNull extends Just<"$isNull", StringFilterOptions> {} + export interface $startsWith + extends Just<"$startsWith", StringFilterOptions> + { + } + export interface $containsAllTermsInOrder + extends Just<"$containsAllTermsInOrder", StringFilterOptions> + { + } + export interface $containsAnyTerm + extends Just<"$containsAnyTerm", StringFilterOptions> + { + } + export interface $containsAllTerms + extends Just<"$containsAllTerms", StringFilterOptions> + { + } + export interface $in extends Just<"$in", StringFilterOptions> {} +} + +export type StringFilter = + | string + | StringFilter.$eq + | StringFilter.$ne + | StringFilter.$isNull + | StringFilter.$in + | StringFilter.$startsWith + | StringFilter.$containsAllTermsInOrder + | StringFilter.$containsAnyTerm + | StringFilter.$containsAllTerms; + +/** @internal */ +function _typeCheck() { + const b: StringFilter = {} as CatchThemAll; +} diff --git a/packages/api/src/aggregate/WhereClause.ts b/packages/api/src/aggregate/WhereClause.ts index faf1b656b..92adf0a4a 100644 --- a/packages/api/src/aggregate/WhereClause.ts +++ b/packages/api/src/aggregate/WhereClause.ts @@ -24,6 +24,13 @@ import type { ObjectMetadata, } from "../ontology/ObjectTypeDefinition.js"; import type { IsNever } from "../OsdkObjectFrom.js"; +import type { ArrayFilter } from "./ArrayFilter.js"; +import type { BaseFilter, BaseFilterOptions } from "./BaseFilter.js"; +import type { BooleanFilter } from "./BooleanFilter.js"; +import type { DatetimeFilter } from "./DatetimeFilter.js"; +import type { GeoFilter } from "./GeoFilter.js"; +import type { NumberFilter } from "./NumberFilter.js"; +import type { StringFilter } from "./StringFilter.js"; export type PossibleWhereClauseFilters = | "$gt" @@ -42,44 +49,6 @@ export type PossibleWhereClauseFilters = | "$containsAnyTerm" | "$containsAllTerms"; -// We need to conditional here to force the union to be distributed -type MakeFilter = K extends string ? { - [k in K]: V; - } - : never; - -type BaseFilter = - | T - | MakeFilter<"$eq" | "$ne", T> - | MakeFilter<"$in", ReadonlyArray> - | MakeFilter<"$isNull", boolean>; - -type StringFilter = - | BaseFilter - | MakeFilter< - | "$startsWith" - | "$containsAllTermsInOrder" - | "$containsAnyTerm" - | "$containsAllTerms", - string - >; -type NumberFilter = - | BaseFilter - | MakeFilter<"$gt" | "$gte" | "$lt" | "$lte", number>; - -type DatetimeFilter = - | BaseFilter - | MakeFilter<"$gt" | "$gte" | "$lt" | "$lte", string>; - -type BooleanFilter = - | boolean - | MakeFilter<"$eq" | "$ne", boolean> - | MakeFilter<"$isNull", boolean>; - -type ArrayFilter = - | MakeFilter<"$contains", T> - | MakeFilter<"$isNull", boolean>; - // the value side of this needs to match DistanceUnit from @osdk/internal.foundry but we don't // want the dependency export const DistanceUnitMapping = { @@ -153,11 +122,6 @@ export type GeoFilter_Intersects = { | Polygon; }; -export type GeoFilter = - | GeoFilter_Within - | GeoFilter_Intersects - | MakeFilter<"$isNull", boolean>; - type FilterFor = PD["multiplicity"] extends true ? (PD["type"] extends @@ -169,7 +133,10 @@ type FilterFor = PD["multiplicity"] extends : PD["type"] extends "geopoint" | "geoshape" ? GeoFilter : PD["type"] extends "datetime" | "timestamp" ? DatetimeFilter : PD["type"] extends "boolean" ? BooleanFilter - : NumberFilter); // FIXME we need to represent all types + : PD["type"] extends + "double" | "integer" | "long" | "float" | "decimal" | "byte" + ? NumberFilter + : BaseFilter); // FIXME we need to represent all types export interface AndWhereClause< T extends ObjectOrInterfaceDefinition, @@ -195,6 +162,10 @@ export type WhereClause< | OrWhereClause | AndWhereClause | NotWhereClause - | (IsNever> extends true ? Record : { - [P in PropertyKeys]?: FilterFor["properties"][P]>; - }); + | (IsNever["properties"]> extends true + ? Record + : { + [P in keyof CompileTimeMetadata["properties"]]?: FilterFor< + CompileTimeMetadata["properties"][P] + >; + }); diff --git a/packages/client/src/internal/conversions/modernToLegacyWhereClause.test.ts b/packages/client/src/internal/conversions/modernToLegacyWhereClause.test.ts index ff0331024..b62632286 100644 --- a/packages/client/src/internal/conversions/modernToLegacyWhereClause.test.ts +++ b/packages/client/src/internal/conversions/modernToLegacyWhereClause.test.ts @@ -26,10 +26,18 @@ describe(modernToLegacyWhereClause, () => { describe("api namespaces", () => { describe("interfaces", () => { it("properly converts shortname to fqApiName", () => { - const T: ObjectOrInterfaceDefinition = { + const T = { type: "interface", apiName: "a.Foo", - }; + __DefinitionMetadata: { + type: "interface", + properties: { "prop": { type: "integer" } }, + apiName: "a.Foo", + displayName: "", + links: {}, + rid: "", + }, + } as const satisfies ObjectOrInterfaceDefinition; const r = modernToLegacyWhereClause({ prop: 5, @@ -45,10 +53,22 @@ describe(modernToLegacyWhereClause, () => { }); it("properly does not convert when interface has no apiNamespace", () => { - const T: ObjectOrInterfaceDefinition = { + const T = { type: "interface", apiName: "Foo", - }; + __DefinitionMetadata: { + type: "interface", + properties: { + "foo": { type: "integer" }, + "b.prop": { type: "integer" }, + "prop": { type: "integer" }, + }, + apiName: "Foo", + displayName: "", + links: {}, + rid: "", + }, + } as const satisfies ObjectOrInterfaceDefinition; const r = modernToLegacyWhereClause({ "b.prop": 5, @@ -75,10 +95,22 @@ describe(modernToLegacyWhereClause, () => { }); it("gracefully handles redundant apiNamespace in property", () => { - const T: ObjectOrInterfaceDefinition = { + const T = { type: "interface", apiName: "a.Foo", - }; + __DefinitionMetadata: { + type: "interface", + properties: { + "a.foo": { type: "integer" }, + "b.prop": { type: "integer" }, + "prop": { type: "integer" }, + }, + apiName: "a.Foo", + displayName: "", + links: {}, + rid: "", + }, + } as const satisfies ObjectOrInterfaceDefinition; const r = modernToLegacyWhereClause({ "b.prop": 5, @@ -105,10 +137,22 @@ describe(modernToLegacyWhereClause, () => { }); it("properly does not convert different apiNamespaces", () => { - const T: ObjectOrInterfaceDefinition = { + const T = { type: "interface", apiName: "a.Foo", - }; + __DefinitionMetadata: { + type: "interface", + properties: { + "a.foo": { type: "integer" }, + "b.prop": { type: "integer" }, + "prop": { type: "integer" }, + }, + apiName: "a.Foo", + displayName: "", + links: {}, + rid: "", + }, + } as const satisfies ObjectOrInterfaceDefinition; expect(modernToLegacyWhereClause({ "b.prop": 5, @@ -124,18 +168,28 @@ describe(modernToLegacyWhereClause, () => { describe("objects", () => { it("does not convert object short property names to fq", () => { - const T: ObjectOrInterfaceDefinition = { - type: "object", + const T = { + type: "interface", apiName: "a.Foo", - }; - + __DefinitionMetadata: { + type: "interface", + properties: { + "a.foo": { type: "integer" }, + "prop": { type: "integer" }, + }, + apiName: "a.Foo", + displayName: "", + links: {}, + rid: "", + }, + } as const satisfies ObjectOrInterfaceDefinition; const r = modernToLegacyWhereClause({ prop: 5, }, T); expect(r).toMatchInlineSnapshot(` { - "field": "prop", + "field": "a.prop", "type": "eq", "value": 5, } diff --git a/packages/client/src/object/fetchPage.test.ts b/packages/client/src/object/fetchPage.test.ts index 5e8b48e95..8d3b1d656 100644 --- a/packages/client/src/object/fetchPage.test.ts +++ b/packages/client/src/object/fetchPage.test.ts @@ -24,7 +24,7 @@ import type { SelectArgToKeys, } from "@osdk/api"; import type { FooInterface } from "@osdk/client.test.ontology"; -import { Todo } from "@osdk/client.test.ontology"; +import { Employee, Todo } from "@osdk/client.test.ontology"; import type { SearchJsonQueryV2 } from "@osdk/internal.foundry.core"; import { describe, expect, expectTypeOf, it } from "vitest"; import { createMinimalClient } from "../createMinimalClient.js"; @@ -168,6 +168,52 @@ describe(fetchPage, () => { ); }); + it("where clause keys correctly typed", () => { + const client = createMinimalClient( + metadata, + "https://foo", + async () => "", + ); + const objectSet = createObjectSet(Todo, client); + const objectSetWithSpecialPropertyTypes = createObjectSet(Employee, client); + + expectTypeOf(objectSet.where).toBeCallableWith({ + $and: [{ id: { $gt: 2 } }, { id: { $lte: 2 } }], + }); + expectTypeOf(objectSet.where).toBeCallableWith({ + // @ts-expect-error + id: { $gt: 2, $lte: 2 }, + }); + + // We used to default to number filters for other types, like geotimeseries reference and timeseries. These tests will make sure + // we don't do that anymore + expectTypeOf(objectSetWithSpecialPropertyTypes.where).toBeCallableWith({ + $and: [ + { employeeLocation: { $eq: "myLocation" } }, + { + employeeLocation: { $ne: "notMyLocation" }, + }, + { employeeLocation: { $isNull: false } }, + // @ts-expect-error + { employeeLocation: { $isNull: false, $eq: "myLocation" } }, + // @ts-expect-error + { employeeLocation: { $gt: 5 } }, + ], + }); + + expectTypeOf(objectSetWithSpecialPropertyTypes.where).toBeCallableWith({ + $and: [ + { employeeStatus: { $eq: "myStatus" } }, + { + employeeLocation: { $ne: "notMyStatus" }, + }, + { employeeLocation: { $isNull: false } }, + // @ts-expect-error + { employeeLocation: { $lte: 5 } }, + ], + }); + }); + describe("includeRid", () => { it("properly returns the correct string for includeRid", () => { expectTypeOf>>() diff --git a/packages/client/src/objectSet/ObjectSet.test.ts b/packages/client/src/objectSet/ObjectSet.test.ts index da41347e5..30c5a7ebd 100644 --- a/packages/client/src/objectSet/ObjectSet.test.ts +++ b/packages/client/src/objectSet/ObjectSet.test.ts @@ -25,7 +25,7 @@ import type { PropertyKeys, Result, } from "@osdk/api"; -import { isOk } from "@osdk/api"; +import { isOk, WhereClause } from "@osdk/api"; import { $ontologyRid, BarInterface, @@ -44,6 +44,7 @@ import { } from "vitest"; import type { ApiNameAsString, + IsNever, JustProps, PropMapToInterface, PropMapToObject, diff --git a/packages/monorepo.cspell/dict.test-words.txt b/packages/monorepo.cspell/dict.test-words.txt index f0513d32b..b376e1b6a 100644 --- a/packages/monorepo.cspell/dict.test-words.txt +++ b/packages/monorepo.cspell/dict.test-words.txt @@ -6,3 +6,4 @@ objectdoesnotexist Packag querydoesnotexist unstubAllEnvs +geotimeseries