@xuda.io/xuda-worker-bundle-min 1.3.495 → 1.3.497
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/index.js +59 -41
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -354,9 +354,10 @@ func.common.db = async function (
|
|
|
354
354
|
table_id: dataP.table_id,
|
|
355
355
|
entire_table: table_req_id === rep_id,
|
|
356
356
|
source: "runtime",
|
|
357
|
+
e: data,
|
|
357
358
|
});
|
|
358
359
|
}
|
|
359
|
-
func.db.pouch.set_db_replication_from_server(SESSION_ID
|
|
360
|
+
func.db.pouch.set_db_replication_from_server(SESSION_ID);
|
|
360
361
|
} catch (err) {}
|
|
361
362
|
}
|
|
362
363
|
return json;
|
|
@@ -408,40 +409,54 @@ func.common.db = async function (
|
|
|
408
409
|
}
|
|
409
410
|
};
|
|
410
411
|
const delete_dbs_pouch = async function (db) {
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
412
|
+
for await (let row_id of dataP.ids) {
|
|
413
|
+
try {
|
|
414
|
+
const { code: table_req_code, data: table_req_id } =
|
|
415
|
+
await validate_existence_of_whole_table_request(db);
|
|
414
416
|
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
417
|
+
if (table_req_code > 0) {
|
|
418
|
+
data.full_table_downloaded = true;
|
|
419
|
+
}
|
|
418
420
|
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
421
|
+
await db.get(row_id);
|
|
422
|
+
let _data = _.cloneDeep(dataP);
|
|
423
|
+
_data.ids = [row_id];
|
|
424
|
+
return await func.db.pouch["dbs_delete"](SESSION_ID, _data);
|
|
425
|
+
} catch (err) {
|
|
426
|
+
return await func.common.perform_rpi_request(
|
|
427
|
+
SESSION_ID,
|
|
428
|
+
serviceP,
|
|
429
|
+
opt,
|
|
430
|
+
data
|
|
431
|
+
);
|
|
432
|
+
}
|
|
428
433
|
}
|
|
429
434
|
};
|
|
430
435
|
if (
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
436
|
+
typeof IS_DOCKER === "undefined" &&
|
|
437
|
+
typeof IS_PROCESS_SERVER === "undefined"
|
|
438
|
+
// ||
|
|
439
|
+
// !SESSION_OBJ?.[SESSION_ID]?.rpi_http_methods?.includes(serviceP)
|
|
434
440
|
) {
|
|
435
441
|
// (await func.db.pouch.get_replication_stat(SESSION_ID)) &&
|
|
436
442
|
// (_session.engine_mode === "live_preview" ||
|
|
437
443
|
// APP_OBJ[_session.APP_ID].app_available_offline)
|
|
438
|
-
|
|
444
|
+
|
|
445
|
+
try {
|
|
446
|
+
if (!SESSION_OBJ?.[SESSION_ID]?.rpi_http_methods?.includes(serviceP)) {
|
|
447
|
+
throw "";
|
|
448
|
+
}
|
|
449
|
+
if (!(await func?.db?.pouch?.get_replication_stat(SESSION_ID)))
|
|
450
|
+
throw "";
|
|
439
451
|
const db = await func.utils.connect_pouchdb(SESSION_ID);
|
|
440
452
|
switch (serviceP) {
|
|
441
453
|
case "dbs_read": {
|
|
442
454
|
try {
|
|
443
455
|
return success_callback(await read_dbs_pouch(db));
|
|
444
456
|
} catch (err) {
|
|
457
|
+
if (err === "creating index in progress") {
|
|
458
|
+
throw "";
|
|
459
|
+
}
|
|
445
460
|
return error_callback(err);
|
|
446
461
|
}
|
|
447
462
|
break;
|
|
@@ -484,30 +499,32 @@ func.common.db = async function (
|
|
|
484
499
|
}
|
|
485
500
|
|
|
486
501
|
default:
|
|
487
|
-
try {
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
} catch (err) {
|
|
496
|
-
|
|
497
|
-
}
|
|
502
|
+
// try {
|
|
503
|
+
// const json = await func.common.perform_rpi_request(
|
|
504
|
+
// SESSION_ID,
|
|
505
|
+
// serviceP,
|
|
506
|
+
// opt,
|
|
507
|
+
// data
|
|
508
|
+
// );
|
|
509
|
+
// return success_callback(json, true);
|
|
510
|
+
// } catch (err) {
|
|
511
|
+
// return error_callback(err);
|
|
512
|
+
// }
|
|
513
|
+
throw "";
|
|
498
514
|
break;
|
|
499
515
|
}
|
|
500
|
-
}
|
|
501
|
-
try {
|
|
502
|
-
const json = await func.common.perform_rpi_request(
|
|
503
|
-
SESSION_ID,
|
|
504
|
-
serviceP,
|
|
505
|
-
opt,
|
|
506
|
-
data
|
|
507
|
-
);
|
|
508
|
-
return success_callback(json, true);
|
|
509
516
|
} catch (err) {
|
|
510
|
-
|
|
517
|
+
try {
|
|
518
|
+
const json = await func.common.perform_rpi_request(
|
|
519
|
+
SESSION_ID,
|
|
520
|
+
serviceP,
|
|
521
|
+
opt,
|
|
522
|
+
data
|
|
523
|
+
);
|
|
524
|
+
return success_callback(json, true);
|
|
525
|
+
} catch (err) {
|
|
526
|
+
return error_callback(err);
|
|
527
|
+
}
|
|
511
528
|
}
|
|
512
529
|
}
|
|
513
530
|
|
|
@@ -1490,6 +1507,7 @@ func.datasource.prepare = async function (
|
|
|
1490
1507
|
worker_id
|
|
1491
1508
|
) {
|
|
1492
1509
|
const set_parameters = async function () {
|
|
1510
|
+
var _session = SESSION_OBJ[SESSION_ID];
|
|
1493
1511
|
const get_Out_parameters = async function (
|
|
1494
1512
|
fieldIdP,
|
|
1495
1513
|
located_field_param_idxP,
|