@or-sdk/idw 2.1.0-beta.1667.0 → 2.1.0-beta.1675.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 (68) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/cjs/api/flowApi.js +43 -0
  3. package/dist/cjs/api/flowApi.js.map +1 -0
  4. package/dist/cjs/api/idwRwcApi.js +114 -0
  5. package/dist/cjs/api/idwRwcApi.js.map +1 -0
  6. package/dist/cjs/api/index.js +5 -3
  7. package/dist/cjs/api/index.js.map +1 -1
  8. package/dist/cjs/idwApi.js +3 -1
  9. package/dist/cjs/idwApi.js.map +1 -1
  10. package/dist/cjs/index.js +0 -1
  11. package/dist/cjs/index.js.map +1 -1
  12. package/dist/cjs/types/idwRwc.js +11 -0
  13. package/dist/cjs/types/idwRwc.js.map +1 -0
  14. package/dist/cjs/types/index.js +1 -1
  15. package/dist/cjs/types/index.js.map +1 -1
  16. package/dist/esm/api/flowApi.js +38 -0
  17. package/dist/esm/api/flowApi.js.map +1 -0
  18. package/dist/esm/api/idwRwcApi.js +69 -0
  19. package/dist/esm/api/idwRwcApi.js.map +1 -0
  20. package/dist/esm/api/index.js +2 -1
  21. package/dist/esm/api/index.js.map +1 -1
  22. package/dist/esm/idwApi.js +4 -2
  23. package/dist/esm/idwApi.js.map +1 -1
  24. package/dist/esm/index.js +0 -1
  25. package/dist/esm/index.js.map +1 -1
  26. package/dist/esm/types/idwRwc.js +8 -0
  27. package/dist/esm/types/idwRwc.js.map +1 -0
  28. package/dist/esm/types/index.js +1 -1
  29. package/dist/esm/types/index.js.map +1 -1
  30. package/dist/types/api/flowApi.d.ts +11 -0
  31. package/dist/types/api/flowApi.d.ts.map +1 -0
  32. package/dist/types/api/idwRwcApi.d.ts +16 -0
  33. package/dist/types/api/idwRwcApi.d.ts.map +1 -0
  34. package/dist/types/api/index.d.ts +2 -1
  35. package/dist/types/api/index.d.ts.map +1 -1
  36. package/dist/types/idwApi.d.ts +4 -2
  37. package/dist/types/idwApi.d.ts.map +1 -1
  38. package/dist/types/index.d.ts +0 -1
  39. package/dist/types/index.d.ts.map +1 -1
  40. package/dist/types/types/flow.d.ts +10 -0
  41. package/dist/types/types/flow.d.ts.map +1 -1
  42. package/dist/types/types/idwRwc.d.ts +15 -0
  43. package/dist/types/types/idwRwc.d.ts.map +1 -0
  44. package/dist/types/types/index.d.ts +1 -1
  45. package/dist/types/types/index.d.ts.map +1 -1
  46. package/package.json +1 -1
  47. package/src/api/flowApi.ts +60 -0
  48. package/src/api/idwRwcApi.ts +96 -0
  49. package/src/api/index.ts +2 -1
  50. package/src/idwApi.ts +6 -3
  51. package/src/index.ts +0 -1
  52. package/src/types/flow.ts +10 -0
  53. package/src/types/idwRwc.ts +17 -0
  54. package/src/types/index.ts +2 -1
  55. package/dist/cjs/api/channelApi.js +0 -62
  56. package/dist/cjs/api/channelApi.js.map +0 -1
  57. package/dist/cjs/types/channel.js +0 -3
  58. package/dist/cjs/types/channel.js.map +0 -1
  59. package/dist/esm/api/channelApi.js +0 -57
  60. package/dist/esm/api/channelApi.js.map +0 -1
  61. package/dist/esm/types/channel.js +0 -2
  62. package/dist/esm/types/channel.js.map +0 -1
  63. package/dist/types/api/channelApi.d.ts +0 -14
  64. package/dist/types/api/channelApi.d.ts.map +0 -1
  65. package/dist/types/types/channel.d.ts +0 -19
  66. package/dist/types/types/channel.d.ts.map +0 -1
  67. package/src/api/channelApi.ts +0 -93
  68. package/src/types/channel.ts +0 -9
