From 18ead7922ba0bb1b0e5e5a0aaabd180fc7cf7e6e Mon Sep 17 00:00:00 2001 From: Saurav Date: Sat, 20 Jul 2024 08:10:15 -0400 Subject: [PATCH] review comments --- packages/client.api/src/index.ts | 2 -- packages/client/src/createTimeseriesProperty.ts | 17 ++++++----------- .../createOsdkInterface.ts | 4 ---- .../createOsdkObject.ts | 3 +-- 4 files changed, 7 insertions(+), 19 deletions(-) diff --git a/packages/client.api/src/index.ts b/packages/client.api/src/index.ts index e13e29035..b3f80b6e5 100644 --- a/packages/client.api/src/index.ts +++ b/packages/client.api/src/index.ts @@ -14,8 +14,6 @@ * limitations under the License. */ -import { TimeseriesDurationMapping } from "./timeseries/timeseries.js"; - export type { ActionReturnTypeForOptions } from "./actions/ActionReturnTypeForOptions.js"; export type { ActionEditResponse, diff --git a/packages/client/src/createTimeseriesProperty.ts b/packages/client/src/createTimeseriesProperty.ts index 6b01fc0f8..20db65a8c 100644 --- a/packages/client/src/createTimeseriesProperty.ts +++ b/packages/client/src/createTimeseriesProperty.ts @@ -89,21 +89,16 @@ async function getAllTimeSeriesPoints( propertyName: string, body: TimeSeriesQuery, ): Promise>> { - const streamPointsIterator = await OntologiesV2.OntologyObjectsV2 - .streamPoints( + const allPoints: Array> = []; + + for await ( + const point of iterateTimeSeriesPoints( client, - await client.ontologyRid, objectApiName, primaryKey, propertyName, - { range: getTimeRange(body) }, - ); - - const allPoints: Array> = []; - - const reader = streamPointsIterator.stream().getReader(); - for await ( - const point of parseStreamedResponse(iterateReadableStream(reader)) + body, + ) ) { allPoints.push({ time: point.time, diff --git a/packages/client/src/object/convertWireToOsdkObjects/createOsdkInterface.ts b/packages/client/src/object/convertWireToOsdkObjects/createOsdkInterface.ts index 3759c476c..db71c5441 100644 --- a/packages/client/src/object/convertWireToOsdkObjects/createOsdkInterface.ts +++ b/packages/client/src/object/convertWireToOsdkObjects/createOsdkInterface.ts @@ -49,10 +49,6 @@ export function createOsdkInterface< [InterfaceDefRef]: interfaceDef, }; - if (process.env.TARGET !== "browser") { - Object.setPrototypeOf(interfaceHolder, null); - } - const handler = handlerCache.get(interfaceDef); const proxy = new Proxy>( diff --git a/packages/client/src/object/convertWireToOsdkObjects/createOsdkObject.ts b/packages/client/src/object/convertWireToOsdkObjects/createOsdkObject.ts index 0befa8abe..350d292c0 100644 --- a/packages/client/src/object/convertWireToOsdkObjects/createOsdkObject.ts +++ b/packages/client/src/object/convertWireToOsdkObjects/createOsdkObject.ts @@ -33,13 +33,12 @@ import type { ObjectHolder, ObjectHolderPrototypeOwnProps, } from "./ObjectHolder.js"; -import { OsdkCustomInspectPrototype } from "./OsdkCustomInspectPrototype.js"; import type { PropertyDescriptorRecord } from "./PropertyDescriptorRecord.js"; const objectPrototypeCache = createClientCache( function(client, objectDef: FetchedObjectTypeDefinition) { return Object.create( - process.env.target !== "browser" ? null : null, + null, { [ObjectDefRef]: { value: objectDef }, [ClientRef]: { value: client },