web_lib

Common web application libraries
git clone https://radroots.dev/git/web_lib.git
Log | Files | Refs | LICENSE

config.ts (2050B)


      1 import type { IdbClientConfig } from "@radroots/utils";
      2 
      3 export const RADROOTS_IDB_DATABASE = "radroots-pwa-v1";
      4 
      5 export const IDB_STORE_DATASTORE = "radroots.app.datastore";
      6 export const IDB_STORE_KEYSTORE = "radroots.security.keystore";
      7 export const IDB_STORE_KEYSTORE_NOSTR = "radroots.security.keystore.nostr";
      8 export const IDB_STORE_CRYPTO_REGISTRY = "radroots.security.crypto.registry";
      9 export const IDB_STORE_CIPHER_AES_GCM = "radroots.security.cipher.aes-gcm";
     10 export const IDB_STORE_CIPHER_SQL = "radroots.security.cipher.sql";
     11 export const IDB_STORE_REPLICA = "radroots.storage.replica.sql";
     12 export const IDB_STORE_CIPHER_SUFFIX = ".cipher";
     13 
     14 export const IDB_CONFIG_DATASTORE: IdbClientConfig = {
     15     database: RADROOTS_IDB_DATABASE,
     16     store: IDB_STORE_DATASTORE
     17 };
     18 
     19 export const IDB_CONFIG_KEYSTORE: IdbClientConfig = {
     20     database: RADROOTS_IDB_DATABASE,
     21     store: IDB_STORE_KEYSTORE
     22 };
     23 
     24 export const IDB_CONFIG_KEYSTORE_NOSTR: IdbClientConfig = {
     25     database: RADROOTS_IDB_DATABASE,
     26     store: IDB_STORE_KEYSTORE_NOSTR
     27 };
     28 
     29 export const IDB_CONFIG_CRYPTO_REGISTRY: IdbClientConfig = {
     30     database: RADROOTS_IDB_DATABASE,
     31     store: IDB_STORE_CRYPTO_REGISTRY
     32 };
     33 
     34 export const IDB_CONFIG_CIPHER_AES_GCM: IdbClientConfig = {
     35     database: RADROOTS_IDB_DATABASE,
     36     store: IDB_STORE_CIPHER_AES_GCM
     37 };
     38 
     39 export const IDB_CONFIG_CIPHER_SQL: IdbClientConfig = {
     40     database: RADROOTS_IDB_DATABASE,
     41     store: IDB_STORE_CIPHER_SQL
     42 };
     43 
     44 export const IDB_CONFIG_REPLICA: IdbClientConfig = {
     45     database: RADROOTS_IDB_DATABASE,
     46     store: IDB_STORE_REPLICA
     47 };
     48 
     49 export const RADROOTS_IDB_CONFIGS: IdbClientConfig[] = [
     50     IDB_CONFIG_DATASTORE,
     51     IDB_CONFIG_KEYSTORE,
     52     IDB_CONFIG_KEYSTORE_NOSTR,
     53     IDB_CONFIG_CRYPTO_REGISTRY,
     54     IDB_CONFIG_CIPHER_AES_GCM,
     55     IDB_CONFIG_CIPHER_SQL,
     56     IDB_CONFIG_REPLICA
     57 ];
     58 
     59 export const RADROOTS_IDB_STORES: string[] = [
     60     ...RADROOTS_IDB_CONFIGS.map((config) => config.store),
     61     `${IDB_STORE_KEYSTORE}${IDB_STORE_CIPHER_SUFFIX}`,
     62     `${IDB_STORE_KEYSTORE_NOSTR}${IDB_STORE_CIPHER_SUFFIX}`
     63 ];