@@ -0,0 +1,15 @@
1
+ export interface IdwRwcData {
2
+ idwRwcUrl?: string;
3
+ }
4
+ export type UpsertIdwRwcData = Partial<IdwRwcData>;
5
+ export declare enum InstallationProcessStatus {
6
+ installed = "installed",
7
+ uninstalled = "uninstalled",
8
+ pending = "pending",
9
+ notExist = "notExist"
10
+ }
11
+ export type ChatCheckResponse = {
12
+ status: InstallationProcessStatus;
13
+ chatLink?: string;
14
+ };
15
+ //# 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,UAAU;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,MAAM,gBAAgB,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAEnD,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"}
@@ -1,7 +1,7 @@
1
1
  export * from './skill';
2
- export * from './channel';
3
2
  export * from './config';
4
3
  export * from './common';
5
4
  export * from './flow';
6
5
  export * from './idwInfo';
6
+ export * from './idwRwc';
7
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,WAAW,CAAC;AAC1B,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.1.0-beta.1667.0",
2
+ "version": "2.1.0-beta.1675.0",
3
3
  "name": "@or-sdk/idw",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/esm/index.js",
@@ -0,0 +1,60 @@
1
+ import { ConnectedFlowCreateData, Flow, FlowCreateData } from '../types';
2
+ import { Providers } from '@or-sdk/providers';
3
+ import { buildRoute } from '../helpres';
4
+
5
+ export class FlowApi {
6
+ constructor(
7
+ private readonly providers: Providers
8
+ ) {}
9
+
10
+ /**
11
+ * @description Get specific flow
12
+ * @param id
13
+ */
14
+ getFlow(id: string): Promise<Flow> {
15
+ return this.providers.makeRequest({
16
+ route: buildRoute('skill'),
17
+ params: {
18
+ id,
19
+ },
20
+ });
21
+ }
22
+
23
+ /**
24
+ * @description Delete specific flow
25
+ * @param id
26
+ */
27
+ deleteFlow(id: string): Promise<void> {
28
+ return this.providers.makeRequest({
29
+ route: buildRoute('flow'),
30
+ method: 'DELETE',
31
+ params: {
32
+ id,
33
+ },
34
+ });
35
+ }
36
+
37
+ /**
38
+ * @description create flow
39
+ * @param data
40
+ */
41
+ createFlow(data: FlowCreateData): Promise<Flow> {
42
+ return this.providers.makeRequest({
43
+ route: buildRoute('flow'),
44
+ method: 'POST',
45
+ data,
46
+ });
47
+ }
48
+
49
+ /**
50
+ * @description create flow connected with existing node
51
+ * @param data
52
+ */
53
+ createConnectedFlow(data: ConnectedFlowCreateData): Promise<Flow> {
54
+ return this.providers.makeRequest({
55
+ route: buildRoute('flow/connected'),
56
+ method: 'POST',
57
+ data,
58
+ });
59
+ }
60
+ }
@@ -0,0 +1,96 @@
1
+ import { Providers } from '@or-sdk/providers';
2
+ import { ChatCheckResponse, IdwRwcData, UpsertIdwRwcData } from '../types';
3
+ import { buildRoute } from '../helpres';
4
+
5
+ const noop: (...args: []) => void = () => {};
6
+
7
+ export class IdwRwcApi {
8
+ constructor(
9
+ private readonly providers: Providers
10
+ ) {}
11
+
12
+ /**
13
+ * Get IDW RWC data
14
+ */
15
+ getIdwRwcData(): Promise<IdwRwcData | undefined> {
16
+ return this.providers.makeRequest({
17
+ route: buildRoute('idw-rwc'),
18
+ method: 'GET',
19
+ });
20
+ }
21
+
22
+ /**
23
+ * Set IDW RWC data
24
+ */
25
+ upsertIdwRwcData(data: UpsertIdwRwcData): Promise<IdwRwcData> {
26
+ return this.providers.makeRequest({
27
+ route: buildRoute('idw-rwc'),
28
+ method: 'GET',
29
+ data,
30
+ });
31
+ }
32
+
33
+ /**
34
+ * Remove IDW RWC data
35
+ */
36
+ deleteIdwRwcData(): Promise<void> {
37
+ return this.providers.makeRequest({
38
+ route: buildRoute('idw-rwc'),
39
+ method: 'DELETE',
40
+ });
41
+ }
42
+
43
+ /**
44
+ * Install Rwc chat
45
+ */
46
+ installRwcChat(): Promise<void> {
47
+ return this.providers.makeRequest({
48
+ route: buildRoute('idw-rwc/install'),
49
+ method: 'POST',
50
+ });
51
+ }
52
+
53
+ /**
54
+ * Get Rwc chat status
55
+ */
56
+ getChatStatus(): Promise<ChatCheckResponse> {
57
+ return this.providers.makeRequest({
58
+ route: buildRoute('idw-rwc/install'),
59
+ method: 'GET',
60
+ });
61
+ }
62
+
63
+ /**
64
+ * Subscribe on rwc chat installation process
65
+ * @param pollingInterval
66
+ * @param tikCallback
67
+ * @param errorCallback
68
+ */
69
+ getSubscriptionOnInstallationProcess(
70
+ pollingInterval: number,
71
+ tikCallback: (status: ChatCheckResponse) => void = noop,
72
+ errorCallback: (e: unknown) => void = noop
73
+ ) {
74
+ // eslint-disable-next-line @typescript-eslint/no-this-alias
75
+ const $this = this;
76
+ let intervalId: NodeJS.Timer | undefined;
77
+
78
+ return {
79
+ subscribe: function () {
80
+ intervalId = setInterval(async () => {
81
+ try {
82
+ const status = await $this.getChatStatus();
83
+ tikCallback(status);
84
+ } catch (e) {
85
+ errorCallback(e);
86
+ this.unsubscribe();
87
+ }
88
+ }, pollingInterval);
89
+ },
90
+ unsubscribe: function () {
91
+ clearInterval(intervalId);
92
+ },
93
+ };
94
+ }
95
+
96
+ }
package/src/api/index.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export { SkillApi } from './skillApi';
2
- export { ChannelApi } from './channelApi';
3
2
  export { MigrationApi } from './migrationApi';
