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 Properties
|
- 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
|
- Source: