@or-sdk/idw 2.0.9 → 2.0.10-beta.1666.0

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.
Files changed (43) hide show
  1. package/dist/cjs/api/idwRwcApi.js +116 -0
  2. package/dist/cjs/api/idwRwcApi.js.map +1 -0
  3. package/dist/cjs/api/index.js +3 -1
  4. package/dist/cjs/api/index.js.map +1 -1
  5. package/dist/cjs/idwApi.js +1 -0
  6. package/dist/cjs/idwApi.js.map +1 -1
  7. package/dist/cjs/index.js +0 -1
  8. package/dist/cjs/index.js.map +1 -1
  9. package/dist/cjs/types/idwRwc.js +11 -0
  10. package/dist/cjs/types/idwRwc.js.map +1 -0
  11. package/dist/cjs/types/index.js +1 -0
  12. package/dist/cjs/types/index.js.map +1 -1
  13. package/dist/esm/api/idwRwcApi.js +71 -0
  14. package/dist/esm/api/idwRwcApi.js.map +1 -0
  15. package/dist/esm/api/index.js +1 -0
  16. package/dist/esm/api/index.js.map +1 -1
  17. package/dist/esm/idwApi.js +2 -1
  18. package/dist/esm/idwApi.js.map +1 -1
  19. package/dist/esm/index.js +0 -1
  20. package/dist/esm/index.js.map +1 -1
  21. package/dist/esm/types/idwRwc.js +8 -0
  22. package/dist/esm/types/idwRwc.js.map +1 -0
  23. package/dist/esm/types/index.js +1 -0
  24. package/dist/esm/types/index.js.map +1 -1
  25. package/dist/types/api/idwRwcApi.d.ts +16 -0
  26. package/dist/types/api/idwRwcApi.d.ts.map +1 -0
  27. package/dist/types/api/index.d.ts +1 -0
  28. package/dist/types/api/index.d.ts.map +1 -1
  29. package/dist/types/idwApi.d.ts +2 -1
  30. package/dist/types/idwApi.d.ts.map +1 -1
  31. package/dist/types/index.d.ts +0 -1
  32. package/dist/types/index.d.ts.map +1 -1
  33. package/dist/types/types/idwRwc.d.ts +14 -0
  34. package/dist/types/types/idwRwc.d.ts.map +1 -0
  35. package/dist/types/types/index.d.ts +1 -0
  36. package/dist/types/types/index.d.ts.map +1 -1
  37. package/package.json +2 -3
  38. package/src/api/idwRwcApi.ts +99 -0
  39. package/src/api/index.ts +1 -0
  40. package/src/idwApi.ts +3 -1
  41. package/src/index.ts +0 -1
  42. package/src/types/idwRwc.ts +15 -0
  43. package/src/types/index.ts +2 -0
@@ -0,0 +1,116 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __generator = (this && this.__generator) || function (thisArg, body) {
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
+ function verb(n) { return function (v) { return step([n, v]); }; }
15
+ function step(op) {
16
+ if (f) throw new TypeError("Generator is already executing.");
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
+ if (y = 0, t) op = [op[0] & 2, t.value];
20
+ switch (op[0]) {
21
+ case 0: case 1: t = op; break;
22
+ case 4: _.label++; return { value: op[1], done: false };
23
+ case 5: _.label++; y = op[1]; op = [0]; continue;
24
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
+ default:
26
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
+ if (t[2]) _.ops.pop();
31
+ _.trys.pop(); continue;
32
+ }
33
+ op = body.call(thisArg, _);
34
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
+ }
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.IdwRwcApi = void 0;
40
+ var helpres_1 = require("../helpres");
41
+ var noop = function () { };
42
+ var IdwRwcApi = (function () {
43
+ function IdwRwcApi(providers) {
44
+ this.providers = providers;
45
+ }
46
+ IdwRwcApi.prototype.getRwcUrl = function () {
47
+ return this.providers.makeRequest({
48
+ route: (0, helpres_1.buildRoute)('idw-rwc'),
49
+ method: 'GET',
50
+ });
51
+ };
52
+ IdwRwcApi.prototype.setRwcUrl = function (url) {
53
+ return this.providers.makeRequest({
54
+ route: (0, helpres_1.buildRoute)('idw-rwc'),
55
+ method: 'GET',
56
+ data: {
57
+ idwRwcUrl: url,
58
+ },
59
+ });
60
+ };
61
+ IdwRwcApi.prototype.deleteRwcUrl = function () {
62
+ return this.providers.makeRequest({
63
+ route: (0, helpres_1.buildRoute)('idw-rwc'),
64
+ method: 'DELETE',
65
+ });
66
+ };
67
+ IdwRwcApi.prototype.installRwcChat = function () {
68
+ return this.providers.makeRequest({
69
+ route: (0, helpres_1.buildRoute)('idw-rwc/install'),
70
+ method: 'POST',
71
+ });
72
+ };
73
+ IdwRwcApi.prototype.getChatStatus = function () {
74
+ return this.providers.makeRequest({
75
+ route: (0, helpres_1.buildRoute)('idw-rwc/install'),
76
+ method: 'GET',
77
+ });
78
+ };
79
+ IdwRwcApi.prototype.getSubscriptionOnInstallationProcess = function (pollingInterval, tikCallback, errorCallback) {
80
+ if (tikCallback === void 0) { tikCallback = noop; }
81
+ if (errorCallback === void 0) { errorCallback = noop; }
82
+ var $this = this;
83
+ var intervalId;
84
+ return {
85
+ subscribe: function () {
86
+ var _this = this;
87
+ intervalId = setInterval(function () { return __awaiter(_this, void 0, void 0, function () {
88
+ var status_1, e_1;
89
+ return __generator(this, function (_a) {
90
+ switch (_a.label) {
91
+ case 0:
92
+ _a.trys.push([0, 2, , 3]);
93
+ return [4, $this.getChatStatus()];
94
+ case 1:
95
+ status_1 = _a.sent();
96
+ tikCallback(status_1);
97
+ return [3, 3];
98
+ case 2:
99
+ e_1 = _a.sent();
100
+ errorCallback(e_1);
101
+ this.unsubscribe();
102
+ return [3, 3];
103
+ case 3: return [2];
104
+ }
105
+ });
106
+ }); }, pollingInterval);
107
+ },
108
+ unsubscribe: function () {
109
+ clearInterval(intervalId);
110
+ },
111
+ };
112
+ };
113
+ return IdwRwcApi;
114
+ }());
115
+ exports.IdwRwcApi = IdwRwcApi;
116
+ //# sourceMappingURL=idwRwcApi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"idwRwcApi.js","sourceRoot":"","sources":["../../../src/api/idwRwcApi.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,sCAAwC;AAGxC,IAAM,IAAI,GAA0B,cAAO,CAAC,CAAC;AAE7C;IACE,mBACmB,SAAoB;QAApB,cAAS,GAAT,SAAS,CAAW;IACpC,CAAC;IAKJ,6BAAS,GAAT;QACE,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC;YAChC,KAAK,EAAE,IAAA,oBAAU,EAAC,SAAS,CAAC;YAC5B,MAAM,EAAE,KAAK;SACd,CAAC,CAAC;IACL,CAAC;IAKD,6BAAS,GAAT,UAAU,GAAW;QACnB,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC;YAChC,KAAK,EAAE,IAAA,oBAAU,EAAC,SAAS,CAAC;YAC5B,MAAM,EAAE,KAAK;YACb,IAAI,EAAE;gBACJ,SAAS,EAAE,GAAG;aACE;SACnB,CAAC,CAAC;IACL,CAAC;IAKD,gCAAY,GAAZ;QACE,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC;YAChC,KAAK,EAAE,IAAA,oBAAU,EAAC,SAAS,CAAC;YAC5B,MAAM,EAAE,QAAQ;SACjB,CAAC,CAAC;IACL,CAAC;IAKD,kCAAc,GAAd;QACE,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC;YAChC,KAAK,EAAE,IAAA,oBAAU,EAAC,iBAAiB,CAAC;YACpC,MAAM,EAAE,MAAM;SACf,CAAC,CAAC;IACL,CAAC;IAKD,iCAAa,GAAb;QACE,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC;YAChC,KAAK,EAAE,IAAA,oBAAU,EAAC,iBAAiB,CAAC;YACpC,MAAM,EAAE,KAAK;SACd,CAAC,CAAC;IACL,CAAC;IAQD,wDAAoC,GAApC,UACE,eAAuB,EACvB,WAAuD,EACvD,aAA0C;QAD1C,4BAAA,EAAA,kBAAuD;QACvD,8BAAA,EAAA,oBAA0C;QAG1C,IAAM,KAAK,GAAG,IAAI,CAAC;QACnB,IAAI,UAAoC,CAAC;QAEzC,OAAO;YACL,SAAS,EAAE;gBAAA,iBAUV;gBATC,UAAU,GAAG,WAAW,CAAC;;;;;;gCAEN,WAAM,KAAK,CAAC,aAAa,EAAE,EAAA;;gCAApC,WAAS,SAA2B;gCAC1C,WAAW,CAAC,QAAM,CAAC,CAAC;;;;gCAEpB,aAAa,CAAC,GAAC,CAAC,CAAC;gCACjB,IAAI,CAAC,WAAW,EAAE,CAAC;;;;;qBAEtB,EAAE,eAAe,CAAC,CAAC;YACtB,CAAC;YACD,WAAW,EAAE;gBACX,aAAa,CAAC,UAAU,CAAC,CAAC;YAC5B,CAAC;SACF,CAAC;IACJ,CAAC;IAEH,gBAAC;AAAD,CAAC,AA3FD,IA2FC;AA3FY,8BAAS"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.IdwDbApi = exports.IdwInfoApi = exports.MigrationApi = exports.SkillApi = void 0;
3
+ exports.IdwRwcApi = exports.IdwDbApi = exports.IdwInfoApi = exports.MigrationApi = exports.SkillApi = void 0;
4
4
  var skillApi_1 = require("./skillApi");
5
5
  Object.defineProperty(exports, "SkillApi", { enumerable: true, get: function () { return skillApi_1.SkillApi; } });
6
6
  var migrationApi_1 = require("./migrationApi");
@@ -9,4 +9,6 @@ var idwInfoApi_1 = require("./idwInfoApi");
9
9
  Object.defineProperty(exports, "IdwInfoApi", { enumerable: true, get: function () { return idwInfoApi_1.IdwInfoApi; } });
10
10
  var idwDbApi_1 = require("./idwDbApi");
11
11
  Object.defineProperty(exports, "IdwDbApi", { enumerable: true, get: function () { return idwDbApi_1.IdwDbApi; } });
12
+ var idwRwcApi_1 = require("./idwRwcApi");
13
+ Object.defineProperty(exports, "IdwRwcApi", { enumerable: true, get: function () { return idwRwcApi_1.IdwRwcApi; } });
12
14
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/index.ts"],"names":[],"mappings":";;;AAAA,uCAAsC;AAA7B,oGAAA,QAAQ,OAAA;AACjB,+CAA8C;AAArC,4GAAA,YAAY,OAAA;AACrB,2CAA0C;AAAjC,wGAAA,UAAU,OAAA;AACnB,uCAAsC;AAA7B,oGAAA,QAAQ,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/index.ts"],"names":[],"mappings":";;;AAAA,uCAAsC;AAA7B,oGAAA,QAAQ,OAAA;AACjB,+CAA8C;AAArC,4GAAA,YAAY,OAAA;AACrB,2CAA0C;AAAjC,wGAAA,UAAU,OAAA;AACnB,uCAAsC;AAA7B,oGAAA,QAAQ,OAAA;AACjB,yCAAwC;AAA/B,sGAAA,SAAS,OAAA"}
@@ -15,6 +15,7 @@ var IdwApi = (function () {
15
15
  this.migrationApi = new api_1.MigrationApi(provider);
16
16
  this.idwInfoApi = new api_1.IdwInfoApi(provider);
17
17
  this.idwDbApi = new api_1.IdwDbApi(provider);
18
+ this.idwRwcApi = new api_1.IdwRwcApi(provider);
18
19
  }
19
20
  return IdwApi;
20
21
  }());
@@ -1 +1 @@
1
- {"version":3,"file":"idwApi.js","sourceRoot":"","sources":["../../src/idwApi.ts"],"names":[],"mappings":";;;AACA,6BAAqE;AACrE,+CAA8C;AAE9C;IAKE,gBAAY,EAAkD;YAAhD,iBAAiB,uBAAA,EAAE,KAAK,WAAA,EAAE,KAAK,WAAA;QAC3C,IAAM,QAAQ,GAAG,IAAI,qBAAS,CAAC;YAC7B,KAAK,OAAA;YACL,eAAe,EAAE,KAAK;YACtB,kBAAkB,EAAE,iBAAiB;SACtC,CAAC,CAAC;QAEH,IAAI,CAAC,QAAQ,GAAG,IAAI,cAAQ,CAAC,QAAQ,CAAC,CAAC;QACvC,IAAI,CAAC,YAAY,GAAG,IAAI,kBAAY,CAAC,QAAQ,CAAC,CAAC;QAC/C,IAAI,CAAC,UAAU,GAAG,IAAI,gBAAU,CAAC,QAAQ,CAAC,CAAC;QAC3C,IAAI,CAAC,QAAQ,GAAG,IAAI,cAAQ,CAAC,QAAQ,CAAC,CAAC;IACzC,CAAC;IACH,aAAC;AAAD,CAAC,AAjBD,IAiBC;AAjBY,wBAAM"}
1
+ {"version":3,"file":"idwApi.js","sourceRoot":"","sources":["../../src/idwApi.ts"],"names":[],"mappings":";;;AACA,6BAAgF;AAChF,+CAA8C;AAE9C;IAME,gBAAY,EAAkD;YAAhD,iBAAiB,uBAAA,EAAE,KAAK,WAAA,EAAE,KAAK,WAAA;QAC3C,IAAM,QAAQ,GAAG,IAAI,qBAAS,CAAC;YAC7B,KAAK,OAAA;YACL,eAAe,EAAE,KAAK;YACtB,kBAAkB,EAAE,iBAAiB;SACtC,CAAC,CAAC;QAEH,IAAI,CAAC,QAAQ,GAAG,IAAI,cAAQ,CAAC,QAAQ,CAAC,CAAC;QACvC,IAAI,CAAC,YAAY,GAAG,IAAI,kBAAY,CAAC,QAAQ,CAAC,CAAC;QAC/C,IAAI,CAAC,UAAU,GAAG,IAAI,gBAAU,CAAC,QAAQ,CAAC,CAAC;QAC3C,IAAI,CAAC,QAAQ,GAAG,IAAI,cAAQ,CAAC,QAAQ,CAAC,CAAC;QACvC,IAAI,CAAC,SAAS,GAAG,IAAI,eAAS,CAAC,QAAQ,CAAC,CAAC;IAC3C,CAAC;IACH,aAAC;AAAD,CAAC,AAnBD,IAmBC;AAnBY,wBAAM"}
package/dist/cjs/index.js CHANGED
@@ -34,5 +34,4 @@ exports.migrations = __importStar(require("./migrations"));
34
34
  __exportStar(require("./api"), exports);
