@pickaxeproject/react 2.1.7 → 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.
@@ -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 t=process.env.NEXT_PUBLIC_API_URL||"";if(!t)throw new Error("[px/react] NEXT_PUBLIC_API_URL is not defined");const n=("undefined"!=typeof window?window.location.hostname:"").includes("pickaxe.co"),o=s.default.create(Object.assign(Object.assign({baseURL:t},(!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}})),n&&{withCredentials:!0}));exports.default=o;
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:o,deploymentId:r,embedUserId:i,pickaxe:a,value:c,valueObj:d,disabledDocIds:u,metadata:p})=>e.__awaiter(void 0,void 0,void 0,(function*(){const e=("undefined"!=typeof window?window.location.hostname:"").includes("pickaxe.co"),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}),r&&{deploymentId:r}),i&&{embedUserId:i}),a&&{pickaxe:a}),c&&{value:c}),d&&{valueObj:d}),u&&{disabledDocIds: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}})),e&&{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)});
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,7 +9,7 @@ type MutationParams = {
9
9
  pickaxe?: Partial<Pickaxe>;
10
10
  value?: string;
11
11
  valueObj?: Record<string, string>;
12
- disabledDocIds?: string[];
12
+ disabledDocumentIds?: string[];
13
13
  metadata?: Record<string, unknown>;
14
14
  };
15
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 n=("undefined"!=typeof window?window.location.hostname:"").includes("pickaxe.co"),o=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}})),n&&{withCredentials:!0}));export{o as default};
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 n=()=>s({mutationFn:s=>(({formId:s,responseId:n,documentId:t,studioUserId:o,deploymentId:i,embedUserId:r,pickaxe:c,value:a,valueObj:d,disabledDocIds:p,metadata:O})=>e(void 0,void 0,void 0,(function*(){const e=("undefined"!=typeof window?window.location.hostname:"").includes("pickaxe.co"),I=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}),r&&{embedUserId:r}),c&&{pickaxe:c}),a&&{value:a}),d&&{valueObj:d}),p&&{disabledDocIds:p}),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}})),e&&{credentials:"include"}));if(200!==I.status){const e=yield I.json();throw new Error(e.error||"Unknown error, please contact support")}if("application/json"===I.headers.get("content-type")){const{success:e,error:s}=yield I.json();if(!e)throw new Error(s||"Unknown error, please contact support")}return I})))(s)});export{n as useSubmit};
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,7 +9,7 @@ type MutationParams = {
9
9
  pickaxe?: Partial<Pickaxe>;
10
10
  value?: string;
11
11
  valueObj?: Record<string, string>;
12
- disabledDocIds?: string[];
12
+ disabledDocumentIds?: string[];
13
13
  metadata?: Record<string, unknown>;
14
14
  };
15
15
  export declare const useSubmit: () => import("@tanstack/react-query").UseMutationResult<Response, Error, MutationParams, unknown>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pickaxeproject/react",
3
- "version": "2.1.7",
3
+ "version": "2.1.8",
4
4
  "description": "Client utility library for Pickaxe",
5
5
  "repository": {
6
6
  "type": "git",