@pickaxeproject/react 2.1.6 → 2.1.8
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/cjs/common/api/index.js +1 -1
- package/dist/cjs/hooks/pickaxe/useSubmit.js +1 -1
- package/dist/cjs/src/hooks/pickaxe/useSubmit.d.ts +1 -0
- package/dist/esm/common/api/index.js +1 -1
- package/dist/esm/hooks/pickaxe/useSubmit.js +1 -1
- package/dist/esm/src/hooks/pickaxe/useSubmit.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}Object.defineProperty(exports,"__esModule",{value:!0});var s=e(require("axios"));const
|
|
1
|
+
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}Object.defineProperty(exports,"__esModule",{value:!0});var s=e(require("axios"));const n=process.env.NEXT_PUBLIC_API_URL||"";if(!n)throw new Error("[px/react] NEXT_PUBLIC_API_URL is not defined");const o="undefined"!=typeof window?window.location.hostname:"",t="undefined"!=typeof window?window.location.href:"",i=o.includes("pickaxe.co")&&!t.includes("https://studio.pickaxe.co/_embed"),c=s.default.create(Object.assign(Object.assign({baseURL:n},(!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}})),i&&{withCredentials:!0}));exports.default=c;
|
|
@@ -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=>(({formId:s,responseId:t,documentId:n,studioUserId:
|
|
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=>(({formId:s,responseId:t,documentId:n,studioUserId:o,deploymentId:i,embedUserId:r,pickaxe:d,value:a,valueObj:c,disabledDocumentIds:u,metadata:p})=>e.__awaiter(void 0,void 0,void 0,(function*(){const e="undefined"!=typeof window?window.location.hostname:"",l="undefined"!=typeof window?window.location.href:"",b=e.includes("pickaxe.co")&&!l.includes("https://studio.pickaxe.co/_embed"),O=yield fetch(`${process.env.NEXT_PUBLIC_API_URL}/pickaxe/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({formId:s},t&&{responseId:t}),n&&{documentId:n}),o&&{studioUserId:o}),i&&{deploymentId:i}),r&&{embedUserId:r}),d&&{pickaxe:d}),a&&{value:a}),c&&{valueObj:c}),u&&{disabledDocumentIds:u}),p&&{metadata:p}))},(!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!==O.status){const e=yield O.json();throw new Error(e.error||"Unknown error, please contact support")}if("application/json"===O.headers.get("content-type")){const{success:e,error:s}=yield O.json();if(!e)throw new Error(s||"Unknown error, please contact support")}return O})))(s)});
|
|
@@ -9,6 +9,7 @@ type MutationParams = {
|
|
|
9
9
|
pickaxe?: Partial<Pickaxe>;
|
|
10
10
|
value?: string;
|
|
11
11
|
valueObj?: Record<string, string>;
|
|
12
|
+
disabledDocumentIds?: string[];
|
|
12
13
|
metadata?: Record<string, unknown>;
|
|
13
14
|
};
|
|
14
15
|
export declare const useSubmit: () => import("@tanstack/react-query").UseMutationResult<Response, Error, MutationParams, unknown>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"axios";const s=process.env.NEXT_PUBLIC_API_URL||"";if(!s)throw new Error("[px/react] NEXT_PUBLIC_API_URL is not defined");const o=e.create(Object.assign({baseURL:s},process.env.NODE_ENV
|
|
1
|
+
import e from"axios";const s=process.env.NEXT_PUBLIC_API_URL||"";if(!s)throw new Error("[px/react] NEXT_PUBLIC_API_URL is not defined");const o="undefined"!=typeof window?window.location.hostname:"",n="undefined"!=typeof window?window.location.href:"",i=o.includes("pickaxe.co")&&!n.includes("https://studio.pickaxe.co/_embed"),t=e.create(Object.assign(Object.assign({baseURL:s},(!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}})),i&&{withCredentials:!0}));export{t as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e}from"../../_virtual/_tslib.js";import{useMutation as s}from"@tanstack/react-query";const
|
|
1
|
+
import{__awaiter as e}from"../../_virtual/_tslib.js";import{useMutation as s}from"@tanstack/react-query";const n=()=>s({mutationFn:s=>(({formId:s,responseId:n,documentId:t,studioUserId:o,deploymentId:i,embedUserId:d,pickaxe:c,value:r,valueObj:a,disabledDocumentIds:p,metadata:u})=>e(void 0,void 0,void 0,(function*(){const e="undefined"!=typeof window?window.location.hostname:"",l="undefined"!=typeof window?window.location.href:"",O=e.includes("pickaxe.co")&&!l.includes("https://studio.pickaxe.co/_embed"),b=yield fetch(`${process.env.NEXT_PUBLIC_API_URL}/pickaxe/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({formId:s},n&&{responseId:n}),t&&{documentId:t}),o&&{studioUserId:o}),i&&{deploymentId:i}),d&&{embedUserId:d}),c&&{pickaxe:c}),r&&{value:r}),a&&{valueObj:a}),p&&{disabledDocumentIds:p}),u&&{metadata:u}))},(!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}})),O&&{credentials:"include"}));if(200!==b.status){const e=yield b.json();throw new Error(e.error||"Unknown error, please contact support")}if("application/json"===b.headers.get("content-type")){const{success:e,error:s}=yield b.json();if(!e)throw new Error(s||"Unknown error, please contact support")}return b})))(s)});export{n as useSubmit};
|
|
@@ -9,6 +9,7 @@ type MutationParams = {
|
|
|
9
9
|
pickaxe?: Partial<Pickaxe>;
|
|
10
10
|
value?: string;
|
|
11
11
|
valueObj?: Record<string, string>;
|
|
12
|
+
disabledDocumentIds?: string[];
|
|
12
13
|
metadata?: Record<string, unknown>;
|
|
13
14
|
};
|
|
14
15
|
export declare const useSubmit: () => import("@tanstack/react-query").UseMutationResult<Response, Error, MutationParams, unknown>;
|