AIDC Toolkit / GS1 / RemoteGCPLengthCache
Class: RemoteGCPLengthCache
Defined in: src/gcp-length-cache.ts:177
GS1 Company Prefix length cache with remote source. This class provides access to the data from a remote source, by default the AIDC Toolkit website. If any error occurs, the next check date/time is set to the current date/time plus ten minutes to prevent the network from being overloaded.
The data on the AIDC Toolkit website is updated regularly with the data provided by GS1, and it's stored in binary format for faster retrieval.
Extends
Properties
DEFAULT_BASE_URL
staticDEFAULT_BASE_URL:string
Defined in: src/gcp-length-cache.ts:181
Default base URL pointing to AIDC Toolkit website data directory.
APP_DATA_STORAGE_KEY
staticAPP_DATA_STORAGE_KEY:string="gcp-length"
Defined in: src/gcp-length-cache.ts:28
Storage key for full application data object.
Inherited from
GCPLengthCache.APP_DATA_STORAGE_KEY
NEXT_CHECK_DATE_TIME_STORAGE_KEY
staticNEXT_CHECK_DATE_TIME_STORAGE_KEY:string="gcp-length-next-check-date-time"
Defined in: src/gcp-length-cache.ts:33
Storage key for next check date/time.
Inherited from
GCPLengthCache.NEXT_CHECK_DATE_TIME_STORAGE_KEY
HEADER_STORAGE_KEY
staticHEADER_STORAGE_KEY:string="gcp-length-header"
Defined in: src/gcp-length-cache.ts:38
Storage key for header information (date/time and disclaimer).
Inherited from
GCPLengthCache.HEADER_STORAGE_KEY
DATA_STORAGE_KEY
staticDATA_STORAGE_KEY:string="gcp-length-data"
Defined in: src/gcp-length-cache.ts:43
Storage key for data only.
Inherited from
GCPLengthCache.DATA_STORAGE_KEY
Constructors
Constructor
new RemoteGCPLengthCache(
appDataStorage,baseURL,httpFetch):RemoteGCPLengthCache
Defined in: src/gcp-length-cache.ts:206
Constructor.
Parameters
appDataStorage
AppDataStorage<boolean>
Application data storage.
baseURL
string = RemoteGCPLengthCache.DEFAULT_BASE_URL
Base URL. The URL must not end with a slash and must host the gcp-length-header.json and gcp-length-data.bin files.
httpFetch
HTTPFetch = defaultHTTPFetch
HTTP fetch function.
Returns
RemoteGCPLengthCache
Overrides
Accessors
sourceDateTime
Get Signature
Defined in: src/gcp-length-cache.ts:251
Get the date/time at which the source was last updated. This should not be called unless the next check date/time has passed, as it may trigger an expensive remote retrieval.
Returns
Overrides
sourceData
Get Signature
get sourceData():
Promise<GCPLengthData>
Defined in: src/gcp-length-cache.ts:268
Get the source data. This should not be called unless the next check date/time has passed, as it may trigger an expensive remote retrieval.
Returns
Overrides
appDataStorage
Get Signature
get appDataStorage():
AppDataStorage<boolean>
Defined in: src/gcp-length-cache.ts:70
Get the application data storage.
Returns
AppDataStorage<boolean>
Inherited from
nextCheckDateTime
Get Signature
Defined in: src/gcp-length-cache.ts:120
Inherit Doc
Returns
Inherited from
GCPLengthCache.nextCheckDateTime
cacheDateTime
Get Signature
Defined in: src/gcp-length-cache.ts:127
Inherit Doc
Returns
Inherited from
cacheData
Get Signature
get cacheData():
Promise<GCPLengthData>
Defined in: src/gcp-length-cache.ts:134
Inherit Doc
Returns
Inherited from
Methods
update()
update(
nextCheckDateTime,_cacheDateTime?,cacheData?):Promise<void>
Defined in: src/gcp-length-cache.ts:148
Parameters
nextCheckDateTime
_cacheDateTime?
cacheData?
Returns
Promise<void>