evnex-sdk 1.0.3 → 1.0.4

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
@@ -3,7 +3,7 @@
3
3
  "author": "Ben Lawrence",
4
4
  "description": "A TypeScript library for interacting with the Evnex API",
5
5
  "license": "MIT",
6
- "version": "1.0.3",
6
+ "version": "1.0.4",
7
7
  "type": "module",
8
8
  "main": "./dist/index.js",
9
9
  "types": "./dist/index.d.ts",
package/dist/api.d.ts DELETED
@@ -1,67 +0,0 @@
1
- import type { EvnexChargePoint, EvnexChargePointDetail, EvnexChargePointLoadSchedule, EvnexChargePointOverrideConfig, EvnexChargePointSolarConfig, EvnexChargeProfileSegment, EvnexChargePointTransaction, EvnexChargePointStatusResponse } from "./schema/charge_points";
2
- import type { EvnexCommandResponse } from "./schema/commands";
3
- import type { EvnexOrgInsightEntry, EvnexOrgSummaryStatus } from "./schema/org";
4
- import type { EvnexUserDetail } from "./schema/user";
5
- import type { EvnexChargePointDetail as EvnexChargePointDetailV3, EvnexChargePointSession } from "./schema/v3/charge_points";
6
- import type { EvnexV3APIResponse } from "./schema/v3/generic";
7
- export interface EvnexConfig {
8
- baseUrl?: string;
9
- cognitoUserPoolId?: string;
10
- cognitoClientId?: string;
11
- cognitoRegion?: string;
12
- orgId?: string;
13
- }
14
- export interface EvnexTokens {
15
- idToken: string;
16
- accessToken: string;
17
- refreshToken: string;
18
- }
19
- export declare class Evnex {
20
- private client;
21
- private tokens;
22
- private orgId?;
23
- private readonly username;
24
- private readonly password;
25
- private readonly clientId;
26
- private readonly cognito;
27
- constructor(username: string, password: string, tokens?: EvnexTokens, config?: EvnexConfig);
28
- /**
29
- * Authenticate with Cognito and populate tokens.
30
- * Call this after constructing if you don't have existing tokens.
31
- *
32
- * @throws NotAuthorizedException
33
- */
34
- authenticate(): Promise<void>;
35
- /**
36
- * Refresh tokens using the stored refresh token.
37
- *
38
- * @throws NotAuthorizedException
39
- */
40
- refreshTokens(): Promise<void>;
41
- get accessToken(): string;
42
- get idToken(): string;
43
- get refreshToken(): string;
44
- private get commonHeaders();
45
- private checkApiResponse;
46
- getUserDetail(): Promise<EvnexUserDetail>;
47
- getOrgChargePoints(orgId?: string): Promise<EvnexChargePoint[]>;
48
- getOrgInsight(days: number, orgId?: string, tzOffset?: number): Promise<EvnexOrgInsightEntry[]>;
49
- getOrgSummaryStatus(orgId?: string): Promise<EvnexOrgSummaryStatus>;
50
- /** @deprecated Use getChargePointDetailV3 */
51
- getChargePointDetail(chargePointId: string): Promise<EvnexChargePointDetail>;
52
- getChargePointDetailV3(chargePointId: string): Promise<EvnexV3APIResponse<EvnexChargePointDetailV3>>;
53
- getChargePointSolarConfig(chargePointId: string): Promise<EvnexChargePointSolarConfig>;
54
- getChargePointOverride(chargePointId: string): Promise<EvnexChargePointOverrideConfig>;
55
- setChargePointOverride(chargePointId: string, chargeNow: boolean, connectorId?: number): Promise<true>;
56
- getChargePointStatus(chargePointId: string): Promise<EvnexChargePointStatusResponse>;
57
- /** @deprecated Use getChargePointSessions */
58
- getChargePointTransactions(chargePointId: string): Promise<EvnexChargePointTransaction[]>;
59
- getChargePointSessions(chargePointId: string): Promise<EvnexChargePointSession[]>;
60
- stopChargePoint(chargePointId: string, orgId?: string, connectorId?: string, timeout?: number): Promise<EvnexCommandResponse>;
61
- enableCharger(orgId: string, chargePointId: string, connectorId?: number | string): Promise<EvnexCommandResponse>;
62
- disableCharger(orgId: string, chargePointId: string, connectorId?: number | string): Promise<EvnexCommandResponse>;
63
- setChargerAvailability(orgId: string, chargePointId: string, available?: boolean, connectorId?: number | string, timeout?: number): Promise<EvnexCommandResponse>;
64
- unlockCharger(chargePointId: string, available?: boolean, connectorId?: string, timeout?: number): Promise<EvnexCommandResponse>;
65
- setChargerLoadProfile(chargePointId: string, chargingProfilePeriods: EvnexChargeProfileSegment[], enabled?: boolean, duration?: number, units?: string, timeout?: number): Promise<EvnexChargePointLoadSchedule>;
66
- setChargePointSchedule(chargePointId: string, chargingProfilePeriods: EvnexChargeProfileSegment[], enabled?: boolean, duration?: number, timeout?: number): Promise<EvnexChargePointLoadSchedule>;
67
- }
package/dist/errors.d.ts DELETED
@@ -1,3 +0,0 @@
1
- export declare class NotAuthorizedException extends Error {
2
- constructor(message?: string);
3
- }
package/dist/index.d.ts DELETED
@@ -1,3 +0,0 @@
1
- export { Evnex } from "./api";
2
- export { Evnex as default } from "./api";
3
- export type { EvnexConfig, EvnexTokens } from "./api";