@miso.ai/server-wordpress 0.6.3-beta.16 → 0.6.3-beta.18

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
@@ -1,4 +1,5 @@
1
1
  import { Transform } from 'stream';
2
+ import { pipeline } from 'stream/promises';
2
3
  import split2 from 'split2';
3
4
  import { stream, parseDuration } from '@miso.ai/server-commons';
4
5
  import { WordPressClient } from '../src/index.js';
@@ -51,13 +52,10 @@ export async function runTerms(client, name, options) {
51
52
  }
52
53
  }
53
54
 
54
- export async function runGet(client, name, { transform, ...options }) {
55
- await stream.pipelineToStdout(
56
- await client.entities(name).stream({
57
- ...options,
58
- transform,
59
- }),
60
- stream.stringify(),
55
+ export async function runGet(client, name, options) {
56
+ await pipeline(
57
+ await client.entities(name).stream(options),
58
+ new stream.OutputStream(),
61
59
  );
62
60
  }
63
61
 
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.16",
20
+ "@miso.ai/server-commons": "0.6.3-beta.18",
21
21
  "axios": "^1.6.2",
22
22
  "axios-retry": "^3.3.1"
23
23
  },
24
- "version": "0.6.3-beta.16"
24
+ "version": "0.6.3-beta.18"
25
25
  }
package/src/helpers.js CHANGED
@@ -44,9 +44,9 @@ export default class Helpers {
44
44
  return this._axios;
45
45
  }
46
46
 
47
- async stream(resource, options) {
47
+ async stream(resource, options = {}) {
48
48
  const [streamOptions, sourceOptions] = splitObj(options, STREAM_OPTIONS);
49
- const source = new DataSource(this, resource, sourceOptions);
49
+ const source = options.source || new DataSource(this, resource, sourceOptions);
50
50
  return new stream.BufferedReadStream(source, { ...streamOptions, debug: this.debug });
51
51
  }
52
52
 
package/src/version.js CHANGED
@@ -1 +1 @@
1
- export default '0.6.3-beta.16';
1
+ export default '0.6.3-beta.18';