@transifex/native 4.3.0 → 5.0.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@transifex/native",
3
- "version": "4.3.0",
3
+ "version": "5.0.1",
4
4
  "description": "i18n framework using Transifex Native",
5
5
  "keywords": [
6
6
  "transifex",
package/src/TxNative.js CHANGED
@@ -30,6 +30,7 @@ export default class TxNative {
30
30
  this.token = '';
31
31
  this.secret = '';
32
32
  this.filterTags = '';
33
+ this.filterStatus = '';
33
34
  this.fetchTimeout = 0;
34
35
  this.fetchInterval = 250;
35
36
  this.cache = new MemoryCache();
@@ -48,6 +49,7 @@ export default class TxNative {
48
49
  * @param {Object} params
49
50
  * @param {String} params.cdsHost
50
51
  * @param {String} params.filterTags
52
+ * @param {String} params.filterStatus
51
53
  * @param {String} params.token
52
54
  * @param {String} params.secret
53
55
  * @param {Number} params.fetchTimeout
@@ -65,6 +67,7 @@ export default class TxNative {
65
67
  'secret',
66
68
  'cache',
67
69
  'filterTags',
70
+ 'filterStatus',
68
71
  'fetchTimeout',
69
72
  'fetchInterval',
70
73
  'missingPolicy',
@@ -203,8 +206,15 @@ export default class TxNative {
203
206
  while (lastResponseStatus === 202) {
204
207
  /* eslint-disable no-await-in-loop */
205
208
  let url = `${this.cdsHost}/content/${localeCode}`;
209
+ const getOptions = [];
206
210
  if (filterTags) {
207
- url = `${url}?filter[tags]=${filterTags}`;
211
+ getOptions.push(`filter[tags]=${filterTags}`);
212
+ }
213
+ if (this.filterStatus) {
214
+ getOptions.push(`filter[status]=${this.filterStatus}`);
215
+ }
216
+ if (getOptions.length) {
217
+ url = `${url}?${getOptions.join('&')}`;
208
218
  }
209
219
  response = await axios.get(url, {
210
220
  headers: {