@miso.ai/server-wordpress 0.6.6-beta.1 → 0.6.6-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
@@ -123,20 +123,6 @@ async function buildUpdateStream(client, name, update, {
123
123
  modifiedAfter: threshold,
124
124
  before: threshold,
125
125
  }),
126
- /*
127
- entities.stream({
128
- ...options,
129
- transform,
130
- orderBy: 'modified',
131
- before: threshold,
132
- pageSize: 20,
133
- strategy: {
134
- highWatermark: 100,
135
- eagerLoad: true,
136
- terminate: entity => parseDate(entity.modified_gmt) < threshold,
137
- },
138
- })
139
- */
140
126
  ])
141
127
  );
142
128
  }
package/package.json CHANGED
@@ -17,12 +17,12 @@
17
17
  "simonpai <simon.pai@askmiso.com>"
18
18
  ],
19
19
  "dependencies": {
20
- "@miso.ai/server-commons": "0.6.6-beta.1",
20
+ "@miso.ai/server-commons": "0.6.6-beta.11",
21
21
  "axios": "^1.6.2",
22
22
  "axios-retry": "^3.3.1",
23
23
  "dotenv": "^16.4.5",
24
24
  "saxes": "^6.0.0",
25
25
  "split2": "^4.2.0"
26
26
  },
27
- "version": "0.6.6-beta.1"
27
+ "version": "0.6.6-beta.11"
28
28
  }
@@ -50,7 +50,7 @@ export default class EntityIndex {
50
50
  if (this.hierarchical) {
51
51
  return; // already all fetched
52
52
  }
53
- ids = asArray(ids).filter(id => id); // discard 0, null, undefined
53
+ ids = asArray(ids).filter(id => id && Number.isInteger(Number(id))); // discard 0, null, undefined, non-integer
54
54
 
55
55
  const promises = []
56
56
  const idsToFetch = [];
@@ -24,6 +24,9 @@ export class Entities {
24
24
  return this._client._helpers.stream(this.name, options);
25
25
  }
26
26
  const client = this._client;
27
+ if (transform === true) {
28
+ transform = (this._client._options.transforms || {})[this.name] || transform;
29
+ }
27
30
  transform = await _getTransformFn(client, this.name, transform);
28
31
 
29
32
  // we need taxonomy fetched so we know whether it's hierarchical
@@ -39,7 +39,7 @@ export default class WordPressDataSource {
39
39
  return { data: [], terminate: true };
40
40
  }
41
41
  if (!Array.isArray(data)) {
42
- throw new Error(`Unexpected response from WordPress API for ${url}. Expected an array of objects: ${data}`);
42
+ throw new Error(`Unexpected response from WordPress API for ${url}. Expected an array of objects: ${typeof data === 'object' ? JSON.stringify(data) : data}`);
43
43
  }
44
44
  const { records } = request;
45
45
  if (records) {
package/src/version.js CHANGED
@@ -1 +1 @@
1
- export default '0.6.6-beta.1';
1
+ export default '0.6.6-beta.11';