Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | 110x 110x 110x 110x 110x 110x 110x 55x 55x 44x 44x 7x | import { env } from 'fastly:env'
import { ConfigStore } from 'fastly:config-store'
import { SecretStore } from 'fastly:secret-store'
import { KVStore } from 'fastly:kv-store'
export function getNamesForStores() {
const serviceId = env('FASTLY_SERVICE_ID')
const storeNamePrefix = process.env.STORE_NAME_PREFIX
const configStoreName = `${storeNamePrefix}_Config_Store_${serviceId}`
const secretStoreName = `${storeNamePrefix}_Secret_Store_${serviceId}`
const resultsKvStoreName = `Fingerprint_Results_${serviceId}`
const eventsKvStoreName = `Fingerprint_Events_${serviceId}`
return {
configStoreName,
secretStoreName,
resultsKvStoreName,
eventsKvStoreName,
}
}
export function getConfigStore() {
const { configStoreName } = getNamesForStores()
return new ConfigStore(configStoreName)
}
export function getSecretStore() {
const { secretStoreName } = getNamesForStores()
return new SecretStore(secretStoreName)
}
export function getBuiltinKVStore(storeName: string) {
return new KVStore(storeName)
}
|