sync

Methods

(async, inner) sync(subdomains, tokens, cookies, options) → {Promise.<syncResponseObject>}

Sync emoji between slack subdomains

Sync can be executed in either a "one way" or "n way" configuration, and both configurations can have a variable number of sources and destinations. In a "one way" configuration, all emoji from all source subdomains will be added to all destination subdomains" and can be set by specifying srcSubdomains and dstSubdomains. In an "n way" configuration, every subdomain given is treated as the destination for every emoji in every other subdomain.

Parameters:
Name Type Description
subdomains string | Array.<string> | null

Two ore more subdomains that you wish to have the same emoji pool

tokens string | Array.<string> | null

cookie tokens corresponding to the given subdomains

cookies string | Array.<string> | null

User cookies corresponding to the given subdomains

options object

contains src and dst information for "one way" sync configuration. Either specify subdomains and tokens, or srcSubdomains, srcTokens, dstSubdomains, and dstTokens, not both.

Properties
Name Type Attributes Description
srcSubdomains string | Array.<string> <optional>

slack instances from which to draw emoji. No additions will be made to these subdomains

srcTokens string | Array.<string> <optional>

tokens for the slack instances from which to draw emoji

srcCookies string | Array.<string> <optional>

cookies auth cookies for the slack instances from which to draw emoji

dstSubdomains string | Array.<string> <optional>

slack instances in which all source emoji will be deposited. None of dstSubdomain's emoji will end up in srcSubdomain

dstTokens string | Array.<string> <optional>

tokens for the slack instances where emoji will be deposited

dstCookies string | Array.<string> <optional>

cookies auth cookies for the slack instances from which to draw emoji

bustCache boolean <optional>

if true, ignore any adminList younger than 24 hours and repull slack instance's existing emoji. Can be useful for making options.avoidCollisions more accurate

output boolean <optional>

if false, no files will be written during execution. Prevents saving of adminList for future use, as well as the writing of log files

verbose boolean <optional>

if true, all messages will be written to stdout in addition to combined log file.

Source:
Example
var syncOptions = {
  srcSubdomains: ['srcSubdomain'], // copy all emoji from srcSubdomain...
  srcTokens: ['srcToken'],
  srcCookies: ['srcCookie'],
  dstSubdomains: ['dstSubdomain1', 'dstSubdomain2'], // ...to dstSubdomain1 and dstSubdomain2
  dstTokens: ['dstToken1', 'dstToken2'],
  dstCookies: ['dstCookie1', 'dstCookie2'],
  bustCache: true // get fresh lists to make sure we're not doing more lifting than we have to
};
var syncResults = await emojme.sync(null, null, syncOptions);
console.log(syncResults);
// {
//   dstSubdomain1: {
//     emojiList: [
//       { name: emoji-1-from-srcSubdomain ... },
//       { name: emoji-2-from-srcSubdomain ... }
//     ]
//   },
//   dstSubdomain2: {
//     emojiList: [
//       { name: emoji-1-from-srcSubdomain ... },
//       { name: emoji-2-from-srcSubdomain ... }
//     ]
//   }
// }

Type Definitions

syncResponseObject :object

The sync response object, like other response objects, is organized by input subdomain.

Properties:
Name Type Description
subdomain object

each subdomain passed in to add will appear as a key in the response

Properties
Name Type Description
emojiList Array.<emojiList>

the list of emoji added to subdomain, with each element an emoji pulled from either srcSubdomain or subdomains less the subdomain in question.

Source: