@glodon-aiot/agent-cli-sdk 2.4.7

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 (108) hide show
  1. package/README.md +70 -0
  2. package/dist/agent-cli-sdk.js +34975 -0
  3. package/dist/agent-cli-sdk.umd.cjs +150 -0
  4. package/dist/cdn/agent-cli-sdk.js +32945 -0
  5. package/dist/cdn/agent-cli-sdk.umd.cjs +140 -0
  6. package/dist/cdn/src/AgentPlugin.d.ts +17 -0
  7. package/dist/cdn/src/AgentSession.d.ts +8 -0
  8. package/dist/cdn/src/BotClient.d.ts +46 -0
  9. package/dist/cdn/src/Config.d.ts +32 -0
  10. package/dist/cdn/src/DialogSession.d.ts +21 -0
  11. package/dist/cdn/src/EventBus.d.ts +23 -0
  12. package/dist/cdn/src/Logger.d.ts +12 -0
  13. package/dist/cdn/src/PayloadTypes.d.ts +84 -0
  14. package/dist/cdn/src/Session.d.ts +156 -0
  15. package/dist/cdn/src/__ tests __/AgentClient.spec.d.ts +1 -0
  16. package/dist/cdn/src/__ tests __/AgentSession.spec.d.ts +1 -0
  17. package/dist/cdn/src/__ tests __/DialogClient.spec.d.ts +1 -0
  18. package/dist/cdn/src/api/fetchEventSource/fetch.d.ts +44 -0
  19. package/dist/cdn/src/api/fetchEventSource/index.d.ts +1 -0
  20. package/dist/cdn/src/api/fetchEventSource/parse.d.ts +36 -0
  21. package/dist/cdn/src/api/index.d.ts +2 -0
  22. package/dist/cdn/src/index.d.ts +5 -0
  23. package/dist/cdn/src/utils.d.ts +4 -0
  24. package/dist/es/AgentPlugin.mjs +20 -0
  25. package/dist/es/AgentSession.mjs +243 -0
  26. package/dist/es/BotClient.mjs +242 -0
  27. package/dist/es/Config.mjs +34 -0
  28. package/dist/es/DialogSession.mjs +281 -0
  29. package/dist/es/EventBus.mjs +64 -0
  30. package/dist/es/Logger.mjs +31 -0
  31. package/dist/es/PayloadTypes.mjs +4 -0
  32. package/dist/es/Session.mjs +527 -0
  33. package/dist/es/_virtual/_commonjsHelpers.mjs +4 -0
  34. package/dist/es/_virtual/index.mjs +4 -0
  35. package/dist/es/_virtual/index2.mjs +4 -0
  36. package/dist/es/_virtual/index3.mjs +4 -0
  37. package/dist/es/_virtual/minio-zj.mjs +4 -0
  38. package/dist/es/api/fetchEventSource/fetch.mjs +112 -0
  39. package/dist/es/api/fetchEventSource/parse.mjs +97 -0
  40. package/dist/es/api/index.mjs +48 -0
  41. package/dist/es/index.mjs +11 -0
  42. package/dist/es/node_modules/@glodon-aiot/minio/dist/minio-zj.mjs +26485 -0
  43. package/dist/es/node_modules/@socket.io/component-emitter/lib/esm/index.mjs +54 -0
  44. package/dist/es/node_modules/base64-js/index.mjs +47 -0
  45. package/dist/es/node_modules/buffer/index.mjs +927 -0
  46. package/dist/es/node_modules/engine.io-client/build/esm/contrib/has-cors.mjs +9 -0
  47. package/dist/es/node_modules/engine.io-client/build/esm/contrib/parseqs.mjs +18 -0
  48. package/dist/es/node_modules/engine.io-client/build/esm/contrib/parseuri.mjs +24 -0
  49. package/dist/es/node_modules/engine.io-client/build/esm/contrib/yeast.mjs +19 -0
  50. package/dist/es/node_modules/engine.io-client/build/esm/globalThis.browser.mjs +4 -0
  51. package/dist/es/node_modules/engine.io-client/build/esm/socket.mjs +317 -0
  52. package/dist/es/node_modules/engine.io-client/build/esm/transport.mjs +113 -0
  53. package/dist/es/node_modules/engine.io-client/build/esm/transports/index.mjs +11 -0
  54. package/dist/es/node_modules/engine.io-client/build/esm/transports/polling.mjs +273 -0
  55. package/dist/es/node_modules/engine.io-client/build/esm/transports/websocket-constructor.browser.mjs +8 -0
  56. package/dist/es/node_modules/engine.io-client/build/esm/transports/websocket.mjs +87 -0
  57. package/dist/es/node_modules/engine.io-client/build/esm/transports/webtransport.mjs +52 -0
  58. package/dist/es/node_modules/engine.io-client/build/esm/transports/xmlhttprequest.browser.mjs +21 -0
  59. package/dist/es/node_modules/engine.io-client/build/esm/util.mjs +23 -0
  60. package/dist/es/node_modules/engine.io-parser/build/esm/commons.mjs +21 -0
  61. package/dist/es/node_modules/engine.io-parser/build/esm/contrib/base64-arraybuffer.mjs +14 -0
  62. package/dist/es/node_modules/engine.io-parser/build/esm/decodePacket.browser.mjs +39 -0
  63. package/dist/es/node_modules/engine.io-parser/build/esm/encodePacket.browser.mjs +28 -0
  64. package/dist/es/node_modules/engine.io-parser/build/esm/index.mjs +105 -0
  65. package/dist/es/node_modules/ieee754/index.mjs +28 -0
  66. package/dist/es/node_modules/js-base64/base64.mjs +31 -0
  67. package/dist/es/node_modules/socket.io-client/build/esm/contrib/backo2.mjs +26 -0
  68. package/dist/es/node_modules/socket.io-client/build/esm/index.mjs +25 -0
  69. package/dist/es/node_modules/socket.io-client/build/esm/manager.mjs +242 -0
  70. package/dist/es/node_modules/socket.io-client/build/esm/on.mjs +8 -0
  71. package/dist/es/node_modules/socket.io-client/build/esm/socket.mjs +608 -0
  72. package/dist/es/node_modules/socket.io-client/build/esm/url.mjs +19 -0
  73. package/dist/es/node_modules/socket.io-parser/build/esm/binary.mjs +52 -0
  74. package/dist/es/node_modules/socket.io-parser/build/esm/index.mjs +203 -0
  75. package/dist/es/node_modules/socket.io-parser/build/esm/is-binary.mjs +26 -0
  76. package/dist/es/node_modules/uuid/dist/esm-browser/native.mjs +6 -0
  77. package/dist/es/node_modules/uuid/dist/esm-browser/rng.mjs +10 -0
  78. package/dist/es/node_modules/uuid/dist/esm-browser/stringify.mjs +9 -0
  79. package/dist/es/node_modules/uuid/dist/esm-browser/v4.mjs +19 -0
  80. package/dist/es/packages/apis/dist/es/aecpilot/model.mjs +4 -0
  81. package/dist/es/packages/apis/dist/es/aecpilotui/index.mjs +8 -0
  82. package/dist/es/packages/apis/dist/es/agentcliui/index.mjs +8 -0
  83. package/dist/es/packages/apis/dist/es/base/index.mjs +154 -0
  84. package/dist/es/packages/apis/dist/es/cvforce/index.mjs +431 -0
  85. package/dist/es/packages/apis/dist/es/cvforce/model.mjs +5 -0
  86. package/dist/es/packages/apis/dist/es/node_modules/uuid/dist/esm-browser/native.mjs +1 -0
  87. package/dist/es/packages/apis/dist/es/node_modules/uuid/dist/esm-browser/stringify.mjs +3 -0
  88. package/dist/es/utils.mjs +11 -0
  89. package/dist/lib/index.js +126 -0
  90. package/dist/src/AgentPlugin.d.ts +17 -0
  91. package/dist/src/AgentSession.d.ts +8 -0
  92. package/dist/src/BotClient.d.ts +46 -0
  93. package/dist/src/Config.d.ts +32 -0
  94. package/dist/src/DialogSession.d.ts +21 -0
  95. package/dist/src/EventBus.d.ts +23 -0
  96. package/dist/src/Logger.d.ts +12 -0
  97. package/dist/src/PayloadTypes.d.ts +84 -0
  98. package/dist/src/Session.d.ts +155 -0
  99. package/dist/src/__ tests __/AgentClient.spec.d.ts +1 -0
  100. package/dist/src/__ tests __/AgentSession.spec.d.ts +1 -0
  101. package/dist/src/__ tests __/DialogClient.spec.d.ts +1 -0
  102. package/dist/src/api/fetchEventSource/fetch.d.ts +44 -0
  103. package/dist/src/api/fetchEventSource/index.d.ts +1 -0
  104. package/dist/src/api/fetchEventSource/parse.d.ts +36 -0
  105. package/dist/src/api/index.d.ts +2 -0
  106. package/dist/src/index.d.ts +5 -0
  107. package/dist/src/utils.d.ts +4 -0
  108. package/package.json +102 -0
@@ -0,0 +1,97 @@
1
+ var b = (s, t, e) => new Promise((a, c) => {
2
+ var f = (r) => {
3
+ try {
4
+ i(e.next(r));
5
+ } catch (n) {
6
+ c(n);
7
+ }
8
+ }, l = (r) => {
9
+ try {
10
+ i(e.throw(r));
11
+ } catch (n) {
12
+ c(n);
13
+ }
14
+ }, i = (r) => r.done ? a(r.value) : Promise.resolve(r.value).then(f, l);
15
+ i((e = e.apply(s, t)).next());
16
+ });
17
+ function w(s, t) {
18
+ return b(this, null, function* () {
19
+ const e = s.getReader();
20
+ let a;
21
+ for (; !(a = yield e.read()).done; )
22
+ t(a.value);
23
+ });
24
+ }
25
+ function g(s) {
26
+ let t, e, a, c = !1, f;
27
+ return function(i) {
28
+ t === void 0 ? (t = i, e = 0, a = -1, f = !1) : t = h(t, i);
29
+ const r = t.length;
30
+ let n = 0;
31
+ for (; e < r; ) {
32
+ c && (t[e] === 10 && (n = ++e), c = !1);
33
+ let o = -1;
34
+ for (; e < r && o === -1; ++e)
35
+ switch (t[e]) {
36
+ case 58:
37
+ a === -1 && (a = e - n);
38
+ break;
39
+ case 13:
40
+ c = !1, e + 4 < r && t[e + 1] === 10 && t[e + 2] !== 13 && t[e - 1] !== 10 && t[e - 2] !== 13 && (f = !0);
41
+ case 10:
42
+ o = e;
43
+ break;
44
+ }
45
+ if (o === -1)
46
+ break;
47
+ s(t.subarray(n, o), a, f), n = e, a = -1, f = !1;
48
+ }
49
+ n === r ? t = void 0 : n !== 0 && (t = t.subarray(n), e -= n);
50
+ };
51
+ }
52
+ function k(s, t, e) {
53
+ let a = y();
54
+ const c = new TextDecoder();
55
+ return function(l, i, r) {
56
+ if (l.length === 0)
57
+ e == null || e(a), a = y();
58
+ else if (i > 0) {
59
+ const n = c.decode(l.subarray(0, i)), o = i + (l[i + 1] === 32 ? 2 : 1);
60
+ let d = c.decode(l.subarray(o));
61
+ switch (r && (d += `
62
+ `), n) {
63
+ case "data":
64
+ a.data = a.data ? a.data + `
65
+ ` + d : d;
66
+ break;
67
+ case "event":
68
+ a.event = d;
69
+ break;
70
+ case "id":
71
+ s(a.id = d);
72
+ break;
73
+ case "retry":
74
+ const u = parseInt(d, 10);
75
+ isNaN(u) || t(a.retry = u);
76
+ break;
77
+ }
78
+ }
79
+ };
80
+ }
81
+ function h(s, t) {
82
+ const e = new Uint8Array(s.length + t.length);
83
+ return e.set(s), e.set(t, s.length), e;
84
+ }
85
+ function y() {
86
+ return {
87
+ data: "",
88
+ event: "",
89
+ id: "",
90
+ retry: void 0
91
+ };
92
+ }
93
+ export {
94
+ w as getBytes,
95
+ g as getLines,
96
+ k as getMessages
97
+ };
@@ -0,0 +1,48 @@
1
+ var d = Object.defineProperty, h = Object.defineProperties;
2
+ var S = Object.getOwnPropertyDescriptors;
3
+ var s = Object.getOwnPropertySymbols;
4
+ var x = Object.prototype.hasOwnProperty, C = Object.prototype.propertyIsEnumerable;
5
+ var a = (t, e, r) => e in t ? d(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, p = (t, e) => {
6
+ for (var r in e || (e = {}))
7
+ x.call(e, r) && a(t, r, e[r]);
8
+ if (s)
9
+ for (var r of s(e))
10
+ C.call(e, r) && a(t, r, e[r]);
11
+ return t;
12
+ }, m = (t, e) => h(t, S(e));
13
+ import E from "axios";
14
+ import { isExpired as F } from "../utils.mjs";
15
+ import "../node_modules/@glodon-aiot/minio/dist/minio-zj.mjs";
16
+ import "dayjs";
17
+ import "../packages/apis/dist/es/node_modules/uuid/dist/esm-browser/native.mjs";
18
+ import "../packages/apis/dist/es/node_modules/uuid/dist/esm-browser/stringify.mjs";
19
+ import "../packages/apis/dist/es/agentcliui/index.mjs";
20
+ import "../packages/apis/dist/es/aecpilotui/index.mjs";
21
+ import { CVForceApi as I } from "../packages/apis/dist/es/cvforce/index.mjs";
22
+ function j(t, e, r) {
23
+ console.log("getCVForceService apiBase", t);
24
+ const f = (o) => {
25
+ var i;
26
+ return e && (F(e) && r(403, "aiotToken is timeout"), o.headers = (i = o.headers) != null ? i : {}, o.headers = m(p({}, o.headers), {
27
+ Authorization: e ? `Bearer ${e}` : ""
28
+ })), o;
29
+ };
30
+ function g(o, i = !0) {
31
+ const n = `${t}${o}`, c = E.create({
32
+ baseURL: n
33
+ });
34
+ return i && c.interceptors.request.use(f), c;
35
+ }
36
+ const u = (o, i) => {
37
+ o === 401 && r(o, "aiotToken is invalid");
38
+ }, v = (o, i) => {
39
+ o !== 10001 && o !== 10215 && r(o, i);
40
+ }, A = g("/data/v1");
41
+ return new I(A, {
42
+ onHttpStatusError: u,
43
+ onAppStatusError: v
44
+ });
45
+ }
46
+ export {
47
+ j as getCVForceService
48
+ };
@@ -0,0 +1,11 @@
1
+ import { configuration as t, configure as r } from "./Config.mjs";
2
+ import { default as a } from "./BotClient.mjs";
3
+ import { default as i } from "./Session.mjs";
4
+ import { default as l } from "./AgentPlugin.mjs";
5
+ export {
6
+ l as AgentPlugin,
7
+ a as BotClient,
8
+ i as Session,
9
+ t as configuration,
10
+ r as configure
11
+ };