4
3
  export { IdwInfoApi } from './idwInfoApi';
5
4
  export { IdwDbApi } from './idwDbApi';
5
+ export { IdwRwcApi } from './idwRwcApi';
6
+ export { FlowApi } from './flowApi';
package/src/idwApi.ts CHANGED
@@ -1,13 +1,15 @@
1
1
  import { IDWBaseConfig } from './types';
2
- import { IdwDbApi, IdwInfoApi, MigrationApi, SkillApi, ChannelApi } from './api';
2
+ import { IdwDbApi, IdwInfoApi, IdwRwcApi, MigrationApi, SkillApi } from './api';
3
3
  import { Providers } from '@or-sdk/providers';
4
+ import { FlowApi } from './api/flowApi';
4
5
 
5
6
  export class IdwApi {
6
7
  readonly skillApi: SkillApi;
7
- readonly channelApi: ChannelApi;
8
8
  readonly migrationApi: MigrationApi;
9
9
  readonly idwInfoApi: IdwInfoApi;
10
10
  readonly idwDbApi: IdwDbApi;
11
+ readonly idwRwcApi: IdwRwcApi;
12
+ readonly flowApi: FlowApi;
11
13
  constructor({ providerAccountId, emUrl, token }: IDWBaseConfig) {
12
14
  const provider = new Providers({
13
15
  token,
@@ -16,9 +18,10 @@ export class IdwApi {
16
18
  });
17
19
 
18
20
  this.skillApi = new SkillApi(provider);
19
- this.channelApi = new ChannelApi(provider);
20
21
  this.migrationApi = new MigrationApi(provider);
21
22
  this.idwInfoApi = new IdwInfoApi(provider);
22
23
  this.idwDbApi = new IdwDbApi(provider);
24
+ this.idwRwcApi = new IdwRwcApi(provider);
25
+ this.flowApi = new FlowApi(provider);
23
26
  }
24
27
  }
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/';
package/src/types/flow.ts CHANGED
@@ -1,3 +1,4 @@
1
+
1
2
  export interface Flow {
2
3
  id: string;
3
4
  createdAt: number;
@@ -15,3 +16,12 @@ export interface Flow {
15
16
  export interface FlowWithRelationshipStatus extends Flow {
16
17
  isRelationshipActive: boolean;
17
18
  }
19
+
20
+ interface ConnectedNode {
21
+ id: string;
22
+ label: string;
23
+ relationship: string;
24
+ }
25
+
26
+ export type FlowCreateData = Pick<Flow, 'id' | 'name'>;
27
+ export type ConnectedFlowCreateData = FlowCreateData & {connectedNode: ConnectedNode;};
@@ -0,0 +1,17 @@
1
+ export interface IdwRwcData {
2
+ idwRwcUrl?: string;
3
+ }
4
+
5
+ export type UpsertIdwRwcData = Partial<IdwRwcData>;
6
+
7
+ export enum InstallationProcessStatus {
8
+ installed= 'installed',
9
+ uninstalled = 'uninstalled',
10
+ pending = 'pending',
11
+ notExist = 'notExist',
12
+ }
13
+
14
+ export type ChatCheckResponse = {
15
+ status: InstallationProcessStatus;
16
+ chatLink?: string;
17
+ };
@@ -1,6 +1,7 @@
1
1
  export * from './skill';
2
- export * from './channel';
3
2
  export * from './config';
4
3
  export * from './common';
5
4
  export * from './flow';
6
5
  export * from './idwInfo';
6
+ export * from './idwRwc';
7
+
@@ -1,62 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ChannelApi = void 0;
4
- var helpres_1 = require("../helpres");
5
- var ChannelApi = (function () {
6
- function ChannelApi(providers) {
7
- this.providers = providers;
8
- }
9
- ChannelApi.prototype.getChannel = function (id) {
10
- return this.providers.makeRequest({
11
- route: (0, helpres_1.buildRoute)('channel'),
12
- params: {
13
- id: id,
14
- },
15
- });
16
- };
17
- ChannelApi.prototype.getAllChannels = function () {
18
- return this.providers.makeRequest({
19
- route: (0, helpres_1.buildRoute)('channels'),
20
- });
21
- };
22
- ChannelApi.prototype.deleteChannel = function (id) {
23
- return this.providers.makeRequest({
24
- route: (0, helpres_1.buildRoute)('channel'),
25
- method: 'DELETE',
26
- params: {
27
- id: id,
28
- },
29
- });
30
- };
31
- ChannelApi.prototype.deleteAllChannels = function () {
32
- return this.providers.makeRequest({
33
- route: (0, helpres_1.buildRoute)('channels'),
34
- method: 'DELETE',
35
- });
36
- };
37
- ChannelApi.prototype.updateChannel = function (id, data) {
38
- return this.providers.makeRequest({
39
- route: (0, helpres_1.buildRoute)('channel'),
40
- method: 'PATCH',
41
- data: data,
42
- params: {
43
- id: id,
44
- },
45
- });
46
- };
47
- ChannelApi.prototype.createChannel = function (data) {
48
- return this.providers.makeRequest({
49
- route: (0, helpres_1.buildRoute)('channel'),
50
- method: 'POST',
51
- data: data,
52
- });
53
- };
54
- ChannelApi.prototype.getSuggestedChannels = function () {
55
- return this.providers.makeRequest({
56
- route: (0, helpres_1.buildRoute)('suggested-channels'),
57
- });
58
- };
59
- return ChannelApi;
60
- }());
61
- exports.ChannelApi = ChannelApi;
62
- //# sourceMappingURL=channelApi.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"channelApi.js","sourceRoot":"","sources":["../../../src/api/channelApi.ts"],"names":[],"mappings":";;;AAAA,sCAAwC;AAIxC;IACE,oBACmB,SAAoB;QAApB,cAAS,GAAT,SAAS,CAAW;IACpC,CAAC;IAMJ,+BAAU,GAAV,UAAW,EAAU;QACnB,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC;YAChC,KAAK,EAAE,IAAA,oBAAU,EAAC,SAAS,CAAC;YAC5B,MAAM,EAAE;gBACN,EAAE,IAAA;aACH;SACF,CAAC,CAAC;IACL,CAAC;IAMD,mCAAc,GAAd;QACE,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC;YAChC,KAAK,EAAE,IAAA,oBAAU,EAAC,UAAU,CAAC;SAC9B,CAAC,CAAC;IACL,CAAC;IAMD,kCAAa,GAAb,UAAc,EAAU;QACtB,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC;YAChC,KAAK,EAAE,IAAA,oBAAU,EAAC,SAAS,CAAC;YAC5B,MAAM,EAAE,QAAQ;YAChB,MAAM,EAAE;gBACN,EAAE,IAAA;aACH;SACF,CAAC,CAAC;IACL,CAAC;IAKD,sCAAiB,GAAjB;QACE,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC;YAChC,KAAK,EAAE,IAAA,oBAAU,EAAC,UAAU,CAAC;YAC7B,MAAM,EAAE,QAAQ;SACjB,CAAC,CAAC;IACL,CAAC;IAOD,kCAAa,GAAb,UAAc,EAAU,EAAE,IAAuB;QAC/C,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC;YAChC,KAAK,EAAE,IAAA,oBAAU,EAAC,SAAS,CAAC;YAC5B,MAAM,EAAE,OAAO;YACf,IAAI,MAAA;YACJ,MAAM,EAAE;gBACN,EAAE,IAAA;aACH;SACF,CAAC,CAAC;IACL,CAAC;IAMD,kCAAa,GAAb,UAAc,IAAuB;QACnC,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC;YAChC,KAAK,EAAE,IAAA,oBAAU,EAAC,SAAS,CAAC;YAC5B,MAAM,EAAE,MAAM;YACd,IAAI,MAAA;SACL,CAAC,CAAC;IACL,CAAC;IAKD,yCAAoB,GAApB;QACE,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC;YAChC,KAAK,EAAE,IAAA,oBAAU,EAAC,oBAAoB,CAAC;SACxC,CAAC,CAAC;IACL,CAAC;IACH,iBAAC;AAAD,CAAC,AAxFD,IAwFC;AAxFY,gCAAU"}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=channel.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"channel.js","sourceRoot":"","sources":["../../../src/types/channel.ts"],"names":[],"mappings":""}
@@ -1,57 +0,0 @@
1
- import { buildRoute } from '../helpres';
2
- export class ChannelApi {
3
- constructor(providers) {
4
- this.providers = providers;
5
- }
6
- getChannel(id) {
7
- return this.providers.makeRequest({
8
- route: buildRoute('channel'),
9
- params: {
10
- id,
11
- },
12
- });
13
- }
14
- getAllChannels() {
15
- return this.providers.makeRequest({
16
- route: buildRoute('channels'),
17
- });
18
- }
19
- deleteChannel(id) {
20
- return this.providers.makeRequest({
21
- route: buildRoute('channel'),
22
- method: 'DELETE',
23
- params: {
24
- id,
25
- },
26
- });
27
- }
28
- deleteAllChannels() {
29
- return this.providers.makeRequest({
30
- route: buildRoute('channels'),
31
- method: 'DELETE',
32
- });
33
- }
34
- updateChannel(id, data) {
35
- return this.providers.makeRequest({
36
- route: buildRoute('channel'),
37
- method: 'PATCH',
38
- data,
39
- params: {
40
- id,
41
- },
42
- });
43
- }
44
- createChannel(data) {
45
- return this.providers.makeRequest({
46
- route: buildRoute('channel'),
47
- method: 'POST',
48
- data,
49
- });
50
- }
51
- getSuggestedChannels() {
52
- return this.providers.makeRequest({
53
- route: buildRoute('suggested-channels'),
54
- });
55
- }
56
- }
57
- //# sourceMappingURL=channelApi.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"channelApi.js","sourceRoot":"","sources":["../../../src/api/channelApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAIxC,MAAM,OAAO,UAAU;IACrB,YACmB,SAAoB;QAApB,cAAS,GAAT,SAAS,CAAW;IACpC,CAAC;IAMJ,UAAU,CAAC,EAAU;QACnB,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC;YAChC,KAAK,EAAE,UAAU,CAAC,SAAS,CAAC;YAC5B,MAAM,EAAE;gBACN,EAAE;aACH;SACF,CAAC,CAAC;IACL,CAAC;IAMD,cAAc;QACZ,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC;YAChC,KAAK,EAAE,UAAU,CAAC,UAAU,CAAC;SAC9B,CAAC,CAAC;IACL,CAAC;IAMD,aAAa,CAAC,EAAU;QACtB,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC;YAChC,KAAK,EAAE,UAAU,CAAC,SAAS,CAAC;YAC5B,MAAM,EAAE,QAAQ;YAChB,MAAM,EAAE;gBACN,EAAE;aACH;SACF,CAAC,CAAC;IACL,CAAC;IAKD,iBAAiB;QACf,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC;YAChC,KAAK,EAAE,UAAU,CAAC,UAAU,CAAC;YAC7B,MAAM,EAAE,QAAQ;SACjB,CAAC,CAAC;IACL,CAAC;IAOD,aAAa,CAAC,EAAU,EAAE,IAAuB;QAC/C,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC;YAChC,KAAK,EAAE,UAAU,CAAC,SAAS,CAAC;YAC5B,MAAM,EAAE,OAAO;YACf,IAAI;YACJ,MAAM,EAAE;gBACN,EAAE;aACH;SACF,CAAC,CAAC;IACL,CAAC;IAMD,aAAa,CAAC,IAAuB;QACnC,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC;YAChC,KAAK,EAAE,UAAU,CAAC,SAAS,CAAC;YAC5B,MAAM,EAAE,MAAM;YACd,IAAI;SACL,CAAC,CAAC;IACL,CAAC;IAKD,oBAAoB;QAClB,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC;YAChC,KAAK,EAAE,UAAU,CAAC,oBAAoB,CAAC;SACxC,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=channel.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"channel.js","sourceRoot":"","sources":["../../../src/types/channel.ts"],"names":[],"mappings":""}
@@ -1,14 +0,0 @@
1
- import { Channel, ListChannels, ChannelWithFlow, ChannelUpdateData, ChannelCreateData } from '../types';
2
- import { Providers } from '@or-sdk/providers';
3
- export declare class ChannelApi {
4
- private readonly providers;
5
- constructor(providers: Providers);
6
- getChannel(id: string): Promise<ChannelWithFlow>;
7
- getAllChannels(): Promise<ListChannels>;
8
- deleteChannel(id: string): Promise<void>;
9
- deleteAllChannels(): Promise<void>;
10
- updateChannel(id: string, data: ChannelUpdateData): Promise<Channel>;
11
- createChannel(data: ChannelCreateData): Promise<Channel>;
12
- getSuggestedChannels(): Promise<ListChannels>;
13
- }
14
- //# sourceMappingURL=channelApi.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"channelApi.d.ts","sourceRoot":"","sources":["../../../src/api/channelApi.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AACxG,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C,qBAAa,UAAU;IAEnB,OAAO,CAAC,QAAQ,CAAC,SAAS;gBAAT,SAAS,EAAE,SAAS;IAOvC,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;IAahD,cAAc,IAAI,OAAO,CAAC,YAAY,CAAC;IAUvC,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAaxC,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC;IAYlC,aAAa,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC;IAepE,aAAa,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC;IAWxD,oBAAoB,IAAI,OAAO,CAAC,YAAY,CAAC;CAK9C"}
@@ -1,19 +0,0 @@
1
- import { EntityWithStatistic, SimpleNode } from './common';
2
- import { FlowWithRelationshipStatus } from './flow';
3
- export type ListChannels = EntityWithStatistic<{
4
- channels: {
5
- stepCount: number;
6
- channel: Channel;
7
- }[];
8
- }>;
9
- export type ChannelCreateData = Pick<SimpleNode, 'id' | 'name' | 'icon'>;
10
- export type ChannelUpdateData = Partial<ChannelCreateData>;
11
- export type Channel = Omit<SimpleNode, 'description'>;
12
- export type ChannelWithFlow = {
13
- channel: Channel;
14
- flows: FlowWithRelationshipStatus[];
15
- };
16
- export type SuggestedChannels = {
17
- channels: Channel[];
18
- };
19
- //# sourceMappingURL=channel.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"channel.d.ts","sourceRoot":"","sources":["../../../src/types/channel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC3D,OAAO,EAAE,0BAA0B,EAAE,MAAM,QAAQ,CAAC;AAEpD,MAAM,MAAM,YAAY,GAAG,mBAAmB,CAAC;IAAC,QAAQ,EAAE;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,CAAC;KAAC,EAAE,CAAC;CAAC,CAAC,CAAC;AACtG,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,UAAU,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,CAAC,CAAC;AACzE,MAAM,MAAM,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAC3D,MAAM,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC;AACtD,MAAM,MAAM,eAAe,GAAG;IAAC,OAAO,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,0BAA0B,EAAE,CAAC;CAAC,CAAC;AACvF,MAAM,MAAM,iBAAiB,GAAG;IAAC,QAAQ,EAAE,OAAO,EAAE,CAAC;CAAC,CAAC"}
@@ -1,93 +0,0 @@
1
- import { buildRoute } from '../helpres';
2
- import { Channel, ListChannels, ChannelWithFlow, ChannelUpdateData, ChannelCreateData } from '../types';
3
- import { Providers } from '@or-sdk/providers';
4
-
5
- export class ChannelApi {
6
- constructor(
7
- private readonly providers: Providers
8
- ) {}
9
-
10
- /**
11
- * @description Get specific channel
12
- * @param id
13
- */
14
- getChannel(id: string): Promise<ChannelWithFlow> {
15
- return this.providers.makeRequest({
16
- route: buildRoute('channel'),
17
- params: {
18
- id,
19
- },
20
- });
21
- }
22
-
23
-
24
- /**
25
- * @description Get all channels
26
- */
27
- getAllChannels(): Promise<ListChannels> {
28
- return this.providers.makeRequest({
29
- route: buildRoute('channels'),
30
- });
31
- }
32
-
33
- /**
34
- * @description Delete specific channel
35
- * @param id
36
- */
37
- deleteChannel(id: string): Promise<void> {
38
- return this.providers.makeRequest({
39
- route: buildRoute('channel'),
40
- method: 'DELETE',
41
- params: {
42
- id,
43
- },
44
- });
45
- }
46
-
47
- /**
48
- * @description Delete all channels
49
- */
50
- deleteAllChannels(): Promise<void> {
51
- return this.providers.makeRequest({
52
- route: buildRoute('channels'),
53
- method: 'DELETE',
54
- });
55
- }
56
-
57
- /**
58
- * @description update specific channel
59
- * @param id
60
- * @param data
61
- */
62
- updateChannel(id: string, data: ChannelUpdateData): Promise<Channel> {
63
- return this.providers.makeRequest({
64
- route: buildRoute('channel'),
65
- method: 'PATCH',
66
- data,
67
- params: {
68
- id,
69
- },
70
- });
71
- }
72
-
73
- /**
74
- * @description create channel
75
- * @param data
76
- */
77
- createChannel(data: ChannelCreateData): Promise<Channel> {
78
- return this.providers.makeRequest({
79
- route: buildRoute('channel'),
80
- method: 'POST',
81
- data,
82
- });
83
- }
84
-
85
- /**
86
- * @description Get all suggested (unlinked) channels
87
- */
88
- getSuggestedChannels(): Promise<ListChannels> {
89
- return this.providers.makeRequest({
90
- route: buildRoute('suggested-channels'),
91
- });
92
- }
93
- }
@@ -1,9 +0,0 @@
1
- import { EntityWithStatistic, SimpleNode } from './common';
2
- import { FlowWithRelationshipStatus } from './flow';
3
-
4
- export type ListChannels = EntityWithStatistic<{channels: {stepCount: number; channel: Channel;}[];}>;
5
- export type ChannelCreateData = Pick<SimpleNode, 'id' | 'name' | 'icon'>;
6
- export type ChannelUpdateData = Partial<ChannelCreateData>;
7
- export type Channel = Omit<SimpleNode, 'description'>;
8
- export type ChannelWithFlow = {channel: Channel; flows: FlowWithRelationshipStatus[];};
9
- export type SuggestedChannels = {channels: Channel[];};