Module: cpb-api/filestore

FileStore API

  • get - get bucket directory contents
  • list - list bucket directories
Source:

Methods

(async, static) get(bucketopt, nullable, id, shop_idopt, versionsopt, nullable, fetchopt, nullable, filesopt, nullable) → {Store}

Get and categorize the storage bucket files for the given filestore

Parameters:
Name Type Attributes Default Description
bucket string <optional>
<nullable>
process.env.BUCKET || 'custom-product-builder'

gce storage bucket

id string | number

filestore id

shop_id string | number <optional>
:id

filestore id

versions boolean <optional>
<nullable>
true

include file versions

fetch boolean <optional>
<nullable>
false

fetch new data and update index

files boolean <optional>
<nullable>
false

include files array to the output

Source:
Returns:
Type
Store

(async, static) list(bucketopt, fetchopt, versionsopt, filesopt, indexFileNameopt, legacyopt, miscopt) → {StoreList}

List all stores data in the given bucket.

If fetch flag is se - read file index.json if present. Otherwise generate new index file

Parameters:
Name Type Attributes Default Description
bucket string <optional>
${process.env.BUCKET}

gce bucket

fetch boolean <optional>
false

fetch new data if true or use existing
index if present

versions boolean <optional>
false

include file versions

files boolean <optional>
true

include array with files to the output

indexFileName string <optional>
'index.json'

index file name

legacy boolean <optional>
true

include array of the legacy shopify filestore dirs (ones with the name that
includes.myshopify in it )

misc boolean <optional>
true

include array of the uncategorized directories
(ones that are neither shopifyStoreIds nor the shopify filestore domains)

Source:
Throws:

NO_DATA_FOUND

Type
Error
Returns:
Type
StoreList