35
35
  var idwApi_1 = require("./idwApi");
36
36
  Object.defineProperty(exports, "IdwApi", { enumerable: true, get: function () { return idwApi_1.IdwApi; } });
37
- __exportStar(require("./types/"), exports);
38
37
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6BAA4B;AAAnB,0FAAA,GAAG,OAAA;AACZ,0CAAwB;AACxB,2DAA2C;AAC3C,wCAAsB;AACtB,mCAAkC;AAAzB,gGAAA,MAAM,OAAA;AACf,2CAAyB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6BAA4B;AAAnB,0FAAA,GAAG,OAAA;AACZ,0CAAwB;AACxB,2DAA2C;AAC3C,wCAAsB;AACtB,mCAAkC;AAAzB,gGAAA,MAAM,OAAA"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InstallationProcessStatus = void 0;
4
+ var InstallationProcessStatus;
5
+ (function (InstallationProcessStatus) {
6
+ InstallationProcessStatus["installed"] = "installed";
7
+ InstallationProcessStatus["uninstalled"] = "uninstalled";
8
+ InstallationProcessStatus["pending"] = "pending";
9
+ InstallationProcessStatus["notExist"] = "notExist";
10
+ })(InstallationProcessStatus = exports.InstallationProcessStatus || (exports.InstallationProcessStatus = {}));
11
+ //# sourceMappingURL=idwRwc.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"idwRwc.js","sourceRoot":"","sources":["../../../src/types/idwRwc.ts"],"names":[],"mappings":";;;AAIA,IAAY,yBAKX;AALD,WAAY,yBAAyB;IACnC,oDAAsB,CAAA;IACtB,wDAA2B,CAAA;IAC3B,gDAAmB,CAAA;IACnB,kDAAqB,CAAA;AACvB,CAAC,EALW,yBAAyB,GAAzB,iCAAyB,KAAzB,iCAAyB,QAKpC"}
@@ -19,4 +19,5 @@ __exportStar(require("./config"), exports);
19
19
  __exportStar(require("./common"), exports);
20
20
  __exportStar(require("./flow"), exports);
21
21
  __exportStar(require("./idwInfo"), exports);
