mx-cloud 0.0.4 → 0.0.5

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.
@@ -30,6 +30,7 @@ declare global {
30
30
  * Defines optional intepreter options (passed in constructor)
31
31
  */
32
32
  interface InterpreterOptions {
33
+ mode?: string;
33
34
  maxRepeats: number;
34
35
  maxConcurrency: number;
35
36
  serializableCallback: (output: any) => (void | Promise<void>);
@@ -378,6 +378,10 @@ class Interpreter extends events_1.EventEmitter {
378
378
  if ((_a = this.options.debugChannel) === null || _a === void 0 ? void 0 : _a.setActionType) {
379
379
  this.options.debugChannel.setActionType('scrapeSchema');
380
380
  }
381
+ if (this.options.mode && this.options.mode === 'editor') {
382
+ yield this.options.serializableCallback({});
383
+ return;
384
+ }
381
385
  yield this.ensureScriptsLoaded(page);
382
386
  const scrapeResult = yield page.evaluate((schemaObj) => window.scrapeSchema(schemaObj), schema);
383
387
  if (!this.cumulativeResults || !Array.isArray(this.cumulativeResults)) {
@@ -401,6 +405,10 @@ class Interpreter extends events_1.EventEmitter {
401
405
  if ((_a = this.options.debugChannel) === null || _a === void 0 ? void 0 : _a.setActionType) {
402
406
  this.options.debugChannel.setActionType('scrapeList');
403
407
  }
408
+ if (this.options.mode && this.options.mode === 'editor') {
409
+ yield this.options.serializableCallback({});
410
+ return;
411
+ }
404
412
  yield this.ensureScriptsLoaded(page);
405
413
  let scrapeResults = [];
406
414
  if (!config.pagination) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mx-cloud",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "description": "mx cloud",
5
5
  "main": "build/index.js",
6
6
  "typings": "build/index.d.ts",