namirasoft-expert 1.4.28 → 1.4.29
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/dist/NamirasoftExpertServer.js +1 -1
- package/dist/NamirasoftExpertServerChat.d.ts +4 -1
- package/dist/NamirasoftExpertServerChat.js +21 -6
- package/dist/NamirasoftExpertServerChat.js.map +1 -1
- package/dist/command/ChatCommand.js +5 -1
- package/dist/command/ChatCommand.js.map +1 -1
- package/dist/command/ChatCreateCommand.d.ts +5 -0
- package/dist/command/ChatCreateCommand.js +94 -0
- package/dist/command/ChatCreateCommand.js.map +1 -0
- package/dist/command/ChatDeleteCommand.d.ts +5 -0
- package/dist/command/ChatDeleteCommand.js +38 -0
- package/dist/command/ChatDeleteCommand.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/meta/ChatMetaTable.js +0 -1
- package/dist/meta/ChatMetaTable.js.map +1 -1
- package/dist/row/ChatInputRow.d.ts +9 -0
- package/dist/row/ChatInputRow.js +3 -0
- package/dist/row/ChatInputRow.js.map +1 -0
- package/package.json +1 -1
- package/src/NamirasoftExpertServer.ts +1 -1
- package/src/NamirasoftExpertServerChat.ts +20 -6
- package/src/command/ChatCommand.ts +5 -1
- package/src/command/ChatCreateCommand.ts +101 -0
- package/src/command/ChatDeleteCommand.ts +45 -0
- package/src/index.ts +3 -0
- package/src/meta/ChatMetaTable.ts +0 -1
- package/src/row/ChatInputRow.ts +31 -0
|
@@ -16,7 +16,7 @@ const NamirasoftExpertServerRoleAssignment_1 = require("./NamirasoftExpertServer
|
|
|
16
16
|
const NamirasoftExpertServerValue_1 = require("./NamirasoftExpertServerValue");
|
|
17
17
|
class NamirasoftExpertServer extends namirasoft_account_1.NSABaseServer {
|
|
18
18
|
constructor(base_url, token_manager, onError) {
|
|
19
|
-
super(base_url, `1.4.
|
|
19
|
+
super(base_url, `1.4.29`, token_manager, onError);
|
|
20
20
|
this.healthz = new NamirasoftExpertServerHealthz_1.NamirasoftExpertServerHealthz(this);
|
|
21
21
|
this.health = new NamirasoftExpertServerHealth_1.NamirasoftExpertServerHealth(this);
|
|
22
22
|
this.metrics = new NamirasoftExpertServerMetrics_1.NamirasoftExpertServerMetrics(this);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { BaseServerConfig } from "namirasoft-core";
|
|
2
|
+
import { ChatInputRow } from "./row/ChatInputRow";
|
|
2
3
|
import { ChatRow } from "./row/ChatRow";
|
|
3
4
|
import { FilterItem } from "namirasoft-core";
|
|
4
5
|
import { NamirasoftExpertServer } from "./NamirasoftExpertServer";
|
|
@@ -6,9 +7,11 @@ import { NamirasoftExpertServerBase } from "./NamirasoftExpertServerBase";
|
|
|
6
7
|
import { SortItem } from "namirasoft-core";
|
|
7
8
|
export declare class NamirasoftExpertServerChat extends NamirasoftExpertServerBase {
|
|
8
9
|
constructor(server: NamirasoftExpertServer);
|
|
9
|
-
Get(id: (string | null), config?: BaseServerConfig<any>): Promise<ChatRow>;
|
|
10
10
|
List(filters: FilterItem[] | null, page: (number | null), size: (number | null), sorts: SortItem[], config?: BaseServerConfig<any>): Promise<{
|
|
11
11
|
rows: ChatRow[];
|
|
12
12
|
count: number;
|
|
13
13
|
}>;
|
|
14
|
+
Get(id: (string | null), config?: BaseServerConfig<any>): Promise<ChatRow>;
|
|
15
|
+
Create(body: ChatInputRow, config?: BaseServerConfig<any>): Promise<ChatRow>;
|
|
16
|
+
Delete(id: string, config?: BaseServerConfig<any>): Promise<void>;
|
|
14
17
|
}
|
|
@@ -16,8 +16,19 @@ const namirasoft_core_2 = require("namirasoft-core");
|
|
|
16
16
|
class NamirasoftExpertServerChat extends NamirasoftExpertServerBase_1.NamirasoftExpertServerBase {
|
|
17
17
|
constructor(server) {
|
|
18
18
|
super(server);
|
|
19
|
-
this.Get = this.Get.bind(this);
|
|
20
19
|
this.List = this.List.bind(this);
|
|
20
|
+
this.Get = this.Get.bind(this);
|
|
21
|
+
this.Create = this.Create.bind(this);
|
|
22
|
+
this.Delete = this.Delete.bind(this);
|
|
23
|
+
}
|
|
24
|
+
List(filters, page, size, sorts, config) {
|
|
25
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
+
let filters_string_value = namirasoft_core_1.FilterItem.stringify(filters);
|
|
27
|
+
let sorts_string_value = namirasoft_core_2.SortItem.stringify(sorts);
|
|
28
|
+
let path = `/chat/list`;
|
|
29
|
+
let { data } = yield this.server._get(path, { filters: filters_string_value, page, size, sorts: sorts_string_value }, config);
|
|
30
|
+
return data;
|
|
31
|
+
});
|
|
21
32
|
}
|
|
22
33
|
Get(id, config) {
|
|
23
34
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -26,15 +37,19 @@ class NamirasoftExpertServerChat extends NamirasoftExpertServerBase_1.Namirasoft
|
|
|
26
37
|
return data;
|
|
27
38
|
});
|
|
28
39
|
}
|
|
29
|
-
|
|
40
|
+
Create(body, config) {
|
|
30
41
|
return __awaiter(this, void 0, void 0, function* () {
|
|
31
|
-
let
|
|
32
|
-
let
|
|
33
|
-
let path = `/chat/list`;
|
|
34
|
-
let { data } = yield this.server._get(path, { filters: filters_string_value, page, size, sorts: sorts_string_value }, config);
|
|
42
|
+
let path = `/chat`;
|
|
43
|
+
let { data } = yield this.server._post(path, {}, body, config);
|
|
35
44
|
return data;
|
|
36
45
|
});
|
|
37
46
|
}
|
|
47
|
+
Delete(id, config) {
|
|
48
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
49
|
+
let path = `/chat/${id}`;
|
|
50
|
+
yield this.server._delete(path, {}, config);
|
|
51
|
+
});
|
|
52
|
+
}
|
|
38
53
|
}
|
|
39
54
|
exports.NamirasoftExpertServerChat = NamirasoftExpertServerChat;
|
|
40
55
|
;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NamirasoftExpertServerChat.js","sourceRoot":"","sources":["../src/NamirasoftExpertServerChat.ts"],"names":[],"mappings":";;;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AG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAU,IAAI,EAAE,EAAE,EAAE,MAAM,CAAC,CAAC;YACjE,OAAO,IAAI,CAAC;QAChB,CAAC;KAAA;IACK,MAAM,CAAC,IAAkB,EAAE,MAA8B;;YAE3D,IAAI,IAAI,GAAG,OAAO,CAAC;YACnB,IAAI,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAAU,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;YACxE,OAAO,IAAI,CAAC;QAChB,CAAC;KAAA;IACK,MAAM,CAAC,EAAU,EAAE,MAA8B;;YAEnD,IAAI,IAAI,GAAG,SAAS,EAAE,EAAE,CAAC;YACzB,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAO,IAAI,EAAE,EAAE,EAAE,MAAM,CAAC,CAAC;QACtD,CAAC;KAAA;CACJ;AAnCD,gEAmCC;AAAA,CAAC"}
|
|
@@ -2,13 +2,17 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ChatCommand = void 0;
|
|
4
4
|
const namirasoft_node_cli_1 = require("namirasoft-node-cli");
|
|
5
|
+
const ChatCreateCommand_1 = require("./ChatCreateCommand");
|
|
6
|
+
const ChatDeleteCommand_1 = require("./ChatDeleteCommand");
|
|
5
7
|
const ChatGetCommand_1 = require("./ChatGetCommand");
|
|
6
8
|
const ChatListCommand_1 = require("./ChatListCommand");
|
|
7
9
|
class ChatCommand extends namirasoft_node_cli_1.BaseNavigatorCommand {
|
|
8
10
|
constructor(argv) {
|
|
9
11
|
super(argv, {
|
|
10
|
-
"get": ChatGetCommand_1.ChatGetCommand,
|
|
11
12
|
"list": ChatListCommand_1.ChatListCommand,
|
|
13
|
+
"get": ChatGetCommand_1.ChatGetCommand,
|
|
14
|
+
"create": ChatCreateCommand_1.ChatCreateCommand,
|
|
15
|
+
"delete": ChatDeleteCommand_1.ChatDeleteCommand,
|
|
12
16
|
});
|
|
13
17
|
}
|
|
14
18
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatCommand.js","sourceRoot":"","sources":["../../src/command/ChatCommand.ts"],"names":[],"mappings":";;;AAoBA,6DAA2D;AAC3D,qDAAkD;AAClD,uDAAoD;AAEpD,MAAa,WAAY,SAAQ,0CAAoB;IAEjD,YAAY,IAAc;QAEtB,KAAK,CAAC,IAAI,EAAE;YACR,KAAK,EAAE,+BAAc;YACrB,
|
|
1
|
+
{"version":3,"file":"ChatCommand.js","sourceRoot":"","sources":["../../src/command/ChatCommand.ts"],"names":[],"mappings":";;;AAoBA,6DAA2D;AAC3D,2DAAwD;AACxD,2DAAwD;AACxD,qDAAkD;AAClD,uDAAoD;AAEpD,MAAa,WAAY,SAAQ,0CAAoB;IAEjD,YAAY,IAAc;QAEtB,KAAK,CAAC,IAAI,EAAE;YACR,MAAM,EAAE,iCAAe;YACvB,KAAK,EAAE,+BAAc;YACrB,QAAQ,EAAE,qCAAiB;YAC3B,QAAQ,EAAE,qCAAiB;SAC9B,CAAC,CAAC;IACP,CAAC;CACJ;AAXD,kCAWC;AAAA,CAAC"}
|
|
@@ -0,0 +1,94 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ChatCreateCommand = void 0;
|
|
13
|
+
const namirasoft_node_cli_1 = require("namirasoft-node-cli");
|
|
14
|
+
const namirasoft_core_1 = require("namirasoft-core");
|
|
15
|
+
const NamirasoftExpertServer_1 = require("../NamirasoftExpertServer");
|
|
16
|
+
const namirasoft_account_1 = require("namirasoft-account");
|
|
17
|
+
class ChatCreateCommand extends namirasoft_node_cli_1.BaseFinalCommand {
|
|
18
|
+
constructor(argv) {
|
|
19
|
+
super(argv, [], [
|
|
20
|
+
{
|
|
21
|
+
name: "workspace_id",
|
|
22
|
+
short: "",
|
|
23
|
+
description: "Provides the value of 'workspace_id' in body",
|
|
24
|
+
optional: true,
|
|
25
|
+
args: ["workspace_id"],
|
|
26
|
+
defaults: [""]
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: "agent_id",
|
|
30
|
+
short: "",
|
|
31
|
+
description: "Provides the value of 'agent_id' in body",
|
|
32
|
+
optional: false,
|
|
33
|
+
args: ["agent_id"],
|
|
34
|
+
defaults: [""]
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: "incident_id",
|
|
38
|
+
short: "",
|
|
39
|
+
description: "Provides the value of 'incident_id' in body",
|
|
40
|
+
optional: true,
|
|
41
|
+
args: ["incident_id"],
|
|
42
|
+
defaults: [""]
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: "type",
|
|
46
|
+
short: "",
|
|
47
|
+
description: "Provides the value of 'type' in body",
|
|
48
|
+
optional: false,
|
|
49
|
+
args: ["type"],
|
|
50
|
+
defaults: [""]
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
name: "name",
|
|
54
|
+
short: "",
|
|
55
|
+
description: "Provides the value of 'name' in body",
|
|
56
|
+
optional: false,
|
|
57
|
+
args: ["name"],
|
|
58
|
+
defaults: [""]
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: "meta",
|
|
62
|
+
short: "",
|
|
63
|
+
description: "Provides the value of 'meta' in body",
|
|
64
|
+
optional: false,
|
|
65
|
+
args: ["meta"],
|
|
66
|
+
defaults: [""]
|
|
67
|
+
}
|
|
68
|
+
]);
|
|
69
|
+
}
|
|
70
|
+
exec() {
|
|
71
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
72
|
+
let token = this.app.storage.getNSAToken();
|
|
73
|
+
if (token == null)
|
|
74
|
+
throw new Error("Token is not available. Please login first using:\nns-expert account config \nor \nns-expert account login.");
|
|
75
|
+
let storage = new namirasoft_core_1.IStorageMemoryDedicated();
|
|
76
|
+
let token_manager = new namirasoft_account_1.TokenManager(storage, () => { });
|
|
77
|
+
token_manager.setValue(token, false);
|
|
78
|
+
let url = this.app.storage.getItem("ns-expert-server-url");
|
|
79
|
+
let server = new NamirasoftExpertServer_1.NamirasoftExpertServer(url, token_manager, e => this.app.logger.error(e.message));
|
|
80
|
+
let ans = yield server.chat.Create({
|
|
81
|
+
workspace_id: this.option_values.workspace_id,
|
|
82
|
+
agent_id: this.option_values.agent_id,
|
|
83
|
+
incident_id: this.option_values.incident_id,
|
|
84
|
+
type: this.option_values.type,
|
|
85
|
+
name: this.option_values.name,
|
|
86
|
+
meta: this.option_values.meta
|
|
87
|
+
});
|
|
88
|
+
this.app.logger.success(JSON.stringify(ans));
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
exports.ChatCreateCommand = ChatCreateCommand;
|
|
93
|
+
;
|
|
94
|
+
//# sourceMappingURL=ChatCreateCommand.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChatCreateCommand.js","sourceRoot":"","sources":["../../src/command/ChatCreateCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;AAoBA,6DAAuD;AACvD,qDAA0D;AAC1D,sEAAmE;AACnE,2DAAkD;AAElD,MAAa,iBAAkB,SAAQ,sCAAgB;IAEnD,YAAY,IAAc;QAEtB,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE;YACZ;gBACI,I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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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ChatDeleteCommand = void 0;
|
|
13
|
+
const namirasoft_node_cli_1 = require("namirasoft-node-cli");
|
|
14
|
+
const namirasoft_core_1 = require("namirasoft-core");
|
|
15
|
+
const NamirasoftExpertServer_1 = require("../NamirasoftExpertServer");
|
|
16
|
+
const namirasoft_account_1 = require("namirasoft-account");
|
|
17
|
+
class ChatDeleteCommand extends namirasoft_node_cli_1.BaseFinalCommand {
|
|
18
|
+
constructor(argv) {
|
|
19
|
+
super(argv, ["id"], []);
|
|
20
|
+
}
|
|
21
|
+
exec() {
|
|
22
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
23
|
+
let token = this.app.storage.getNSAToken();
|
|
24
|
+
if (token == null)
|
|
25
|
+
throw new Error("Token is not available. Please login first using:\nns-expert account config \nor \nns-expert account login.");
|
|
26
|
+
let storage = new namirasoft_core_1.IStorageMemoryDedicated();
|
|
27
|
+
let token_manager = new namirasoft_account_1.TokenManager(storage, () => { });
|
|
28
|
+
token_manager.setValue(token, false);
|
|
29
|
+
let url = this.app.storage.getItem("ns-expert-server-url");
|
|
30
|
+
let server = new NamirasoftExpertServer_1.NamirasoftExpertServer(url, token_manager, e => this.app.logger.error(e.message));
|
|
31
|
+
let ans = yield server.chat.Delete(this.arg_values[0]);
|
|
32
|
+
this.app.logger.success(JSON.stringify(ans));
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.ChatDeleteCommand = ChatDeleteCommand;
|
|
37
|
+
;
|
|
38
|
+
//# sourceMappingURL=ChatDeleteCommand.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChatDeleteCommand.js","sourceRoot":"","sources":["../../src/command/ChatDeleteCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;AAoBA,6DAAuD;AACvD,qDAA0D;AAC1D,sEAAmE;AACnE,2DAAkD;AAElD,MAAa,iBAAkB,SAAQ,sCAAgB;IAEnD,YAAY,IAAc;QAEtB,KAAK,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;IAC5B,CAAC;IACc,IAAI;;YAEf,IAAI,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;YAC3C,IAAI,KAAK,IAAI,IAAI;gBACb,MAAM,IAAI,KAAK,CAAC,6GAA6G,CAAC,CAAC;YACnI,IAAI,OAAO,GAAG,IAAI,yCAAuB,EAAE,CAAC;YAC5C,IAAI,aAAa,GAAG,IAAI,iCAAY,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;YACzD,aAAa,CAAC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;YACrC,IAAI,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,sBAAsB,CAAC,CAAC;YAC3D,IAAI,MAAM,GAAG,IAAI,+CAAsB,CAAC,GAAG,EAAE,aAAa,EAAE,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;YACnG,IAAI,GAAG,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;YACvD,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;QACjD,CAAC;KAAA;CACJ;AAnBD,8CAmBC;AAAA,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -36,6 +36,8 @@ export * from "./command/AgentTagListCommand";
|
|
|
36
36
|
export * from "./command/AgentTagUpdateCommand";
|
|
37
37
|
export * from "./command/AgentUpdateCommand";
|
|
38
38
|
export * from "./command/ChatCommand";
|
|
39
|
+
export * from "./command/ChatCreateCommand";
|
|
40
|
+
export * from "./command/ChatDeleteCommand";
|
|
39
41
|
export * from "./command/ChatGetCommand";
|
|
40
42
|
export * from "./command/ChatListCommand";
|
|
41
43
|
export * from "./command/DescriptionCommand";
|
|
@@ -85,6 +87,7 @@ export * from "./row/AgentFieldRow";
|
|
|
85
87
|
export * from "./row/AgentInputRow";
|
|
86
88
|
export * from "./row/AgentRow";
|
|
87
89
|
export * from "./row/AgentTagRow";
|
|
90
|
+
export * from "./row/ChatInputRow";
|
|
88
91
|
export * from "./row/ChatRow";
|
|
89
92
|
export * from "./row/DescriptionInputRow";
|
|
90
93
|
export * from "./row/DescriptionRow";
|
package/dist/index.js
CHANGED
|
@@ -52,6 +52,8 @@ __exportStar(require("./command/AgentTagListCommand"), exports);
|
|
|
52
52
|
__exportStar(require("./command/AgentTagUpdateCommand"), exports);
|
|
53
53
|
__exportStar(require("./command/AgentUpdateCommand"), exports);
|
|
54
54
|
__exportStar(require("./command/ChatCommand"), exports);
|
|
55
|
+
__exportStar(require("./command/ChatCreateCommand"), exports);
|
|
56
|
+
__exportStar(require("./command/ChatDeleteCommand"), exports);
|
|
55
57
|
__exportStar(require("./command/ChatGetCommand"), exports);
|
|
56
58
|
__exportStar(require("./command/ChatListCommand"), exports);
|
|
57
59
|
__exportStar(require("./command/DescriptionCommand"), exports);
|
|
@@ -101,6 +103,7 @@ __exportStar(require("./row/AgentFieldRow"), exports);
|
|
|
101
103
|
__exportStar(require("./row/AgentInputRow"), exports);
|
|
102
104
|
__exportStar(require("./row/AgentRow"), exports);
|
|
103
105
|
__exportStar(require("./row/AgentTagRow"), exports);
|
|
106
|
+
__exportStar(require("./row/ChatInputRow"), exports);
|
|
104
107
|
__exportStar(require("./row/ChatRow"), exports);
|
|
105
108
|
__exportStar(require("./row/DescriptionInputRow"), exports);
|
|
106
109
|
__exportStar(require("./row/DescriptionRow"), exports);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAoBA,2DAAyC;AACzC,gEAA8C;AAC9C,wEAAsD;AACtD,qEAAmD;AACnD,mEAAiD;AACjD,+DAA6C;AAC7C,+DAA6C;AAC7C,sEAAoD;AACpD,iEAA+C;AAC/C,kEAAgD;AAChD,kEAAgD;AAChD,+DAA6C;AAC7C,yEAAuD;AACvD,gEAA8C;AAC9C,iEAA+C;AAC/C,uEAAqD;AACrD,uEAAqD;AACrD,oEAAkD;AAClD,qEAAmD;AACnD,yDAAuC;AACvC,+DAA6C;AAC7C,+DAA6C;AAC7C,8DAA4C;AAC5C,oEAAkD;AAClD,oEAAkD;AAClD,iEAA+C;AAC/C,kEAAgD;AAChD,oEAAkD;AAClD,4DAA0C;AAC1C,6DAA2C;AAC3C,4DAA0C;AAC1C,kEAAgD;AAChD,kEAAgD;AAChD,+DAA6C;AAC7C,gEAA8C;AAC9C,kEAAgD;AAChD,+DAA6C;AAC7C,wDAAsC;AACtC,2DAAyC;AACzC,4DAA0C;AAC1C,+DAA6C;AAC7C,qEAAmD;AACnD,uEAAqD;AACrD,mEAAiD;AACjD,oEAAkD;AAClD,qEAAmD;AACnD,0DAAwC;AACxC,kEAAgD;AAChD,mEAAiD;AACjD,2DAAyC;AACzC,8DAA4C;AAC5C,2DAAyC;AACzC,8DAA4C;AAC5C,kEAAgD;AAChD,wEAAsD;AACtD,wEAAsD;AACtD,0EAAwD;AACxD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AA6C;AAC7C,wDAAsC;AACtC,8DAA4C;AAC5C,8DAA4C;AAC5C,2DAAyC;AACzC,4DAA0C;AAC1C,+DAA6C;AAC7C,qEAAmD;AACnD,uEAAqD;AACrD,mEAAiD;AACjD,oEAAkD;AAClD,qEAAmD;AACnD,0DAAwC;AACxC,kEAAgD;AAChD,mEAAiD;AACjD,2DAAyC;AACzC,8DAA4C;AAC5C,2DAAyC;AACzC,8DAA4C;AAC5C,kEAAgD;AAChD,wEAAsD;AACtD,wEAAsD;AACtD,0EAAwD;AACxD,sEAAoD;AACpD,uEAAqD;AACrD,wDAAsC;AACtC,8DAA4C;AAC5C,8DAA4C;AAC5C,gEAA8C;AAC9C,4DAA0C;AAC1C,6DAA2C;AAC3C,8DAA4C;AAC5C,yDAAuC;AACvC,6DAA2C;AAC3C,kDAAgC;AAChC,+DAA6C;AAC7C,oDAAkC;AAClC,kEAAgD;AAChD,wDAAsC;AACtC,gEAA8C;AAC9C,6DAA2C;AAC3C,wDAAsC;AACtC,2DAAyC;AACzC,uDAAqC;AACrC,8DAA4C;AAC5C,sEAAoD;AACpD,iEAA+C;AAC/C,uDAAqC;AACrC,yDAAuC;AACvC,sDAAoC;AACpC,sDAAoC;AACpC,iDAA+B;AAC/B,oDAAkC;AAClC,qDAAmC;AACnC,gDAA8B;AAC9B,4DAA0C;AAC1C,uDAAqC;AACrC,+DAA6C;AAC7C,4DAA0C;AAC1C,0DAAwC;AACxC,+DAA6C;AAC7C,0DAAwC;AACxC,qDAAmC;AACnC,gDAA8B"}
|
|
@@ -35,7 +35,6 @@ class ChatMetaTable extends namirasoft_site_1.NSBaseMetaTable {
|
|
|
35
35
|
let server = this.database.getServer();
|
|
36
36
|
return yield server.chat.List(filters, page, size, sorts);
|
|
37
37
|
});
|
|
38
|
-
this.front_end.getNewLink = () => "";
|
|
39
38
|
this.front_end.getUpdateLink = () => "";
|
|
40
39
|
}
|
|
41
40
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"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CAAC;QAC9D,CAAC,CAAA,CAAC;QACF,IAAI,CAAC,SAAS,CAAC,aAAa,GAAG,GAAG,EAAE,CAAC,EAAE,CAAC;IAC5C,CAAC;CACJ;AAzCD,sCAyCC;AAAA,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChatInputRow.js","sourceRoot":"","sources":["../../src/row/ChatInputRow.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -49,7 +49,7 @@ export class NamirasoftExpertServer extends NSABaseServer
|
|
|
49
49
|
chat: NamirasoftExpertServerChat;
|
|
50
50
|
constructor(base_url: string, token_manager: TokenManager, onError: (error: Error) => void)
|
|
51
51
|
{
|
|
52
|
-
super(base_url, `1.4.
|
|
52
|
+
super(base_url, `1.4.29`, token_manager, onError);
|
|
53
53
|
this.healthz = new NamirasoftExpertServerHealthz(this);
|
|
54
54
|
this.health = new NamirasoftExpertServerHealth(this);
|
|
55
55
|
this.metrics = new NamirasoftExpertServerMetrics(this);
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
/****************************************************************/
|
|
20
20
|
|
|
21
21
|
import { BaseServerConfig } from "namirasoft-core";
|
|
22
|
+
import { ChatInputRow } from "./row/ChatInputRow";
|
|
22
23
|
import { ChatRow } from "./row/ChatRow";
|
|
23
24
|
import { FilterItem } from "namirasoft-core";
|
|
24
25
|
import { NamirasoftExpertServer } from "./NamirasoftExpertServer";
|
|
@@ -30,8 +31,18 @@ export class NamirasoftExpertServerChat extends NamirasoftExpertServerBase
|
|
|
30
31
|
constructor(server: NamirasoftExpertServer)
|
|
31
32
|
{
|
|
32
33
|
super(server);
|
|
33
|
-
this.Get = this.Get.bind(this);
|
|
34
34
|
this.List = this.List.bind(this);
|
|
35
|
+
this.Get = this.Get.bind(this);
|
|
36
|
+
this.Create = this.Create.bind(this);
|
|
37
|
+
this.Delete = this.Delete.bind(this);
|
|
38
|
+
}
|
|
39
|
+
async List(filters: FilterItem[] | null, page: (number | null), size: (number | null), sorts: SortItem[], config?: BaseServerConfig<any>): Promise<{ rows: ChatRow[], count: number }>
|
|
40
|
+
{
|
|
41
|
+
let filters_string_value: string = FilterItem.stringify(filters);
|
|
42
|
+
let sorts_string_value: string = SortItem.stringify(sorts);
|
|
43
|
+
let path = `/chat/list`;
|
|
44
|
+
let { data } = await this.server._get<{ rows: ChatRow[], count: number }>(path, { filters: filters_string_value, page, size, sorts: sorts_string_value }, config);
|
|
45
|
+
return data;
|
|
35
46
|
}
|
|
36
47
|
async Get(id: (string | null), config?: BaseServerConfig<any>): Promise<ChatRow>
|
|
37
48
|
{
|
|
@@ -39,12 +50,15 @@ export class NamirasoftExpertServerChat extends NamirasoftExpertServerBase
|
|
|
39
50
|
let { data } = await this.server._get<ChatRow>(path, {}, config);
|
|
40
51
|
return data;
|
|
41
52
|
}
|
|
42
|
-
async
|
|
53
|
+
async Create(body: ChatInputRow, config?: BaseServerConfig<any>): Promise<ChatRow>
|
|
43
54
|
{
|
|
44
|
-
let
|
|
45
|
-
let
|
|
46
|
-
let path = `/chat/list`;
|
|
47
|
-
let { data } = await this.server._get<{ rows: ChatRow[], count: number }>(path, { filters: filters_string_value, page, size, sorts: sorts_string_value }, config);
|
|
55
|
+
let path = `/chat`;
|
|
56
|
+
let { data } = await this.server._post<ChatRow>(path, {}, body, config);
|
|
48
57
|
return data;
|
|
49
58
|
}
|
|
59
|
+
async Delete(id: string, config?: BaseServerConfig<any>): Promise<void>
|
|
60
|
+
{
|
|
61
|
+
let path = `/chat/${id}`;
|
|
62
|
+
await this.server._delete<void>(path, {}, config);
|
|
63
|
+
}
|
|
50
64
|
};
|
|
@@ -19,6 +19,8 @@
|
|
|
19
19
|
/****************************************************************/
|
|
20
20
|
|
|
21
21
|
import { BaseNavigatorCommand } from "namirasoft-node-cli";
|
|
22
|
+
import { ChatCreateCommand } from "./ChatCreateCommand";
|
|
23
|
+
import { ChatDeleteCommand } from "./ChatDeleteCommand";
|
|
22
24
|
import { ChatGetCommand } from "./ChatGetCommand";
|
|
23
25
|
import { ChatListCommand } from "./ChatListCommand";
|
|
24
26
|
|
|
@@ -27,8 +29,10 @@ export class ChatCommand extends BaseNavigatorCommand
|
|
|
27
29
|
constructor(argv: string[])
|
|
28
30
|
{
|
|
29
31
|
super(argv, {
|
|
30
|
-
"get": ChatGetCommand,
|
|
31
32
|
"list": ChatListCommand,
|
|
33
|
+
"get": ChatGetCommand,
|
|
34
|
+
"create": ChatCreateCommand,
|
|
35
|
+
"delete": ChatDeleteCommand,
|
|
32
36
|
});
|
|
33
37
|
}
|
|
34
38
|
};
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/****************************************************************/
|
|
2
|
+
/* */
|
|
3
|
+
/* This is an Auto-Generated File */
|
|
4
|
+
/* Made By */
|
|
5
|
+
/* Namirasoft SDK Generator NPM Package */
|
|
6
|
+
/* */
|
|
7
|
+
/****************************************************************/
|
|
8
|
+
/****************************************************************/
|
|
9
|
+
/* */
|
|
10
|
+
/* Please do not make any change to this file */
|
|
11
|
+
/* If any change is required, ns-sdkg command must be used */
|
|
12
|
+
/* */
|
|
13
|
+
/****************************************************************/
|
|
14
|
+
/****************************************************************/
|
|
15
|
+
/* */
|
|
16
|
+
/* Namira Software Corporation */
|
|
17
|
+
/* https://namirasoft.com */
|
|
18
|
+
/* */
|
|
19
|
+
/****************************************************************/
|
|
20
|
+
|
|
21
|
+
import { BaseFinalCommand } from "namirasoft-node-cli";
|
|
22
|
+
import { IStorageMemoryDedicated } from "namirasoft-core";
|
|
23
|
+
import { NamirasoftExpertServer } from "../NamirasoftExpertServer";
|
|
24
|
+
import { TokenManager } from "namirasoft-account";
|
|
25
|
+
|
|
26
|
+
export class ChatCreateCommand extends BaseFinalCommand
|
|
27
|
+
{
|
|
28
|
+
constructor(argv: string[])
|
|
29
|
+
{
|
|
30
|
+
super(argv, [], [
|
|
31
|
+
{
|
|
32
|
+
name: "workspace_id",
|
|
33
|
+
short: "",
|
|
34
|
+
description: "Provides the value of 'workspace_id' in body",
|
|
35
|
+
optional: true,
|
|
36
|
+
args: ["workspace_id"],
|
|
37
|
+
defaults: [""]
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: "agent_id",
|
|
41
|
+
short: "",
|
|
42
|
+
description: "Provides the value of 'agent_id' in body",
|
|
43
|
+
optional: false,
|
|
44
|
+
args: ["agent_id"],
|
|
45
|
+
defaults: [""]
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
name: "incident_id",
|
|
49
|
+
short: "",
|
|
50
|
+
description: "Provides the value of 'incident_id' in body",
|
|
51
|
+
optional: true,
|
|
52
|
+
args: ["incident_id"],
|
|
53
|
+
defaults: [""]
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: "type",
|
|
57
|
+
short: "",
|
|
58
|
+
description: "Provides the value of 'type' in body",
|
|
59
|
+
optional: false,
|
|
60
|
+
args: ["type"],
|
|
61
|
+
defaults: [""]
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
name: "name",
|
|
65
|
+
short: "",
|
|
66
|
+
description: "Provides the value of 'name' in body",
|
|
67
|
+
optional: false,
|
|
68
|
+
args: ["name"],
|
|
69
|
+
defaults: [""]
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
name: "meta",
|
|
73
|
+
short: "",
|
|
74
|
+
description: "Provides the value of 'meta' in body",
|
|
75
|
+
optional: false,
|
|
76
|
+
args: ["meta"],
|
|
77
|
+
defaults: [""]
|
|
78
|
+
}
|
|
79
|
+
]);
|
|
80
|
+
}
|
|
81
|
+
override async exec()
|
|
82
|
+
{
|
|
83
|
+
let token = this.app.storage.getNSAToken();
|
|
84
|
+
if (token == null)
|
|
85
|
+
throw new Error("Token is not available. Please login first using:\nns-expert account config \nor \nns-expert account login.");
|
|
86
|
+
let storage = new IStorageMemoryDedicated();
|
|
87
|
+
let token_manager = new TokenManager(storage, () => { });
|
|
88
|
+
token_manager.setValue(token, false);
|
|
89
|
+
let url = this.app.storage.getItem("ns-expert-server-url");
|
|
90
|
+
let server = new NamirasoftExpertServer(url, token_manager, e => this.app.logger.error(e.message));
|
|
91
|
+
let ans = await server.chat.Create({
|
|
92
|
+
workspace_id: this.option_values.workspace_id,
|
|
93
|
+
agent_id: this.option_values.agent_id,
|
|
94
|
+
incident_id: this.option_values.incident_id,
|
|
95
|
+
type: this.option_values.type,
|
|
96
|
+
name: this.option_values.name,
|
|
97
|
+
meta: this.option_values.meta
|
|
98
|
+
});
|
|
99
|
+
this.app.logger.success(JSON.stringify(ans));
|
|
100
|
+
}
|
|
101
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/****************************************************************/
|
|
2
|
+
/* */
|
|
3
|
+
/* This is an Auto-Generated File */
|
|
4
|
+
/* Made By */
|
|
5
|
+
/* Namirasoft SDK Generator NPM Package */
|
|
6
|
+
/* */
|
|
7
|
+
/****************************************************************/
|
|
8
|
+
/****************************************************************/
|
|
9
|
+
/* */
|
|
10
|
+
/* Please do not make any change to this file */
|
|
11
|
+
/* If any change is required, ns-sdkg command must be used */
|
|
12
|
+
/* */
|
|
13
|
+
/****************************************************************/
|
|
14
|
+
/****************************************************************/
|
|
15
|
+
/* */
|
|
16
|
+
/* Namira Software Corporation */
|
|
17
|
+
/* https://namirasoft.com */
|
|
18
|
+
/* */
|
|
19
|
+
/****************************************************************/
|
|
20
|
+
|
|
21
|
+
import { BaseFinalCommand } from "namirasoft-node-cli";
|
|
22
|
+
import { IStorageMemoryDedicated } from "namirasoft-core";
|
|
23
|
+
import { NamirasoftExpertServer } from "../NamirasoftExpertServer";
|
|
24
|
+
import { TokenManager } from "namirasoft-account";
|
|
25
|
+
|
|
26
|
+
export class ChatDeleteCommand extends BaseFinalCommand
|
|
27
|
+
{
|
|
28
|
+
constructor(argv: string[])
|
|
29
|
+
{
|
|
30
|
+
super(argv, ["id"], []);
|
|
31
|
+
}
|
|
32
|
+
override async exec()
|
|
33
|
+
{
|
|
34
|
+
let token = this.app.storage.getNSAToken();
|
|
35
|
+
if (token == null)
|
|
36
|
+
throw new Error("Token is not available. Please login first using:\nns-expert account config \nor \nns-expert account login.");
|
|
37
|
+
let storage = new IStorageMemoryDedicated();
|
|
38
|
+
let token_manager = new TokenManager(storage, () => { });
|
|
39
|
+
token_manager.setValue(token, false);
|
|
40
|
+
let url = this.app.storage.getItem("ns-expert-server-url");
|
|
41
|
+
let server = new NamirasoftExpertServer(url, token_manager, e => this.app.logger.error(e.message));
|
|
42
|
+
let ans = await server.chat.Delete(this.arg_values[0]);
|
|
43
|
+
this.app.logger.success(JSON.stringify(ans));
|
|
44
|
+
}
|
|
45
|
+
};
|
package/src/index.ts
CHANGED
|
@@ -56,6 +56,8 @@ export * from "./command/AgentTagListCommand";
|
|
|
56
56
|
export * from "./command/AgentTagUpdateCommand";
|
|
57
57
|
export * from "./command/AgentUpdateCommand";
|
|
58
58
|
export * from "./command/ChatCommand";
|
|
59
|
+
export * from "./command/ChatCreateCommand";
|
|
60
|
+
export * from "./command/ChatDeleteCommand";
|
|
59
61
|
export * from "./command/ChatGetCommand";
|
|
60
62
|
export * from "./command/ChatListCommand";
|
|
61
63
|
export * from "./command/DescriptionCommand";
|
|
@@ -105,6 +107,7 @@ export * from "./row/AgentFieldRow";
|
|
|
105
107
|
export * from "./row/AgentInputRow";
|
|
106
108
|
export * from "./row/AgentRow";
|
|
107
109
|
export * from "./row/AgentTagRow";
|
|
110
|
+
export * from "./row/ChatInputRow";
|
|
108
111
|
export * from "./row/ChatRow";
|
|
109
112
|
export * from "./row/DescriptionInputRow";
|
|
110
113
|
export * from "./row/DescriptionRow";
|
|
@@ -63,7 +63,6 @@ export class ChatMetaTable extends NSBaseMetaTable<NamirasoftExpertServer, ChatR
|
|
|
63
63
|
let server = this.database.getServer();
|
|
64
64
|
return await server.chat.List(filters, page, size, sorts);
|
|
65
65
|
};
|
|
66
|
-
this.front_end.getNewLink = () => "";
|
|
67
66
|
this.front_end.getUpdateLink = () => "";
|
|
68
67
|
}
|
|
69
68
|
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/****************************************************************/
|
|
2
|
+
/* */
|
|
3
|
+
/* This is an Auto-Generated File */
|
|
4
|
+
/* Made By */
|
|
5
|
+
/* Namirasoft SDK Generator NPM Package */
|
|
6
|
+
/* */
|
|
7
|
+
/****************************************************************/
|
|
8
|
+
/****************************************************************/
|
|
9
|
+
/* */
|
|
10
|
+
/* Please do not make any change to this file */
|
|
11
|
+
/* If any change is required, ns-sdkg command must be used */
|
|
12
|
+
/* */
|
|
13
|
+
/****************************************************************/
|
|
14
|
+
/****************************************************************/
|
|
15
|
+
/* */
|
|
16
|
+
/* Namira Software Corporation */
|
|
17
|
+
/* https://namirasoft.com */
|
|
18
|
+
/* */
|
|
19
|
+
/****************************************************************/
|
|
20
|
+
|
|
21
|
+
import { ChatType } from "../enum/ChatType";
|
|
22
|
+
|
|
23
|
+
export type ChatInputRow =
|
|
24
|
+
{
|
|
25
|
+
workspace_id: (string | null);
|
|
26
|
+
agent_id: string;
|
|
27
|
+
incident_id: (string | null);
|
|
28
|
+
type: ChatType;
|
|
29
|
+
name: string;
|
|
30
|
+
meta: any;
|
|
31
|
+
}
|