@dimo-network/data-sdk 1.3.3 → 1.5.1

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/dist/dimo.d.ts CHANGED
@@ -1,8 +1,9 @@
1
1
  /** @format */
2
2
  import { DimoEnvironment } from "./environments";
3
3
  import { Identity, Telemetry } from "./graphql/resources/DimoGraphqlResources";
4
- import { Attestation, Auth, DeviceDefinitions, Devices, TokenExchange, Trips, Valuations, VehicleEvents } from "./api/resources/DimoRestResources";
4
+ import { Agents, Attestation, Auth, DeviceDefinitions, Devices, TokenExchange, Trips, Valuations, VehicleTriggers } from "./api/resources/DimoRestResources";
5
5
  export declare class DIMO {
6
+ agents: Agents;
6
7
  attestation: Attestation;
7
8
  auth: Auth;
8
9
  devicedefinitions: DeviceDefinitions;
@@ -12,7 +13,7 @@ export declare class DIMO {
12
13
  tokenexchange: TokenExchange;
13
14
  trips: Trips;
14
15
  valuations: Valuations;
15
- vehicleEvents: VehicleEvents;
16
+ vehicleTriggers: VehicleTriggers;
16
17
  constructor(env: keyof typeof DimoEnvironment);
17
18
  authenticate(): Promise<any>;
18
19
  }
package/dist/dimo.js CHANGED
@@ -2,9 +2,10 @@
2
2
  import { DimoEnvironment } from "./environments";
3
3
  import { DimoError } from "./errors";
4
4
  import { Identity, Telemetry } from "./graphql/resources/DimoGraphqlResources";
5
- import { Attestation, Auth, DeviceDefinitions, Devices, TokenExchange, Trips, Valuations, VehicleEvents, } from "./api/resources/DimoRestResources";
5
+ import { Agents, Attestation, Auth, DeviceDefinitions, Devices, TokenExchange, Trips, Valuations, VehicleTriggers, } from "./api/resources/DimoRestResources";
6
6
  // import { Stream } from './streamr';
7
7
  export class DIMO {
8
+ agents;
8
9
  attestation;
9
10
  auth;
10
11
  devicedefinitions;
@@ -14,13 +15,14 @@ export class DIMO {
14
15
  tokenexchange;
15
16
  trips;
16
17
  valuations;
17
- vehicleEvents;
18
+ vehicleTriggers;
18
19
  constructor(env) {
19
20
  this.identity = new Identity(DimoEnvironment[env].Identity, env);
20
21
  this.telemetry = new Telemetry(DimoEnvironment[env].Telemetry, env);
21
22
  /**
22
23
  * Set up all REST Endpoints
23
24
  */
25
+ this.agents = new Agents(DimoEnvironment[env].Agents, env);
24
26
  this.attestation = new Attestation(DimoEnvironment[env].Attestation, env);
25
27
  this.auth = new Auth(DimoEnvironment[env].Auth, env);
26
28
  this.devicedefinitions = new DeviceDefinitions(DimoEnvironment[env].DeviceDefinitions, env);
@@ -28,7 +30,7 @@ export class DIMO {
28
30
  this.tokenexchange = new TokenExchange(DimoEnvironment[env].TokenExchange, env);
29
31
  this.trips = new Trips(DimoEnvironment[env].Trips, env);
30
32
  this.valuations = new Valuations(DimoEnvironment[env].Valuations, env);
31
- this.vehicleEvents = new VehicleEvents(DimoEnvironment[env].VehicleEvents, env);
33
+ this.vehicleTriggers = new VehicleTriggers(DimoEnvironment[env].VehicleTriggers, env);
32
34
  }
33
35
  // Helper Function
34
36
  async authenticate() {
package/dist/dimo.test.js CHANGED
@@ -5,6 +5,7 @@ const dimo = new DIMO(PROD);
5
5
  const devDimo = new DIMO(DEV);
6
6
  describe('Production Environment', () => {
7
7
  test('Production resources are initialized with the correct environment', () => {
8
+ expect(dimo.agents.env).toBe(PROD);
8
9
  expect(dimo.attestation.env).toBe(PROD);
9
10
  expect(dimo.auth.env).toBe(PROD);
10
11
  expect(dimo.devicedefinitions.env).toBe(PROD);
@@ -16,6 +17,7 @@ describe('Production Environment', () => {
16
17
  expect(dimo.valuations.env).toBe(PROD);
17
18
  });
18
19
  test('Production API endpoints are defined', () => {
20
+ expect(dimo.agents.api).toBeDefined;
19
21
  expect(dimo.attestation.api).toBeDefined;
20
22
  expect(dimo.auth.api).toBeDefined;
21
23
  expect(dimo.devicedefinitions.api).toBeDefined;
@@ -29,6 +31,7 @@ describe('Production Environment', () => {
29
31
  });
30
32
  describe('Dev Environment', () => {
31
33
  test('Dev resources are initialized with the correct environment', () => {
34
+ expect(devDimo.agents.env).toBe(DEV);
32
35
  expect(devDimo.attestation.env).toBe(DEV);
33
36
  expect(devDimo.auth.env).toBe(DEV);
34
37
  expect(devDimo.devicedefinitions.env).toBe(DEV);
@@ -40,6 +43,7 @@ describe('Dev Environment', () => {
40
43
  expect(devDimo.valuations.env).toBe(DEV);
41
44
  });
42
45
  test('Dev API endpoints are defined', () => {
46
+ expect(devDimo.agents.api).toBeDefined;
43
47
  expect(devDimo.attestation.api).toBeDefined;
44
48
  expect(devDimo.auth.api).toBeDefined;
45
49
  expect(devDimo.devicedefinitions.api).toBeDefined;
@@ -1,6 +1,7 @@
1
1
  /** @format */
2
2
  export declare const DimoEnvironment: {
3
3
  readonly Production: {
4
+ readonly Agents: "https://agents.dimo.zone";
4
5
  readonly Attestation: "https://attestation-api.dimo.zone";
5
6
  readonly Auth: "https://auth.dimo.zone";
6
7
  readonly Identity: "https://identity-api.dimo.zone/query";
@@ -11,9 +12,10 @@ export declare const DimoEnvironment: {
11
12
  readonly Trips: "https://trips-api.dimo.zone";
12
13
  readonly Valuations: "https://valuations-api.dimo.zone";
13
14
  readonly VehicleSignalDecoding: "https://vehicle-signal-decoding.dimo.zone";
14
- readonly VehicleEvents: "https://vehicle-events-api.dimo.zone";
15
+ readonly VehicleTriggers: "https://vehicle-triggers-api.dimo.zone";
15
16
  };
16
17
  readonly Dev: {
18
+ readonly Agents: "https://agents.dev.dimo.zone";
17
19
  readonly Attestation: "https://attestation-api.dev.dimo.zone";
18
20
  readonly Auth: "https://auth.dev.dimo.zone";
19
21
  readonly Identity: "https://identity-api.dev.dimo.zone/query";
@@ -24,7 +26,7 @@ export declare const DimoEnvironment: {
24
26
  readonly Trips: "https://trips-api.dev.dimo.zone";
25
27
  readonly Valuations: "https://valuations-api.dev.dimo.zone";
26
28
  readonly VehicleSignalDecoding: "https://vehicle-signal-decoding.dev.dimo.zone";
27
- readonly VehicleEvents: "https://vehicle-events-api.dev.dimo.zone";
29
+ readonly VehicleTriggers: "https://vehicle-triggers-api.dev.dimo.zone";
28
30
  };
29
31
  };
30
32
  export type DimoEnvironment = typeof DimoEnvironment.Production | typeof DimoEnvironment.Dev;
@@ -1,6 +1,7 @@
1
1
  /** @format */
2
2
  export const DimoEnvironment = {
3
3
  Production: {
4
+ Agents: 'https://agents.dimo.zone',
4
5
  Attestation: 'https://attestation-api.dimo.zone',
5
6
  Auth: 'https://auth.dimo.zone',
6
7
  Identity: 'https://identity-api.dimo.zone/query',
@@ -11,9 +12,10 @@ export const DimoEnvironment = {
11
12
  Trips: 'https://trips-api.dimo.zone',
12
13
  Valuations: 'https://valuations-api.dimo.zone',
13
14
  VehicleSignalDecoding: 'https://vehicle-signal-decoding.dimo.zone',
14
- VehicleEvents: 'https://vehicle-events-api.dimo.zone',
15
+ VehicleTriggers: 'https://vehicle-triggers-api.dimo.zone',
15
16
  },
16
17
  Dev: {
18
+ Agents: 'https://agents.dev.dimo.zone',
17
19
  Attestation: 'https://attestation-api.dev.dimo.zone',
18
20
  Auth: 'https://auth.dev.dimo.zone',
19
21
  Identity: 'https://identity-api.dev.dimo.zone/query',
@@ -24,6 +26,6 @@ export const DimoEnvironment = {
24
26
  Trips: 'https://trips-api.dev.dimo.zone',
25
27
  Valuations: 'https://valuations-api.dev.dimo.zone',
26
28
  VehicleSignalDecoding: 'https://vehicle-signal-decoding.dev.dimo.zone',
27
- VehicleEvents: 'https://vehicle-events-api.dev.dimo.zone',
29
+ VehicleTriggers: 'https://vehicle-triggers-api.dev.dimo.zone',
28
30
  },
29
31
  };