@empiricalrun/playwright-utils 0.54.0 → 0.56.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/dist/api-worker-client.d.ts +38 -0
- package/dist/api-worker-client.d.ts.map +1 -0
- package/dist/api-worker-client.js +110 -0
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/captcha/index.d.ts.map +1 -1
- package/dist/captcha/index.js +14 -12
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +7 -1
- package/dist/email.d.ts.map +1 -1
- package/dist/email.js +2 -4
- package/dist/generated/api-worker-openapi.d.ts +23994 -0
- package/dist/generated/api-worker-openapi.d.ts.map +1 -0
- package/dist/generated/api-worker-openapi.js +6 -0
- package/dist/inbox-client.d.ts +3 -2
- package/dist/inbox-client.d.ts.map +1 -1
- package/dist/inbox-client.js +12 -4
- package/dist/kv.d.ts.map +1 -1
- package/dist/kv.js +4 -21
- package/dist/mailosaur-client.d.ts +2 -2
- package/dist/mailosaur-client.d.ts.map +1 -1
- package/dist/mailosaur-client.js +4 -3
- package/dist/reporter/attachment-cleanup-test-reporter.d.ts.map +1 -1
- package/dist/reporter/attachment-cleanup.d.ts.map +1 -1
- package/dist/reporter/empirical-reporter.d.ts +3 -1
- package/dist/reporter/empirical-reporter.d.ts.map +1 -1
- package/dist/reporter/empirical-reporter.js +7 -0
- package/dist/reporter/incremental-blob-reporter.d.ts.map +1 -1
- package/dist/reporter/test-case-sync-reporter.d.ts.map +1 -1
- package/dist/reporter/uploader.d.ts.map +1 -1
- package/dist/reporter/uploader.js +7 -1
- package/dist/reporter/util.d.ts.map +1 -1
- package/dist/test/index.d.ts.map +1 -1
- package/dist/test/scripts/pw-locator-patch/dismiss-overlays/index.d.ts.map +1 -1
- package/dist/webhook.d.ts.map +1 -1
- package/dist/webhook.js +16 -29
- package/package.json +10 -7
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/types.d.ts +0 -7
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @empiricalrun/playwright-utils
|
|
2
2
|
|
|
3
|
+
## 0.56.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 10f0931: feat: client-side maxFailure config informs server-side behavior
|
|
8
|
+
|
|
9
|
+
## 0.55.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- 91798e6: feat: use OpenAPI based api client
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- @empiricalrun/cua@0.4.1
|
|
18
|
+
- @empiricalrun/llm@0.27.0
|
|
19
|
+
- @empiricalrun/reporter@0.29.1
|
|
20
|
+
|
|
3
21
|
## 0.54.0
|
|
4
22
|
|
|
5
23
|
### Minor Changes
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type Client } from "openapi-fetch";
|
|
2
|
+
import type { components, paths } from "./generated/api-worker-openapi";
|
|
3
|
+
type OpenApiWorkerClient = Client<paths>;
|
|
4
|
+
type ProviderProxyPath = "/api/inbox/proxy" | "/api/mailosaur/proxy" | "/api/webhook-site/proxy";
|
|
5
|
+
export type ProviderProxyRequest = components["schemas"]["PlaywrightUtilsProxyRequest"];
|
|
6
|
+
export type ProviderProxyResponse = components["schemas"]["PlaywrightUtilsProxyResponse"];
|
|
7
|
+
export type TwoCaptchaProxyRequest = components["schemas"]["TwoCaptchaProxyRequest"];
|
|
8
|
+
export type TwoCaptchaProxyResponse = components["schemas"]["TwoCaptchaProxyResponse"];
|
|
9
|
+
export type ProjectKvGetResponse = components["schemas"]["ProjectKvGetResponse"];
|
|
10
|
+
export type ProjectKvSetRequest = NonNullable<paths["/api/projects/kv"]["post"]["requestBody"]>["content"]["application/json"];
|
|
11
|
+
export type ProjectKvSetResponse = components["schemas"]["ProjectKvSetResponse"];
|
|
12
|
+
export declare class HTTPError extends Error {
|
|
13
|
+
status: number;
|
|
14
|
+
constructor(message: string, status: number);
|
|
15
|
+
}
|
|
16
|
+
export declare class NonRetryableHTTPError extends HTTPError {
|
|
17
|
+
}
|
|
18
|
+
export declare class RetryableHTTPError extends HTTPError {
|
|
19
|
+
}
|
|
20
|
+
export declare class ApiWorkerClient {
|
|
21
|
+
private baseUrl;
|
|
22
|
+
readonly client: OpenApiWorkerClient;
|
|
23
|
+
constructor({ projectApiKey, baseUrl, }?: {
|
|
24
|
+
projectApiKey?: string;
|
|
25
|
+
baseUrl?: string;
|
|
26
|
+
});
|
|
27
|
+
getBaseUrl(): string;
|
|
28
|
+
getProjectKv(key: string): Promise<ProjectKvGetResponse>;
|
|
29
|
+
setProjectKv(body: ProjectKvSetRequest): Promise<ProjectKvSetResponse>;
|
|
30
|
+
postProviderProxy(path: ProviderProxyPath, body: ProviderProxyRequest): Promise<ProviderProxyResponse>;
|
|
31
|
+
unwrap<T>(result: {
|
|
32
|
+
data?: unknown;
|
|
33
|
+
error?: unknown;
|
|
34
|
+
response: Response;
|
|
35
|
+
}, label: string): T;
|
|
36
|
+
}
|
|
37
|
+
export {};
|
|
38
|
+
//# sourceMappingURL=api-worker-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-worker-client.d.ts","sourceRoot":"","sources":["../src/api-worker-client.ts"],"names":[],"mappings":"AACA,OAAqB,EAAE,KAAK,MAAM,EAAE,MAAM,eAAe,CAAC;AAE1D,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AAExE,KAAK,mBAAmB,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;AAEzC,KAAK,iBAAiB,GAClB,kBAAkB,GAClB,sBAAsB,GACtB,yBAAyB,CAAC;AAE9B,MAAM,MAAM,oBAAoB,GAC9B,UAAU,CAAC,SAAS,CAAC,CAAC,6BAA6B,CAAC,CAAC;AACvD,MAAM,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,IAAI,EAAE,oBAAoB,GACzB,OAAO,CAAC,qBAAqB,CAAC,CAKhC;IAED,MAAM,CAAC,CAAC,EACN,MAAM,EAAE;QACN,IAAI,CAAC,EAAE,OAAO,CAAC;QACf,KAAK,CAAC,EAAE,OAAO,CAAC;QAChB,QAAQ,EAAE,QAAQ,CAAC;KACpB,EACD,KAAK,EAAE,MAAM,GACZ,CAAC,CAUH;CACF"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ApiWorkerClient = exports.RetryableHTTPError = exports.NonRetryableHTTPError = exports.HTTPError = void 0;
|
|
7
|
+
const async_retry_1 = __importDefault(require("async-retry"));
|
|
8
|
+
const openapi_fetch_1 = __importDefault(require("openapi-fetch"));
|
|
9
|
+
class HTTPError extends Error {
|
|
10
|
+
status;
|
|
11
|
+
constructor(message, status) {
|
|
12
|
+
super(message);
|
|
13
|
+
this.status = status;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.HTTPError = HTTPError;
|
|
17
|
+
class NonRetryableHTTPError extends HTTPError {
|
|
18
|
+
}
|
|
19
|
+
exports.NonRetryableHTTPError = NonRetryableHTTPError;
|
|
20
|
+
class RetryableHTTPError extends HTTPError {
|
|
21
|
+
}
|
|
22
|
+
exports.RetryableHTTPError = RetryableHTTPError;
|
|
23
|
+
function describeRequest(input, init) {
|
|
24
|
+
const method = init?.method || (input instanceof Request ? input.method : "GET");
|
|
25
|
+
const url = input instanceof Request ? input.url : input.toString();
|
|
26
|
+
return { method, url };
|
|
27
|
+
}
|
|
28
|
+
async function fetchWithRetry(input, init) {
|
|
29
|
+
return (0, async_retry_1.default)(async (bail) => {
|
|
30
|
+
const response = await fetch(input, init);
|
|
31
|
+
if (!response.ok) {
|
|
32
|
+
const { method, url } = describeRequest(input, init);
|
|
33
|
+
const message = `HTTP error in ${method} request to ${url}! Status code: ${response.status}.`;
|
|
34
|
+
if (response.status < 500) {
|
|
35
|
+
bail(new NonRetryableHTTPError(message, response.status));
|
|
36
|
+
return response;
|
|
37
|
+
}
|
|
38
|
+
throw new RetryableHTTPError(message, response.status);
|
|
39
|
+
}
|
|
40
|
+
return response;
|
|
41
|
+
}, {
|
|
42
|
+
retries: 3,
|
|
43
|
+
factor: 2,
|
|
44
|
+
minTimeout: 1_000,
|
|
45
|
+
maxTimeout: 5_000,
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
function formatError(error) {
|
|
49
|
+
if (error == null) {
|
|
50
|
+
return "";
|
|
51
|
+
}
|
|
52
|
+
if (typeof error === "string") {
|
|
53
|
+
return error;
|
|
54
|
+
}
|
|
55
|
+
try {
|
|
56
|
+
return JSON.stringify(error);
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
return String(error);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
class ApiWorkerClient {
|
|
63
|
+
baseUrl;
|
|
64
|
+
client;
|
|
65
|
+
constructor({ projectApiKey, baseUrl, } = {}) {
|
|
66
|
+
this.baseUrl =
|
|
67
|
+
baseUrl || process.env.DASHBOARD_DOMAIN || "https://api.empirical.run";
|
|
68
|
+
const apiKey = projectApiKey || process.env.EMPIRICALRUN_API_KEY;
|
|
69
|
+
if (!apiKey) {
|
|
70
|
+
throw new Error("EMPIRICALRUN_API_KEY environment variable is required");
|
|
71
|
+
}
|
|
72
|
+
this.client = (0, openapi_fetch_1.default)({
|
|
73
|
+
baseUrl: this.baseUrl,
|
|
74
|
+
fetch: fetchWithRetry,
|
|
75
|
+
headers: {
|
|
76
|
+
Authorization: `Bearer ${apiKey}`,
|
|
77
|
+
"User-Agent": "@empiricalrun/playwright-utils",
|
|
78
|
+
},
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
getBaseUrl() {
|
|
82
|
+
return this.baseUrl;
|
|
83
|
+
}
|
|
84
|
+
async getProjectKv(key) {
|
|
85
|
+
const result = await this.client.GET("/api/projects/kv", {
|
|
86
|
+
params: { query: { key } },
|
|
87
|
+
});
|
|
88
|
+
return this.unwrap(result, "GET /api/projects/kv");
|
|
89
|
+
}
|
|
90
|
+
async setProjectKv(body) {
|
|
91
|
+
const result = await this.client.POST("/api/projects/kv", {
|
|
92
|
+
body,
|
|
93
|
+
});
|
|
94
|
+
return this.unwrap(result, "POST /api/projects/kv");
|
|
95
|
+
}
|
|
96
|
+
async postProviderProxy(path, body) {
|
|
97
|
+
const result = await this.client.POST(path, {
|
|
98
|
+
body,
|
|
99
|
+
});
|
|
100
|
+
return this.unwrap(result, `POST ${path}`);
|
|
101
|
+
}
|
|
102
|
+
unwrap(result, label) {
|
|
103
|
+
if (result.data !== undefined) {
|
|
104
|
+
return result.data;
|
|
105
|
+
}
|
|
106
|
+
const message = formatError(result.error);
|
|
107
|
+
throw new NonRetryableHTTPError(`HTTP error in ${label}! Status code: ${result.response.status}.${message ? ` Response: ${message}` : ""}`, result.response.status);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
exports.ApiWorkerClient = ApiWorkerClient;
|
package/dist/auth/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAI5D,KAAK,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtC,KAAK,OAAO,GAAG,SAAS,GAAG,kBAAkB,CAAC;AAE9C,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,QAAQ,GAAG,cAAc,CAAC;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd,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;QACD,IAAI,EAAE,IAAI,CAAC;QACX,WAAW,EAAE,CAAC,CAAC;QACf,SAAS,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;QACzD,iBAAiB,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;QACpE,OAAO,CAAC,EAAE,OAAO,CAAC;KACnB,EAMA;IAEK,eAAe,kBAEpB;IAEK,YAAY,IAAI,OAAO,CAAC,IAAI,GAAG,SAAS,CAAC,CAgC9C;IAED,MAAM,CAAC,qBAAqB,CAC1B,WAAW,EAAE;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,EAC5B,KAAK,EAAE,WAAW,GACjB,MAAM,GAAG,SAAS,CAuBpB;YAEa,qBAAqB;YAuCrB,aAAa;IA6B3B,MAAM,CAAC,QAAQ,CAAC,WAAW,EAAE;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM,CAEpD;IAED,OAAa,eAAe,CAC1B,OAAO,EAAE,cAAc,EACvB,WAAW,EAAE,OAAO,CAAC,GAAG,CAAC,iBAmB1B;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/captcha/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/captcha/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAsI7C,wBAAsB,cAAc,CAAC,IAAI,EAAE,IAAI,iBAU9C"}
|
package/dist/captcha/index.js
CHANGED
|
@@ -4,8 +4,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.solveRecaptcha = solveRecaptcha;
|
|
7
|
-
const dashboard_client_1 = require("@empiricalrun/dashboard-client");
|
|
8
7
|
const puppeteer_extra_plugin_recaptcha_1 = __importDefault(require("puppeteer-extra-plugin-recaptcha"));
|
|
8
|
+
const api_worker_client_1 = require("../api-worker-client");
|
|
9
9
|
const POLLING_INTERVAL = 10_000;
|
|
10
10
|
const MAX_POLLING_TIME = 300_000;
|
|
11
11
|
function buildTask(captcha) {
|
|
@@ -31,9 +31,7 @@ function assertNoError(result) {
|
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
async function solveViaProxy(captchas) {
|
|
34
|
-
const apiClient = new
|
|
35
|
-
authType: "project-api-key",
|
|
36
|
-
});
|
|
34
|
+
const apiClient = new api_worker_client_1.ApiWorkerClient();
|
|
37
35
|
const solutions = await Promise.all(captchas.map((captcha) => solveSingleViaProxy(apiClient, captcha)));
|
|
38
36
|
return { solutions, error: solutions.find((s) => !!s.error) };
|
|
39
37
|
}
|
|
@@ -48,10 +46,12 @@ async function solveSingleViaProxy(apiClient, captcha) {
|
|
|
48
46
|
}
|
|
49
47
|
solution.id = captcha.id;
|
|
50
48
|
solution.requestAt = new Date();
|
|
51
|
-
const createResult = await apiClient.
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
49
|
+
const createResult = apiClient.unwrap(await apiClient.client.POST("/api/twocaptcha/proxy", {
|
|
50
|
+
body: {
|
|
51
|
+
endpoint: "/createTask",
|
|
52
|
+
body: { task: buildTask(captcha) },
|
|
53
|
+
},
|
|
54
|
+
}), "POST /api/twocaptcha/proxy");
|
|
55
55
|
assertNoError(createResult);
|
|
56
56
|
if (!createResult.taskId) {
|
|
57
57
|
throw new Error("2captcha error: no taskId returned");
|
|
@@ -60,10 +60,12 @@ async function solveSingleViaProxy(apiClient, captcha) {
|
|
|
60
60
|
const startTime = Date.now();
|
|
61
61
|
while (Date.now() - startTime < MAX_POLLING_TIME) {
|
|
62
62
|
await new Promise((resolve) => setTimeout(resolve, POLLING_INTERVAL));
|
|
63
|
-
const result = await apiClient.
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
const result = apiClient.unwrap(await apiClient.client.POST("/api/twocaptcha/proxy", {
|
|
64
|
+
body: {
|
|
65
|
+
endpoint: "/getTaskResult",
|
|
66
|
+
body: { taskId },
|
|
67
|
+
},
|
|
68
|
+
}), "POST /api/twocaptcha/proxy");
|
|
67
69
|
assertNoError(result);
|
|
68
70
|
if (result.status === "ready" && result.solution) {
|
|
69
71
|
const token = result.solution.gRecaptchaResponse || result.solution.token;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAE7D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAgBzD,wBAAgB,gBAAgB,IAAI,MAAM,CAazC;AAqCD,eAAO,MAAM,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAE7D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAgBzD,wBAAgB,gBAAgB,IAAI,MAAM,CAazC;AAqCD,eAAO,MAAM,UAAU,EAAE,oBA+BxB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,iBAarB,CAAC"}
|
package/dist/config/index.js
CHANGED
|
@@ -79,7 +79,13 @@ exports.baseConfig = {
|
|
|
79
79
|
retries: process.env.CI ? 2 : 0,
|
|
80
80
|
// Let playwright choose max workers based on size of infra
|
|
81
81
|
workers: undefined,
|
|
82
|
-
//
|
|
82
|
+
// Since Playwright 1.48, a test counts toward maxFailures only after all its
|
|
83
|
+
// retries are exhausted, so this is 30 definitively-failed tests (see
|
|
84
|
+
// https://github.com/microsoft/playwright/issues/26350). The reporter sends
|
|
85
|
+
// the resolved value on run-end events so the server-side early-end
|
|
86
|
+
// (api-worker cancelTestRunIfMaxFailuresReached) enforces the same cap
|
|
87
|
+
// run-wide across shards. Matches DEFAULT_MAX_FAILURES_PER_RUN in
|
|
88
|
+
// shared-types, the server's fallback for events without the field.
|
|
83
89
|
maxFailures: process.env.CI ? 30 : undefined,
|
|
84
90
|
timeout: 15 * 60 * 1_000,
|
|
85
91
|
expect: {
|
package/dist/email.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"email.d.ts","sourceRoot":"","sources":["../src/email.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"email.d.ts","sourceRoot":"","sources":["../src/email.ts"],"names":[],"mappings":"AACA,OAAO,EAAe,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EAAmB,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAE1E,MAAM,MAAM,KAAK,GAAG,cAAc,GAAG,UAAU,CAAC;AAEhD,KAAK,WAAW,GAAG;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAMF,KAAK,aAAa,GAAG,OAAO,GAAG,WAAW,CAAC;AAM3C,KAAK,kBAAkB,GAAG;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,aAAa,CAAC;CAC1B,CAAC;AAEF,qBAAa,WAAW;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,MAAM,CAAsB;IAEpC,YAAY,IAAI,GAAE,kBAAuB,EA2BxC;IAED,UAAU,IAAI,MAAM,CAEnB;IAEK,YAAY,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,KAAK,CAAC,CAEvD;CACF"}
|
package/dist/email.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.EmailClient = void 0;
|
|
4
|
-
const
|
|
4
|
+
const api_worker_client_1 = require("./api-worker-client");
|
|
5
5
|
const inbox_client_1 = require("./inbox-client");
|
|
6
6
|
const mailosaur_client_1 = require("./mailosaur-client");
|
|
7
7
|
const DEFAULT_TIMEOUT = 30_000;
|
|
@@ -15,9 +15,7 @@ class EmailClient {
|
|
|
15
15
|
const { timeout = DEFAULT_TIMEOUT, emailId: knownEmailId } = opts;
|
|
16
16
|
this.timeout = timeout;
|
|
17
17
|
const provider = opts.provider || "mailosaur";
|
|
18
|
-
const apiClient = new
|
|
19
|
-
authType: "project-api-key",
|
|
20
|
-
});
|
|
18
|
+
const apiClient = new api_worker_client_1.ApiWorkerClient();
|
|
21
19
|
const emailId = knownEmailId ||
|
|
22
20
|
[...Array(7)].map(() => Math.random().toString(36)[2]).join("");
|
|
23
21
|
if (provider === "inbox") {
|