Skip to main content Link Search Menu Expand Document (external link)

The Profile Factory Interface

The profile factory interface creates profile objects that are initialized correctly.

There is only one profile factory and it can always be found at jancy.profileFactory.

Methods

profileFactory.addBuyer(profile, buyer)

  • profile (object) a profile object created by profileFactory.create()
  • buyer (string) the ID of the buyer

Adds a buyer to the given profile.

buyer will be normalized to be lowercase and duplicates will be ignored.

profileFactory.addCard(profile, data)

  • profile (object) a profile object created by profileFactory.create()
  • data (object)
    • number (string) the credit card number
    • cvv (string) the CVV of the credit card
    • expDate (string) optional expiration date of the card
    • label (string) optional the label to assign to the card
    • address (string) optional address line associated with the card
    • address2 (string) optional address line 2 associated with the card
    • city (string) optional city associated with the card
    • state (string) optional state associated with the card
    • zip (string) optional zip code associated with the card
    • note (string) optional an optional note to associate with the card

expDate format is MM/YY.

Adds a credit card to the given profile.

profileFactory.addProxy(profile, proxy)

  • profile (object) a profile object created by profileFactory.create()
  • proxy (object) a proxy object created by proxyFactory.createSync()

Adds a proxy to the given profile.

profileFactory.addSite(profile, data)

  • profile (object) a profile object created by profileFactory.create()
  • data (object)
    • site (string or RegExp object)
    • isPattern (boolean)
    • fields ([object])

Adds a site record to the given profile. See the example project for example usage.

fields should be an array of objects where each object should have the following properties.

  • field (string) should be password, smscode, emailcode, or othercode
  • resolver (string) the name of the resolver to run
  • resolverArgs ([string]) array of arguments to be passed to the resolver when it’s called

Set isPattern to false when site is a string representing a registered site (eg. “ticketmaster” and “axs”). Otherwise set isPattern to true and site to a constructed RegExp object that will be used to match the URL in the tab against when deciding to run the resolvers associated with the given fields.

profileFactory.create(data)

  • data (object)
    • providerId (string) value passed in to the provider.loadProfiles() method
    • groupName (string) the group to assign this profile to
    • profileName (string) the name of the profile
    • email (string) the email associated with the profile
    • name (string) optional
    • adress (string) optional
    • address2 (string) optional
    • city (string) optional
    • state (string) optional
    • zip (string) optional
    • phoneNumber (string) optional
    • smsNumber (string) optional
    • passcodes ([string]) optional
    • persistCookies (boolean) optional
    • dob (string) optional
    • notes (string) optional
    • free1 (string) optional
    • free2 (string) optional
    • free3 (string) optional
    • free4 (string) optional
    • free5 (string) optional
    • url (string) optional
    • tabColor (string) optional
    • timezone (string) optional

Returns a profile object suitable for additional calls to other profile factory methods and profileRegistry.addProfile().