@or-sdk/hitl 0.30.8-beta.737.0 → 0.30.9
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/CHANGELOG.md +17 -0
- package/dist/cjs/api/Agents.js +51 -0
- package/dist/cjs/api/Agents.js.map +1 -1
- package/dist/cjs/types/agents.js.map +1 -1
- package/dist/cjs/types/commands.js +3 -0
- package/dist/cjs/types/commands.js.map +1 -1
- package/dist/esm/api/Agents.js +41 -0
- package/dist/esm/api/Agents.js.map +1 -1
- package/dist/esm/types/agents.js.map +1 -1
- package/dist/esm/types/commands.js +2 -1
- package/dist/esm/types/commands.js.map +1 -1
- package/dist/types/api/Agents.d.ts +6 -1
- package/dist/types/api/Agents.d.ts.map +1 -1
- package/dist/types/types/agents.d.ts +15 -7
- package/dist/types/types/agents.d.ts.map +1 -1
- package/dist/types/types/commands.d.ts +2 -1
- package/dist/types/types/commands.d.ts.map +1 -1
- package/package.json +5 -4
- package/src/api/Agents.ts +58 -1
- package/src/types/agents.ts +23 -10
- package/src/types/commands.ts +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,23 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
### [0.30.9](https://gitlab.com/onereach/platform/or-sdk-next/compare/@or-sdk/hitl@0.30.8...@or-sdk/hitl@0.30.9) (2022-11-23)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **hitl:** add agent management api ([9c175a4](https://gitlab.com/onereach/platform/or-sdk-next/commit/9c175a4193f83c0c4565b5830602a6c24e8e9c76))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### [0.30.8](https://gitlab.com/onereach/platform/or-sdk-next/compare/@or-sdk/hitl@0.30.7...@or-sdk/hitl@0.30.8) (2022-11-21)
|
|
16
|
+
|
|
17
|
+
**Note:** Version bump only for package @or-sdk/hitl
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
6
23
|
### [0.30.7](https://gitlab.com/onereach/platform/or-sdk-next/compare/@or-sdk/hitl@0.30.6...@or-sdk/hitl@0.30.7) (2022-11-15)
|
|
7
24
|
|
|
8
25
|
**Note:** Version bump only for package @or-sdk/hitl
|
package/dist/cjs/api/Agents.js
CHANGED
|
@@ -63,6 +63,55 @@ var Agents = (function (_super) {
|
|
|
63
63
|
function Agents() {
|
|
64
64
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
65
65
|
}
|
|
66
|
+
Agents.getAgents = function (options) {
|
|
67
|
+
if (options === void 0) { options = {}; }
|
|
68
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
69
|
+
var baseUrl, route, params;
|
|
70
|
+
return __generator(this, function (_a) {
|
|
71
|
+
baseUrl = this.getBaseUrl(options);
|
|
72
|
+
route = new urijs_1.default(baseUrl).segment(this.AGENT_STATUS_URL).href();
|
|
73
|
+
params = lodash_1.default.omit(options, ['version']);
|
|
74
|
+
return [2, this.request({
|
|
75
|
+
route: route,
|
|
76
|
+
params: params,
|
|
77
|
+
})];
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
};
|
|
81
|
+
Agents.updateAgentMeta = function (options) {
|
|
82
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
83
|
+
var baseUrl, route, params, data;
|
|
84
|
+
return __generator(this, function (_a) {
|
|
85
|
+
baseUrl = this.getBaseUrl(options);
|
|
86
|
+
route = new urijs_1.default(baseUrl).segment(this.AGENT_META_URL).href();
|
|
87
|
+
params = lodash_1.default.pick(options, ['agentId']);
|
|
88
|
+
data = lodash_1.default.omit(options, ['version', 'agentId']);
|
|
89
|
+
return [2, this.request({
|
|
90
|
+
method: 'PUT',
|
|
91
|
+
route: route,
|
|
92
|
+
params: params,
|
|
93
|
+
data: data,
|
|
94
|
+
})];
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
};
|
|
98
|
+
Agents.updateAgentRuleGroups = function (options) {
|
|
99
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
100
|
+
var baseUrl, route, params, data;
|
|
101
|
+
return __generator(this, function (_a) {
|
|
102
|
+
baseUrl = this.getBaseUrl(options);
|
|
103
|
+
route = new urijs_1.default(baseUrl).segment(this.AGENT_RULE_GROUPS_URL).href();
|
|
104
|
+
params = lodash_1.default.pick(options, ['agentId']);
|
|
105
|
+
data = lodash_1.default.omit(options, ['version', 'agentId']);
|
|
106
|
+
return [2, this.request({
|
|
107
|
+
method: 'PUT',
|
|
108
|
+
route: route,
|
|
109
|
+
params: params,
|
|
110
|
+
data: data,
|
|
111
|
+
})];
|
|
112
|
+
});
|
|
113
|
+
});
|
|
114
|
+
};
|
|
66
115
|
Agents.getAgentStatus = function (options) {
|
|
67
116
|
if (options === void 0) { options = {}; }
|
|
68
117
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -113,6 +162,8 @@ var Agents = (function (_super) {
|
|
|
113
162
|
};
|
|
114
163
|
Agents.MODULE_URL = 'agents';
|
|
115
164
|
Agents.AGENT_STATUS_URL = 'agent-status';
|
|
165
|
+
Agents.AGENT_META_URL = 'agents-meta';
|
|
166
|
+
Agents.AGENT_RULE_GROUPS_URL = 'agents-meta/rule-groups';
|
|
116
167
|
Agents.PING_AGENT_STATUS_URL = 'ping-agent-status';
|
|
117
168
|
Agents.SET_AGENT_STATUS_URL = 'status';
|
|
118
169
|
return Agents;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Agents.js","sourceRoot":"","sources":["../../../src/api/Agents.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAAuB;AACvB,gDAAwB;
|
|
1
|
+
{"version":3,"file":"Agents.js","sourceRoot":"","sources":["../../../src/api/Agents.ts"],"names":[],"mappings":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O,IAAI,CAAC,OAAO,CAAC;wBAClB,KAAK,OAAA;wBACL,MAAM,EAAE,KAAK;wBACb,MAAM,QAAA;qBACP,CAAC,EAAC;;;KACJ;IAEmB,qBAAc,GAAlC,UACE,OAA8B;;;;gBAExB,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;gBACnC,KAAK,GAAG,IAAI,eAAG,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC,IAAI,EAAE,CAAC;gBACnE,MAAM,GAAG,gBAAC,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;gBACtC,IAAI,GAAG,gBAAC,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC;gBAErD,WAAO,IAAI,CAAC,OAAO,CAAC;wBAClB,MAAM,EAAE,KAAK;wBACb,KAAK,OAAA;wBACL,MAAM,QAAA;wBACN,IAAI,MAAA;qBACL,CAAC,EAAC;;;KACJ;IA7FgB,iBAAU,GAAG,QAAQ,CAAC;IACtB,uBAAgB,GAAG,cAAc,CAAC;IAClC,qBAAc,GAAG,aAAa,CAAC;IAC/B,4BAAqB,GAAG,yBAAyB,CAAC;IAClD,4BAAqB,GAAG,mBAAmB,CAAC;IAC5C,2BAAoB,GAAG,QAAQ,CAAC;IAyFnD,aAAC;CAAA,AA/FD,CAA4B,mBAAQ,GA+FnC;AA/FY,wBAAM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agents.js","sourceRoot":"","sources":["../../../src/types/agents.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"agents.js","sourceRoot":"","sources":["../../../src/types/agents.ts"],"names":[],"mappings":";;;AAAA,2DAAoG;AAiC3F,6FAjCoB,6BAAY,OAiCpB;AAAE,uGAjCoB,uCAAsB,OAiCpB"}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.COMMANDS = void 0;
|
|
4
|
+
var types_hitl_api_1 = require("@onereach/types-hitl-api");
|
|
5
|
+
Object.defineProperty(exports, "COMMANDS", { enumerable: true, get: function () { return types_hitl_api_1.COMMANDS; } });
|
|
3
6
|
//# sourceMappingURL=commands.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands.js","sourceRoot":"","sources":["../../../src/types/commands.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"commands.js","sourceRoot":"","sources":["../../../src/types/commands.ts"],"names":[],"mappings":";;;AAAA,2DAA8D;AAQrD,yFARU,yBAAQ,OAQV"}
|
package/dist/esm/api/Agents.js
CHANGED
|
@@ -11,6 +11,45 @@ import _ from 'lodash';
|
|
|
11
11
|
import URI from 'urijs';
|
|
12
12
|
import { HITLBase } from './HITLBase';
|
|
13
13
|
export class Agents extends HITLBase {
|
|
14
|
+
static getAgents(options = {}) {
|
|
15
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
16
|
+
const baseUrl = this.getBaseUrl(options);
|
|
17
|
+
const route = new URI(baseUrl).segment(this.AGENT_STATUS_URL).href();
|
|
18
|
+
const params = _.omit(options, ['version']);
|
|
19
|
+
return this.request({
|
|
20
|
+
route,
|
|
21
|
+
params,
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
static updateAgentMeta(options) {
|
|
26
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
27
|
+
const baseUrl = this.getBaseUrl(options);
|
|
28
|
+
const route = new URI(baseUrl).segment(this.AGENT_META_URL).href();
|
|
29
|
+
const params = _.pick(options, ['agentId']);
|
|
30
|
+
const data = _.omit(options, ['version', 'agentId']);
|
|
31
|
+
return this.request({
|
|
32
|
+
method: 'PUT',
|
|
33
|
+
route,
|
|
34
|
+
params,
|
|
35
|
+
data,
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
static updateAgentRuleGroups(options) {
|
|
40
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
+
const baseUrl = this.getBaseUrl(options);
|
|
42
|
+
const route = new URI(baseUrl).segment(this.AGENT_RULE_GROUPS_URL).href();
|
|
43
|
+
const params = _.pick(options, ['agentId']);
|
|
44
|
+
const data = _.omit(options, ['version', 'agentId']);
|
|
45
|
+
return this.request({
|
|
46
|
+
method: 'PUT',
|
|
47
|
+
route,
|
|
48
|
+
params,
|
|
49
|
+
data,
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
}
|
|
14
53
|
static getAgentStatus(options = {}) {
|
|
15
54
|
return __awaiter(this, void 0, void 0, function* () {
|
|
16
55
|
const baseUrl = this.getBaseUrl(options);
|
|
@@ -51,6 +90,8 @@ export class Agents extends HITLBase {
|
|
|
51
90
|
}
|
|
52
91
|
Agents.MODULE_URL = 'agents';
|
|
53
92
|
Agents.AGENT_STATUS_URL = 'agent-status';
|
|
93
|
+
Agents.AGENT_META_URL = 'agents-meta';
|
|
94
|
+
Agents.AGENT_RULE_GROUPS_URL = 'agents-meta/rule-groups';
|
|
54
95
|
Agents.PING_AGENT_STATUS_URL = 'ping-agent-status';
|
|
55
96
|
Agents.SET_AGENT_STATUS_URL = 'status';
|
|
56
97
|
//# sourceMappingURL=Agents.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Agents.js","sourceRoot":"","sources":["../../../src/api/Agents.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,CAAC,MAAM,QAAQ,CAAC;AACvB,OAAO,GAAG,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Agents.js","sourceRoot":"","sources":["../../../src/api/Agents.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,CAAC,MAAM,QAAQ,CAAC;AACvB,OAAO,GAAG,MAAM,OAAO,CAAC;AAaxB,OAAO,EAAE,QAAQ,EAAE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MAAM,CAAO,cAAc,CAChC,OAA8B;;YAE9B,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;YACzC,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC,IAAI,EAAE,CAAC;YACzE,MAAM,MAAM,GAAG,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;YAC5C,MAAM,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC;YAErD,OAAO,IAAI,CAAC,OAAO,CAAC;gBAClB,MAAM,EAAE,KAAK;gBACb,KAAK;gBACL,MAAM;gBACN,IAAI;aACL,CAAC,CAAC;QACL,CAAC;KAAA;;AA7FgB,iBAAU,GAAG,QAAQ,CAAC;AACtB,uBAAgB,GAAG,cAAc,CAAC;AAClC,qBAAc,GAAG,aAAa,CAAC;AAC/B,4BAAqB,GAAG,yBAAyB,CAAC;AAClD,4BAAqB,GAAG,mBAAmB,CAAC;AAC5C,2BAAoB,GAAG,QAAQ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agents.js","sourceRoot":"","sources":["../../../src/types/agents.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"agents.js","sourceRoot":"","sources":["../../../src/types/agents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,YAAY,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAiCpG,OAAO,EAAE,YAAY,EAAE,sBAAsB,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands.js","sourceRoot":"","sources":["../../../src/types/commands.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"commands.js","sourceRoot":"","sources":["../../../src/types/commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAQ9D,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
import { GetAgentStatusResponse, AgentStatusOptions, SetAgentStatusOptions } from '../types/agents';
|
|
1
|
+
import { GetAgentStatusResponse, AgentStatusOptions, SetAgentStatusOptions, GetAgentsOptions, GetAgentsResponse, UpdateAgentMetaOptions, UpdateAgentMetaResponse, UpdateAgentRuleGroupsOptions, UpdateAgentRuleGroupsResponse } from '../types/agents';
|
|
2
2
|
import { HITLBase } from './HITLBase';
|
|
3
3
|
export declare class Agents extends HITLBase {
|
|
4
4
|
protected static MODULE_URL: string;
|
|
5
5
|
protected static AGENT_STATUS_URL: string;
|
|
6
|
+
protected static AGENT_META_URL: string;
|
|
7
|
+
protected static AGENT_RULE_GROUPS_URL: string;
|
|
6
8
|
protected static PING_AGENT_STATUS_URL: string;
|
|
7
9
|
protected static SET_AGENT_STATUS_URL: string;
|
|
10
|
+
static getAgents(options?: GetAgentsOptions): Promise<GetAgentsResponse>;
|
|
11
|
+
static updateAgentMeta(options: UpdateAgentMetaOptions): Promise<UpdateAgentMetaResponse>;
|
|
12
|
+
static updateAgentRuleGroups(options: UpdateAgentRuleGroupsOptions): Promise<UpdateAgentRuleGroupsResponse>;
|
|
8
13
|
static getAgentStatus(options?: AgentStatusOptions): Promise<GetAgentStatusResponse>;
|
|
9
14
|
static pingAgentStatus(options?: AgentStatusOptions): Promise<GetAgentStatusResponse>;
|
|
10
15
|
static setAgentStatus(options: SetAgentStatusOptions): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Agents.d.ts","sourceRoot":"","sources":["../../../src/api/Agents.ts"],"names":[],"mappings":"AAGA,OAAO,
|
|
1
|
+
{"version":3,"file":"Agents.d.ts","sourceRoot":"","sources":["../../../src/api/Agents.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,sBAAsB,EACtB,kBAAkB,EAClB,qBAAqB,EACrB,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,EACtB,uBAAuB,EACvB,4BAA4B,EAC5B,6BAA6B,EAC9B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,qBAAa,MAAO,SAAQ,QAAQ;IAClC,SAAS,CAAC,MAAM,CAAC,UAAU,SAAY;IACvC,SAAS,CAAC,MAAM,CAAC,gBAAgB,SAAkB;IACnD,SAAS,CAAC,MAAM,CAAC,cAAc,SAAiB;IAChD,SAAS,CAAC,MAAM,CAAC,qBAAqB,SAA6B;IACnE,SAAS,CAAC,MAAM,CAAC,qBAAqB,SAAuB;IAC7D,SAAS,CAAC,MAAM,CAAC,oBAAoB,SAAY;WAE7B,SAAS,CAC3B,OAAO,GAAE,gBAAqB,GAC7B,OAAO,CAAC,iBAAiB,CAAC;WAWT,eAAe,CACjC,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC,uBAAuB,CAAC;WAcf,qBAAqB,CACvC,OAAO,EAAE,4BAA4B,GACpC,OAAO,CAAC,6BAA6B,CAAC;WAcrB,cAAc,CAChC,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAAC,sBAAsB,CAAC;WAWd,eAAe,CACjC,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAAC,sBAAsB,CAAC;WAYd,cAAc,CAChC,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC,IAAI,CAAC;CAajB"}
|
|
@@ -1,15 +1,23 @@
|
|
|
1
|
-
import { Agents, AGENT_STATUS, AGENT_BROADCAST_EVENTS } from '@onereach/types-hitl-api';
|
|
1
|
+
import { Agents, AgentsMeta, AGENT_STATUS, AGENT_BROADCAST_EVENTS } from '@onereach/types-hitl-api';
|
|
2
2
|
import { ApiVersionOptions, NoAccountId } from './common';
|
|
3
|
+
export declare type Agent = Agents.IAgent;
|
|
4
|
+
export declare type AgentMeta = AgentsMeta.IAgentMeta;
|
|
5
|
+
export declare type GetAgentsResponse = Agents.IGetAgentsResponse;
|
|
6
|
+
export declare type GetAgentsOptions = ApiVersionOptions & NoAccountId<Agents.IGetAgentsOptions>;
|
|
7
|
+
export declare type UpdateAgentMetaResponse = Partial<AgentMeta>;
|
|
8
|
+
export declare type UpdateAgentMetaOptions = ApiVersionOptions & NoAccountId<Agents.IPutAgentMetaOptions>;
|
|
9
|
+
export declare type UpdateAgentRuleGroupsResponse = Partial<AgentMeta>;
|
|
10
|
+
export declare type UpdateAgentRuleGroupsOptions = ApiVersionOptions & NoAccountId<Agents.IPutAgentRuleGroupsOptions>;
|
|
3
11
|
export declare type GetAgentStatusResponse = Agents.IAgentStatus;
|
|
4
12
|
export interface AgentStatusOptions extends ApiVersionOptions {
|
|
5
13
|
readonly agentId?: string;
|
|
6
14
|
}
|
|
7
|
-
export interface
|
|
8
|
-
readonly
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
15
|
+
export interface SetAgentStatusOptions extends ApiVersionOptions, NoAccountId<Agents.ISetAgentStatusQuery> {
|
|
16
|
+
readonly statusData: {
|
|
17
|
+
readonly status: AGENT_STATUS;
|
|
18
|
+
readonly busyReason?: string;
|
|
19
|
+
};
|
|
20
|
+
readonly notifyStatusChange?: boolean;
|
|
12
21
|
}
|
|
13
|
-
export declare type SetAgentStatusOptions = ApiVersionOptions & NoAccountId<Agents.ISetAgentStatusQuery> & Agents.ISetAgentStatusBody;
|
|
14
22
|
export { AGENT_STATUS, AGENT_BROADCAST_EVENTS };
|
|
15
23
|
//# sourceMappingURL=agents.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../../src/types/agents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../../src/types/ag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
import { Commands } from '@onereach/types-hitl-api';
|
|
1
|
+
import { Commands, COMMANDS } from '@onereach/types-hitl-api';
|
|
2
2
|
import { ApiVersionOptions } from './common';
|
|
3
3
|
export declare type ApplyCommandOptions = ApiVersionOptions & Commands.IApplyCommandQuery & Commands.IApplyCommandBody;
|
|
4
|
+
export { COMMANDS };
|
|
4
5
|
//# sourceMappingURL=commands.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../../src/types/commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../../src/types/commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAG7C,oBAAY,mBAAmB,GAAG,iBAAiB,GAC/C,QAAQ,CAAC,kBAAkB,GAC3B,QAAQ,CAAC,iBAAiB,CAAC;AAE/B,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@or-sdk/hitl",
|
|
3
|
-
"version": "0.30.
|
|
3
|
+
"version": "0.30.9",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"types": "dist/types/index.d.ts",
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
"dev": "pnpm build:watch:esm"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@onereach/types-hitl-api": "^0.0.
|
|
21
|
-
"@or-sdk/base": "^0.
|
|
20
|
+
"@onereach/types-hitl-api": "^0.0.35-rc.2",
|
|
21
|
+
"@or-sdk/base": "^0.27.0",
|
|
22
22
|
"@types/lodash": "^4.14.186",
|
|
23
23
|
"@types/urijs": "^1.19.18",
|
|
24
24
|
"urijs": "^1.19.8"
|
|
@@ -29,5 +29,6 @@
|
|
|
29
29
|
},
|
|
30
30
|
"publishConfig": {
|
|
31
31
|
"access": "public"
|
|
32
|
-
}
|
|
32
|
+
},
|
|
33
|
+
"gitHead": "f4f1503a9dbfcfe939847464cf6a9f2d943c7c80"
|
|
33
34
|
}
|
package/src/api/Agents.ts
CHANGED
|
@@ -1,15 +1,72 @@
|
|
|
1
1
|
import _ from 'lodash';
|
|
2
2
|
import URI from 'urijs';
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
GetAgentStatusResponse,
|
|
6
|
+
AgentStatusOptions,
|
|
7
|
+
SetAgentStatusOptions,
|
|
8
|
+
GetAgentsOptions,
|
|
9
|
+
GetAgentsResponse,
|
|
10
|
+
UpdateAgentMetaOptions,
|
|
11
|
+
UpdateAgentMetaResponse,
|
|
12
|
+
UpdateAgentRuleGroupsOptions,
|
|
13
|
+
UpdateAgentRuleGroupsResponse,
|
|
14
|
+
} from '../types/agents';
|
|
5
15
|
import { HITLBase } from './HITLBase';
|
|
6
16
|
|
|
7
17
|
export class Agents extends HITLBase {
|
|
8
18
|
protected static MODULE_URL = 'agents';
|
|
9
19
|
protected static AGENT_STATUS_URL = 'agent-status';
|
|
20
|
+
protected static AGENT_META_URL = 'agents-meta';
|
|
21
|
+
protected static AGENT_RULE_GROUPS_URL = 'agents-meta/rule-groups';
|
|
10
22
|
protected static PING_AGENT_STATUS_URL = 'ping-agent-status';
|
|
11
23
|
protected static SET_AGENT_STATUS_URL = 'status';
|
|
12
24
|
|
|
25
|
+
public static async getAgents(
|
|
26
|
+
options: GetAgentsOptions = {}
|
|
27
|
+
): Promise<GetAgentsResponse> {
|
|
28
|
+
const baseUrl = this.getBaseUrl(options);
|
|
29
|
+
const route = new URI(baseUrl).segment(this.AGENT_STATUS_URL).href();
|
|
30
|
+
const params = _.omit(options, ['version']);
|
|
31
|
+
|
|
32
|
+
return this.request({
|
|
33
|
+
route,
|
|
34
|
+
params,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
public static async updateAgentMeta(
|
|
39
|
+
options: UpdateAgentMetaOptions
|
|
40
|
+
): Promise<UpdateAgentMetaResponse> {
|
|
41
|
+
const baseUrl = this.getBaseUrl(options);
|
|
42
|
+
const route = new URI(baseUrl).segment(this.AGENT_META_URL).href();
|
|
43
|
+
const params = _.pick(options, ['agentId']);
|
|
44
|
+
const data = _.omit(options, ['version', 'agentId']);
|
|
45
|
+
|
|
46
|
+
return this.request({
|
|
47
|
+
method: 'PUT',
|
|
48
|
+
route,
|
|
49
|
+
params,
|
|
50
|
+
data,
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
public static async updateAgentRuleGroups(
|
|
55
|
+
options: UpdateAgentRuleGroupsOptions
|
|
56
|
+
): Promise<UpdateAgentRuleGroupsResponse> {
|
|
57
|
+
const baseUrl = this.getBaseUrl(options);
|
|
58
|
+
const route = new URI(baseUrl).segment(this.AGENT_RULE_GROUPS_URL).href();
|
|
59
|
+
const params = _.pick(options, ['agentId']);
|
|
60
|
+
const data = _.omit(options, ['version', 'agentId']);
|
|
61
|
+
|
|
62
|
+
return this.request({
|
|
63
|
+
method: 'PUT',
|
|
64
|
+
route,
|
|
65
|
+
params,
|
|
66
|
+
data,
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
|
|
13
70
|
public static async getAgentStatus(
|
|
14
71
|
options: AgentStatusOptions = {}
|
|
15
72
|
): Promise<GetAgentStatusResponse> {
|
package/src/types/agents.ts
CHANGED
|
@@ -1,21 +1,34 @@
|
|
|
1
|
-
import { Agents, AGENT_STATUS, AGENT_BROADCAST_EVENTS } from '@onereach/types-hitl-api';
|
|
1
|
+
import { Agents, AgentsMeta, AGENT_STATUS, AGENT_BROADCAST_EVENTS } from '@onereach/types-hitl-api';
|
|
2
2
|
import { ApiVersionOptions, NoAccountId } from './common';
|
|
3
3
|
|
|
4
4
|
/* eslint-disable @typescript-eslint/indent */
|
|
5
|
+
export type Agent = Agents.IAgent;
|
|
6
|
+
export type AgentMeta = AgentsMeta.IAgentMeta;
|
|
7
|
+
|
|
8
|
+
export type GetAgentsResponse = Agents.IGetAgentsResponse;
|
|
9
|
+
export type GetAgentsOptions = ApiVersionOptions
|
|
10
|
+
& NoAccountId<Agents.IGetAgentsOptions>;
|
|
11
|
+
|
|
12
|
+
export type UpdateAgentMetaResponse = Partial<AgentMeta>;
|
|
13
|
+
export type UpdateAgentMetaOptions = ApiVersionOptions
|
|
14
|
+
& NoAccountId<Agents.IPutAgentMetaOptions>;
|
|
15
|
+
|
|
16
|
+
export type UpdateAgentRuleGroupsResponse = Partial<AgentMeta>;
|
|
17
|
+
export type UpdateAgentRuleGroupsOptions = ApiVersionOptions
|
|
18
|
+
& NoAccountId<Agents.IPutAgentRuleGroupsOptions>;
|
|
19
|
+
|
|
5
20
|
export type GetAgentStatusResponse = Agents.IAgentStatus;
|
|
6
21
|
export interface AgentStatusOptions extends ApiVersionOptions {
|
|
7
22
|
readonly agentId?: string;
|
|
8
23
|
}
|
|
9
24
|
|
|
10
|
-
export interface
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
25
|
+
export interface SetAgentStatusOptions extends ApiVersionOptions,
|
|
26
|
+
NoAccountId<Agents.ISetAgentStatusQuery> {
|
|
27
|
+
readonly statusData: {
|
|
28
|
+
readonly status: AGENT_STATUS;
|
|
29
|
+
readonly busyReason?: string;
|
|
30
|
+
};
|
|
31
|
+
readonly notifyStatusChange?: boolean;
|
|
15
32
|
}
|
|
16
33
|
|
|
17
|
-
export type SetAgentStatusOptions = ApiVersionOptions
|
|
18
|
-
& NoAccountId<Agents.ISetAgentStatusQuery>
|
|
19
|
-
& Agents.ISetAgentStatusBody;
|
|
20
|
-
|
|
21
34
|
export { AGENT_STATUS, AGENT_BROADCAST_EVENTS };
|
package/src/types/commands.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { Commands } from '@onereach/types-hitl-api';
|
|
1
|
+
import { Commands, COMMANDS } from '@onereach/types-hitl-api';
|
|
2
2
|
import { ApiVersionOptions } from './common';
|
|
3
3
|
|
|
4
4
|
/* eslint-disable @typescript-eslint/indent */
|
|
5
5
|
export type ApplyCommandOptions = ApiVersionOptions
|
|
6
6
|
& Commands.IApplyCommandQuery
|
|
7
7
|
& Commands.IApplyCommandBody;
|
|
8
|
+
|
|
9
|
+
export { COMMANDS };
|