22
+ __exportStar(require("./idwRwc"), exports);
22
23
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,2CAAyB;AACzB,2CAAyB;AACzB,yCAAuB;AACvB,4CAA0B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,2CAAyB;AACzB,2CAAyB;AACzB,yCAAuB;AACvB,4CAA0B;AAC1B,2CAAyB"}
@@ -0,0 +1,71 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { buildRoute } from '../helpres';
11
+ const noop = () => { };
12
+ export class IdwRwcApi {
13
+ constructor(providers) {
14
+ this.providers = providers;
15
+ }
16
+ getRwcUrl() {
17
+ return this.providers.makeRequest({
18
+ route: buildRoute('idw-rwc'),
19
+ method: 'GET',
20
+ });
21
+ }
22
+ setRwcUrl(url) {
23
+ return this.providers.makeRequest({
24
+ route: buildRoute('idw-rwc'),
25
+ method: 'GET',
26
+ data: {
27
+ idwRwcUrl: url,
28
+ },
29
+ });
30
+ }
31
+ deleteRwcUrl() {
32
+ return this.providers.makeRequest({
33
+ route: buildRoute('idw-rwc'),
34
+ method: 'DELETE',
35
+ });
36
+ }
37
+ installRwcChat() {
38
+ return this.providers.makeRequest({
39
+ route: buildRoute('idw-rwc/install'),
40
+ method: 'POST',
41
+ });
42
+ }
43
+ getChatStatus() {
44
+ return this.providers.makeRequest({
45
+ route: buildRoute('idw-rwc/install'),
46
+ method: 'GET',
47
+ });
48
+ }
49
+ getSubscriptionOnInstallationProcess(pollingInterval, tikCallback = noop, errorCallback = noop) {
50
+ const $this = this;
51
+ let intervalId;
52
+ return {
53
+ subscribe: function () {
54
+ intervalId = setInterval(() => __awaiter(this, void 0, void 0, function* () {
55
+ try {
56
+ const status = yield $this.getChatStatus();
57
+ tikCallback(status);
58
+ }
59
+ catch (e) {
60
+ errorCallback(e);
61
+ this.unsubscribe();
62
+ }
63
+ }), pollingInterval);
64
+ },
65
+ unsubscribe: function () {
66
+ clearInterval(intervalId);
67
+ },
68
+ };
69
+ }
70
+ }
71
+ //# sourceMappingURL=idwRwcApi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"idwRwcApi.js","sourceRoot":"","sources":["../../../src/api/idwRwcApi.ts"],"names":[],"mappings":";;;;;;;;;AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAGxC,MAAM,IAAI,GAA0B,GAAG,EAAE,GAAE,CAAC,CAAC;AAE7C,MAAM,OAAO,SAAS;IACpB,YACmB,SAAoB;QAApB,cAAS,GAAT,SAAS,CAAW;IACpC,CAAC;IAKJ,SAAS;QACP,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC;YAChC,KAAK,EAAE,UAAU,CAAC,SAAS,CAAC;YAC5B,MAAM,EAAE,KAAK;SACd,CAAC,CAAC;IACL,CAAC;IAKD,SAAS,CAAC,GAAW;QACnB,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC;YAChC,KAAK,EAAE,UAAU,CAAC,SAAS,CAAC;YAC5B,MAAM,EAAE,KAAK;YACb,IAAI,EAAE;gBACJ,SAAS,EAAE,GAAG;aACE;SACnB,CAAC,CAAC;IACL,CAAC;IAKD,YAAY;QACV,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC;YAChC,KAAK,EAAE,UAAU,CAAC,SAAS,CAAC;YAC5B,MAAM,EAAE,QAAQ;SACjB,CAAC,CAAC;IACL,CAAC;IAKD,cAAc;QACZ,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC;YAChC,KAAK,EAAE,UAAU,CAAC,iBAAiB,CAAC;YACpC,MAAM,EAAE,MAAM;SACf,CAAC,CAAC;IACL,CAAC;IAKD,aAAa;QACX,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC;YAChC,KAAK,EAAE,UAAU,CAAC,iBAAiB,CAAC;YACpC,MAAM,EAAE,KAAK;SACd,CAAC,CAAC;IACL,CAAC;IAQD,oCAAoC,CAClC,eAAuB,EACvB,cAAmD,IAAI,EACvD,gBAAsC,IAAI;QAG1C,MAAM,KAAK,GAAG,IAAI,CAAC;QACnB,IAAI,UAAoC,CAAC;QAEzC,OAAO;YACL,SAAS,EAAE;gBACT,UAAU,GAAG,WAAW,CAAC,GAAS,EAAE;oBAClC,IAAI;wBACF,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,aAAa,EAAE,CAAC;wBAC3C,WAAW,CAAC,MAAM,CAAC,CAAC;qBACrB;oBAAC,OAAO,CAAC,EAAE;wBACV,aAAa,CAAC,CAAC,CAAC,CAAC;wBACjB,IAAI,CAAC,WAAW,EAAE,CAAC;qBACpB;gBACH,CAAC,CAAA,EAAE,eAAe,CAAC,CAAC;YACtB,CAAC;YACD,WAAW,EAAE;gBACX,aAAa,CAAC,UAAU,CAAC,CAAC;YAC5B,CAAC;SACF,CAAC;IACJ,CAAC;CAEF"}
@@ -2,4 +2,5 @@ export { SkillApi } from './skillApi';
2
2
  export { MigrationApi } from './migrationApi';
3
3
  export { IdwInfoApi } from './idwInfoApi';
4
4
  export { IdwDbApi } from './idwDbApi';
5
+ export { IdwRwcApi } from './idwRwcApi';
5
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC"}
@@ -1,4 +1,4 @@
1
- import { IdwDbApi, IdwInfoApi, MigrationApi, SkillApi } from './api';
1
+ import { IdwDbApi, IdwInfoApi, IdwRwcApi, MigrationApi, SkillApi } from './api';
2
2
  import { Providers } from '@or-sdk/providers';
