Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@applitools/ufg-client

Package Overview
Dependencies
Maintainers
33
Versions
99
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@applitools/ufg-client - npm Package Compare versions

Comparing version 1.0.9 to 1.0.10

dist/resources/fetch-resource.js

6

dist/client.js

@@ -32,5 +32,5 @@ "use strict";

const render_1 = require("./render");
const process_resources_1 = require("./process-resources");
const fetch_resource_1 = require("./fetch-resource");
const upload_resource_1 = require("./upload-resource");
const process_resources_1 = require("./resources/process-resources");
const fetch_resource_1 = require("./resources/fetch-resource");
const upload_resource_1 = require("./resources/upload-resource");
const utils = __importStar(require("@applitools/utils"));

@@ -37,0 +37,0 @@ exports.defaultResourceCache = new Map();

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.makeCreateRenderTarget = void 0;
const resource_1 = require("./resource");
const resource_dom_1 = require("./resource-dom");
const resource_vhs_1 = require("./resource-vhs");
const resource_1 = require("./resources/resource");
const resource_dom_1 = require("./resources/resource-dom");
const resource_vhs_1 = require("./resources/resource-vhs");
function makeCreateRenderTarget({ processResources }) {
return async function createRenderTarget({ snapshot, settings }) {
return async function createRenderTarget({ snapshot, settings, }) {
const isWeb = !!snapshot.cdt;

@@ -10,0 +10,0 @@ const processedSnapshotResources = await processSnapshotResources({ snapshot, settings });

@@ -17,3 +17,4 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./client"), exports);
__exportStar(require("./types"), exports);
__exportStar(require("./server/requests"), exports);
__exportStar(require("./client"), exports);

@@ -37,5 +37,5 @@ "use strict";

return renderWithConcurrency;
async function render({ request, signal }) {
async function render({ target, settings, signal }) {
const timedOutAt = Date.now() + timeout;
const render = await startRenderWithBatching(request);
const render = await startRenderWithBatching({ target, settings });
return checkRenderResultWithBatching({ render, signal, timedOutAt });

@@ -81,3 +81,3 @@ }

const [{ render, signal, timedOutAt }, { resolve, reject }] = batch[index];
if (result.status === 'error' || result.error) {
if (result.status === 'error') {
logger === null || logger === void 0 ? void 0 : logger.error(`Render with id "${render.renderId}" failed due to an error - ${result.error}`);

@@ -84,0 +84,0 @@ reject(new Error(`Render with id "${render.renderId}" failed due to an error - ${result.error}`));

{
"name": "@applitools/ufg-client",
"version": "1.0.9",
"version": "1.0.10",
"homepage": "https://applitools.com",

@@ -55,6 +55,5 @@ "bugs": {

"@applitools/jsdom": "1.0.4",
"@applitools/logger": "1.1.26",
"@applitools/req": "1.1.10",
"@applitools/types": "1.5.19",
"@applitools/utils": "1.3.12",
"@applitools/logger": "1.1.27",
"@applitools/req": "1.1.11",
"@applitools/utils": "1.3.13",
"abort-controller": "3.0.0",

@@ -66,3 +65,3 @@ "postcss-value-parser": "4.2.0",

"@applitools/bongo": "^2.2.0",
"@applitools/test-server": "^1.1.5",
"@applitools/test-server": "^1.1.6",
"@applitools/test-utils": "^1.5.2",

@@ -69,0 +68,0 @@ "@types/mocha": "^9.1.1",

@@ -0,6 +1,4 @@

import type { RenderSettings, BookedRenderer } from './types';
import { type Logger } from '@applitools/logger';
import { type UFGRequests, type RenderSettings, type BookedRenderer } from './server/requests';
export declare type BookRenderer = (options: {
settings: RenderSettings;
}) => Promise<BookedRenderer>;
import { type UFGRequests } from './server/requests';
export declare function makeBookRenderer({ requests, batchingTimeout, logger, }: {

@@ -10,2 +8,4 @@ requests: UFGRequests;

logger?: Logger;
}): BookRenderer;
}): ({ settings }: {
settings: RenderSettings;
}) => Promise<BookedRenderer>;

@@ -0,15 +1,4 @@

import type { UFGClient } from './types';
import { type Logger } from '@applitools/logger';
import { type UFGRequests, type UFGRequestsConfig } from './server/requests';
import { type CreateRenderTarget } from './create-render-target';
import { type BookRenderer } from './book-renderer';
import { type Render } from './render';
export interface UFGClient {
createRenderTarget: CreateRenderTarget;
bookRenderer: BookRenderer;
render: Render;
getChromeEmulationDevices: UFGRequests['getChromeEmulationDevices'];
getAndroidDevices: UFGRequests['getAndroidDevices'];
getIOSDevices: UFGRequests['getIOSDevices'];
getCachedResourceUrls(): string[];
}
import { type UFGRequestsConfig } from './server/requests';
export declare const defaultResourceCache: Map<string, any>;

@@ -16,0 +5,0 @@ export declare function makeUFGClient({ config, concurrency, cache, logger, }: {

@@ -1,18 +0,8 @@

import { type ProcessResources, type ProcessResourcesSettings } from './process-resources';
import { type HashedResource } from './resource';
export declare type RenderTarget = {
snapshot: HashedResource;
resources: Record<string, HashedResource | {
errorStatusCode: number;
}>;
source?: string;
vhsType?: string;
vhsCompatibilityParams?: Record<string, any>;
};
export declare type CreateRenderTarget = (options: {
import type { RenderTarget } from './types';
import { type ProcessResources, type ProcessResourcesSettings } from './resources/process-resources';
export declare function makeCreateRenderTarget({ processResources }: {
processResources: ProcessResources;
}): ({ snapshot, settings, }: {
snapshot: any;
settings?: ProcessResourcesSettings;
}) => Promise<RenderTarget>;
export declare function makeCreateRenderTarget({ processResources }: {
processResources: ProcessResources;
}): CreateRenderTarget;

@@ -1,5 +0,3 @@

export { type BookRenderer } from './book-renderer';
export { type CreateRenderTarget, type RenderTarget } from './create-render-target';
export { type Render } from './render';
export * from './client';
export * from './types';
export * from './server/requests';
export * from './client';

@@ -0,8 +1,5 @@

import type { RenderTarget, RenderSettings, RenderResult } from './types';
import { type Logger } from '@applitools/logger';
import { type AbortSignal } from 'abort-controller';
import { type UFGRequests, type RenderRequest, type RenderResult } from './server/requests';
export declare type Render = (options: {
request: RenderRequest;
signal?: AbortSignal;
}) => Promise<RenderResult>;
import { type UFGRequests } from './server/requests';
export declare function makeRender({ requests, concurrency, timeout, batchingTimeout, logger, }: {

@@ -14,2 +11,6 @@ requests: UFGRequests;

logger?: Logger;
}): Render;
}): ({ target, settings, signal }: {
target: RenderTarget;
settings: RenderSettings;
signal?: AbortSignal;
}) => Promise<RenderResult>;

@@ -1,4 +0,3 @@

import type { Proxy } from '@applitools/types';
import { type Logger } from '@applitools/logger';
import { type Req, type Options } from '@applitools/req';
import { type Req, type Options, type Proxy } from '@applitools/req';
export declare type ReqUFGConfig = {

@@ -5,0 +4,0 @@ serverUrl: string;

@@ -1,21 +0,5 @@

import type { AndroidDevice, ChromeEmulationDevice, IOSDevice, Region, Renderer, Selector } from '@applitools/types';
import type { Target as BaseTarget } from '@applitools/types/base';
import { type ContentfulResource } from '../resource';
import { type RenderTarget } from '../create-render-target';
import type { AndroidDevice, IOSDevice, ChromeEmulationDevice, RenderTarget, RenderSettings, RenderResult, BookedRenderer } from '../types';
import { type ContentfulResource } from '../resources/resource';
import { type Logger } from '@applitools/logger';
import { type ReqUFGConfig } from './req-ufg';
export declare type RenderSettings = {
type: 'web' | 'native';
renderer: Renderer;
rendererId?: string;
region?: Region | Selector;
fully?: boolean;
selectorsToCalculate?: Selector[];
includeFullPageSize?: boolean;
ufgOptions?: Record<string, any>;
hooks?: {
beforeCaptureScreenshot: string;
};
sendDom?: boolean;
};
export declare type RenderRequest = {

@@ -25,6 +9,2 @@ target: RenderTarget;

};
export declare type BookedRenderer = {
rendererId: string;
rawEnvironment: Record<string, any>;
};
export declare type StartedRender = {

@@ -35,8 +15,2 @@ jobId: string;

};
export declare type RenderResult = BaseTarget & {
renderId: string;
status: 'rendering' | 'rendered' | 'error';
selectorRegions?: Region[][];
error?: any;
};
export interface UFGRequests {

@@ -43,0 +17,0 @@ bookRenderers(options: {

@@ -1,2 +0,2 @@

import type { Cookie } from '@applitools/types';
import type { Cookie } from '../types';
export declare function createCookieHeader({ url, cookies }: {

@@ -3,0 +3,0 @@ url: string;

@@ -1,4 +0,4 @@

import type { Renderer } from '@applitools/types';
import type { Renderer } from '../types';
export declare function createUserAgentHeader({ renderer }: {
renderer: Renderer;
}): any;
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc