Skip to content

AIDC Toolkit / GS1 / RemoteGCPLengthCache

Abstract Class: RemoteGCPLengthCache ​

Defined in: src/gcp-length-cache.ts:14

GS1 Company Prefix length cache with remote source.

Extends ​

Properties ​

DEFAULT_BASE_URL ​

static DEFAULT_BASE_URL: string = "/data/"

Defined in: src/gcp-length-cache.ts:18

Default base URL pointing to AIDC Toolkit website data directory.


SOURCE_HEADER_FILE_NAME ​

static SOURCE_HEADER_FILE_NAME: string = "gcp-length-header.json"

Defined in: src/gcp-length-cache.ts:23

File containing header information (date/time and disclaimer).


SOURCE_DATA_FILE_NAME ​

static SOURCE_DATA_FILE_NAME: string = "gcp-length-data.bin"

Defined in: src/gcp-length-cache.ts:28

File containing tree data in binary form.

Constructors ​

Constructor ​

new RemoteGCPLengthCache(baseURL): RemoteGCPLengthCache

Defined in: src/gcp-length-cache.ts:47

Constructor.

Parameters ​

baseURL ​

string = RemoteGCPLengthCache.DEFAULT_BASE_URL

Base URL. The URL must end with a slash, and must host the SOURCE_HEADER_FILE_NAME and SOURCE_DATA_FILE_NAME files.

Returns ​

RemoteGCPLengthCache

Overrides ​

GCPLengthCache.constructor

Accessors ​

sourceDateTime ​

Get Signature ​

get sourceDateTime(): Promise<Date>

Defined in: src/gcp-length-cache.ts:86

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 ​

Promise<Date>

Overrides ​

GCPLengthCache.sourceDateTime


sourceData ​

Get Signature ​

get sourceData(): Promise<GCPLengthData>

Defined in: src/gcp-length-cache.ts:99

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 ​

Promise<GCPLengthData>

Overrides ​

GCPLengthCache.sourceData


nextCheckDateTime ​

Get Signature ​

get abstract nextCheckDateTime(): Promisable<Date | undefined>

Defined in: node_modules/@aidc-toolkit/core/dist/cache.d.ts:16

Get the date/time at or after which the source should be checked for updates. If the value is undefined, this is the first usage.

Returns ​

Promisable<Date | undefined>

Inherited from ​

GCPLengthCache.nextCheckDateTime


cacheDateTime ​

Get Signature ​

get abstract cacheDateTime(): Promisable<Date | undefined>

Defined in: node_modules/@aidc-toolkit/core/dist/cache.d.ts:21

Get the date/time at which the cache was last updated. This may more accurately reflect the date/time at which the last source retrieved was updated. If the value is undefined, there is no data in the cache.

Returns ​

Promisable<Date | undefined>

Inherited from ​

GCPLengthCache.cacheDateTime


cacheData ​

Get Signature ​

get abstract cacheData(): Promisable<TCache>

Defined in: node_modules/@aidc-toolkit/core/dist/cache.d.ts:25

Get the cache data. This should only ever be called if the cache date/time is defined.

Returns ​

Promisable<TCache>

Inherited from ​

GCPLengthCache.cacheData

Methods ​

update() ​

Call Signature ​

abstract update(nextCheckDateTime): Promisable<void>

Defined in: node_modules/@aidc-toolkit/core/dist/cache.d.ts:43

Update the cache with only the next check date/time. The cache date/time and cache data must not be modified. This is typically called when the cache is up to date with the source or source retrieval has failed.

Parameters ​
nextCheckDateTime ​

Date

Next check date/time.

Returns ​

Promisable<void>

Inherited from ​

GCPLengthCache.update

Call Signature ​

abstract update(nextCheckDateTime, cacheDateTime, cacheData): Promisable<void>

Defined in: node_modules/@aidc-toolkit/core/dist/cache.d.ts:56

Update all cache parameters. This is typically called when the cache is updated from the source.

Parameters ​
nextCheckDateTime ​

Date

Next check date/time.

cacheDateTime ​

Date

Cache date/time.

cacheData ​

GCPLengthData

Cache data.

Returns ​

Promisable<void>

Inherited from ​

GCPLengthCache.update