Skip to content

Commit

Permalink
review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ssanjay1 committed Jul 20, 2024
1 parent 22087a3 commit 18ead79
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 19 deletions.
2 changes: 0 additions & 2 deletions packages/client.api/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
* limitations under the License.
*/

import { TimeseriesDurationMapping } from "./timeseries/timeseries.js";

export type { ActionReturnTypeForOptions } from "./actions/ActionReturnTypeForOptions.js";
export type {
ActionEditResponse,
Expand Down
17 changes: 6 additions & 11 deletions packages/client/src/createTimeseriesProperty.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,21 +89,16 @@ async function getAllTimeSeriesPoints<T extends string | number>(
propertyName: string,
body: TimeSeriesQuery,
): Promise<Array<TimeSeriesPoint<T>>> {
const streamPointsIterator = await OntologiesV2.OntologyObjectsV2
.streamPoints(
const allPoints: Array<TimeSeriesPoint<T>> = [];

for await (
const point of iterateTimeSeriesPoints(
client,
await client.ontologyRid,
objectApiName,
primaryKey,
propertyName,
{ range: getTimeRange(body) },
);

const allPoints: Array<TimeSeriesPoint<T>> = [];

const reader = streamPointsIterator.stream().getReader();
for await (
const point of parseStreamedResponse(iterateReadableStream(reader))
body,
)
) {
allPoints.push({
time: point.time,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<OsdkObject<any>>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<any, any>) {
return Object.create(
process.env.target !== "browser" ? null : null,
null,
{
[ObjectDefRef]: { value: objectDef },
[ClientRef]: { value: client },
Expand Down

0 comments on commit 18ead79

Please sign in to comment.