| Server IP : 35.80.110.71 / Your IP : 216.73.216.221 Web Server : Apache/2.4.58 (Ubuntu) System : Linux ip-172-31-21-44 6.17.0-1019-aws #19~24.04.1-Ubuntu SMP Tue Jun 23 18:53:06 UTC 2026 x86_64 User : ubuntu ( 1000) PHP Version : 8.3.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/foyer-web/current/node_modules/@scalar/api-reference/dist/helpers/ |
Upload File : |
{"version":3,"file":"storage.js","names":[],"sources":["../../src/helpers/storage.ts"],"sourcesContent":["import { REFERENCE_LS_KEYS, safeLocalStorage } from '@scalar/helpers/object/local-storage'\nimport { type Auth, AuthSchema } from '@scalar/workspace-store/entities/auth'\nimport { coerceValue } from '@scalar/workspace-store/schemas/typebox-coerce'\n\n// Local storage helper instance, safely wrapped.\nconst storage = safeLocalStorage()\n\n/**\n * Provides an interface to store and retrieve the selected client value\n * in local storage.\n */\nexport const clientStorage = () => {\n const key = REFERENCE_LS_KEYS.SELECTED_CLIENT\n return {\n /**\n * Gets the stored selected client from local storage.\n */\n get: () => {\n return storage.getItem(key)\n },\n /**\n * Stores the selected client value in local storage.\n * @param value The value to store\n */\n set: (value: string) => {\n storage.setItem(key, value as string)\n },\n }\n}\n\n/**\n * Provides an interface to store and retrieve authentication scheme\n * information in local storage, including both the available schemes and\n * the user's selected schemes.\n */\nexport const authStorage = () => {\n const getKey = (slug: string) => {\n return `${REFERENCE_LS_KEYS.AUTH}-${slug}`\n }\n\n return {\n /**\n * Retrieves and coerces the authentication schemes stored in local storage.\n */\n getAuth: (slug: string) => {\n const parsed = JSON.parse(storage.getItem(getKey(slug)) ?? '{}')\n return coerceValue(AuthSchema, parsed)\n },\n /**\n * Stores the authentication schemes in local storage.\n * @param value The Auth object to stringify and store.\n */\n setAuth: (slug: string, value: Auth) => {\n storage.setItem(getKey(slug), JSON.stringify(value))\n },\n }\n}\n"],"mappings":";;;;AAKA,IAAM,UAAU,kBAAkB;;;;;AAMlC,IAAa,sBAAsB;CACjC,MAAM,MAAM,kBAAkB;AAC9B,QAAO;EAIL,WAAW;AACT,UAAO,QAAQ,QAAQ,IAAI;;EAM7B,MAAM,UAAkB;AACtB,WAAQ,QAAQ,KAAK,MAAgB;;EAExC;;;;;;;AAQH,IAAa,oBAAoB;CAC/B,MAAM,UAAU,SAAiB;AAC/B,SAAO,GAAG,kBAAkB,KAAK,GAAG;;AAGtC,QAAO;EAIL,UAAU,SAAiB;AAEzB,UAAO,YAAY,YADJ,KAAK,MAAM,QAAQ,QAAQ,OAAO,KAAK,CAAC,IAAI,KAAK,CAC1B;;EAMxC,UAAU,MAAc,UAAgB;AACtC,WAAQ,QAAQ,OAAO,KAAK,EAAE,KAAK,UAAU,MAAM,CAAC;;EAEvD"}