3
3
  export class IdwApi {
4
4
  constructor({ providerAccountId, emUrl, token }) {
@@ -11,6 +11,7 @@ export class IdwApi {
11
11
  this.migrationApi = new MigrationApi(provider);
12
12
  this.idwInfoApi = new IdwInfoApi(provider);
13
13
  this.idwDbApi = new IdwDbApi(provider);
14
+ this.idwRwcApi = new IdwRwcApi(provider);
14
15
  }
15
16
  }
16
17
  //# sourceMappingURL=idwApi.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"idwApi.js","sourceRoot":"","sources":["../../src/idwApi.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C,MAAM,OAAO,MAAM;IAKjB,YAAY,EAAE,iBAAiB,EAAE,KAAK,EAAE,KAAK,EAAiB;QAC5D,MAAM,QAAQ,GAAG,IAAI,SAAS,CAAC;YAC7B,KAAK;YACL,eAAe,EAAE,KAAK;YACtB,kBAAkB,EAAE,iBAAiB;SACtC,CAAC,CAAC;QAEH,IAAI,CAAC,QAAQ,GAAG,IAAI,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACvC,IAAI,CAAC,YAAY,GAAG,IAAI,YAAY,CAAC,QAAQ,CAAC,CAAC;QAC/C,IAAI,CAAC,UAAU,GAAG,IAAI,UAAU,CAAC,QAAQ,CAAC,CAAC;QAC3C,IAAI,CAAC,QAAQ,GAAG,IAAI,QAAQ,CAAC,QAAQ,CAAC,CAAC;IACzC,CAAC;CACF"}
1
+ {"version":3,"file":"idwApi.js","sourceRoot":"","sources":["../../src/idwApi.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAChF,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C,MAAM,OAAO,MAAM;IAMjB,YAAY,EAAE,iBAAiB,EAAE,KAAK,EAAE,KAAK,EAAiB;QAC5D,MAAM,QAAQ,GAAG,IAAI,SAAS,CAAC;YAC7B,KAAK;YACL,eAAe,EAAE,KAAK;YACtB,kBAAkB,EAAE,iBAAiB;SACtC,CAAC,CAAC;QAEH,IAAI,CAAC,QAAQ,GAAG,IAAI,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACvC,IAAI,CAAC,YAAY,GAAG,IAAI,YAAY,CAAC,QAAQ,CAAC,CAAC;QAC/C,IAAI,CAAC,UAAU,GAAG,IAAI,UAAU,CAAC,QAAQ,CAAC,CAAC;QAC3C,IAAI,CAAC,QAAQ,GAAG,IAAI,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACvC,IAAI,CAAC,SAAS,GAAG,IAAI,SAAS,CAAC,QAAQ,CAAC,CAAC;IAC3C,CAAC;CACF"}
package/dist/esm/index.js CHANGED
@@ -4,5 +4,4 @@ import * as migrations_1 from './migrations';
4
4
  export { migrations_1 as migrations };
5
5
  export * from './api';
6
6
  export { IdwApi } from './idwApi';
7
- export * from './types/';
8
7
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,cAAc,SAAS,CAAC;8BACI,cAAc;yBAA9B,UAAU;AACtB,cAAc,OAAO,CAAC;AACtB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,cAAc,UAAU,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,cAAc,SAAS,CAAC;8BACI,cAAc;yBAA9B,UAAU;AACtB,cAAc,OAAO,CAAC;AACtB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC"}
@@ -0,0 +1,8 @@
1
+ export var InstallationProcessStatus;
2
+ (function (InstallationProcessStatus) {
3
+ InstallationProcessStatus["installed"] = "installed";
4
+ InstallationProcessStatus["uninstalled"] = "uninstalled";
5
+ InstallationProcessStatus["pending"] = "pending";
6
+ InstallationProcessStatus["notExist"] = "notExist";
7
+ })(InstallationProcessStatus || (InstallationProcessStatus = {}));
8
+ //# sourceMappingURL=idwRwc.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"idwRwc.js","sourceRoot":"","sources":["../../../src/types/idwRwc.ts"],"names":[],"mappings":"AAIA,MAAM,CAAN,IAAY,yBAKX;AALD,WAAY,yBAAyB;IACnC,oDAAsB,CAAA;IACtB,wDAA2B,CAAA;IAC3B,gDAAmB,CAAA;IACnB,kDAAqB,CAAA;AACvB,CAAC,EALW,yBAAyB,KAAzB,yBAAyB,QAKpC"}
@@ -3,4 +3,5 @@ export * from './config';
3
3
  export * from './common';
4
4
  export * from './flow';
5
5
  export * from './idwInfo';
6
+ export * from './idwRwc';
6
7
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { Providers } from '@or-sdk/providers';
2
+ import { ChatCheckResponse, IdwInfoWithStatistic } from '../types';
3
+ export declare class IdwRwcApi {
4
+ private readonly providers;
5
+ constructor(providers: Providers);
6
+ getRwcUrl(): Promise<string | undefined>;
7
+ setRwcUrl(url: string): Promise<IdwInfoWithStatistic>;
8
+ deleteRwcUrl(): Promise<void>;
9
+ installRwcChat(): Promise<void>;
10
+ getChatStatus(): Promise<ChatCheckResponse>;
11
+ getSubscriptionOnInstallationProcess(pollingInterval: number, tikCallback?: (status: ChatCheckResponse) => void, errorCallback?: (e: unknown) => void): {
12
+ subscribe: () => void;
13
+ unsubscribe: () => void;
14
+ };
15
+ }
16
+ //# sourceMappingURL=idwRwcApi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"idwRwcApi.d.ts","sourceRoot":"","sources":["../../../src/api/idwRwcApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAMnE,qBAAa,SAAS;IAElB,OAAO,CAAC,QAAQ,CAAC,SAAS;gBAAT,SAAS,EAAE,SAAS;IAMvC,SAAS,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAUxC,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAarD,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAU7B,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;IAU/B,aAAa,IAAI,OAAO,CAAC,iBAAiB,CAAC;IAa3C,oCAAoC,CAClC,eAAe,EAAE,MAAM,EACvB,WAAW,GAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,IAAW,EACvD,aAAa,GAAE,CAAC,CAAC,EAAE,OAAO,KAAK,IAAW;;;;CAwB7C"}
@@ -2,4 +2,5 @@ export { SkillApi } from './skillApi';
2
2
  export { MigrationApi } from './migrationApi';
3
3
  export { IdwInfoApi } from './idwInfoApi';
4
4
  export { IdwDbApi } from './idwDbApi';
5
+ export { IdwRwcApi } from './idwRwcApi';
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC"}
@@ -1,10 +1,11 @@
1
1
  import { IDWBaseConfig } from './types';
2
- import { IdwDbApi, IdwInfoApi, MigrationApi, SkillApi } from './api';
2
+ import { IdwDbApi, IdwInfoApi, IdwRwcApi, MigrationApi, SkillApi } from './api';
3
3
  export declare class IdwApi {
4
4
  readonly skillApi: SkillApi;
5
5
  readonly migrationApi: MigrationApi;
6
6
  readonly idwInfoApi: IdwInfoApi;
7
7
  readonly idwDbApi: IdwDbApi;
8
+ readonly idwRwcApi: IdwRwcApi;
8
9
  constructor({ providerAccountId, emUrl, token }: IDWBaseConfig);
9
10
  }
10
11
  //# sourceMappingURL=idwApi.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"idwApi.d.ts","sourceRoot":"","sources":["../../src/idwApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGrE,qBAAa,MAAM;IACjB,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IACpC,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAChC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;gBAChB,EAAE,iBAAiB,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,aAAa;CAY/D"}
1
+ {"version":3,"file":"idwApi.d.ts","sourceRoot":"","sources":["../../src/idwApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGhF,qBAAa,MAAM;IACjB,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IACpC,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAChC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;gBAClB,EAAE,iBAAiB,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,aAAa;CAa/D"}
@@ -3,5 +3,4 @@ export * from './types';
3
3
  export * as migrations from './migrations';
4
4
  export * from './api';
5
5
  export { IdwApi } from './idwApi';
6
- export * from './types/';
7
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAC3C,cAAc,OAAO,CAAC;AACtB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,cAAc,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAC3C,cAAc,OAAO,CAAC;AACtB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC"}
@@ -0,0 +1,14 @@
1
+ export interface IdwRwcSetData {
2
+ idwRwcUrl: string;
3
+ }
4
+ export declare enum InstallationProcessStatus {
5
+ installed = "installed",
6
+ uninstalled = "uninstalled",
7
+ pending = "pending",
8
+ notExist = "notExist"
9
+ }
10
+ export type ChatCheckResponse = {
11
+ status: InstallationProcessStatus;
12
+ chatLink?: string;
13
+ };
14
+ //# sourceMappingURL=idwRwc.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"idwRwc.d.ts","sourceRoot":"","sources":["../../../src/types/idwRwc.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,oBAAY,yBAAyB;IACnC,SAAS,cAAa;IACtB,WAAW,gBAAgB;IAC3B,OAAO,YAAY;IACnB,QAAQ,aAAa;CACtB;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,yBAAyB,CAAC;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC"}
@@ -3,4 +3,5 @@ export * from './config';
3
3
  export * from './common';
4
4
  export * from './flow';
5
5
  export * from './idwInfo';
6
+ export * from './idwRwc';
6
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC"}
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.0.9",
2
+ "version": "2.0.10-beta.1666.0",
3
3
  "name": "@or-sdk/idw",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/esm/index.js",
@@ -33,6 +33,5 @@
33
33
  "@or-sdk/settings": "^0.24.11",
34
34
  "@or-sdk/users": "^0.30.2",
35
35
  "axios": "^0.24.0"
36
- },
37
- "gitHead": "21eb5f350f91063300e63568fad9c08339a5b52a"
36
+ }
38
37
  }
