0.0.21 • Published 2 years ago

cloud-sdk-capacitor-plugin v0.0.21

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

cloud-sdk-capacitor-plugin

PACE Cloud SDK is a Capacitor plugin to easily integrate PACE's Connected Fueling into your own apps.

Install

npm install cloud-sdk-capacitor-plugin
npx cap sync

API

setup(...)

setup(config: Configuration) => Promise<boolean>

Setup the plugin

ParamTypeDescription
configConfigurationis the configuration provided to this method

Returns: Promise<boolean>


respondToEvent(...)

respondToEvent(response: EventResponse) => Promise<boolean>

Method that can to be called whenever the client wants to communicate to the plugin in regards to a received event

ParamTypeDescription
responseEventResponseis the response to a given event

Returns: Promise<boolean>


getNearbyGasStations(...)

getNearbyGasStations(options: { coordinate: [number, number]; radius: number; }) => Promise<{ results: GasStation[]; }>

Returns a list of gasStations based on a given coordinate

ParamType
options{ coordinate: number, number; radius: number; }

Returns: Promise<{ results: GasStation[]; }>


isPoiInRange(...)

isPoiInRange(options: { poiId: string; coordinate: [number, number]; }) => Promise<{ result: boolean; }>

Check if there is a App for the given GasStation Id at the current location

ParamType
options{ poiId: string; coordinate: number, number; }

Returns: Promise<{ result: boolean; }>


startApp(...)

startApp(options: { url: string | PresetUrl; }) => Promise<boolean>

Start an App via a url

ParamType
options{ url: string; }

Returns: Promise<boolean>


startFuelingApp(...)

startFuelingApp(options: { poiId: string; }) => Promise<boolean>

Start an App for a given poiId

ParamType
options{ poiId: string; }

Returns: Promise<boolean>


addListener(string, ...)

addListener(eventName: string, listenerFunc: ListenerCallback) => PluginListenerHandle
ParamType
eventNamestring
listenerFuncListenerCallback

Returns: PluginListenerHandle


Interfaces

Configuration

PropTypeDescription
apiKeystringUse this property to provide the plugin with your PACE SDK API Key
authenticationModeAuthenticationModeIf you use native logins, then this should be set to 'AuthenticationMode.NATIVE'. Defaults to 'AuthenticationMode.WEB'
environmentEnvironmentSet your environment to 'Environment.STAGE' or 'Environment.SANDBOX' while developing or running tests. Defaults to 'Environment.PRODUCTION'

EventResponse

PropTypeDescription
idstringThe id must be the same as from the received event
namestringThe name must be the same as from the received event
valuestringIn case the value is an object, make sure to stringify it first

GasStation

PropTypeDescription
idstring
namestring
addressAddress
coordinatesnumber, numberA set of coordinates, as lng, lat
openingHoursOpeningHour[]The opening hours for the Gas Station
fuelPricesFuelPrice[]The available fuel prices
isConnectedFuelingAvailablebooleanIndicates if the gasStations supports Connected Fueling
lastUpdatedDate

Address

PropType
countryCodestring
citystring
zipCodestring
suburbstring
statestring
streetstring
houseNumberstring

OpeningHour

PropType
dayOpeningHourDay
hoursnumber, number

FuelPrice

PropType
fuelTypeFuelType
productNamestring
pricenumber
priceFormattingstring
unitFuelPriceUnit
currencyFuelCurrency
updatednumber

Date

Enables basic storage and retrieval of dates and times.

