puppeteer-extra-plugin-timezone
Version:
A puppeteer-extra plugin to automatically emulate the appropriate timezones using IP reflection services.
37 lines • 1.28 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.TargetInfoSchema = exports.LumResponseSchema = void 0;
const zod_1 = require("zod");
/**
* Define the expected shape of the lumtest.com response.
* @type {z.ZodObject}
*/
exports.LumResponseSchema = zod_1.z.object({
ip: zod_1.z.string(),
country: zod_1.z.string().optional(),
asn: zod_1.z.any().optional(),
geo: zod_1.z.object({
city: zod_1.z.string().optional(),
region: zod_1.z.string().optional(),
region_name: zod_1.z.string().optional(),
postal_code: zod_1.z.string().optional(),
latitude: zod_1.z.number().optional(),
longitude: zod_1.z.number().optional(),
tz: zod_1.z.string()
})
});
/**
* Define the shape expected to be returned by CDP when querying target id.
* @see https://chromedevtools.github.io/devtools-protocol/tot/Target/#method-getTargetInfo
* @type {z.ZodObject}
*/
exports.TargetInfoSchema = zod_1.z.object({
targetInfo: zod_1.z
.object({
targetId: zod_1.z.string(),
type: zod_1.z.string().refine((type) => type === "browser"),
attached: zod_1.z.boolean().refine((attached) => attached)
})
.nonstrict()
});
//# sourceMappingURL=schemas.js.map
;