@ai4b-team/fsaos-gateway-sdk 4.3.0 → 4.3.1

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/iife/ui.js CHANGED
@@ -1,3 +1,3 @@
1
- /* @fsaos/ui v2.0.0 — FSAOS UI Primitives — 2026-11-05T00:06:42.061Z */
1
+ /* @fsaos/ui v2.0.0 — FSAOS UI Primitives — 2026-11-10T14:04:27.053Z */
2
2
  "use strict";var __FSAOS_UI__=(()=>{var m=Object.create;var r=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var f=Object.getPrototypeOf,h=Object.prototype.hasOwnProperty;var y=(e,i)=>()=>(i||e((i={exports:{}}).exports,i),i.exports),N=(e,i)=>{for(var a in i)r(e,a,{get:i[a],enumerable:!0})},s=(e,i,a,l)=>{if(i&&typeof i=="object"||typeof i=="function")for(let t of u(i))!h.call(e,t)&&t!==a&&r(e,t,{get:()=>i[t],enumerable:!(l=g(i,t))||l.enumerable});return e};var x=(e,i,a)=>(a=e!=null?m(f(e)):{},s(i||!e||!e.__esModule?r(a,"default",{value:e,enumerable:!0}):a,e)),b=e=>s(r({},"__esModule",{value:!0}),e);var d=y((V,c)=>{c.exports=React});var P={};N(P,{Badge:()=>z,Breadcrumbs:()=>A,Button:()=>D,Card:()=>w,DataView:()=>R,Detail:()=>_,Empty:()=>I,FilePreview:()=>O,Form:()=>F,Grid:()=>k,Image:()=>G,Link:()=>E,Page:()=>v,Router:()=>T,Sidebar:()=>S,Spinner:()=>B,Stack:()=>C,Table:()=>j,Tabs:()=>W,Video:()=>H});var n=x(d(),1);function o(){return(typeof window<"u"&&window.__FSAOS_CONFIG__||{}).edgeBaseUrl||""}function v(e){return(0,n.createElement)("div",{style:{minHeight:"100vh",display:"flex",flexDirection:"column"},className:e.className||""},e.children)}function C(e){let i=e.direction||"vertical";return(0,n.createElement)("div",{style:{display:"flex",flexDirection:i==="horizontal"?"row":"column",gap:e.gap||"0.5rem",padding:e.padding||"0",alignItems:e.align||"stretch",justifyContent:e.justify||"flex-start",flex:e.flex||"initial"},className:e.className||""},e.children)}function k(e){return(0,n.createElement)("div",{style:{display:"grid",gridTemplateColumns:"repeat("+(e.columns||3)+", 1fr)",gap:e.gap||"1rem",padding:e.padding||"0"},className:e.className||""},e.children)}function S(e){return(0,n.createElement)("div",{style:{display:"flex",flexDirection:"row",minHeight:"100vh"},className:e.className||""},e.children)}function w(e){return(0,n.createElement)("div",{style:{border:"1px solid var(--color-border, #e5e7eb)",borderRadius:"var(--border-radius, 0.5rem)",padding:e.padding||"1rem",background:"var(--color-surface, #fff)"},className:e.className||"",onClick:e.onClick},e.children)}function z(e){return(0,n.createElement)("span",{style:{display:"inline-flex",alignItems:"center",padding:"0.125rem 0.5rem",fontSize:"0.75rem",fontWeight:"500",borderRadius:"9999px",background:e.color||"#e5e7eb",color:e.textColor||"#374151"},className:e.className||""},e.children||e.label)}function B(e){let i=e.size||"1.5rem";return(0,n.createElement)("div",{style:{width:i,height:i,border:"2px solid #e5e7eb",borderTopColor:"var(--color-primary, #3b82f6)",borderRadius:"50%",animation:"fsaos-spin 0.6s linear infinite"}})}function D(e){return(0,n.createElement)("button",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",padding:"0.5rem 1rem",fontSize:"0.875rem",fontWeight:"500",borderRadius:"var(--border-radius, 0.375rem)",border:e.variant==="outline"?"1px solid var(--color-border, #d1d5db)":"none",background:e.variant==="outline"||e.variant==="ghost"?"transparent":"var(--color-primary, #3b82f6)",color:e.variant==="outline"||e.variant==="ghost"?"var(--color-text, #1a1a1a)":"#fff",cursor:e.disabled?"not-allowed":"pointer",opacity:e.disabled?"0.5":"1",gap:"0.5rem"},className:e.className||"",onClick:e.onClick,disabled:e.disabled},e.children||e.label)}function I(e){return(0,n.createElement)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"3rem",color:"var(--color-text-secondary, #6b7280)",textAlign:"center"}},e.icon?(0,n.createElement)("div",{style:{fontSize:"2rem",marginBottom:"0.5rem"}},e.icon):null,(0,n.createElement)("div",{style:{fontWeight:500,marginBottom:"0.25rem"}},e.title||e.message||e.children||"No items"),e.description?(0,n.createElement)("div",{style:{fontSize:"0.875rem",opacity:.7}},e.description):null)}function R(e){return(0,n.createElement)("div",{className:e.className||""},e.children)}function j(e){return(0,n.createElement)("table",{className:e.className||""},e.children)}function F(e){return(0,n.createElement)("form",{className:e.className||"",onSubmit:e.onSubmit},e.children)}function _(e){return(0,n.createElement)("div",{className:e.className||""},e.children)}function T(e){return(0,n.createElement)("div",null,e.children)}function E(e){return(0,n.createElement)("a",{href:e.href||e.to,className:e.className||"",onClick:e.onClick},e.children)}function W(e){return(0,n.createElement)("div",{className:e.className||""},e.children)}function A(e){return(0,n.createElement)("nav",{className:e.className||""},e.children)}function G(e){return(0,n.createElement)("img",{src:e.src||(e.path?o()+e.path:""),alt:e.alt||"",className:e.className||"",style:e.style})}function H(e){return(0,n.createElement)("video",{src:e.src||(e.path?o()+e.path:""),controls:!0,className:e.className||""})}function O(e){return(0,n.createElement)("div",{className:e.className||""},e.children||"File preview")}return b(P);})();
3
3
  //# sourceMappingURL=ui.js.map
package/dist/index.cjs CHANGED
@@ -5659,14 +5659,27 @@ function getRequiredFormFields(typeDef) {
5659
5659
  (f) => required.has(f.key) || f.default_value === void 0
5660
5660
  );
5661
5661
  }
5662
- var _idCounter = 0;
5663
5662
  function generateUploadId() {
5664
- return `upload_${Date.now()}_${++_idCounter}`;
5663
+ if (globalThis.crypto?.randomUUID) return globalThis.crypto.randomUUID();
5664
+ const bytes = new Uint8Array(16);
5665
+ if (globalThis.crypto?.getRandomValues) {
5666
+ globalThis.crypto.getRandomValues(bytes);
5667
+ bytes[6] = bytes[6] & 15 | 64;
5668
+ bytes[8] = bytes[8] & 63 | 128;
5669
+ const hex = Array.from(bytes, (byte) => byte.toString(16).padStart(2, "0")).join("");
5670
+ return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`;
5671
+ }
5672
+ return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => {
5673
+ const n = Math.floor(Math.random() * 16);
5674
+ return (c === "x" ? n : n & 3 | 8).toString(16);
5675
+ });
5665
5676
  }
5666
5677
  async function uploadFile(file, options, onProgress, signal2) {
5667
5678
  const fileName = options.name || (file instanceof File ? file.name : `file-${Date.now()}`);
5668
5679
  const contentType = file.type || "application/octet-stream";
5669
5680
  const itemType = options.itemType || "file";
5681
+ const collisionPolicy = options.collisionPolicy || "keep_both";
5682
+ const uploadId = collisionPolicy === "keep_both" ? generateUploadId() : void 0;
5670
5683
  const createParams = {
5671
5684
  parent_path: options.parentPath,
5672
5685
  item_type: itemType,
@@ -5675,7 +5688,9 @@ async function uploadFile(file, options, onProgress, signal2) {
5675
5688
  ...options.typeData || {},
5676
5689
  file_source: {
5677
5690
  type: "upload",
5678
- content_type: contentType
5691
+ content_type: contentType,
5692
+ collision_policy: collisionPolicy,
5693
+ ...uploadId ? { upload_id: uploadId } : {}
5679
5694
  }
5680
5695
  }
5681
5696
  };
@@ -5777,6 +5792,7 @@ function useFileUpload() {
5777
5792
  const fileName = options.name || file.name;
5778
5793
  const contentType = file.type || "application/octet-stream";
5779
5794
  const itemType = options.itemType || "file";
5795
+ const collisionPolicy = options.collisionPolicy || "keep_both";
5780
5796
  let itemId = existingState?.itemId || null;
5781
5797
  let itemPath = existingState?.itemPath || null;
5782
5798
  let storageKey = existingState?.storageKey || null;
@@ -5793,7 +5809,9 @@ function useFileUpload() {
5793
5809
  ...options.typeData || {},
5794
5810
  file_source: {
5795
5811
  type: "upload",
5796
- content_type: contentType
5812
+ content_type: contentType,
5813
+ collision_policy: collisionPolicy,
5814
+ ...collisionPolicy === "keep_both" ? { upload_id: uploadId } : {}
5797
5815
  }
5798
5816
  }
5799
5817
  });