@bigbinary/neeto-playwright-commons 1.26.33 → 1.26.34

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 CHANGED
@@ -496,6 +496,30 @@ class ThankYouApi {
496
496
  }
497
497
  }
498
498
 
499
+ const NEETO_TOWER_BASE_URL = "https://ops.neetotower.com/";
500
+ const DNS_RECORDS_BASE_URL = `${NEETO_TOWER_BASE_URL}api/v1/public/automation_tests/dns_records`;
501
+ class NeetoTowerApi {
502
+ constructor(neetoPlaywrightUtilities) {
503
+ this.neetoPlaywrightUtilities = neetoPlaywrightUtilities;
504
+ this.apiRequest = ({ method, dnsDomainId = "", body, }) => this.neetoPlaywrightUtilities.apiRequest({
505
+ url: `${DNS_RECORDS_BASE_URL}${dnsDomainId ? `/${dnsDomainId}` : ""}`,
506
+ headers: { "X-API-KEY": this.apiKey },
507
+ method,
508
+ body,
509
+ });
510
+ this.createRecord = ({ hostname, value }) => this.apiRequest({
511
+ method: "post",
512
+ body: { name: hostname, type: "TXT", content: value },
513
+ });
514
+ this.getRecords = () => this.apiRequest({ method: "get" });
515
+ this.deleteRecord = (dnsDomainId) => this.apiRequest({ method: "delete", dnsDomainId });
516
+ if (!process.env.NEETO_TOWER_API_KEY) {
517
+ throw new Error("NEETO_TOWER_API_KEY is not set");
518
+ }
519
+ this.apiKey = process.env.NEETO_TOWER_API_KEY;
520
+ }
521
+ }
522
+
499
523
  class SlackApi {
500
524
  constructor(neetoPlaywrightUtilities) {
501
525
  this.neetoPlaywrightUtilities = neetoPlaywrightUtilities;
@@ -125332,6 +125356,7 @@ exports.NEETO_IMAGE_UPLOADER_SELECTORS = NEETO_IMAGE_UPLOADER_SELECTORS;
125332
125356
  exports.NEETO_ROUTES = NEETO_ROUTES;
125333
125357
  exports.NEETO_SEO_SELECTORS = NEETO_SEO_SELECTORS;
125334
125358
  exports.NEETO_TEXT_MODIFIER_SELECTORS = NEETO_TEXT_MODIFIER_SELECTORS;
125359
+ exports.NeetoTowerApi = NeetoTowerApi;
125335
125360
  exports.ONBOARDING_SELECTORS = ONBOARDING_SELECTORS;
125336
125361
  exports.ORGANIZATION_TEXTS = ORGANIZATION_TEXTS;
125337
125362
  exports.OTP_EMAIL_PATTERN = OTP_EMAIL_PATTERN;