import type { Pool } from 'pg'; import type { Lookup, AddressRules, NamedRecord, PasswordCheck, StoredAddress, StoredAttribute, StoredCategory, StoredCustomer, StoredMetafield, StoredProduct, StoredRedirect, StoredVariantGroup } from '../services/ports/lookup.js'; import type { ImportEntity } from '../services/types.js'; /** * What decides a reserved `url_key` and does not live in the database: the * routes of the storefront (they are scanned from `route.json` files into the * router's memory) and the enabled languages (a setting with a merge rule of its * own). The composition root gives core's `getRoutes()` and * `getEnabledLanguages()`, so the rule stays in core and is not copied here. */ export interface ReservedKeySources { /** The paths of the routes that are not admin and not API, e.g. `/cart`. */ routePaths(): readonly string[]; /** The enabled locale codes, e.g. `en`. */ enabledLanguages(): Promise; } /** * The questions of the stages about the store (ยง 4.5, point 2), read-only and in * batches. It takes the pool as an argument, so a test can point it at a scratch * database. */ export declare class PgLookup implements Lookup { private readonly pool; private readonly reserved; constructor(pool: Pool, reserved: ReservedKeySources); categories(urlKeys: readonly string[]): Promise>; reservedUrlKeys(): Promise>; metafieldKeys(entity: ImportEntity): Promise>; metafields(entity: ImportEntity): Promise>; customers(emails: readonly string[]): Promise>; customerGroups(names: readonly string[]): Promise>; addressRules(): Promise; customerAddresses(customerIds: readonly number[]): Promise>; passwordCheck(): Promise; products(skus: readonly string[]): Promise>; productUrlKeyOwners(urlKeys: readonly string[]): Promise>; attributeGroups(names: readonly string[]): Promise>; packages(names: readonly string[]): Promise>; taxClasses(names: readonly string[]): Promise>; private named; defaultPackage(): Promise; attributeCodes(): Promise; attributes(codes: readonly string[]): Promise>; attributeGroupLinks(groupId: number): Promise<{ linked: ReadonlySet; required: StoredAttribute[]; }>; attributeOptions(attributeId: number, texts: readonly string[]): Promise>; variantGroups(ids: readonly number[]): Promise>; redirects(paths: readonly string[]): Promise>; rewritePaths(paths: readonly string[]): Promise>; }