@e-llm-studio/citation 0.0.221-beta.1 → 0.0.221-beta.3

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.
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib");exports.getFileContent=function(t,n){var r,o;return e.__awaiter(this,void 0,void 0,function(){var i,s;return e.__generator(this,function(e){switch(e.label){case 0:return[4,fetch("".concat(n,"/gcs/get-file-content"),{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({file_path:t})})];case 1:if(!(i=e.sent()).ok)throw new Error("Failed to fetch file content: ".concat(i.statusText));return[4,i.json()];case 2:return s=e.sent(),[2,null!==(o=null===(r=null==s?void 0:s.responseData)||void 0===r?void 0:r.content)&&void 0!==o?o:""]}})})},exports.getNestedValue=function(e,t){var n;try{for(var r=t.split("."),o=e,i=0,s=r;i<s.length;i++){var a=s[i],l=a.match(/^(\w+)\[(\d+)\]$/);if(l){var c=l[1],u=l[2];o=null===(n=null==o?void 0:o[c])||void 0===n?void 0:n[Number(u)]}else o=null==o?void 0:o[a];if(null==o)return null}return o}catch(e){return console.error("Nested extraction error",e),null}},exports.getSignedUrl=function(t,n){return e.__awaiter(this,void 0,void 0,function(){var r;return e.__generator(this,function(e){switch(e.label){case 0:return[4,fetch("".concat(n,"/gcs/get-signed-url/"),{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({gsutil_url:t})})];case 1:if(!(r=e.sent()).ok)throw new Error("Failed to get signed URL: ".concat(r.statusText));return[4,r.json()];case 2:return[2,e.sent()]}})})},exports.isJSONFile=function(e){var t;return null!==(t=null==e?void 0:e.toLowerCase().includes("json"))&&void 0!==t&&t};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=function(e){return e.endsWith("/")?e.slice(0,-1):e};exports.getFileContent=function(n,r){var o,i;return e.__awaiter(this,void 0,void 0,function(){var s,a,c,l;return e.__generator(this,function(e){switch(e.label){case 0:return s=t(r),a=n.startsWith("gs://")?n.replace("gs://",""):n,[4,fetch("".concat(s,"/gcs/get-file-content"),{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({file_path:a})})];case 1:if(!(c=e.sent()).ok)throw new Error("Failed to fetch file content: ".concat(c.statusText));return[4,c.json()];case 2:return l=e.sent(),[2,null!==(i=null===(o=null==l?void 0:l.responseData)||void 0===o?void 0:o.content)&&void 0!==i?i:""]}})})},exports.getNestedValue=function(e,t){var n;try{for(var r=t.split("."),o=e,i=0,s=r;i<s.length;i++){var a=s[i],c=a.match(/^(\w+)\[(\d+)\]$/);if(c){var l=c[1],u=c[2];o=null===(n=null==o?void 0:o[l])||void 0===n?void 0:n[Number(u)]}else o=null==o?void 0:o[a];if(null==o)return null}return o}catch(e){return console.error("Nested extraction error",e),null}},exports.getSignedUrl=function(n,r){return e.__awaiter(this,void 0,void 0,function(){var o,i,s;return e.__generator(this,function(e){switch(e.label){case 0:return o=n.startsWith("gs://")?n:"gs://".concat(n),i=t(r),[4,fetch("".concat(i,"/gcs/get-signed-url/"),{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({gsutil_url:o})})];case 1:if(!(s=e.sent()).ok)throw new Error("Failed to get signed URL: ".concat(s.statusText));return[4,s.json()];case 2:return[2,e.sent()]}})})},exports.isJSONFile=function(e){var t;return null!==(t=null==e?void 0:e.toLowerCase().includes("json"))&&void 0!==t&&t};
2
2
  //# sourceMappingURL=RuleBookCitationApi.js.map
