evnex-sdk 1.0.5 → 1.0.6
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/index.d.ts +9 -0
- package/dist/index.js +172 -2
- package/dist/schema/v3/index.d.ts +5 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
1
|
export { Evnex } from "./api";
|
|
2
2
|
export { Evnex as default } from "./api";
|
|
3
3
|
export type { EvnexConfig, EvnexTokens } from "./api";
|
|
4
|
+
export * from "./schema/charge_points";
|
|
5
|
+
export * from "./schema/commands";
|
|
6
|
+
export * from "./schema/cost";
|
|
7
|
+
export * from "./schema/org";
|
|
8
|
+
export * from "./schema/user";
|
|
9
|
+
export * as V3 from "./schema/v3";
|
|
10
|
+
export * from "./models";
|
|
11
|
+
export * from "./errors";
|
|
12
|
+
export * from "./status";
|
package/dist/index.js
CHANGED
|
@@ -43904,7 +43904,7 @@ var package_default = {
|
|
|
43904
43904
|
author: "Ben Lawrence",
|
|
43905
43905
|
description: "A TypeScript library for interacting with the Evnex API",
|
|
43906
43906
|
license: "MIT",
|
|
43907
|
-
version: "1.0.
|
|
43907
|
+
version: "1.0.6",
|
|
43908
43908
|
type: "module",
|
|
43909
43909
|
main: "./dist/index.js",
|
|
43910
43910
|
types: "./dist/index.d.ts",
|
|
@@ -44182,7 +44182,177 @@ ${JSON.stringify(response.data)}`);
|
|
|
44182
44182
|
return data.data;
|
|
44183
44183
|
}
|
|
44184
44184
|
}
|
|
44185
|
+
// src/schema/charge_points.ts
|
|
44186
|
+
var ChargingLogic;
|
|
44187
|
+
((ChargingLogic2) => {
|
|
44188
|
+
ChargingLogic2["UNAVAILABLE"] = "Unavailable";
|
|
44189
|
+
ChargingLogic2["NOVEHICLE"] = "NoVehicle";
|
|
44190
|
+
ChargingLogic2["VEHICLE"] = "Vehicle";
|
|
44191
|
+
ChargingLogic2["TRANSFER"] = "Transfer";
|
|
44192
|
+
ChargingLogic2["FAULT"] = "Fault";
|
|
44193
|
+
})(ChargingLogic ||= {});
|
|
44194
|
+
var ChargingCurrentControl;
|
|
44195
|
+
((ChargingCurrentControl2) => {
|
|
44196
|
+
ChargingCurrentControl2["FULLPOWER"] = "FullPower";
|
|
44197
|
+
ChargingCurrentControl2["THERMALLIMITED"] = "ThermalLimited";
|
|
44198
|
+
ChargingCurrentControl2["LLMLIMITED"] = "LLMLimited";
|
|
44199
|
+
ChargingCurrentControl2["WAITINGSCHEDULE"] = "WaitingSchedule";
|
|
44200
|
+
ChargingCurrentControl2["WAITINGSOLAR"] = "WaitingSolar";
|
|
44201
|
+
ChargingCurrentControl2["SOLARCONTROL"] = "SolarControl";
|
|
44202
|
+
ChargingCurrentControl2["SCHEDULELIMITED"] = "ScheduleLimited";
|
|
44203
|
+
ChargingCurrentControl2["SUPPLYLIMITED"] = "SupplyLimited";
|
|
44204
|
+
})(ChargingCurrentControl ||= {});
|
|
44205
|
+
var E2LEDState;
|
|
44206
|
+
((E2LEDState2) => {
|
|
44207
|
+
E2LEDState2["OFF"] = "Off";
|
|
44208
|
+
E2LEDState2["IDLE"] = "Idle";
|
|
44209
|
+
E2LEDState2["CHARGING"] = "Charging";
|
|
44210
|
+
E2LEDState2["CHARGENOWCHARGING"] = "ChargeNowCharging";
|
|
44211
|
+
E2LEDState2["CHARGENOWNOTCHARGING"] = "ChargeNowNotCharging";
|
|
44212
|
+
E2LEDState2["FAULT"] = "Fault";
|
|
44213
|
+
E2LEDState2["DISABLED"] = "Disabled";
|
|
44214
|
+
E2LEDState2["WAITSCHEDULE"] = "WaitSchedule";
|
|
44215
|
+
E2LEDState2["WAITSOLAR"] = "WaitSolar";
|
|
44216
|
+
E2LEDState2["WAITVEHICLE"] = "WaitVehicle";
|
|
44217
|
+
E2LEDState2["SHUTTINGDOWN"] = "ShuttingDown";
|
|
44218
|
+
})(E2LEDState ||= {});
|
|
44219
|
+
var AntiSleepState;
|
|
44220
|
+
((AntiSleepState2) => {
|
|
44221
|
+
AntiSleepState2["DISABLED"] = "Disabled";
|
|
44222
|
+
AntiSleepState2["ENABLED"] = "Enabled";
|
|
44223
|
+
AntiSleepState2["ACTIVE"] = "Active";
|
|
44224
|
+
AntiSleepState2["NA"] = "NA";
|
|
44225
|
+
})(AntiSleepState ||= {});
|
|
44226
|
+
// src/schema/v3/index.ts
|
|
44227
|
+
var exports_v3 = {};
|
|
44228
|
+
// src/models.ts
|
|
44229
|
+
var DEFAULT_MODEL_INFO = {
|
|
44230
|
+
name: "Unknown",
|
|
44231
|
+
connector: "Unknown",
|
|
44232
|
+
cableLength: "Unknown",
|
|
44233
|
+
colour: "Unknown",
|
|
44234
|
+
power: "N/A",
|
|
44235
|
+
powerSensor: "N/A",
|
|
44236
|
+
configuration: "N/A"
|
|
44237
|
+
};
|
|
44238
|
+
var CONNECTOR_MAP = {
|
|
44239
|
+
"1": "Type 1",
|
|
44240
|
+
"2": "Type 2"
|
|
44241
|
+
};
|
|
44242
|
+
var NAME_MAP_E2 = {
|
|
44243
|
+
E2: "E2 Plus",
|
|
44244
|
+
E2C: "E2 Core"
|
|
44245
|
+
};
|
|
44246
|
+
var CABLE_MAP_E2 = {
|
|
44247
|
+
"5": "5 metres",
|
|
44248
|
+
"8": "8 metres"
|
|
44249
|
+
};
|
|
44250
|
+
var COLOUR_MAP = {
|
|
44251
|
+
SN: "Snow",
|
|
44252
|
+
ST: "Stone",
|
|
44253
|
+
SA: "Sand",
|
|
44254
|
+
VO: "Volcanic",
|
|
44255
|
+
W: "White",
|
|
44256
|
+
G: "Grey"
|
|
44257
|
+
};
|
|
44258
|
+
var POWER_MAP = {
|
|
44259
|
+
"7": "7 kW",
|
|
44260
|
+
"22": "22 kW"
|
|
44261
|
+
};
|
|
44262
|
+
var PS_MAP = {
|
|
44263
|
+
T: "External PS",
|
|
44264
|
+
P: "Onboard PS"
|
|
44265
|
+
};
|
|
44266
|
+
var CONFIG_MAP = {
|
|
44267
|
+
S: "Socket",
|
|
44268
|
+
T: "Tether"
|
|
44269
|
+
};
|
|
44270
|
+
function parseModel(modelId) {
|
|
44271
|
+
if (modelId.startsWith("E2")) {
|
|
44272
|
+
const dashIndex = modelId.indexOf("-");
|
|
44273
|
+
if (dashIndex === -1)
|
|
44274
|
+
return { ...DEFAULT_MODEL_INFO };
|
|
44275
|
+
const prefix = modelId.slice(0, dashIndex);
|
|
44276
|
+
const spec = modelId.slice(dashIndex + 1);
|
|
44277
|
+
return {
|
|
44278
|
+
name: NAME_MAP_E2[prefix] ?? prefix,
|
|
44279
|
+
connector: CONNECTOR_MAP[spec[0]] ?? spec[0],
|
|
44280
|
+
cableLength: CABLE_MAP_E2[spec[1]] ?? spec[1],
|
|
44281
|
+
colour: COLOUR_MAP[spec.slice(-2)] ?? spec.slice(-2),
|
|
44282
|
+
power: "N/A",
|
|
44283
|
+
powerSensor: "N/A",
|
|
44284
|
+
configuration: "N/A"
|
|
44285
|
+
};
|
|
44286
|
+
}
|
|
44287
|
+
if (modelId.startsWith("X")) {
|
|
44288
|
+
const parts = modelId.split("-", 3);
|
|
44289
|
+
if (parts.length < 3)
|
|
44290
|
+
return { ...DEFAULT_MODEL_INFO };
|
|
44291
|
+
const [series, spec, colourPart] = parts;
|
|
44292
|
+
const powerKey = series.slice(1);
|
|
44293
|
+
return {
|
|
44294
|
+
name: series,
|
|
44295
|
+
connector: CONNECTOR_MAP[spec[1]] ?? spec[1],
|
|
44296
|
+
cableLength: "N/A",
|
|
44297
|
+
colour: COLOUR_MAP[colourPart[0]] ?? colourPart[0],
|
|
44298
|
+
power: POWER_MAP[powerKey] ?? powerKey,
|
|
44299
|
+
powerSensor: PS_MAP[spec[0]] ?? spec[0],
|
|
44300
|
+
configuration: CONFIG_MAP[spec[2]] ?? spec[2]
|
|
44301
|
+
};
|
|
44302
|
+
}
|
|
44303
|
+
if (modelId.startsWith("E7")) {
|
|
44304
|
+
const parts = modelId.split("-", 3);
|
|
44305
|
+
if (parts.length < 3)
|
|
44306
|
+
return { ...DEFAULT_MODEL_INFO };
|
|
44307
|
+
const [series, spec, colourPart] = parts;
|
|
44308
|
+
return {
|
|
44309
|
+
name: series,
|
|
44310
|
+
connector: CONNECTOR_MAP[spec[1]] ?? spec[1],
|
|
44311
|
+
cableLength: "N/A",
|
|
44312
|
+
colour: COLOUR_MAP[colourPart[0]] ?? colourPart[0],
|
|
44313
|
+
power: "7",
|
|
44314
|
+
powerSensor: "N/A",
|
|
44315
|
+
configuration: CONFIG_MAP[spec[2]] ?? spec[2]
|
|
44316
|
+
};
|
|
44317
|
+
}
|
|
44318
|
+
return { ...DEFAULT_MODEL_INFO };
|
|
44319
|
+
}
|
|
44320
|
+
// src/status.ts
|
|
44321
|
+
var DeviceStatus;
|
|
44322
|
+
((DeviceStatus2) => {
|
|
44323
|
+
DeviceStatus2["OFFLINE"] = "OFFLINE";
|
|
44324
|
+
DeviceStatus2["AVAILABLE"] = "AVAILABLE";
|
|
44325
|
+
DeviceStatus2["PREPARING"] = "PREPARING";
|
|
44326
|
+
DeviceStatus2["CHARGING"] = "CHARGING";
|
|
44327
|
+
DeviceStatus2["SUSPENDED_EVSE"] = "SUSPENDED_EVSE";
|
|
44328
|
+
DeviceStatus2["SUSPENDED_EV"] = "SUSPENDED_EV";
|
|
44329
|
+
DeviceStatus2["FINISHING"] = "FINISHING";
|
|
44330
|
+
DeviceStatus2["RESERVED"] = "RESERVED";
|
|
44331
|
+
DeviceStatus2["UNAVAILABLE"] = "UNAVAILABLE";
|
|
44332
|
+
DeviceStatus2["FAULTED"] = "FAULTED";
|
|
44333
|
+
})(DeviceStatus ||= {});
|
|
44334
|
+
var ConnectorOcppStatus = {
|
|
44335
|
+
["AVAILABLE" /* AVAILABLE */]: "Available",
|
|
44336
|
+
["CHARGING" /* CHARGING */]: "Charging",
|
|
44337
|
+
["FAULTED" /* FAULTED */]: "Faulted",
|
|
44338
|
+
["FINISHING" /* FINISHING */]: "Finished Charging - unplug charghe point",
|
|
44339
|
+
["PREPARING" /* PREPARING */]: "Preparing to charge",
|
|
44340
|
+
["RESERVED" /* RESERVED */]: "Reserved",
|
|
44341
|
+
["SUSPENDED_EV" /* SUSPENDED_EV */]: "The vehicle is not currently requesting energy",
|
|
44342
|
+
["SUSPENDED_EVSE" /* SUSPENDED_EVSE */]: "Charging has been paused by the charge point",
|
|
44343
|
+
["UNAVAILABLE" /* UNAVAILABLE */]: "Disabled",
|
|
44344
|
+
["OFFLINE" /* OFFLINE */]: "Offline"
|
|
44345
|
+
};
|
|
44185
44346
|
export {
|
|
44347
|
+
parseModel,
|
|
44186
44348
|
Evnex as default,
|
|
44187
|
-
|
|
44349
|
+
exports_v3 as V3,
|
|
44350
|
+
NotAuthorizedException,
|
|
44351
|
+
Evnex,
|
|
44352
|
+
E2LEDState,
|
|
44353
|
+
DeviceStatus,
|
|
44354
|
+
ConnectorOcppStatus,
|
|
44355
|
+
ChargingLogic,
|
|
44356
|
+
ChargingCurrentControl,
|
|
44357
|
+
AntiSleepState
|
|
44188
44358
|
};
|
package/package.json
CHANGED