@pickaxeproject/react 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.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_tslib.js"),s=require("@tanstack/react-query");exports.useSubmit=()=>s.useMutation({mutationFn:s=>(({origin:s,pickaxeId:n,sessionId:o,deploymentId:t,sender:i,senderType:r,sessionToken:a,studioSessionToken:c,value:d,valueObj:p,documentIds:u,pickaxe:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_tslib.js"),s=require("@tanstack/react-query");exports.useSubmit=()=>s.useMutation({mutationFn:s=>(({origin:s,pickaxeId:n,sessionId:o,deploymentId:t,sender:i,senderType:r,sessionToken:a,studioSessionToken:c,value:d,valueObj:p,documentIds:u,pickaxe:l,metadata:O})=>e.__awaiter(void 0,void 0,void 0,(function*(){const e="undefined"!=typeof window?window.location.hostname:"",w="undefined"!=typeof window?window.location.href:"",_="undefined"!=typeof window&&window.self!==window.top,b=e.includes("pickaxe.co")&&!w.includes("https://studio.pickaxe.co/_embed")&&!_,j=yield fetch(`${process.env.NEXT_PUBLIC_PICKAXE_API_URL}/sse`,Object.assign(Object.assign({method:"POST",body:JSON.stringify(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({origin:s,pickaxeId:n,senderType:r},o&&{sessionId:o}),t&&{deploymentId:t}),i&&{sender:i}),a&&{sessionToken:a}),c&&{studioSessionToken:c}),d&&{value:d}),p&&{valueObj:p}),u&&{documentIds:u}),l&&{pickaxe:l}),O&&{metadata:O}))},(!process.env.NODE_ENV||"development"===process.env.NODE_ENV)&&Object.assign({},process.env.NEXT_PUBLIC_PICKAXE_SESSION_TOKEN&&{headers:{"x-pickaxe-session-token":process.env.NEXT_PUBLIC_PICKAXE_SESSION_TOKEN}})),b&&{credentials:"include"}));if(200!==j.status){const e=yield j.json();throw new Error(e.error||"Unknown error, please contact support")}if("application/json"===j.headers.get("content-type")){const{success:e,error:s}=yield j.json();if(!e)throw new Error(s||"Unknown error, please contact support")}return j})))(s)});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e}from"../../_virtual/_tslib.js";import{useMutation as s}from"@tanstack/react-query";const n=()=>s({mutationFn:s=>(({origin:s,pickaxeId:n,sessionId:o,deploymentId:t,sender:i,senderType:c,sessionToken:
|
|
1
|
+
import{__awaiter as e}from"../../_virtual/_tslib.js";import{useMutation as s}from"@tanstack/react-query";const n=()=>s({mutationFn:s=>(({origin:s,pickaxeId:n,sessionId:o,deploymentId:t,sender:i,senderType:c,sessionToken:d,studioSessionToken:a,value:r,valueObj:p,documentIds:u,pickaxe:O,metadata:l})=>e(void 0,void 0,void 0,(function*(){const e="undefined"!=typeof window?window.location.hostname:"",w="undefined"!=typeof window?window.location.href:"",j="undefined"!=typeof window&&window.self!==window.top,b=e.includes("pickaxe.co")&&!w.includes("https://studio.pickaxe.co/_embed")&&!j,g=yield fetch(`${process.env.NEXT_PUBLIC_PICKAXE_API_URL}/sse`,Object.assign(Object.assign({method:"POST",body:JSON.stringify(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({origin:s,pickaxeId:n,senderType:c},o&&{sessionId:o}),t&&{deploymentId:t}),i&&{sender:i}),d&&{sessionToken:d}),a&&{studioSessionToken:a}),r&&{value:r}),p&&{valueObj:p}),u&&{documentIds:u}),O&&{pickaxe:O}),l&&{metadata:l}))},(!process.env.NODE_ENV||"development"===process.env.NODE_ENV)&&Object.assign({},process.env.NEXT_PUBLIC_PICKAXE_SESSION_TOKEN&&{headers:{"x-pickaxe-session-token":process.env.NEXT_PUBLIC_PICKAXE_SESSION_TOKEN}})),b&&{credentials:"include"}));if(200!==g.status){const e=yield g.json();throw new Error(e.error||"Unknown error, please contact support")}if("application/json"===g.headers.get("content-type")){const{success:e,error:s}=yield g.json();if(!e)throw new Error(s||"Unknown error, please contact support")}return g})))(s)});export{n as useSubmit};
|