@@ -1,2 +1,2 @@
1
- import{__awaiter as t,__generator as n}from"tslib";function e(t){var n;return null!==(n=null==t?void 0:t.toLowerCase().includes("json"))&&void 0!==n&&n}function r(e,r){return t(this,void 0,void 0,function(){var t;return n(this,function(n){switch(n.label){case 0:return[4,fetch("".concat(r,"/gcs/get-signed-url/"),{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({gsutil_url:e})})];case 1:if(!(t=n.sent()).ok)throw new Error("Failed to get signed URL: ".concat(t.statusText));return[4,t.json()];case 2:return[2,n.sent()]}})})}function o(e,r){var o,i;return t(this,void 0,void 0,function(){var t,c;return n(this,function(n){switch(n.label){case 0:return[4,fetch("".concat(r,"/gcs/get-file-content"),{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({file_path:e})})];case 1:if(!(t=n.sent()).ok)throw new Error("Failed to fetch file content: ".concat(t.statusText));return[4,t.json()];case 2:return c=n.sent(),[2,null!==(i=null===(o=null==c?void 0:c.responseData)||void 0===o?void 0:o.content)&&void 0!==i?i:""]}})})}function i(t,n){var e;try{for(var r=n.split("."),o=t,i=0,c=r;i<c.length;i++){var l=c[i],s=l.match(/^(\w+)\[(\d+)\]$/);if(s){var a=s[1],u=s[2];o=null===(e=null==o?void 0:o[a])||void 0===e?void 0:e[Number(u)]}else o=null==o?void 0:o[l];if(null==o)return null}return o}catch(t){return console.error("Nested extraction error",t),null}}export{o as getFileContent,i as getNestedValue,r as getSignedUrl,e as isJSONFile};
1
+ import{__awaiter as t,__generator as n}from"tslib";var e=function(t){return t.endsWith("/")?t.slice(0,-1):t};function r(t){var n;return null!==(n=null==t?void 0:t.toLowerCase().includes("json"))&&void 0!==n&&n}function o(r,o){return t(this,void 0,void 0,function(){var t,i,s;return n(this,function(n){switch(n.label){case 0:return t=r.startsWith("gs://")?r:"gs://".concat(r),i=e(o),[4,fetch("".concat(i,"/gcs/get-signed-url/"),{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({gsutil_url:t})})];case 1:if(!(s=n.sent()).ok)throw new Error("Failed to get signed URL: ".concat(s.statusText));return[4,s.json()];case 2:return[2,n.sent()]}})})}function i(r,o){var i,s;return t(this,void 0,void 0,function(){var t,c,a,l;return n(this,function(n){switch(n.label){case 0:return t=e(o),c=r.startsWith("gs://")?r.replace("gs://",""):r,[4,fetch("".concat(t,"/gcs/get-file-content"),{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({file_path:c})})];case 1:if(!(a=n.sent()).ok)throw new Error("Failed to fetch file content: ".concat(a.statusText));return[4,a.json()];case 2:return l=n.sent(),[2,null!==(s=null===(i=null==l?void 0:l.responseData)||void 0===i?void 0:i.content)&&void 0!==s?s:""]}})})}function s(t,n){var e;try{for(var r=n.split("."),o=t,i=0,s=r;i<s.length;i++){var c=s[i],a=c.match(/^(\w+)\[(\d+)\]$/);if(a){var l=a[1],u=a[2];o=null===(e=null==o?void 0:o[l])||void 0===e?void 0:e[Number(u)]}else o=null==o?void 0:o[c];if(null==o)return null}return o}catch(t){return console.error("Nested extraction error",t),null}}export{i as getFileContent,s as getNestedValue,o as getSignedUrl,r as isJSONFile};
2
2
  //# sourceMappingURL=RuleBookCitationApi.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RuleBookCitationApi.d.ts","sourceRoot":"","sources":["../../../../../src/features/RulebookCitations/RuleBookCitationApi.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED,MAAM,MAAM,UAAU,GAClB,gBAAgB,EAAE,GAClB,MAAM,CAAC,MAAM,EAAE,gBAAgB,EAAE,CAAC,CAAC;AAGvC,MAAM,WAAW,iBAAiB;IAChC,YAAY,CAAC,EAAE;QACb,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC;IAEF,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,UAAU,CAAC,SAAS,CAAC,EAAE,MAAM,WAE5C;AAED,wBAAsB,YAAY,CAAC,MAAM,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uB1D"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e-llm-studio/citation",
3
- "version": "0.0.221-beta.1",
3
+ "version": "0.0.221-beta.3",
4
4
  "author": "Devesh Patel",
5
5
  "description": "",
6
6
  "license": "MIT",