ChemPal Documentation - v1.18.0
    Preparing search index...

      ChemPal Documentation - v1.18.0

      Categories & Groups / Category

      Constants

      26 entries across 9 modules.

      constants/common4

      • SEARCH_ABORT_REASON

        Reasons the shared search AbortController gets aborted. Passed verbatim to controller.abort() so a terminal search event can name the cause from signal.reason instead of string-matching a free-form message.

      • SUPPLIER_OUTCOME

        How a single supplier's part of a search ended, shown in the results header.

      • PRODUCT_REFRESH_STATUS

        How refetching one specific product ended.

      • SupplierOutcome

        One supplier's result for the most recent search.

      countryData2

      • countryData

        Compact ISO 3166-1 alpha-2 country table: the English name and primary currency code for each country, and nothing else.

        It replaces the runtime country-list-js dependency, which carries provinces, capitals, phone codes and more (~140 kB) for the two fields ChemPal reads. The library is kept as a dev dependency purely so src/constants/__tests__/countryData.test.ts can fail if this table ever drifts from it. Regenerate by re-running the extraction described there.

      • COUNTRY_DATA

        [name, currency] per country, keyed by ISO 3166-1 alpha-2 code. currency is the ISO 4217 code of the country's primary currency (e.g. "EUR").

      constants/drawer5

      constants/hazards2

      • NFPA_COLORS

        Fill colours for the four quadrants of an NFPA 704 "fire diamond".

      • NIST_STRUCTURE_URL

        Base URL for NIST WebBook structure images; append Struct=C<CAS digits>&Type=Color.

      httpStatus2

      • httpStatus

        HTTP status codes the extension compares against or documents. Use these instead of bare numbers so a check like error.status === HttpStatus.FORBIDDEN explains itself.

        Deliberately a short list of the codes that matter when talking to supplier sites, not the full registry; add a member here when a new code is needed. It replaced the http-status-codes package, whose ~60-entry enum was bundled for the sake of one constant.

      • HttpStatus

        Common HTTP status codes, named in UPPER_SNAKE_CASE after their reason phrases.

      supplierMetaGenerated2

      • supplierMetaGenerated

        GENERATED FILE — DO NOT EDIT.

        Written by tools/generate-supplier-meta.js (pnpm run generate) from the static fields of the supplier classes, which remain the single source of truth. Change a supplier's name, country, shipping scope or shipsTo on its class and regenerate; src/suppliers/__tests__/supplierMeta.test.ts fails if this file drifts.

        Its reason to exist is bundle size: the UI needs supplier metadata at mount, and reading it off the classes would pull the whole supplier layer into the popup's startup bundle. See src/constants/supplierMeta.ts for the accessors.

      • SUPPLIER_META

        Display and shipping metadata for every live supplier, keyed by class name, in the order src/suppliers/index.ts exports them.

      constants/supplierMeta6

      constants/suppliers2

      helpers/supplierStats1

      • EXCESSIVE_RATIO

        Failure share at or above which a category counts as "excessive". Below this a supplier is treated as healthy — occasional failures are normal. Total failure (a ratio of 1) escalates to the critical status for that category.

        Exported so callers and tests can reference the threshold rather than duplicating the literal.