MethodSignatureDescription
toString() => stringReturns a string representation of a date. The format of the string depends on the locale.
toDateString() => stringReturns a date as a string value.
toTimeString() => stringReturns a time as a string value.
toLocaleString() => stringReturns a value as a string value appropriate to the host environment's current locale.
toLocaleDateString() => stringReturns a date as a string value appropriate to the host environment's current locale.
toLocaleTimeString() => stringReturns a time as a string value appropriate to the host environment's current locale.
valueOf() => numberReturns the stored time value in milliseconds since midnight, January 1, 1970 UTC.
getTime() => numberGets the time value in milliseconds.
getFullYear() => numberGets the year, using local time.
getUTCFullYear() => numberGets the year using Universal Coordinated Time (UTC).
getMonth() => numberGets the month, using local time.
getUTCMonth() => numberGets the month of a Date object using Universal Coordinated Time (UTC).
getDate() => numberGets the day-of-the-month, using local time.
getUTCDate() => numberGets the day-of-the-month, using Universal Coordinated Time (UTC).
getDay() => numberGets the day of the week, using local time.
getUTCDay() => numberGets the day of the week using Universal Coordinated Time (UTC).
getHours() => numberGets the hours in a date, using local time.
getUTCHours() => numberGets the hours value in a Date object using Universal Coordinated Time (UTC).
getMinutes() => numberGets the minutes of a Date object, using local time.
getUTCMinutes() => numberGets the minutes of a Date object using Universal Coordinated Time (UTC).
getSeconds() => numberGets the seconds of a Date object, using local time.
getUTCSeconds() => numberGets the seconds of a Date object using Universal Coordinated Time (UTC).
getMilliseconds() => numberGets the milliseconds of a Date, using local time.
getUTCMilliseconds() => numberGets the milliseconds of a Date object using Universal Coordinated Time (UTC).
getTimezoneOffset() => numberGets the difference in minutes between the time on the local computer and Universal Coordinated Time (UTC).
setTime(time: number) => numberSets the date and time value in the Date object.
setMilliseconds(ms: number) => numberSets the milliseconds value in the Date object using local time.
setUTCMilliseconds(ms: number) => numberSets the milliseconds value in the Date object using Universal Coordinated Time (UTC).
setSeconds(sec: number, ms?: number | undefined) => numberSets the seconds value in the Date object using local time.
setUTCSeconds(sec: number, ms?: number | undefined) => numberSets the seconds value in the Date object using Universal Coordinated Time (UTC).
setMinutes(min: number, sec?: number | undefined, ms?: number | undefined) => numberSets the minutes value in the Date object using local time.
setUTCMinutes(min: number, sec?: number | undefined, ms?: number | undefined) => numberSets the minutes value in the Date object using Universal Coordinated Time (UTC).
setHours(hours: number, min?: number | undefined, sec?: number | undefined, ms?: number | undefined) => numberSets the hour value in the Date object using local time.
setUTCHours(hours: number, min?: number | undefined, sec?: number | undefined, ms?: number | undefined) => numberSets the hours value in the Date object using Universal Coordinated Time (UTC).
setDate(date: number) => numberSets the numeric day-of-the-month value of the Date object using local time.
setUTCDate(date: number) => numberSets the numeric day of the month in the Date object using Universal Coordinated Time (UTC).
setMonth(month: number, date?: number | undefined) => numberSets the month value in the Date object using local time.
setUTCMonth(month: number, date?: number | undefined) => numberSets the month value in the Date object using Universal Coordinated Time (UTC).
setFullYear(year: number, month?: number | undefined, date?: number | undefined) => numberSets the year of the Date object using local time.
setUTCFullYear(year: number, month?: number | undefined, date?: number | undefined) => numberSets the year value in the Date object using Universal Coordinated Time (UTC).
toUTCString() => stringReturns a date converted to a string using Universal Coordinated Time (UTC).
toISOString() => stringReturns a date as a string value in ISO format.
toJSON(key?: any) => stringUsed by the JSON.stringify method to enable the transformation of an object's data for JavaScript Object Notation (JSON) serialization.

PluginListenerHandle

PropType
remove() => Promise<void>

Type Aliases

ListenerCallback

(err: any, ...args: any[]): void

Enums

AuthenticationMode

MembersValue
WEB'web'
NATIVE'native'

Environment

MembersValue
PRODUCTION'production'
DEVELOPMENT'development'
STAGE'stage'
SANDBOX'sandbox'

OpeningHourDay

MembersValue
MONDAY'monday'
TUESDAY'tuesday'
WEDNESDAY'wednesday'
THURSDAY'thursday'
FRIDAY'friday'
SATURDAY'saturday'
SUNDAY'sunday'

FuelType

MembersValue
RON98'ron98'
RON98E5'ron98e5'
RON95E10'ron95e10'
DIESEL'diesel'
E85'e85'
RON91'ron91'
RON95E5'ron95e5'
RON100'ron100'
DIESELGTL'dieselGtl'
DIESELB7'dieselB7'
DIESELPREMIUM'dieselPremium'
LPG'lpg'
CNG'cng'
LNG'lng'
H2'h2'
TRUCKDIESEL'truckDiesel'
ADBLUE'adBlue'
TRUCKADBLUE'truckAdBlue'
TRUCKDIESELPREMIUM'truckDieselPremium'
TRUCKLPG'truckLpg'
HEATINGOIL'heatingOil'

FuelPriceUnit

MembersValue
LITRE'L'

FuelCurrency

MembersValue
EUR'EUR'

PresetUrl

MembersValue
PACE_ID'paceID'
PAYMENT'payment'
TRANSACTIONS'transactions'
0.0.20

2 years ago

0.0.21

2 years ago

0.0.15

2 years ago

0.0.16

2 years ago

0.0.17

2 years ago

0.0.18

2 years ago

0.0.19

2 years ago

0.0.14

2 years ago

0.0.10

3 years ago

0.0.11

3 years ago

0.0.12

3 years ago

0.0.13

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago