honeyhive 0.3.12 → 0.3.13

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/sdk/sdk.js CHANGED
@@ -48,9 +48,9 @@ var SDKConfiguration = /** @class */ (function () {
48
48
  function SDKConfiguration(init) {
49
49
  this.language = "typescript";
50
50
  this.openapiDocVersion = "1.0.1";
51
- this.sdkVersion = "0.3.1";
52
- this.genVersion = "2.279.1";
53
- this.userAgent = "speakeasy-sdk/typescript 0.3.1 2.279.1 1.0.1 HoneyHive";
51
+ this.sdkVersion = "0.3.2";
52
+ this.genVersion = "2.281.2";
53
+ this.userAgent = "speakeasy-sdk/typescript 0.3.2 2.281.2 1.0.1 HoneyHive";
54
54
  Object.assign(this, init);
55
55
  }
56
56
  return SDKConfiguration;
@@ -60,8 +60,11 @@ var HoneyHive = /** @class */ (function () {
60
60
  function HoneyHive(props) {
61
61
  var _a, _b;
62
62
  var serverURL = props === null || props === void 0 ? void 0 : props.serverURL;
63
- var serverIdx = (_a = props === null || props === void 0 ? void 0 : props.serverIdx) !== null && _a !== void 0 ? _a : 0;
64
63
  if (!serverURL) {
64
+ var serverIdx = (_a = props === null || props === void 0 ? void 0 : props.serverIdx) !== null && _a !== void 0 ? _a : 0;
65
+ if (serverIdx < 0 || serverIdx >= exports.ServerList.length) {
66
+ throw new Error("Invalid server index ".concat(serverIdx));
67
+ }
65
68
  serverURL = exports.ServerList[serverIdx];
66
69
  }
67
70
  var defaultClient = (_b = props === null || props === void 0 ? void 0 : props.defaultClient) !== null && _b !== void 0 ? _b : axios_1.default.create();
@@ -125,6 +125,7 @@ export declare class SessionTracer {
125
125
  constructor(api_key: string, project: string, session_name: string, user_properties?: {
126
126
  [key: string]: any;
127
127
  }, source?: string);
128
+ getSessionId(): string;
128
129
  startSession(inputs?: {
129
130
  [key: string]: any;
130
131
  }): Promise<void>;
@@ -91,9 +91,12 @@ var SessionTracer = /** @class */ (function () {
91
91
  this.session_id = "";
92
92
  this.parentEvent = {};
93
93
  }
94
+ SessionTracer.prototype.getSessionId = function () {
95
+ return this.session_id;
96
+ };
94
97
  SessionTracer.prototype.startSession = function (inputs) {
95
98
  return __awaiter(this, void 0, void 0, function () {
96
- var session, res, _a;
99
+ var session, _a;
97
100
  return __generator(this, function (_b) {
98
101
  switch (_b.label) {
99
102
  case 0:
@@ -128,7 +131,7 @@ var SessionTracer = /** @class */ (function () {
128
131
  session: session,
129
132
  })];
130
133
  case 1:
131
- res = _b.sent();
134
+ _b.sent();
132
135
  return [3 /*break*/, 3];
133
136
  case 2:
134
137
  _a = _b.sent();
@@ -191,7 +194,7 @@ var SessionTracer = /** @class */ (function () {
191
194
  };
192
195
  SessionTracer.prototype.endSession = function (outputs, error) {
193
196
  return __awaiter(this, void 0, void 0, function () {
194
- var session_trace, res, _a;
197
+ var session_trace, _a;
195
198
  return __generator(this, function (_b) {
196
199
  switch (_b.label) {
197
200
  case 0:
@@ -211,7 +214,7 @@ var SessionTracer = /** @class */ (function () {
211
214
  logs: [session_trace],
212
215
  })];
213
216
  case 1:
214
- res = _b.sent();
217
+ _b.sent();
215
218
  return [4 /*yield*/, this.client.put("https://api.honeyhive.ai/events", {
216
219
  event_id: this.session_id,
217
220
  outputs: outputs,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "honeyhive",
3
- "version": "0.3.12",
3
+ "version": "0.3.13",
4
4
  "author": "HoneyHive",
5
5
  "scripts": {
6
6
  "prepare": "tsc --build",