@agility/content-sync 1.1.5 → 1.1.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/.babelrc +6 -6
- package/.vscode/launch.json +34 -34
- package/README.md +206 -206
- package/dist/agility-sync-sdk.node.js +1510 -4238
- package/package.json +46 -46
- package/src/methods/clearSync.js +7 -7
- package/src/methods/runSync.js +94 -94
- package/src/methods/syncContent.js +80 -80
- package/src/methods/syncPages.js +75 -75
- package/src/store-interface-console.js +72 -72
- package/src/store-interface-filesystem.js +201 -201
- package/src/store-interface.js +511 -511
- package/src/sync-client.js +74 -74
- package/src/util.js +79 -45
- package/test/01-getSyncClient.tests.js +37 -37
- package/test/02-runSync.tests.js +74 -74
- package/test/03-store.getContentItem.tests.js +25 -25
- package/test/04-store.getContentList.tests.js +67 -67
- package/test/05-store.getPage.tests.js +25 -25
- package/test/06-store.getRedirects.tests.js +26 -26
- package/test/99-clearSync.tests.js +29 -29
- package/test/_syncClients.config.js +57 -57
- package/webpack.config.js +32 -32
package/src/sync-client.js
CHANGED
|
@@ -1,75 +1,75 @@
|
|
|
1
|
-
import agility from '@agility/content-fetch'
|
|
2
|
-
import syncContent from './methods/syncContent'
|
|
3
|
-
import clearSync from './methods/clearSync'
|
|
4
|
-
import syncPages from './methods/syncPages'
|
|
5
|
-
import runSync from './methods/runSync'
|
|
6
|
-
|
|
7
|
-
import storeInterface from './store-interface'
|
|
8
|
-
import storeInterfaceFileSystem from './store-interface-filesystem'
|
|
9
|
-
|
|
10
|
-
function getSyncClient (userConfig) {
|
|
11
|
-
validateConfigParams(userConfig);
|
|
12
|
-
return createSyncClient(userConfig);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
function validateConfigParams(configParams) {
|
|
16
|
-
|
|
17
|
-
if(!configParams.guid || configParams.guid.length == 0) {
|
|
18
|
-
throw new TypeError('You must provide an guid.');
|
|
19
|
-
} else if(!configParams.apiKey || configParams.apiKey.length == 0) {
|
|
20
|
-
throw new TypeError('You must provide an access token.');
|
|
21
|
-
} else {
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const defaultConfig = {
|
|
27
|
-
baseUrl: null,
|
|
28
|
-
isPreview: false,
|
|
29
|
-
guid: null,
|
|
30
|
-
apiKey: null,
|
|
31
|
-
languages: [],
|
|
32
|
-
channels: [],
|
|
33
|
-
debug: false,
|
|
34
|
-
store: {
|
|
35
|
-
interface: storeInterfaceFileSystem,
|
|
36
|
-
options: {
|
|
37
|
-
rootPath: '.agility-files'
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
function createSyncClient(userConfig) {
|
|
43
|
-
let config = {
|
|
44
|
-
...defaultConfig,
|
|
45
|
-
...userConfig
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
const agilityClient = agility.getApi({
|
|
50
|
-
guid: config.guid,
|
|
51
|
-
apiKey: config.apiKey,
|
|
52
|
-
isPreview: config.isPreview,
|
|
53
|
-
debug: config.debug,
|
|
54
|
-
baseUrl: config.baseUrl
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
//resolve the dependancy for store interface implementation (uses file-system by default)
|
|
59
|
-
let store = config.store.interface;
|
|
60
|
-
|
|
61
|
-
//set the sync storage interface provider, it will also validate it
|
|
62
|
-
storeInterface.setStore(store, config.store.options);
|
|
63
|
-
|
|
64
|
-
return {
|
|
65
|
-
config,
|
|
66
|
-
agilityClient,
|
|
67
|
-
syncContent,
|
|
68
|
-
syncPages,
|
|
69
|
-
clearSync,
|
|
70
|
-
runSync,
|
|
71
|
-
store: storeInterface
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
1
|
+
import agility from '@agility/content-fetch'
|
|
2
|
+
import syncContent from './methods/syncContent'
|
|
3
|
+
import clearSync from './methods/clearSync'
|
|
4
|
+
import syncPages from './methods/syncPages'
|
|
5
|
+
import runSync from './methods/runSync'
|
|
6
|
+
|
|
7
|
+
import storeInterface from './store-interface'
|
|
8
|
+
import storeInterfaceFileSystem from './store-interface-filesystem'
|
|
9
|
+
|
|
10
|
+
function getSyncClient (userConfig) {
|
|
11
|
+
validateConfigParams(userConfig);
|
|
12
|
+
return createSyncClient(userConfig);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function validateConfigParams(configParams) {
|
|
16
|
+
|
|
17
|
+
if(!configParams.guid || configParams.guid.length == 0) {
|
|
18
|
+
throw new TypeError('You must provide an guid.');
|
|
19
|
+
} else if(!configParams.apiKey || configParams.apiKey.length == 0) {
|
|
20
|
+
throw new TypeError('You must provide an access token.');
|
|
21
|
+
} else {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const defaultConfig = {
|
|
27
|
+
baseUrl: null,
|
|
28
|
+
isPreview: false,
|
|
29
|
+
guid: null,
|
|
30
|
+
apiKey: null,
|
|
31
|
+
languages: [],
|
|
32
|
+
channels: [],
|
|
33
|
+
debug: false,
|
|
34
|
+
store: {
|
|
35
|
+
interface: storeInterfaceFileSystem,
|
|
36
|
+
options: {
|
|
37
|
+
rootPath: '.agility-files'
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
function createSyncClient(userConfig) {
|
|
43
|
+
let config = {
|
|
44
|
+
...defaultConfig,
|
|
45
|
+
...userConfig
|
|
46
|
+
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const agilityClient = agility.getApi({
|
|
50
|
+
guid: config.guid,
|
|
51
|
+
apiKey: config.apiKey,
|
|
52
|
+
isPreview: config.isPreview,
|
|
53
|
+
debug: config.debug,
|
|
54
|
+
baseUrl: config.baseUrl
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
//resolve the dependancy for store interface implementation (uses file-system by default)
|
|
59
|
+
let store = config.store.interface;
|
|
60
|
+
|
|
61
|
+
//set the sync storage interface provider, it will also validate it
|
|
62
|
+
storeInterface.setStore(store, config.store.options);
|
|
63
|
+
|
|
64
|
+
return {
|
|
65
|
+
config,
|
|
66
|
+
agilityClient,
|
|
67
|
+
syncContent,
|
|
68
|
+
syncPages,
|
|
69
|
+
clearSync,
|
|
70
|
+
runSync,
|
|
71
|
+
store: storeInterface
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
75
|
export default { getSyncClient }
|
package/src/util.js
CHANGED
|
@@ -1,46 +1,80 @@
|
|
|
1
|
-
const asyncForEach = async (array, callback) => {
|
|
2
|
-
for (let index = 0; index < array.length; index++) {
|
|
3
|
-
await callback(array[index], index, array);
|
|
4
|
-
}
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
1
|
+
const asyncForEach = async (array, callback) => {
|
|
2
|
+
for (let index = 0; index < array.length; index++) {
|
|
3
|
+
await callback(array[index], index, array);
|
|
4
|
+
}
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
const getLogLevel = () => {
|
|
9
|
+
const logLevel = (process.env.AGILITY_LOG_LEVEL || 'warning').toLowerCase();
|
|
10
|
+
|
|
11
|
+
if (logLevel !== 'debug' && logLevel !== 'info' && logLevel !== 'warning' && logLevel !== 'error') {
|
|
12
|
+
return 'warning';
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
return logLevel;
|
|
16
|
+
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
const logSuccess = (message) => {
|
|
21
|
+
|
|
22
|
+
const logLevel = getLogLevel();
|
|
23
|
+
if (logLevel === 'debug' || logLevel === 'info') {
|
|
24
|
+
|
|
25
|
+
message = `AgilityCMS => ${message} `;
|
|
26
|
+
console.log('\x1b[32m%s\x1b[0m', message);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const logWarning = (message) => {
|
|
31
|
+
|
|
32
|
+
const logLevel = getLogLevel();
|
|
33
|
+
if (logLevel === 'debug' || logLevel === 'info' || logLevel === 'warning') {
|
|
34
|
+
|
|
35
|
+
message = `AgilityCMS => ${message} `;
|
|
36
|
+
console.log('\x1b[33m%s\x1b[0m', message);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const logError = (message) => {
|
|
41
|
+
|
|
42
|
+
const logLevel = getLogLevel();
|
|
43
|
+
if (logLevel === 'debug' || logLevel === 'info' || logLevel === 'warning' || logLevel === 'error') {
|
|
44
|
+
|
|
45
|
+
message = `AgilityCMS => ${message} `;
|
|
46
|
+
console.log('\x1b[31m%s\x1b[0m', message);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const logInfo = (message) => {
|
|
51
|
+
const logLevel = getLogLevel();
|
|
52
|
+
if (logLevel === 'debug' || logLevel === 'info') {
|
|
53
|
+
message = `AgilityCMS => ${message} `;
|
|
54
|
+
console.log(message);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const logDebug = (message) => {
|
|
59
|
+
const logLevel = getLogLevel();
|
|
60
|
+
if (logLevel === 'debug') {
|
|
61
|
+
console.log('#######################################################################');
|
|
62
|
+
message = `AgilityCMS(debug) => ${message} `;
|
|
63
|
+
console.log('"\x1b[35m%s\x1b[0m', message);
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
const sleep = (ms) => {
|
|
69
|
+
return new Promise(resolve => setTimeout(resolve, ms));
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
module.exports = {
|
|
73
|
+
logDebug,
|
|
74
|
+
logInfo,
|
|
75
|
+
logError,
|
|
76
|
+
logWarning,
|
|
77
|
+
logSuccess,
|
|
78
|
+
asyncForEach,
|
|
79
|
+
sleep
|
|
46
80
|
}
|
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import chai from 'chai'
|
|
2
|
-
const assert = chai.assert;
|
|
3
|
-
|
|
4
|
-
import agilitySync from '../src/sync-client'
|
|
5
|
-
import { createSyncClientUsingConsoleStore } from './_syncClients.config'
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
//This is a synchronous test
|
|
9
|
-
describe('getSyncClient:', function() {
|
|
10
|
-
|
|
11
|
-
this.timeout('120s');
|
|
12
|
-
|
|
13
|
-
it('should return a sync worker object with required params', function(done) {
|
|
14
|
-
const syncClient = agilitySync.getSyncClient({
|
|
15
|
-
guid: 'some-guid',
|
|
16
|
-
apiKey: 'some-access-token'
|
|
17
|
-
});
|
|
18
|
-
assert.strictEqual(typeof(syncClient), "object");
|
|
19
|
-
done();
|
|
20
|
-
})
|
|
21
|
-
|
|
22
|
-
it('should return an sync worker object in preview mode', function(done) {
|
|
23
|
-
const syncClient = agilitySync.getSyncClient({
|
|
24
|
-
guid: 'some-guid',
|
|
25
|
-
apiKey: 'some-access-token',
|
|
26
|
-
isPreview: true
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
assert.strictEqual(syncClient.config.isPreview, true);
|
|
30
|
-
done();
|
|
31
|
-
})
|
|
32
|
-
|
|
33
|
-
it('should validate a valid external store interface (console)', function(done) {
|
|
34
|
-
const syncClient = createSyncClientUsingConsoleStore()
|
|
35
|
-
done();
|
|
36
|
-
})
|
|
37
|
-
|
|
1
|
+
import chai from 'chai'
|
|
2
|
+
const assert = chai.assert;
|
|
3
|
+
|
|
4
|
+
import agilitySync from '../src/sync-client'
|
|
5
|
+
import { createSyncClientUsingConsoleStore } from './_syncClients.config'
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
//This is a synchronous test
|
|
9
|
+
describe('getSyncClient:', function() {
|
|
10
|
+
|
|
11
|
+
this.timeout('120s');
|
|
12
|
+
|
|
13
|
+
it('should return a sync worker object with required params', function(done) {
|
|
14
|
+
const syncClient = agilitySync.getSyncClient({
|
|
15
|
+
guid: 'some-guid',
|
|
16
|
+
apiKey: 'some-access-token'
|
|
17
|
+
});
|
|
18
|
+
assert.strictEqual(typeof(syncClient), "object");
|
|
19
|
+
done();
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
it('should return an sync worker object in preview mode', function(done) {
|
|
23
|
+
const syncClient = agilitySync.getSyncClient({
|
|
24
|
+
guid: 'some-guid',
|
|
25
|
+
apiKey: 'some-access-token',
|
|
26
|
+
isPreview: true
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
assert.strictEqual(syncClient.config.isPreview, true);
|
|
30
|
+
done();
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
it('should validate a valid external store interface (console)', function(done) {
|
|
34
|
+
const syncClient = createSyncClientUsingConsoleStore()
|
|
35
|
+
done();
|
|
36
|
+
})
|
|
37
|
+
|
|
38
38
|
});
|
package/test/02-runSync.tests.js
CHANGED
|
@@ -1,74 +1,74 @@
|
|
|
1
|
-
import chai from 'chai'
|
|
2
|
-
const assert = chai.assert;
|
|
3
|
-
const expect = chai.expect;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import { createSyncClient, createSyncClientUsingConsoleStore, createPreviewSyncClient } from './_syncClients.config'
|
|
7
|
-
|
|
8
|
-
const sleep = (ms) => {
|
|
9
|
-
return new Promise(resolve => setTimeout(resolve, ms));
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
/*
|
|
14
|
-
This file contains static references to content from the instance configured in the apiClient.config file.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
//this file should always run first in the tests...
|
|
18
|
-
|
|
19
|
-
describe('runSync:', async function () {
|
|
20
|
-
|
|
21
|
-
this.timeout('120s');
|
|
22
|
-
|
|
23
|
-
it('should run 1 sync method using the filesystem', async function () {
|
|
24
|
-
|
|
25
|
-
var sync = createSyncClient();
|
|
26
|
-
await sync.runSync();
|
|
27
|
-
|
|
28
|
-
await sync.clearSync();
|
|
29
|
-
|
|
30
|
-
})
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
it('should run 3 syncs at the same time method using the filesystem', async function () {
|
|
34
|
-
|
|
35
|
-
let sync1 = createSyncClient();
|
|
36
|
-
let sync2 = createSyncClient();
|
|
37
|
-
let sync3 = createSyncClient();
|
|
38
|
-
|
|
39
|
-
let p1 = sync1.runSync();
|
|
40
|
-
let p2 = sync2.runSync();
|
|
41
|
-
let p3 = sync3.runSync();
|
|
42
|
-
|
|
43
|
-
await Promise.all([p1, p2, p3])
|
|
44
|
-
|
|
45
|
-
})
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
it('should run 3 syncs 1.5 secs apart', async function () {
|
|
49
|
-
|
|
50
|
-
let sync1 = createSyncClient();
|
|
51
|
-
let sync2 = createSyncClient();
|
|
52
|
-
let sync3 = createSyncClient();
|
|
53
|
-
await sleep(1500)
|
|
54
|
-
await sync1.runSync();
|
|
55
|
-
await sleep(1500)
|
|
56
|
-
await sync2.runSync();
|
|
57
|
-
await sleep(1500)
|
|
58
|
-
await sync3.runSync();
|
|
59
|
-
|
|
60
|
-
})
|
|
61
|
-
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
describe('runSync:', async function () {
|
|
65
|
-
|
|
66
|
-
this.timeout('120s');
|
|
67
|
-
|
|
68
|
-
it('should run sync method using the console store', async function () {
|
|
69
|
-
var sync = createSyncClientUsingConsoleStore();
|
|
70
|
-
await sync.runSync();
|
|
71
|
-
})
|
|
72
|
-
|
|
73
|
-
});
|
|
74
|
-
|
|
1
|
+
import chai from 'chai'
|
|
2
|
+
const assert = chai.assert;
|
|
3
|
+
const expect = chai.expect;
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
import { createSyncClient, createSyncClientUsingConsoleStore, createPreviewSyncClient } from './_syncClients.config'
|
|
7
|
+
|
|
8
|
+
const sleep = (ms) => {
|
|
9
|
+
return new Promise(resolve => setTimeout(resolve, ms));
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
/*
|
|
14
|
+
This file contains static references to content from the instance configured in the apiClient.config file.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
//this file should always run first in the tests...
|
|
18
|
+
|
|
19
|
+
describe('runSync:', async function () {
|
|
20
|
+
|
|
21
|
+
this.timeout('120s');
|
|
22
|
+
|
|
23
|
+
it('should run 1 sync method using the filesystem', async function () {
|
|
24
|
+
|
|
25
|
+
var sync = createSyncClient();
|
|
26
|
+
await sync.runSync();
|
|
27
|
+
|
|
28
|
+
await sync.clearSync();
|
|
29
|
+
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
it('should run 3 syncs at the same time method using the filesystem', async function () {
|
|
34
|
+
|
|
35
|
+
let sync1 = createSyncClient();
|
|
36
|
+
let sync2 = createSyncClient();
|
|
37
|
+
let sync3 = createSyncClient();
|
|
38
|
+
|
|
39
|
+
let p1 = sync1.runSync();
|
|
40
|
+
let p2 = sync2.runSync();
|
|
41
|
+
let p3 = sync3.runSync();
|
|
42
|
+
|
|
43
|
+
await Promise.all([p1, p2, p3])
|
|
44
|
+
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
it('should run 3 syncs 1.5 secs apart', async function () {
|
|
49
|
+
|
|
50
|
+
let sync1 = createSyncClient();
|
|
51
|
+
let sync2 = createSyncClient();
|
|
52
|
+
let sync3 = createSyncClient();
|
|
53
|
+
await sleep(1500)
|
|
54
|
+
await sync1.runSync();
|
|
55
|
+
await sleep(1500)
|
|
56
|
+
await sync2.runSync();
|
|
57
|
+
await sleep(1500)
|
|
58
|
+
await sync3.runSync();
|
|
59
|
+
|
|
60
|
+
})
|
|
61
|
+
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
describe('runSync:', async function () {
|
|
65
|
+
|
|
66
|
+
this.timeout('120s');
|
|
67
|
+
|
|
68
|
+
it('should run sync method using the console store', async function () {
|
|
69
|
+
var sync = createSyncClientUsingConsoleStore();
|
|
70
|
+
await sync.runSync();
|
|
71
|
+
})
|
|
72
|
+
|
|
73
|
+
});
|
|
74
|
+
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import chai from 'chai'
|
|
2
|
-
const assert = chai.assert;
|
|
3
|
-
const expect = chai.expect;
|
|
4
|
-
|
|
5
|
-
import { createSyncClient, createPreviewSyncClient } from './_syncClients.config'
|
|
6
|
-
|
|
7
|
-
/*
|
|
8
|
-
This file contains static references to content from the instance configured in the apiClient.config file.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
const languageCode = 'en-us'
|
|
12
|
-
|
|
13
|
-
describe('store.getContentItem:', async function() {
|
|
14
|
-
|
|
15
|
-
it('should be able to retrieve an item from the store', async function() {
|
|
16
|
-
var syncClient = createSyncClient();
|
|
17
|
-
const contentItem = await syncClient.store.getContentItem({
|
|
18
|
-
contentID: 21,
|
|
19
|
-
languageCode: languageCode,
|
|
20
|
-
})
|
|
21
|
-
assert.strictEqual(contentItem.contentID, 21, 'retrieved the content item we asked for')
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
});
|
|
25
|
-
|
|
1
|
+
import chai from 'chai'
|
|
2
|
+
const assert = chai.assert;
|
|
3
|
+
const expect = chai.expect;
|
|
4
|
+
|
|
5
|
+
import { createSyncClient, createPreviewSyncClient } from './_syncClients.config'
|
|
6
|
+
|
|
7
|
+
/*
|
|
8
|
+
This file contains static references to content from the instance configured in the apiClient.config file.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
const languageCode = 'en-us'
|
|
12
|
+
|
|
13
|
+
describe('store.getContentItem:', async function() {
|
|
14
|
+
|
|
15
|
+
it('should be able to retrieve an item from the store', async function() {
|
|
16
|
+
var syncClient = createSyncClient();
|
|
17
|
+
const contentItem = await syncClient.store.getContentItem({
|
|
18
|
+
contentID: 21,
|
|
19
|
+
languageCode: languageCode,
|
|
20
|
+
})
|
|
21
|
+
assert.strictEqual(contentItem.contentID, 21, 'retrieved the content item we asked for')
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
});
|
|
25
|
+
|