cognite-create 0.2.19 → 0.2.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cognite-create",
3
- "version": "0.2.19",
3
+ "version": "0.2.22",
4
4
  "description": "Create a Next.js app preconfigured with Cognite defaults.",
5
5
  "bin": {
6
6
  "cognite-create": "./bin/index.js"
@@ -8,6 +8,12 @@ Use the ShadCN MCP server to list the Cognite registry for components you can us
8
8
 
9
9
  Always use semantic Tailwind color classes (e.g., bg-primary, text-primary, border-primary) instead of arbitrary color values (e.g., bg-blue-600, text-red-500). This ensures consistency with the design system.
10
10
 
11
+ All CogniteSDK calls should be done server side or in server components.
12
+
13
+ We can't use the cognite sdk in the browser as the COGNITE_CLIENT_SECRET is private.
14
+
15
+ Prefer server actions over API routes.
16
+
11
17
  When setting up auth rememeber to set up the oidcTokenProvider.
12
18
 
13
19
  Use this function to get the token string:
@@ -35,3 +41,13 @@ export const getToken = async (clientId: string, clientSecret: string) => {
35
41
  Always run `pnpm lint` after you make changes to make sure you have fixed all potential errors.
36
42
 
37
43
  Make sure all client and server components are handled properly and you are not passing client events from server components.
44
+
45
+ Security Fix: Moved Cognite SDK authentication to server-side API routes (/api/cognite/*) to keep client secrets secure, with client-side service using fetch() calls to these routes.
46
+
47
+ Date Format Fix: Converted Date objects to Unix timestamps (milliseconds) before sending to Cognite API, as it doesn't accept ISO strings.
48
+
49
+ Granularity/Aggregates Fix: Ensured aggregates are always provided when granularity is specified (Cognite API requirement), defaulting to "average" aggregation.
50
+
51
+ Aggregated Data Display: Updated chart component to handle both regular datapoints (value) and aggregated datapoints (average, max, min, etc.) since granularity returns aggregated data.
52
+
53
+ UI Enhancement: Replaced search dialog with dropdown interface for time series selection, providing better UX with automatic loading and filtering of available time series.
@@ -4,5 +4,4 @@ NEXT_PUBLIC_COGNITE_BASE_URL=https://api.cognitedata.com
4
4
 
5
5
  # OIDC Authentication (Required for production)
6
6
  NEXT_PUBLIC_COGNITE_CLIENT_ID=your_client_id
7
- NEXT_PUBLIC_COGNITE_TENANT_ID=6a5949bb-8ea1-4bd1-aa0a-4d03846de30e
8
7
  COGNITE_CLIENT_SECRET=your_client_secret