@@ -0,0 +1,99 @@
1
+ import { Providers } from '@or-sdk/providers';
2
+ import { ChatCheckResponse, IdwInfoWithStatistic } from '../types';
3
+ import { buildRoute } from '../helpres';
4
+ import { IdwRwcSetData } from '../types';
5
+
6
+ const noop: (...args: []) => void = () => {};
7
+
8
+ export class IdwRwcApi {
9
+ constructor(
10
+ private readonly providers: Providers
11
+ ) {}
12
+
13
+ /**
14
+ * Get IDW RWC chat url
15
+ */
16
+ getRwcUrl(): Promise<string | undefined> {
17
+ return this.providers.makeRequest({
18
+ route: buildRoute('idw-rwc'),
19
+ method: 'GET',
20
+ });
21
+ }
22
+
23
+ /**
24
+ * Set IDW RWC chat url
25
+ */
26
+ setRwcUrl(url: string): Promise<IdwInfoWithStatistic> {
27
+ return this.providers.makeRequest({
28
+ route: buildRoute('idw-rwc'),
29
+ method: 'GET',
30
+ data: {
31
+ idwRwcUrl: url,
32
+ } as IdwRwcSetData,
33
+ });
34
+ }
35
+
36
+ /**
37
+ * Remove IDW RWC chat url
38
+ */
39
+ deleteRwcUrl(): Promise<void> {
40
+ return this.providers.makeRequest({
41
+ route: buildRoute('idw-rwc'),
42
+ method: 'DELETE',
43
+ });
44
+ }
45
+
46
+ /**
47
+ * Install Rwc chat
48
+ */
49
+ installRwcChat(): Promise<void> {
50
+ return this.providers.makeRequest({
51
+ route: buildRoute('idw-rwc/install'),
52
+ method: 'POST',
53
+ });
54
+ }
55
+
56
+ /**
57
+ * Get Rwc chat status
58
+ */
59
+ getChatStatus(): Promise<ChatCheckResponse> {
60
+ return this.providers.makeRequest({
61
+ route: buildRoute('idw-rwc/install'),
62
+ method: 'GET',
63
+ });
64
+ }
65
+
66
+ /**
67
+ * Subscribe on rwc chat installation process
68
+ * @param pollingInterval
69
+ * @param tikCallback
70
+ * @param errorCallback
71
+ */
72
+ getSubscriptionOnInstallationProcess(
73
+ pollingInterval: number,
74
+ tikCallback: (status: ChatCheckResponse) => void = noop,
75
+ errorCallback: (e: unknown) => void = noop
76
+ ) {
77
+ // eslint-disable-next-line @typescript-eslint/no-this-alias
78
+ const $this = this;
79
+ let intervalId: NodeJS.Timer | undefined;
80
+
81
+ return {
82
+ subscribe: function () {
83
+ intervalId = setInterval(async () => {
84
+ try {
85
+ const status = await $this.getChatStatus();
86
+ tikCallback(status);
87
+ } catch (e) {
88
+ errorCallback(e);
89
+ this.unsubscribe();
90
+ }
91
+ }, pollingInterval);
92
+ },
93
+ unsubscribe: function () {
94
+ clearInterval(intervalId);
95
+ },
96
+ };
97
+ }
98
+
99
+ }
package/src/api/index.ts CHANGED
@@ -2,3 +2,4 @@ export { SkillApi } from './skillApi';
2
2
  export { MigrationApi } from './migrationApi';
