@miso.ai/server-wordpress 0.6.3-beta.10 → 0.6.3-beta.11

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/cli/entities.js CHANGED
@@ -2,7 +2,7 @@ import { Transform } from 'stream';
2
2
  import split2 from 'split2';
3
3
  import { stream, parseDuration } from '@miso.ai/server-commons';
4
4
  import { WordPressClient } from '../src/index.js';
5
- import { normalizeOptions, normalizeTransform, parseDate } from './utils.js';
5
+ import { normalizeOptions, normalizeTransform } from './utils.js';
6
6
 
7
7
  export function buildForEntities(yargs) {
8
8
  // TODO: make them mutually exclusive
@@ -34,7 +34,7 @@ export function buildForEntities(yargs) {
34
34
  })
35
35
  .option('ids', {
36
36
  alias: 'include',
37
- describe: 'Specify post ids'
37
+ describe: 'Specify post ids',
38
38
  })
39
39
  .option('fields', {
40
40
  describe: 'Specify which record fields are retrieved',
package/cli/utils.js CHANGED
@@ -3,8 +3,9 @@ import { startOfDate, endOfDate } from '@miso.ai/server-commons';
3
3
 
4
4
  const PWD = process.env.PWD;
5
5
 
6
- export function normalizeOptions({ date, after, before, ids, ...options }) {
6
+ export function normalizeOptions({ date, after, before, ids, include, ...options }) {
7
7
  [after, before] = [startOfDate(date || after), endOfDate(date || before)];
8
+ // TODO: rely on yargs to coerce to array
8
9
  ids = ids ? `${ids}`.split(',').map(s => s.trim()) : ids;
9
10
  return { ...options, after, before, ids };
10
11
  }
package/package.json CHANGED
@@ -17,9 +17,9 @@
17
17
  "simonpai <simon.pai@askmiso.com>"
18
18
  ],
19
19
  "dependencies": {
20
- "@miso.ai/server-commons": "0.6.3-beta.10",
21
- "axios": "^0.27.2",
20
+ "@miso.ai/server-commons": "0.6.3-beta.11",
21
+ "axios": "^1.6.2",
22
22
  "axios-retry": "^3.3.1"
23
23
  },
24
- "version": "0.6.3-beta.10"
24
+ "version": "0.6.3-beta.11"
25
25
  }
package/src/helpers.js CHANGED
@@ -11,7 +11,7 @@ const STREAM_OPTIONS = ['offset', 'limit', 'strategy', 'filter', 'transform', 'o
11
11
  function createAxios(client) {
12
12
  const { auth } = client._options || {};
13
13
  const headers = {
14
- 'User-Agent': `MisoWordPressTool/${version}`,
14
+ 'User-Agent': `MisoBot/${version}`,
15
15
  };
16
16
  if (auth) {
17
17
  if (typeof auth === 'object' && auth.username && auth.password) {
@@ -53,7 +53,7 @@ export default class WordPressDataSource {
53
53
 
54
54
  async _buildBaseUrl() {
55
55
  // exclude parameters meant to be dealt with state
56
- const { page, ...options } = this._options;
56
+ const { page, ids, ...options } = this._options;
57
57
  return this._helpers.url.build(this._resource, options);
58
58
  }
59
59
 
package/src/version.js CHANGED
@@ -1 +1 @@
1
- export default '0.6.3-beta.10';
1
+ export default '0.6.3-beta.11';