@agility/content-fetch 1.1.1 → 1.1.4

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.
@@ -22,7 +22,7 @@ describe('getContentList:', function() {
22
22
  var api = createApiClient();
23
23
  api.getContentList({
24
24
  referenceName: 'posts',
25
- languageCode: 'en-us'
25
+ locale: 'en-us'
26
26
  })
27
27
  .then(function(contentList) {
28
28
  assert.strictEqual(contentList.items[0].contentID, 15);
@@ -36,7 +36,7 @@ describe('getContentList:', function() {
36
36
  var api = createPreviewApiClient();
37
37
  api.getContentList({
38
38
  referenceName: 'posts',
39
- languageCode: 'en-us'
39
+ locale: 'en-us'
40
40
  })
41
41
  .then(function(contentList) {
42
42
  assert.strictEqual(contentList.items[0].contentID, 15);
@@ -51,7 +51,7 @@ describe('getContentList:', function() {
51
51
  var api = createApiClient();
52
52
  api.getContentList({
53
53
  someOtherParam: 'posts',
54
- languageCode: 'en-us'
54
+ locale: 'en-us'
55
55
  })
56
56
  .then(function(contentList) {
57
57
  assert.strictEqual(contentList[0].contentID, 24);
@@ -63,7 +63,7 @@ describe('getContentList:', function() {
63
63
  done();
64
64
  });
65
65
 
66
- it('should throw error if languageCode param is missing in getContentList', function(done) {
66
+ it('should throw error if locale param is missing in getContentList', function(done) {
67
67
  expect(function() {
68
68
  var api = createApiClient();
69
69
  api.getContentList({
@@ -84,7 +84,7 @@ describe('getContentList:', function() {
84
84
  var api = createApiClient();
85
85
  api.getContentList({
86
86
  referenceName: 'posts',
87
- languageCode: 'en-us',
87
+ locale: 'en-us',
88
88
  take: 'ten'
89
89
  })
90
90
  .then(function(contentList) {
@@ -102,7 +102,7 @@ describe('getContentList:', function() {
102
102
  var api = createApiClient();
103
103
  api.getContentList({
104
104
  referenceName: 'posts',
105
- languageCode: 'en-us',
105
+ locale: 'en-us',
106
106
  take: 0
107
107
  })
108
108
  .then(function(contentList) {
@@ -115,13 +115,13 @@ describe('getContentList:', function() {
115
115
  done();
116
116
  });
117
117
 
118
- it('should throw error if take parameter is a number greater than 50 in getContentList', function(done) {
118
+ it('should throw error if take parameter is a number greater than 250 in getContentList', function(done) {
119
119
  expect(function() {
120
120
  var api = createApiClient();
121
121
  api.getContentList({
122
122
  referenceName: 'posts',
123
- languageCode: 'en-us',
124
- take: 51
123
+ locale: 'en-us',
124
+ take: 251
125
125
  })
126
126
  .then(function(contentList) {
127
127
  assert.strictEqual(contentList[0].contentID, 24);
@@ -138,7 +138,7 @@ describe('getContentList:', function() {
138
138
  var api = createApiClient();
139
139
  api.getContentList({
140
140
  referenceName: 'posts',
141
- languageCode: 'en-us',
141
+ locale: 'en-us',
142
142
  skip: -1
143
143
  })
144
144
  .then(function(contentList) {
@@ -156,7 +156,7 @@ describe('getContentList:', function() {
156
156
  var api = createApiClient();
157
157
  api.getContentList({
158
158
  referenceName: 'posts',
159
- languageCode: 'en-us',
159
+ locale: 'en-us',
160
160
  skip: 'ten'
161
161
  })
162
162
  .then(function(contentList) {
@@ -174,7 +174,7 @@ describe('getContentList:', function() {
174
174
  var api = createApiClient();
175
175
  api.getContentList({
176
176
  referenceName: 'posts',
177
- languageCode: 'en-us',
177
+ locale: 'en-us',
178
178
  sort: 'fields.title',
179
179
  direction: 'up'
180
180
  })
@@ -192,12 +192,11 @@ describe('getContentList:', function() {
192
192
  var api = createApiClient();
193
193
  api.getContentList({
194
194
  referenceName: 'posts',
195
- languageCode: 'en-us',
196
- sort: 'properties.versionID',
197
- direction: api.types.SortDirections.DESC
195
+ locale: 'en-us',
196
+ sort: 'contentID',
198
197
  })
199
198
  .then(function(contentList) {
200
- assert.isTrue(contentList.items[0].contentID > contentList.items[1].contentID);
199
+ assert.isTrue(contentList.items[0].contentID < contentList.items[1].contentID);
201
200
  done();
202
201
  })
203
202
  .catch(done);
@@ -208,7 +207,7 @@ describe('getContentList:', function() {
208
207
  var api = createApiClient();
209
208
  api.getContentList({
210
209
  referenceName: 'posts',
211
- languageCode: 'en-us',
210
+ locale: 'en-us',
212
211
  filters: [{operator: api.types.FilterOperators.EQUAL_TO, value: '40'}]
213
212
  })
214
213
  .then(function(contentList) {
@@ -224,7 +223,7 @@ describe('getContentList:', function() {
224
223
  var api = createApiClient();
225
224
  api.getContentList({
226
225
  referenceName: 'posts',
227
- languageCode: 'en-us',
226
+ locale: 'en-us',
228
227
  filters: [{property: 'properties.versionID', value: '40'}]
229
228
  })
230
229
  .then(function(contentList) {
@@ -240,7 +239,7 @@ describe('getContentList:', function() {
240
239
  var api = createApiClient();
241
240
  api.getContentList({
242
241
  referenceName: 'posts',
243
- languageCode: 'en-us',
242
+ locale: 'en-us',
244
243
  filters: [{property: 'properties.versionID', operator: api.types.FilterOperators.EQUAL_TO}]
245
244
  })
246
245
  .then(function(contentList) {
@@ -256,7 +255,7 @@ describe('getContentList:', function() {
256
255
  var api = createApiClient();
257
256
  api.getContentList({
258
257
  referenceName: 'posts',
259
- languageCode: 'en-us',
258
+ locale: 'en-us',
260
259
  filters: [{property: 'properties.versionID', operator: 'xx', value: '40'}]
261
260
  })
262
261
  .then(function(contentList) {
@@ -272,7 +271,7 @@ describe('getContentList:', function() {
272
271
  var api = createApiClient();
273
272
  api.getContentList({
274
273
  referenceName: 'posts',
275
- languageCode: 'en-us',
274
+ locale: 'en-us',
276
275
  filtersLogicOperator: 'SOME'
277
276
  })
278
277
  .then(function(contentList) {
@@ -287,7 +286,7 @@ describe('getContentList:', function() {
287
286
  var api = createApiClient();
288
287
  api.getContentList({
289
288
  referenceName: 'posts',
290
- languageCode: 'en-us',
289
+ locale: 'en-us',
291
290
  filters: [{property: 'contentID', operator: api.types.FilterOperators.EQUAL_TO, value: '15'}, {property: 'properties.referenceName', operator: api.types.FilterOperators.LIKE, value: 'posts'}],
292
291
  filtersLogicOperator: api.types.FilterLogicOperators.OR
293
292
  })
@@ -303,7 +302,7 @@ describe('getContentList:', function() {
303
302
  var api = createApiClient();
304
303
  api.getContentList({
305
304
  referenceName: 'posts',
306
- languageCode: 'en-us',
305
+ locale: 'en-us',
307
306
  filters: [{property: 'contentID', operator: api.types.FilterOperators.EQUAL_TO, value: '16'}, {property: 'properties.referenceName', operator: api.types.FilterOperators.LIKE, value: 'posts'}],
308
307
  filtersLogicOperator: api.types.FilterLogicOperators.AND
309
308
  })
@@ -319,7 +318,7 @@ describe('getContentList:', function() {
319
318
  var api = createApiClient();
320
319
  api.getContentList({
321
320
  referenceName: 'listwithnestedcontentlink',
322
- languageCode: 'en-us',
321
+ locale: 'en-us',
323
322
  expandAllContentLinks: true
324
323
  })
325
324
  .then(function(contentList) {
@@ -333,7 +332,7 @@ describe('getContentList:', function() {
333
332
  var api = createApiClient();
334
333
  api.getContentList({
335
334
  referenceName: 'listwithnestedcontentlink',
336
- languageCode: 'en-us',
335
+ locale: 'en-us',
337
336
  expandAllContentLinks: false
338
337
  })
339
338
  .then(function(contentList) {
@@ -347,7 +346,7 @@ describe('getContentList:', function() {
347
346
  var api = createApiClient();
348
347
  api.getContentList({
349
348
  referenceName: 'listwithnestedcontentlink',
350
- languageCode: 'en-us'
349
+ locale: 'en-us'
351
350
  })
352
351
  .then(function(contentList) {
353
352
  assert.strictEqual(Array.isArray(contentList.items[0].fields.posts), false);
@@ -361,7 +360,7 @@ describe('getContentList:', function() {
361
360
  let referenceName = 'jssdklist';
362
361
  api.getContentList({
363
362
  referenceName: referenceName,
364
- languageCode: 'en-us'
363
+ locale: 'en-us'
365
364
  })
366
365
  .then(function(contentList) {
367
366
  assert.strictEqual(contentList.items[0].properties.referenceName, referenceName);
@@ -21,7 +21,7 @@ import { createApiClient, createPreviewApiClient, createCatchedApiClient } from
21
21
  var api = createApiClient();
22
22
  api.getPage({
23
23
  pageID: 2,
24
- languageCode: 'en-us'
24
+ locale: 'en-us'
25
25
  })
26
26
  .then(function(page) {
27
27
  assert.strictEqual(page.pageID, 2);
@@ -34,7 +34,7 @@ import { createApiClient, createPreviewApiClient, createCatchedApiClient } from
34
34
  var api = createPreviewApiClient();
35
35
  api.getPage({
36
36
  pageID: 2,
37
- languageCode: 'en-us'
37
+ locale: 'en-us'
38
38
  })
39
39
  .then(function(page) {
40
40
  assert.strictEqual(page.pageID, 2);
@@ -48,7 +48,7 @@ import { createApiClient, createPreviewApiClient, createCatchedApiClient } from
48
48
  var api = createApiClient();
49
49
  api.getPage({
50
50
  someOtherParam: 1,
51
- languageCode: 'en-us'
51
+ locale: 'en-us'
52
52
  })
53
53
  .then(function(page) {
54
54
  assert.strictEqual(page.pageID, 2);
@@ -59,7 +59,7 @@ import { createApiClient, createPreviewApiClient, createCatchedApiClient } from
59
59
  done();
60
60
  })
61
61
 
62
- it('should throw error if languageCode not passed as argument for getPage', function(done) {
62
+ it('should throw error if locale not passed as argument for getPage', function(done) {
63
63
  expect(function() {
64
64
  var api = createApiClient();
65
65
  api.getPage({
@@ -78,7 +78,7 @@ import { createApiClient, createPreviewApiClient, createCatchedApiClient } from
78
78
  var api = createApiClient();
79
79
  api.getPage({
80
80
  pageID: 2,
81
- languageCode: 'en-us',
81
+ locale: 'en-us',
82
82
  expandAllContentLinks: true
83
83
  })
84
84
  .then(function(page) {
@@ -18,7 +18,7 @@ describe('getSitemapFlat:', function() {
18
18
  var api = createApiClient();
19
19
  api.getSitemapFlat({
20
20
  channelName: 'website',
21
- languageCode: 'en-us'
21
+ locale: 'en-us'
22
22
  })
23
23
  .then(function(sitemap) {
24
24
  assert.strictEqual(sitemap['/home'].pageID, 2);
@@ -31,7 +31,7 @@ describe('getSitemapFlat:', function() {
31
31
  var api = createPreviewApiClient();
32
32
  api.getSitemapFlat({
33
33
  channelName: 'website',
34
- languageCode: 'en-us'
34
+ locale: 'en-us'
35
35
  })
36
36
  .then(function(sitemap) {
37
37
  assert.strictEqual(sitemap['/home'].pageID, 2);
@@ -45,7 +45,7 @@ describe('getSitemapFlat:', function() {
45
45
  var api = createApiClient();
46
46
  api.getSitemapFlat({
47
47
  someOtherParam: 1,
48
- languageCode: 'en-us'
48
+ locale: 'en-us'
49
49
  })
50
50
  .then(function(sitemap) {
51
51
  assert.strictEqual(sitemap['/home'].pageID, 2);
@@ -56,7 +56,7 @@ describe('getSitemapFlat:', function() {
56
56
  done();
57
57
  })
58
58
 
59
- it('should throw error if languageCode not passed as argument for getSitemapFlat', function(done) {
59
+ it('should throw error if locale not passed as argument for getSitemapFlat', function(done) {
60
60
  expect(function() {
61
61
  var api = createApiClient();
62
62
  api.getSitemapFlat({
@@ -18,7 +18,7 @@ describe('getSitemapNested:', function() {
18
18
  var api = createApiClient();
19
19
  api.getSitemapNested({
20
20
  channelName: 'website',
21
- languageCode: 'en-us'
21
+ locale: 'en-us'
22
22
  })
23
23
  .then(function(sitemap) {
24
24
  assert.strictEqual(sitemap[0].pageID, 2);
@@ -31,7 +31,7 @@ describe('getSitemapNested:', function() {
31
31
  var api = createPreviewApiClient();
32
32
  api.getSitemapNested({
33
33
  channelName: 'website',
34
- languageCode: 'en-us'
34
+ locale: 'en-us'
35
35
  })
36
36
  .then(function(sitemap) {
37
37
  assert.strictEqual(sitemap[0].pageID, 2);
@@ -45,7 +45,7 @@ describe('getSitemapNested:', function() {
45
45
  var api = createApiClient();
46
46
  api.getSitemapNested({
47
47
  someOtherParam: 1,
48
- languageCode: 'en-us'
48
+ locale: 'en-us'
49
49
  })
50
50
  .then(function(sitemap) {
51
51
  assert.strictEqual(sitemap[0].pageID, 2);
@@ -56,7 +56,7 @@ describe('getSitemapNested:', function() {
56
56
  done();
57
57
  })
58
58
 
59
- it('should throw error if languageCode not passed as argument for getSitemapNested', function(done) {
59
+ it('should throw error if locale not passed as argument for getSitemapNested', function(done) {
60
60
  expect(function() {
61
61
  var api = createApiClient();
62
62
  api.getSitemapNested({
@@ -27,7 +27,7 @@ describe('getSyncContent:', function () {
27
27
  api.getSyncContent({
28
28
  syncToken: syncToken,
29
29
  pageSize: 100,
30
- languageCode: 'en-us'
30
+ locale: 'en-us'
31
31
  })
32
32
  .then(function (syncRet) {
33
33
 
@@ -27,7 +27,7 @@ describe('getSyncPages:', function () {
27
27
  api.getSyncPages({
28
28
  syncToken: syncToken,
29
29
  pageSize: 100,
30
- languageCode: 'en-us'
30
+ locale: 'en-us'
31
31
  })
32
32
  .then(function (syncRet) {
33
33