Skip to content

timeZone Not Supported in syntheticQuery #1280

@ArbenPaloja

Description

@ArbenPaloja

Describe the bug
I am using the latest version of the Cognite SDK for JavaScript, but when I attempt to use the timeZone property in a syntheticQuery, I get a TypeScript error indicating that timeZone is not recognized. According to the documentation, timeZone is a valid property, but it is not working as expected in my case.

To Reproduce
Install the latest version of @cognite/sdk.
Attempt to make a syntheticQuery with the timeZone parameter.
Receive the TypeScript error TS2353 indicating that timeZone does not exist in type SyntheticQuery.

Expected behavior
The timeZone parameter should work as expected when passed in the syntheticQuery request, aligning the results to the specified time zone.

Actual Behavior: The TypeScript error TS2353 is thrown, indicating that the timeZone property does not exist in the SyntheticQuery type.

TSError: ⨯ Unable to compile TypeScript:
src/listBuildings.ts:128:7 - error TS2353: Object literal may only specify known properties, and 'timeZone' does not exist in type 'SyntheticQuery'.

128 timeZone: "Europe/Oslo",

Code Sample:

const items = [{ id: 1156214995486520 }];
const startAdjusted = new Date('2025-03-05T00:00:00Z');
const endAdjusted = new Date('2025-03-06T00:00:00Z');

const result = await client.timeseries.syntheticQuery([
{
expression: 24 * (${items .map((ts) => TS{id=${ts.id}, aggregate='average', granularity='1d'}) .join(" + ")}),
start: startAdjusted.toISOString(),
end: endAdjusted.toISOString(),
limit: 1000,
timeZone: "Europe/Oslo", // This causes the error
},
]);

SDK Version:

Version: @cognite/sdk version10.0.0 (latest)
TypeScript version: 5.8.2
Node.js version: 22.13.1

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions