@vulog/aima-event
Version:
```bash npm i @vulog/aima-client @vulog/aima-core @vulog/aima-event ```
216 lines (207 loc) • 11.2 kB
Markdown
```bash
npm i @vulog/aima-client @vulog/aima-core @vulog/aima-event
```
```javascript
import { getClient } from '@vulog/aima-client';
import { geteventbyType } from '@vulog/aima-event';
const client = getClient({
apiKey: '...',
baseUrl: '...',
clientId: '...',
clientSecret: '...',
fleetId: '...',
});
const response = await geteventbyType(client, 'USER_BOOKING_REQUEST');
```
The following event types are supported. Use these as the `type` argument for event queries:
| Event Type | Description |
|------------|-------------|
| USER_ACCOUNT_UPDATE | User account updated (tracks account status changes) |
| USER_CREATED | Generated at user account creation |
| USER_ARCHIVED | User account archived and private data wiped |
| USER_INACTIVE | User account deactivated |
| USER_DELETED | User account deleted and private data wiped |
| USER_RESET_PASSWORD | Password reset link generated for user |
| USER_ROLE_ADD | Role granted to user |
| USER_UNLOCK | User account unlocked |
| USER_ROLE_DEL | Role removed from user |
| USER_BOOKING_REQUEST | New booking request created by user |
| USER_UPDATE_BOOKING_REQUEST | Booking request updated by user |
| USER_DELETE_BOOKING_REQUEST | Booking request deleted by user |
| USER_CANCEL_BOOKING_REQUEST | Booking request canceled by user |
| USER_GET_ADMIN_TK | BLE admin token generated for user on vehicle |
| USER_PROMOCODE_REDEEM | User redeemed a promocode |
| USER_SYSTEM_CREDIT_ADD | System credit granted to user |
| USER_SYSTEM_CREDIT_CONSUMED | System credit consumed by user |
| USER_SYSTEM_CREDIT_REMOVED | System credit removed from user |
| USER_PRODUCT_CHARGED | Product charged to user |
| USER_TRIP_INVOICE_CREATED | Invoice for a trip generated |
| USER_TRIP_EXPENSE_CREATED | Expense for a trip created (business invoicing) |
| USER_TRIP_INVOICE_UPDATED | Invoice for a trip updated |
| USER_PRODUCT_INVOICE_CREATED | Invoice for a product created |
| USER_PRODUCT_EXPENSE_CREATED | Expense for a product created (business invoicing) |
| USER_PRODUCT_INVOICE_UPDATED | Invoice for a product updated |
| VEHICLE_ADDED_TO_STATION | Vehicle assigned to a booking station |
| VEHICLE_REMOVED_FROM_STATION | Vehicle removed from a booking station |
| VEHICLE_ALLOCATED | Vehicle allocated for a booking request |
| VEHICLE_TOWED | Vehicle detected as towed |
| VEHICLE_INTEGRATE_DEL | Box integration deleted after setup |
| VEHICLE_ARCHIVED | Vehicle archived and removed from fleet |
| VEHICLE_DELETE | Vehicle attribute deleted |
| VEHICLE_UPDATED | Vehicle attribute updated |
| VEHICLE_UPDATED_VUBOX | BoxId assigned to vehicle updated |
| VEHICLE_REMOVE_VUBOX | BoxId removed from vehicle |
| VEHICLE_ASSIGN_VUBOX | BoxId assigned to vehicle |
| VEHICLE_OUT_OF_SERVICE | Vehicle marked out of service |
| VEHICLE_SCHEDULED_OUT_OF_SERVICE | Vehicle scheduled out of service |
| VEHICLE_SCHEDULED_OUT_OF_SERVICE_CANCELED | Scheduled out of service canceled |
| VEHICLE_UNLOCK | Vehicle unlocked (API or BOX) |
| VEHICLE_LOCK | Vehicle locked (API or BOX) |
| VEHICLE_BATTERY_LOCK | Battery lock locked (micromobility) |
| VEHICLE_BATTERY_UNLOCK | Battery lock unlocked (micromobility) |
| VEHICLE_HELMET_LOCK | Helmet lock locked (micromobility) |
| VEHICLE_HELMET_UNLOCK | Helmet lock unlocked (micromobility) |
| VEHICLE_SPARE_LOCK | Spare/cable lock locked (micromobility) |
| VEHICLE_SPARE_UNLOCK | Spare/cable lock unlocked (micromobility) |
| VEHICLE_PILE_LOCK | Pile lock locked (micromobility) |
| VEHICLE_PILE_UNLOCK | Pile lock unlocked (micromobility) |
| VEHICLE_SPEED_LIMIT_CHANGED | Max speed setting changed |
| VEHICLE_WAKE_UP | Vehicle wake up (API or BOX) |
| VEHICLE_WAKE_UP_ACCEL | Vehicle awake by shock |
| VEHICLE_WAKE_UP_BLE | Vehicle awake by BLE command |
| VEHICLE_CONNECTIVITY_ONLINE | Vehicle awake and connected |
| VEHICLE_CONNECTIVITY_OFFLINE | Vehicle goes to sleep |
| VEHICLE_CONNECTIVITY_INTERRUPTED | Vehicle connectivity interrupted |
| VEHICLE_OUT_OF_COM | Vehicle connectivity lost |
| VEHICLE_BOOKING_STATUS_CHANGED | Booking request status changed |
| VEHICLE_GET_STATUS | Get status requested on vehicle |
| VEHICLE_SCHEDULED_REBOOT | Box rebooted after scheduled request |
| VEHICLE_WARNING | Warning raised by vehicle |
| VEHICLE_CRUISING_RANGE_LOW | Cruising range low |
| VEHICLE_CRUISING_RANGE_CRITICAL | Cruising range critical |
| VEHICLE_ACCEL_ALERT | Vehicle has fallen |
| VEHICLE_SPEED_ALERT | Vehicle speed above limit |
| VEHICLE_CKH_UPDATE | Key/card inserted/removed in holder |
| VEHICLE_RECOVERY | Recovery process initiated by box |
| VEHICLE_STANDBY | Vehicle in standby (see offline) |
| VEHICLE_AUTOCLOSE_ON | Auto close enabled |
| VEHICLE_AUTOCLOSE_OFF | Auto close disabled |
| VEHICLE_IGNITION_ON | Engine on |
| VEHICLE_IGNITION_OFF | Engine off |
| VEHICLE_REBOOT | Box rebooted |
| VEHICLE_MOBILIZE | Immobilizer disengaged |
| VEHICLE_IMMOBILIZE | Immobilizer engaged |
| VEHICLE_IMMOBILIZER_OOT | Immobilizer engaged out of trip |
| VEHICLE_ENABLE | Vehicle back in service |
| VEHICLE_MAGIC_CARD | Magic badge used on vehicle |
| VEHICLE_CLEANLINESS_RESET | Cleanliness countdown reset |
| VEHICLE_ADD_ZONE | Zone manually assigned to vehicle |
| VEHICLE_REMOVE_ZONE | Zone manually removed from vehicle |
| VEHICLE_RELEASE_TRIP | Trip released by operator |
| VEHICLE_START_TRIP | Trip started (API or BOX) |
| VEHICLE_END_TRIP | Trip ended (API or BOX) |
| VEHICLE_EDIT_TRIP | Trip modified |
| VEHICLE_MANUAL_END_TRIP | Trip manually ended (not implemented) |
| VEHICLE_TRACKING_ON | Location tracking enabled for trip |
| VEHICLE_TRACKING_OFF | Location tracking disabled for trip |
| VEHICLE_TRIP_TERMINATION | Trip ended by operator override |
| VEHICLE_PAUSE_TRIP | Trip paused (API or BOX) |
| VEHICLE_FORCED_PAUSE_TRIP | Trip paused due to inactivity |
| VEHICLE_RESUME_TRIP | Trip resumed (API or BOX) |
| VEHICLE_EXPERT | Expert command request on vehicle |
| VEHICLE_PASSTHROUGH | Deprecated passthrough event |
| VEHICLE_PING | Ping command to check box connectivity |
| VEHICLE_CANCEL_TRIP | Trip canceled |
| VEHICLE_REMOVE_PRODUCT_TRIP | Trip-related product removed |
| VEHICLE_BOOK | Beginning of trip |
| VEHICLE_ADD_PRODUCT_TRIP | Trip-related product added |
| VEHICLE_UPDATE_REASON | Out of service reason updated |
| VEHICLE_RESET_CLEAN_DATE | Cleanliness date reset |
| VEHICLE_RESET_REDISTRIB_DATE | Redistribution date reset |
| VEHICLE_RESET_MOVING_DATE | Moving date reset |
| VEHICLE_RESET_BOOKING_CONTEXT | Booking context reset manually |
| VEHICLE_ARCHIVED_FM | Vehicle archived in fleet manager |
| VEHICLE_CHARGING_ACTIVE | Vehicle charging (active) |
| VEHICLE_CHARGING_ENDED | Vehicle charging stopped |
| VEHICLE_CHARGING_PLUGGED | Charging cable plugged in |
| VEHICLE_CHARGING_UNPLUGGED | Charging cable unplugged |
| VEHICLE_BATTERY_OK | Auxiliary battery voltage normal |
| VEHICLE_BATTERY_LOW | Auxiliary battery voltage low |
| VEHICLE_BATTERY_CRITICAL | Auxiliary battery voltage critical |
| VEHICLE_DOORS_OPEN | Door opened |
| VEHICLE_DOORS_CLOSED | Door closed |
| VEHICLE_WINDOWS_OPEN | Window opened |
| VEHICLE_WINDOWS_CLOSED | Window closed |
| VEHICLE_ALERT | Vehicle alert (may generate ticket) |
| VEHICLE_FATAL | Critical vehicle alert (may put out of service) |
| VEHICLE_PRICING_CHANGED | Specific pricing applied to vehicle |
| VEHICLE_GROUP_CHANGED | Vehicle moved to a group |
| VEHICLE_UPDATE_ODOMETER | Odometer updated |
| VEHICLE_UPDATE_STATUS | Vehicle status updated |
| VEHICLE_UPDATE_GPS_MANUAL | Manual GPS update |
| VEHICLE_UPDATE_GPS_SIM | GPS update from SIM provider |
| VEHICLE_RFID_SYNC | Upload RFID list to box |
| VEHICLE_PREAUTH_CONFIRMED | Pre-authorization confirmed by bank |
| VEHICLE_PREAUTH_REJECTED | Pre-authorization rejected by bank |
| VEHICLE_PREAUTH_EXPIRED | Pre-authorization request expired |
| VEHICLE_PREAUTH_CANCELLED | Pre-authorization request canceled |
| USER_PRODUCT_INVOICE_CANCELLED | Product invoice canceled |
| USER_TRIP_INVOICE_CANCELLED | Trip invoice canceled |
| USER_PRODUCT_INVOICE_REFUSED | Product invoice refused |
| USER_TRIP_INVOICE_REFUSED | Trip invoice refused |
| USER_TRIP_INVOICE_PAID | Trip invoice paid |
| USER_PRODUCT_INVOICE_PAID | Product invoice paid |
| USER_TRIP_INVOICE_REFUNDED | Trip invoice refunded |
| USER_PRODUCT_INVOICE_REFUNDED | Product invoice refunded |
| USER_PLAN_SUBSCRIBED | Mobility plan subscribed |
| USER_PLAN_UNSUBSCRIBED | Mobility plan unsubscribed |
| USER_PLAN_EXPIRED | Mobility plan expired |
| USER_PLAN_RENEWED | Mobility plan renewed |
| USER_PLAN_RENEWAL | Mobility plan renewal attempted |
| USER_PLAN_CANCELED | Mobility plan canceled |
| USER_PLAN_UPDATED | Mobility plan updated |
| USER_PLAN_PERIODIC_TIME_WALLET_CHARGED | Periodic time wallet charged by plan |
| USER_PLAN_PERIODIC_TIME_WALLET_CONSUMED | Periodic time wallet consumed by plan |
| USER_REFERRAL_CREATED | User submitted a new report |
| USER_REFERRAL_CHECKED | User generated referral code |
| USER_REPORT_CREATED | User checked a friend's referral code |
| USER_REPORT_UPDATED | Existing report updated |
| USER_DOC_UPDATED | Document updated |
| USER_BILLING_GROUP_ADDED | User added to billing group |
| USER_BILLING_GROUP_REMOVED | User removed from billing group |
| VEHICLE_ADDED_TO_SERVICE | Vehicle added to service |
| VEHICLE_REMOVED_FROM_SERVICE | Vehicle removed from service |
| USER_RFIDPINCODE_REQUESTED | RFID pinCode requested to refuel vehicle |
| VEHICLE_REFILLED | Vehicle refilled |
| VEHICLE_DIAG_GPS | Vehicle GPS diagnostic |
| VEHICLE_DIAG_CAN | Vehicle CAN diagnostic |
| VEHICLE_DIAG_MOBILIZER | Vehicle mobilizer diagnostic |
| VEHICLE_DIAG_IMMOBILIZER | Vehicle immobilizer diagnostic |
| VEHICLE_DIAG_LOCK | Vehicle lock diagnostic |
| VEHICLE_DIAG_UNLOCK | Vehicle unlock diagnostic |
| VEHICLE_DIAG_ANALOG | Vehicle analog diagnostic |
| VEHICLE_DIAG_CKH | Vehicle ckh diagnostic |
| VEHICLE_DIAG_RFID | Vehicle RFID diagnostic |
| VEHICLE_DIAG_SPEAK | Vehicle speak diagnostic |
| VEHICLE_DIAG_HZ_LED | Vehicle home zone diagnostic |
| VEHICLE_BLE_AUTH | Invalid BLE token usage tracked |
| VEHICLE_BLE_START_FLOW | BLE token requested in start flow |
| VEHICLE_BLE_START_ISSUE | Issue during BLE token usage |
| VEHICLE_FIRMWARE_UPDATE | New firmware assigned to vehicle |
| USER_TRIP_EVENT_MAP_DISPLAY_GDPR | Hide trip user for GDPR compliance |
| USER_AUTOMATICALLY_REFUNDED | User automatically refunded |
| USER_TRIP_CREDIT_REFUNDED | Trip credit refunded |
| USER_PRODUCT_CREDIT_REFUNDED | Product credit refunded |
| USER_PRODUCT_TIME_WALLET_CHARGED | Product time wallet charged |
| USER_PRODUCT_TIME_WALLET_CONSUMED | Product time wallet consumed |
| USER_CREDIT_REFUNDED | User credit refunded |
| USER_ALL_CREDIT_REFUNDED | All user credit refunded |
| USER_PREPAYMENT_SUCCEEDED | Prepayment successful |
| USER_PREPAYMENT_FAILED | Prepayment failed |
| USER_CREATE_SUBSCRIPTION | New subscription created for user |
| USER_UPDATE_SUBSCRIPTION | Subscription updated for user |
| GRACE_PERIOD_APPLIED | Grace period applied to trip |
| USER_LABEL_CREATED | User label created |
| USER_LABEL_DELETED | User label deleted |