3
3
  export { IdwInfoApi } from './idwInfoApi';
4
4
  export { IdwDbApi } from './idwDbApi';
5
+ export { IdwRwcApi } from './idwRwcApi';
package/src/idwApi.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { IDWBaseConfig } from './types';
2
- import { IdwDbApi, IdwInfoApi, MigrationApi, SkillApi } from './api';
2
+ import { IdwDbApi, IdwInfoApi, IdwRwcApi, MigrationApi, SkillApi } from './api';
3
3
  import { Providers } from '@or-sdk/providers';
4
4
 
5
5
  export class IdwApi {
@@ -7,6 +7,7 @@ export class IdwApi {
7
7
  readonly migrationApi: MigrationApi;
8
8
  readonly idwInfoApi: IdwInfoApi;
9
9
  readonly idwDbApi: IdwDbApi;
10
+ readonly idwRwcApi: IdwRwcApi;
10
11
  constructor({ providerAccountId, emUrl, token }: IDWBaseConfig) {
11
12
  const provider = new Providers({
12
13
  token,
@@ -18,5 +19,6 @@ export class IdwApi {
18
19
  this.migrationApi = new MigrationApi(provider);
19
20
  this.idwInfoApi = new IdwInfoApi(provider);
20
21
  this.idwDbApi = new IdwDbApi(provider);
22
+ this.idwRwcApi = new IdwRwcApi(provider);
21
23
  }
22
24
  }
package/src/index.ts CHANGED
@@ -3,4 +3,3 @@ export * from './types';
3
3
  export * as migrations from './migrations';
4
4
  export * from './api';
5
5
  export { IdwApi } from './idwApi';
6
- export * from './types/';
@@ -0,0 +1,15 @@
1
+ export interface IdwRwcSetData {
2
+ idwRwcUrl: string;
3
+ }
4
+
5
+ export enum InstallationProcessStatus {
6
+ installed= 'installed',
7
+ uninstalled = 'uninstalled',
8
+ pending = 'pending',
9
+ notExist = 'notExist',
10
+ }
11
+
12
+ export type ChatCheckResponse = {
13
+ status: InstallationProcessStatus;
14
+ chatLink?: string;
15
+ };
@@ -3,3 +3,5 @@ export * from './config';
3
3
  export * from './common';
4
4
  export * from './flow';
5
5
  export * from './idwInfo';
6
+ export * from './idwRwc';
7
+