chatstreamjs
Advanced tools
Comparing version 1.0.1 to 1.1.0
@@ -1,2 +0,2 @@ | ||
/*! ChatStream v1.0.1 Copyright (c) 2023 riversun.org@gmail.com */ | ||
/*! ChatStream v1.1.0 Copyright (c) 2023 riversun.org@gmail.com */ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.ChatStream=t():e.ChatStream=t()}(this,(()=>(()=>{"use strict";var e={r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};return e.r(t),function(e,t){if("function"==typeof define&&define.amd)define(["exports","./chat-stream-client.js","./stream-status.js"],t);else if("undefined"!=typeof exports)t(exports,require("./chat-stream-client.js"),require("./stream-status.js"));else{var r={exports:{}};t(r.exports,e.chatStreamClient,e.streamStatus),e.index=r.exports}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:void 0,(function(e,t,r){var o;Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"ChatStreamClient",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"StreamStatus",{enumerable:!0,get:function(){return r.StreamStatus}}),t=(o=t)&&o.__esModule?o:{default:o}})),t})())); |
{ | ||
"name": "chatstreamjs", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"description": "Client Side Library for ChatStream", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -126,3 +126,4 @@ import {StreamStatus} from "./stream-status.js"; | ||
statusCode: fetch_response.status, | ||
err: parsedError | ||
err: parsedError, | ||
rawResponse:fetch_response, | ||
} | ||
@@ -141,3 +142,4 @@ console.error(`Client error occurred code:${fetch_response.status}`, parsedError) | ||
statusCode: fetch_response.status, | ||
err: parsedError | ||
err: parsedError, | ||
rawResponse:fetch_response, | ||
}; | ||
@@ -171,3 +173,3 @@ console.error(`Server error occurred code:${fetch_response.status}`, parsedError) | ||
const out = {response_text, pos, status: StreamStatus.OK} | ||
const out = {response_text, pos, status: StreamStatus.OK,rawResponse:fetch_response,} | ||
@@ -188,7 +190,7 @@ const { | ||
// Error that occurs when the fetch process is explicitly interrupted | ||
const out = {response_text: null, pos: 'end', status: StreamStatus.ABORTED} | ||
const out = {response_text: null, pos: 'end', status: StreamStatus.ABORTED,rawResponse:null,} | ||
await fnCallbackOnResponse(out); | ||
} else if (e.name === 'TypeError') { | ||
// - Error that occurs when disconnected from the server or when the network is disconnected during the process | ||
const out = {response_text: null, pos: 'end', status: StreamStatus.NETWORK_ERROR, err: e} | ||
const out = {response_text: null, pos: 'end', status: StreamStatus.NETWORK_ERROR, err: e,rawResponse:null} | ||
console.error(`Network error occurred while fetching...`, e); | ||
@@ -199,3 +201,3 @@ await fnCallbackOnResponse(out); | ||
// - When any other error occurs | ||
const out = {response_text: null, pos: 'end', status: StreamStatus.FETCH_ERROR, err: e} | ||
const out = {response_text: null, pos: 'end', status: StreamStatus.FETCH_ERROR, err: e,rawResponse:null} | ||
console.error(`Unknown error occurred while fetching...`, e); | ||
@@ -202,0 +204,0 @@ await fnCallbackOnResponse(out); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
32838
240