$opts { @type string[] $allowedHosts; @type int $userId }. * @return array{previewToken:string,status:string,statusMessage:string,extracted:array|null,contentType:string,finalUrl:string,httpStatus?:int} */ public function preview( string $url, array $opts = array() ): array; /** * Create a fixed URL source from a preview. * * @param string $token preview()'s token. * @param array $meta { @type string $name; @type string $scopeType; @type int $scopeId; @type int $staleAfterDays }. * @param int $userId Creating user. * @return array|false|null The new source row; null when there is no * matching, unexpired preview for this user; * false when the source itself could not be * saved (invalid input the caller already * validated should prevent, or a storage * failure) — never reported as an expired * preview. */ public function createFromPreview( string $token, array $meta, int $userId ); /** * Create a per-product URL field source. * * @param array $meta { @type string $name; @type string $urlField; @type string $scopeType; @type int $scopeId; @type int $staleAfterDays }. * @param int $userId Creating user. * @return array|null The new source row, or null on failure. */ public function createProductUrlSource( array $meta, int $userId ): ?array; /** * Read a fixed URL source's page again and store the outcome. * * @param int $sourceId Source id. * @return array|null The updated row, or null when there is no such fixed URL source. */ public function refresh( int $sourceId ): ?array; /** * Read a per-product URL field source's page for one product. * * @param int $sourceId Source id. * @param int $productId Product id. * @return array{status:string,statusMessage:string,extracted:array|null,url:string} */ public function checkProduct( int $sourceId, int $productId ): array; }