@slavmak2486/bx24ts 1.2.8 → 1.2.10

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.
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BX24Local = void 0;
4
+ class BX24Local {
5
+ constructor(BX24Rest) {
6
+ this.BX24Rest = BX24Rest;
7
+ }
8
+ callBatch(cmd, cb, haltOnError = false) {
9
+ if (typeof cb === "function") {
10
+ this.BX24Rest.callBatch(cmd, cb, haltOnError);
11
+ return;
12
+ }
13
+ haltOnError = typeof cb === "boolean" ? cb : haltOnError;
14
+ return new Promise((res, rej) => {
15
+ try {
16
+ this.callBatch(cmd, result => {
17
+ res(result);
18
+ });
19
+ }
20
+ catch (error) {
21
+ rej(error);
22
+ }
23
+ });
24
+ }
25
+ callMethod(method, params, cb) {
26
+ if (typeof cb === 'function') {
27
+ this.BX24Rest.callMethod(method, params, cb);
28
+ return;
29
+ }
30
+ return new Promise((resolve, reject) => {
31
+ try {
32
+ this.callMethod(method, params, result => {
33
+ resolve(result);
34
+ });
35
+ }
36
+ catch (error) {
37
+ reject(error);
38
+ }
39
+ });
40
+ }
41
+ }
42
+ exports.BX24Local = BX24Local;
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Bx24Hook = exports.baseBX24 = exports.BatchHelper = exports.BX24Dev = exports.BX24Server = exports.BX24 = void 0;
3
+ exports.BX24Local = exports.Bx24Hook = exports.baseBX24 = exports.BatchHelper = exports.BX24Dev = exports.BX24Server = exports.BX24 = void 0;
4
4
  var BX24_1 = require("./BX24");
5
5
  Object.defineProperty(exports, "BX24", { enumerable: true, get: function () { return BX24_1.BX24; } });
6
6
  var BX24Server_1 = require("./BX24Server");
@@ -13,3 +13,5 @@ var BX24_2 = require("./base/BX24");
13
13
  Object.defineProperty(exports, "baseBX24", { enumerable: true, get: function () { return BX24_2.baseBX24; } });
14
14
  var BX24Hook_1 = require("./BX24Hook");
15
15
  Object.defineProperty(exports, "Bx24Hook", { enumerable: true, get: function () { return BX24Hook_1.Bx24Hook; } });
16
+ var BX24Local_1 = require("./BX24Local");
17
+ Object.defineProperty(exports, "BX24Local", { enumerable: true, get: function () { return BX24Local_1.BX24Local; } });
package/index.ts CHANGED
@@ -4,3 +4,4 @@ export { BX24Dev} from './BX24Dev';
4
4
  export { BatchHelper} from './BatchHelper';
5
5
  export { baseBX24 } from './base/BX24';
6
6
  export {Bx24Hook} from './BX24Hook';
7
+ export {BX24Local} from './BX24Local';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slavmak2486/bx24ts",
3
- "version": "1.2.8",
3
+ "version": "1.2.10",
4
4
  "description": "Library for bitrix24",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",