@bigbinary/neeto-playwright-commons 3.0.4 → 3.0.5
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/index.cjs.js +10 -1
- package/index.cjs.js.map +1 -1
- package/index.d.ts +3 -1
- package/index.js +10 -1
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -868,6 +868,7 @@ declare class RailsEmailApiClient {
|
|
|
868
868
|
listEmails: (searchParams?: RailsEmailSearchParams) => Promise<RailsEmail[]>;
|
|
869
869
|
getLatestEmail: (searchParams?: RailsEmailSearchParams) => Promise<RailsEmail | null>;
|
|
870
870
|
clearEmails: () => Promise<unknown>;
|
|
871
|
+
clearStaleEmails: (receivedBefore: string) => Promise<unknown>;
|
|
871
872
|
}
|
|
872
873
|
declare class RoleApis {
|
|
873
874
|
private neetoPlaywrightUtilities;
|
|
@@ -1201,7 +1202,8 @@ declare class RailsEmailUtils {
|
|
|
1201
1202
|
constructor(neetoPlaywrightUtilities: CustomCommands);
|
|
1202
1203
|
private convertRailsEmailToFormattedList;
|
|
1203
1204
|
clearEmails: () => Promise<unknown>;
|
|
1204
|
-
|
|
1205
|
+
clearStaleEmails: () => Promise<unknown>;
|
|
1206
|
+
getLatestEmail: (searchParams: RailsEmailSearchParams) => Promise<void>;
|
|
1205
1207
|
listEmails: (searchParams?: RailsEmailSearchParams) => Promise<RailsEmail[]>;
|
|
1206
1208
|
/**
|
|
1207
1209
|
*
|
package/index.js
CHANGED
|
@@ -393,6 +393,7 @@ class RailsEmailApiClient {
|
|
|
393
393
|
clearEmails = () => this.fetchJson(this.emailsEndpoint, {
|
|
394
394
|
method: "DELETE",
|
|
395
395
|
});
|
|
396
|
+
clearStaleEmails = (receivedBefore) => this.fetchJson(`${this.emailsEndpoint}?received_before=${encodeURIComponent(receivedBefore)}`, { method: "DELETE" });
|
|
396
397
|
}
|
|
397
398
|
|
|
398
399
|
class RoleApis {
|
|
@@ -60453,7 +60454,14 @@ class RailsEmailUtils {
|
|
|
60453
60454
|
};
|
|
60454
60455
|
};
|
|
60455
60456
|
clearEmails = () => this.railsEmailClient.clearEmails();
|
|
60456
|
-
|
|
60457
|
+
clearStaleEmails = () => {
|
|
60458
|
+
const tenMinutesAgo = new Date(Date.now() - 10 * 60 * 1000);
|
|
60459
|
+
return this.railsEmailClient.clearStaleEmails(tenMinutesAgo.toISOString());
|
|
60460
|
+
};
|
|
60461
|
+
getLatestEmail = async (searchParams) => {
|
|
60462
|
+
await this.clearStaleEmails();
|
|
60463
|
+
await this.railsEmailClient.getLatestEmail(searchParams);
|
|
60464
|
+
};
|
|
60457
60465
|
listEmails = (searchParams) => this.railsEmailClient.listEmails(searchParams);
|
|
60458
60466
|
listMessages = async (messageSearchCriteria = {}, { receivedAfter = new Date(new Date().valueOf() - 60 * 60 * 1000), } = {}) => {
|
|
60459
60467
|
const emails = await this.railsEmailClient.listEmails({
|
|
@@ -107383,6 +107391,7 @@ const commands = {
|
|
|
107383
107391
|
const mailerUtils = new MailerUtils(neetoPlaywrightUtilities);
|
|
107384
107392
|
await mailerUtils.fastmailApi.authorizeAndSetAccountId();
|
|
107385
107393
|
await use(mailerUtils);
|
|
107394
|
+
IS_DEV_ENV && (await mailerUtils.railsEmailUtils.clearStaleEmails());
|
|
107386
107395
|
},
|
|
107387
107396
|
colorPicker: async ({ page }, use) => {
|
|
107388
107397
|
const colorPicker = new ColorPickerUtils(page);
|