@bigbinary/neeto-playwright-commons 3.0.5 → 3.0.6
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 +32 -17
- package/index.cjs.js.map +1 -1
- package/index.d.ts +53 -48
- package/index.js +32 -17
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -783,53 +783,6 @@ declare class MemberApis {
|
|
|
783
783
|
update: (memberId: string, body: Record<string, unknown>) => Promise<playwright_core.APIResponse | undefined>;
|
|
784
784
|
bulkUpdate: (body: Record<string, unknown>) => Promise<playwright_core.APIResponse | undefined>;
|
|
785
785
|
}
|
|
786
|
-
type EmailDeliveryProvider = "gmail" | "outlook";
|
|
787
|
-
interface EmailDeliveryConnectParams {
|
|
788
|
-
emailProvider: EmailDeliveryProvider;
|
|
789
|
-
refreshToken: string;
|
|
790
|
-
ownerId?: string;
|
|
791
|
-
}
|
|
792
|
-
interface EmailDeliveryVerifyEmailParams {
|
|
793
|
-
emailProvider: EmailDeliveryProvider;
|
|
794
|
-
subject: string;
|
|
795
|
-
to: string;
|
|
796
|
-
from: string;
|
|
797
|
-
body?: string;
|
|
798
|
-
ownerId?: string;
|
|
799
|
-
}
|
|
800
|
-
interface EmailDeliveryVerifiedEmail {
|
|
801
|
-
subject: string;
|
|
802
|
-
from: string;
|
|
803
|
-
to: string;
|
|
804
|
-
date: string;
|
|
805
|
-
body: string;
|
|
806
|
-
}
|
|
807
|
-
interface EmailDeliveryVerifyEmailResponse {
|
|
808
|
-
exists: boolean;
|
|
809
|
-
email?: EmailDeliveryVerifiedEmail;
|
|
810
|
-
}
|
|
811
|
-
declare class NeetoEmailDeliveryApi {
|
|
812
|
-
private neetoPlaywrightUtilities;
|
|
813
|
-
constructor(neetoPlaywrightUtilities: CustomCommands);
|
|
814
|
-
/**
|
|
815
|
-
*
|
|
816
|
-
* Connects an integration. It takes the following parameters:
|
|
817
|
-
*
|
|
818
|
-
* skipGoTo: Boolean indicating whether to skip navigating to integration index (default: false).
|
|
819
|
-
*
|
|
820
|
-
* @example
|
|
821
|
-
*
|
|
822
|
-
* await integrationBase.connect();
|
|
823
|
-
* // OR
|
|
824
|
-
* await integrationBase.connect(true);
|
|
825
|
-
* @endexample
|
|
826
|
-
*/
|
|
827
|
-
connect: ({
|
|
828
|
-
ownerId,
|
|
829
|
-
...payload
|
|
830
|
-
}: EmailDeliveryConnectParams) => Promise<playwright_core.APIResponse | undefined>;
|
|
831
|
-
verifyEmail: (params: EmailDeliveryVerifyEmailParams) => Promise<playwright_core.APIResponse | undefined>;
|
|
832
|
-
}
|
|
833
786
|
type EmailAddress = string | string[];
|
|
834
787
|
interface RailsEmailAttachment {
|
|
835
788
|
name: string;
|
|
@@ -8974,6 +8927,58 @@ declare class NeetoAuthServer {
|
|
|
8974
8927
|
start: () => Promise<void>;
|
|
8975
8928
|
stop: () => Promise<void>;
|
|
8976
8929
|
}
|
|
8930
|
+
type EmailDeliveryProvider = "gmail" | "outlook" | "sparkpost";
|
|
8931
|
+
type OAuthEmailDeliveryProvider = Exclude<EmailDeliveryProvider, "sparkpost">;
|
|
8932
|
+
type EmailDeliveryConnectParams = {
|
|
8933
|
+
emailProvider: OAuthEmailDeliveryProvider;
|
|
8934
|
+
refreshToken: string;
|
|
8935
|
+
ownerId?: string;
|
|
8936
|
+
} | {
|
|
8937
|
+
emailProvider: "sparkpost";
|
|
8938
|
+
email: string;
|
|
8939
|
+
ownerId?: string;
|
|
8940
|
+
};
|
|
8941
|
+
interface EmailDeliveryVerifyEmailParams {
|
|
8942
|
+
emailProvider: EmailDeliveryProvider;
|
|
8943
|
+
subject: string;
|
|
8944
|
+
to: string;
|
|
8945
|
+
from: string;
|
|
8946
|
+
body?: string;
|
|
8947
|
+
ownerId?: string;
|
|
8948
|
+
}
|
|
8949
|
+
interface EmailDeliveryVerifiedEmail {
|
|
8950
|
+
subject: string;
|
|
8951
|
+
from: string;
|
|
8952
|
+
to: string;
|
|
8953
|
+
date: string;
|
|
8954
|
+
body: string | null;
|
|
8955
|
+
}
|
|
8956
|
+
interface EmailDeliveryVerifyEmailResponse {
|
|
8957
|
+
exists: boolean;
|
|
8958
|
+
email?: EmailDeliveryVerifiedEmail;
|
|
8959
|
+
}
|
|
8960
|
+
declare class NeetoEmailDeliveryApi {
|
|
8961
|
+
private neetoPlaywrightUtilities;
|
|
8962
|
+
constructor(neetoPlaywrightUtilities: CustomCommands);
|
|
8963
|
+
/**
|
|
8964
|
+
*
|
|
8965
|
+
* Connects an integration. It takes the following parameters:
|
|
8966
|
+
*
|
|
8967
|
+
* skipGoTo: Boolean indicating whether to skip navigating to integration index (default: false).
|
|
8968
|
+
*
|
|
8969
|
+
* @example
|
|
8970
|
+
*
|
|
8971
|
+
* await integrationBase.connect();
|
|
8972
|
+
* // OR
|
|
8973
|
+
* await integrationBase.connect(true);
|
|
8974
|
+
* @endexample
|
|
8975
|
+
*/
|
|
8976
|
+
connect: ({
|
|
8977
|
+
ownerId,
|
|
8978
|
+
...payload
|
|
8979
|
+
}: EmailDeliveryConnectParams) => Promise<playwright_core.APIResponse | undefined>;
|
|
8980
|
+
verifyEmail: (params: EmailDeliveryVerifyEmailParams) => Promise<playwright_core.APIResponse | undefined>;
|
|
8981
|
+
}
|
|
8977
8982
|
interface ConnectRequestParams {
|
|
8978
8983
|
provider: EmailDeliveryProvider;
|
|
8979
8984
|
ownerId?: string;
|
|
@@ -9057,4 +9062,4 @@ interface Overrides {
|
|
|
9057
9062
|
*/
|
|
9058
9063
|
declare const definePlaywrightConfig: (overrides: Overrides) => PlaywrightTestConfig<{}, {}>;
|
|
9059
9064
|
export { ACTIONS, ADMIN_PANEL_SELECTORS, ANALYTICS_RESOURCES, API_KEYS_SELECTORS, API_ROUTES, APP_RESOURCES, AUDIT_LOGS_SELECTORS, ApiKeysApi, ApiKeysPage, AuditLogsPage, BASE_URL, CALENDAR_LABELS, CERTIFICATE_LIMIT_EXCEEDED_MESSAGE, CERTIFICATE_LIMIT_EXCEEDED_REGEXP, CHANGELOG_WIDGET_SELECTORS, CHAT_WIDGET_SELECTORS, CHAT_WIDGET_TEXTS, COLOR, COMMON_SELECTORS, COMMON_TEXTS, COMMUNITY_TEXTS, CREDENTIALS, CURRENT_TIME_RANGES, CUSTOM_DOMAIN_SELECTORS, CUSTOM_DOMAIN_SUFFIX, CustomCommands, CustomDomainApi, CustomDomainPage, DATE_FORMATS, DATE_PICKER_SELECTORS, DATE_RANGES, DATE_TEXTS, DEFAULT_WEBHOOKS_RESPONSE_TEXT, DESCRIPTION_EDITOR_TEXTS, EMBED_SELECTORS, EMOJI_LABEL, EMPTY_STORAGE_STATE, ENGAGE_TEXTS, ENVIRONMENT, EXAMPLE_URL, EXPANDED_FONT_SIZE, EXPORT_FILE_TYPES, EditorPage, EmailDeliveryUtils, EmbedBase, FILE_FORMATS, FONTS_RESOURCES, FONT_SIZE_SELECTORS, FROM_EMAIL_ENV_KEYS, GLOBAL_TRANSLATIONS_PATTERN, GOOGLE_ANALYTICS_SELECTORS, GOOGLE_CALENDAR_DATE_FORMAT, GOOGLE_LOGIN_SELECTORS, GOOGLE_LOGIN_TEXTS, GOOGLE_SHEETS_SELECTORS, GooglePage, HELP_CENTER_ROUTES, HELP_CENTER_SELECTORS, HelpAndProfilePage, INTEGRATIONS_TEXTS, INTEGRATION_SELECTORS, IPRestrictionsPage, IP_RESTRICTIONS_SELECTORS, IS_CI, IS_DEV_ENV, IS_STAGING_ENV, ImageUploader, IntegrationBase, IpRestrictionsApi, KEYBOARD_SHORTCUTS_SELECTORS, KEYBOARD_SHORTCUT_TEST_CASES, LIST_MODIFIER_SELECTORS, LIST_MODIFIER_TAGS, LOGIN_SELECTORS, MEMBER_FORM_SELECTORS, MEMBER_SELECTORS, MEMBER_TEXTS, MERGE_TAGS_SELECTORS, MICROSOFT_LOGIN_SELECTORS, MICROSOFT_LOGIN_TEXTS, MailerUtils, Member, MemberApis, MicrosoftPage, NEETO_AUTH_BASE_URL, NEETO_EDITOR_SELECTORS, NEETO_FILTERS_SELECTORS, NEETO_IMAGE_UPLOADER_SELECTORS, NEETO_ROUTES, NEETO_SEO_SELECTORS, NEETO_TEXT_MODIFIER_SELECTORS, NeetoAuthServer, NeetoEmailDeliveryApi, NeetoTowerApi, ONBOARDING_SELECTORS, ORGANIZATION_TEXTS, OTP_EMAIL_PATTERN, OrganizationPage, PAST_TIME_RANGES, PHONE_NUMBER_FORMATS, PLURAL, PROFILE_LINKS, PROFILE_SECTION_SELECTORS, PROJECT_NAMES, PROJECT_TRANSLATIONS_PATH, ROLES_SELECTORS, ROUTES, RailsEmailApiClient, RailsEmailUtils, RoleApis, RolesPage, SIGNUP_SELECTORS, SINGULAR, SLACK_DATA_QA_SELECTORS, SLACK_DEFAULT_CHANNEL, SLACK_SELECTORS, SLACK_WEB_TEXTS, STATUS_TEXTS, STORAGE_STATE, SecurityApi, SidebarSection, SlackApi, SlackPage, TABLE_SELECTORS, TAB_SELECTORS, TAGS_SELECTORS, TEAM_MEMBER_TEXTS, TEXT_MODIFIER_ROLES, TEXT_MODIFIER_SELECTORS, TEXT_MODIFIER_TAGS, THANK_YOU_SELECTORS, THEMES_SELECTORS, THEMES_TEXTS, THIRD_PARTY_RESOURCES, THIRD_PARTY_ROUTES, TIME_RANGES, TOASTR_MESSAGES, TWILIO_SELECTORS, TagsApi, TagsPage, TeamMembers, ThankYouApi, ThankYouPage, TwilioApi, USER_AGENTS, WEBHOOK_SELECTORS, WebhookSiteApi, WebhooksPage, ZAPIER_LIMIT_EXHAUSTED_MESSAGE, ZAPIER_SELECTORS, ZAPIER_TEST_EMAIL, ZAPIER_WEB_TEXTS, ZapierPage, baseURLGenerator, basicHTMLContent, clearCredentials, commands, cpuThrottlingUsingCDP, createOrganizationViaRake, currencyUtils, dataQa, decodeQRCodeFromFile, definePlaywrightConfig, executeWithThrottledResources, extractSubdomainFromError, fillCredentialsAndSubmit, filterUtils, generatePhoneNumber, generatePhoneNumberDetails, generateRandomBypassEmail, generateRandomFile, generateStagingData, getByDataQA, getClipboardContent, getFormattedPhoneNumber, getFullUrl, getGlobalUserProps, getGlobalUserState, getImagePathAndName, getIsoCodeFromPhoneCode, getListCount, globalShortcuts, grantClipboardPermissions, hexToRGB, hexToRGBA, i18nFixture, imageRegex, initializeCredentials, initializeTestData, initializeTotp, isGithubIssueOpen, joinHyphenCase, joinString, login, loginWithoutSSO, networkConditions, networkThrottlingUsingCDP, readFileSyncIfExists, removeCredentialFile, serializeFileForBrowser, shouldSkipCustomDomainSetup, shouldSkipSetupAndTeardown, simulateClickWithDelay, simulateTypingWithDelay, skipTest, squish, _default as stealthTest, tableUtils, toCamelCase, updateCredentials, warmup, writeDataToFile };
|
|
9060
|
-
export type { BaseThemeStyle, BaseThemeStyleType, ColumnMenuAction, CountryProps, CustomFixture, EmailDeliveryConnectParams, EmailDeliveryProvider, EmailDeliveryVerifiedEmail, EmailDeliveryVerifyEmailParams, EmailDeliveryVerifyEmailResponse, EmailMatchCriteria, IntroPageThemeStyle, IntroPageThemeStyleType, ProjectName, ThemeCategory, ValueOf };
|
|
9065
|
+
export type { BaseThemeStyle, BaseThemeStyleType, ColumnMenuAction, CountryProps, CustomFixture, EmailDeliveryConnectParams, EmailDeliveryProvider, EmailDeliveryVerifiedEmail, EmailDeliveryVerifyEmailParams, EmailDeliveryVerifyEmailResponse, EmailMatchCriteria, IntroPageThemeStyle, IntroPageThemeStyleType, OAuthEmailDeliveryProvider, ProjectName, ThemeCategory, ValueOf };
|
package/index.js
CHANGED
|
@@ -319,23 +319,6 @@ class MemberApis {
|
|
|
319
319
|
});
|
|
320
320
|
}
|
|
321
321
|
|
|
322
|
-
const NEETO_EMAIL_DELIVERY_TESTING_BASE_URL = "/neeto_email_delivery/api/v1/testing";
|
|
323
|
-
class NeetoEmailDeliveryApi {
|
|
324
|
-
neetoPlaywrightUtilities;
|
|
325
|
-
constructor(neetoPlaywrightUtilities) {
|
|
326
|
-
this.neetoPlaywrightUtilities = neetoPlaywrightUtilities;
|
|
327
|
-
}
|
|
328
|
-
connect = ({ ownerId, ...payload }) => this.neetoPlaywrightUtilities.apiRequest({
|
|
329
|
-
method: "post",
|
|
330
|
-
url: `${NEETO_EMAIL_DELIVERY_TESTING_BASE_URL}/connect`,
|
|
331
|
-
body: keysToSnakeCase({ ownerId, connect: payload }),
|
|
332
|
-
});
|
|
333
|
-
verifyEmail = (params) => this.neetoPlaywrightUtilities.apiRequest({
|
|
334
|
-
url: `${NEETO_EMAIL_DELIVERY_TESTING_BASE_URL}/verify_email`,
|
|
335
|
-
params: keysToSnakeCase(params),
|
|
336
|
-
});
|
|
337
|
-
}
|
|
338
|
-
|
|
339
322
|
class RailsEmailApiClient {
|
|
340
323
|
port = process.env.RAILS_SERVER_PORT;
|
|
341
324
|
subdomain = process.env.SUBDOMAIN ?? "spinkart";
|
|
@@ -125276,6 +125259,23 @@ class NeetoAuthServer {
|
|
|
125276
125259
|
};
|
|
125277
125260
|
}
|
|
125278
125261
|
|
|
125262
|
+
const NEETO_EMAIL_DELIVERY_TESTING_BASE_URL = "/neeto_email_delivery/api/v1/testing";
|
|
125263
|
+
class NeetoEmailDeliveryApi {
|
|
125264
|
+
neetoPlaywrightUtilities;
|
|
125265
|
+
constructor(neetoPlaywrightUtilities) {
|
|
125266
|
+
this.neetoPlaywrightUtilities = neetoPlaywrightUtilities;
|
|
125267
|
+
}
|
|
125268
|
+
connect = ({ ownerId, ...payload }) => this.neetoPlaywrightUtilities.apiRequest({
|
|
125269
|
+
method: "post",
|
|
125270
|
+
url: `${NEETO_EMAIL_DELIVERY_TESTING_BASE_URL}/connect`,
|
|
125271
|
+
body: keysToSnakeCase({ ownerId, connect: payload }),
|
|
125272
|
+
});
|
|
125273
|
+
verifyEmail = (params) => this.neetoPlaywrightUtilities.apiRequest({
|
|
125274
|
+
url: `${NEETO_EMAIL_DELIVERY_TESTING_BASE_URL}/verify_email`,
|
|
125275
|
+
params: keysToSnakeCase(params),
|
|
125276
|
+
});
|
|
125277
|
+
}
|
|
125278
|
+
|
|
125279
125279
|
const REFRESH_TOKEN_ENV_KEYS = {
|
|
125280
125280
|
gmail: "EMAIL_DELIVERY_GMAIL_REFRESH_TOKEN",
|
|
125281
125281
|
outlook: "EMAIL_DELIVERY_OUTLOOK_REFRESH_TOKEN",
|
|
@@ -125283,6 +125283,7 @@ const REFRESH_TOKEN_ENV_KEYS = {
|
|
|
125283
125283
|
const FROM_EMAIL_ENV_KEYS = {
|
|
125284
125284
|
gmail: "EMAIL_DELIVERY_CONNECTED_GMAIL",
|
|
125285
125285
|
outlook: "EMAIL_DELIVERY_CONNECTED_OUTLOOK",
|
|
125286
|
+
sparkpost: "EMAIL_DELIVERY_CONNECTED_SPARKPOST",
|
|
125286
125287
|
};
|
|
125287
125288
|
class EmailDeliveryUtils {
|
|
125288
125289
|
neetoPlaywrightUtilities;
|
|
@@ -125292,6 +125293,20 @@ class EmailDeliveryUtils {
|
|
|
125292
125293
|
this.emailDeliveryApi = new NeetoEmailDeliveryApi(neetoPlaywrightUtilities);
|
|
125293
125294
|
}
|
|
125294
125295
|
connectViaRequest = async ({ provider, ownerId }) => {
|
|
125296
|
+
if (provider === "sparkpost") {
|
|
125297
|
+
const sparkpostEmailEnvKey = FROM_EMAIL_ENV_KEYS.sparkpost;
|
|
125298
|
+
const email = process.env[sparkpostEmailEnvKey];
|
|
125299
|
+
if (isNil(email)) {
|
|
125300
|
+
throw new Error(`ENV variable ${sparkpostEmailEnvKey} is not properly configured`);
|
|
125301
|
+
}
|
|
125302
|
+
const response = await this.emailDeliveryApi.connect({
|
|
125303
|
+
emailProvider: "sparkpost",
|
|
125304
|
+
email,
|
|
125305
|
+
ownerId,
|
|
125306
|
+
});
|
|
125307
|
+
expect(response?.ok()).toBeTruthy();
|
|
125308
|
+
return response;
|
|
125309
|
+
}
|
|
125295
125310
|
const refreshTokenEnvKey = REFRESH_TOKEN_ENV_KEYS[provider];
|
|
125296
125311
|
const refreshToken = process.env[refreshTokenEnvKey];
|
|
125297
125312
|
if (isNil(refreshToken)) {
|