@pickaxeproject/react 0.0.5 → 0.0.7
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/README.md +6 -2
- package/dist/cjs/common/api/index.js +1 -1
- package/dist/cjs/hooks/useConversation.d.ts +1 -1
- package/dist/cjs/hooks/useHistory.d.ts +2 -2
- package/dist/cjs/hooks/usePickaxe.d.ts +1 -1
- package/dist/cjs/hooks/usePickaxe.js +1 -1
- package/dist/cjs/hooks/useSubmit.d.ts +1 -1
- package/dist/cjs/hooks/useSubmitResult.d.ts +1 -1
- package/dist/esm/common/api/index.js +1 -1
- package/dist/esm/hooks/useConversation.d.ts +1 -1
- package/dist/esm/hooks/useHistory.d.ts +2 -2
- package/dist/esm/hooks/usePickaxe.d.ts +1 -1
- package/dist/esm/hooks/usePickaxe.js +1 -1
- package/dist/esm/hooks/useSubmit.d.ts +1 -1
- package/dist/esm/hooks/useSubmitResult.d.ts +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -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.
|
|
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 r=s.default.create(Object.assign({baseURL:t},(!process.env.NODE_ENV||"development"===process.env.NODE_ENV)&&process.env.NEXT_PUBLIC_PICKAXE_SESSION_TOKEN&&{headers:{"x-pickaxe-session-token":process.env.NEXT_PUBLIC_PICKAXE_SESSION_TOKEN}}));exports.default=r;
|
|
@@ -4,5 +4,5 @@ interface QueryResponse {
|
|
|
4
4
|
messages: ChatMessage[];
|
|
5
5
|
error?: boolean;
|
|
6
6
|
}
|
|
7
|
-
export declare const useConversation: () => import("@tanstack/react-query
|
|
7
|
+
export declare const useConversation: () => import("@tanstack/react-query").UseQueryResult<QueryResponse, Error>;
|
|
8
8
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PickaxeHistory } from "../types/history";
|
|
2
|
-
import {
|
|
2
|
+
import { UseInfiniteQueryResult } from "@tanstack/react-query";
|
|
3
3
|
type QueryInfiniteResponse = {
|
|
4
4
|
next: number | undefined;
|
|
5
5
|
data: PickaxeHistory[];
|
|
@@ -7,5 +7,5 @@ type QueryInfiniteResponse = {
|
|
|
7
7
|
interface UseHistoryQueryProps {
|
|
8
8
|
enabled?: boolean;
|
|
9
9
|
}
|
|
10
|
-
export declare const useHistory: ({ enabled }?: UseHistoryQueryProps) => UseInfiniteQueryResult<
|
|
10
|
+
export declare const useHistory: ({ enabled }?: UseHistoryQueryProps) => UseInfiniteQueryResult<QueryInfiniteResponse, Error>;
|
|
11
11
|
export {};
|
|
@@ -4,4 +4,4 @@ export type QueryResponse = {
|
|
|
4
4
|
pickaxe: Pickaxe;
|
|
5
5
|
error?: string;
|
|
6
6
|
};
|
|
7
|
-
export declare const usePickaxe: () => import("@tanstack/react-query
|
|
7
|
+
export declare const usePickaxe: () => import("@tanstack/react-query").UseQueryResult<Pickaxe | null, Error>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../_virtual/_tslib.js"),r=require("@tanstack/react-query"),t=require("./usePickaxeContext.js"),i=require("../common/api/index.js");exports.usePickaxe=()=>{const{formId:a}=t.usePickaxeContext();return r.useQuery({queryKey:["form",a],queryFn:()=>e.__awaiter(void 0,void 0,void 0,(function*(){return(r=>e.__awaiter(void 0,void 0,void 0,(function*(){if(!r)return null;const e=yield i.default.get(`/pickaxe?formid=${r}`),t=e.data;if(200!==e.status)throw new Error("[_getPickaxe] Failed to fetch pickaxe "+t);return t.pickaxe})))(a
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../_virtual/_tslib.js"),r=require("@tanstack/react-query"),t=require("./usePickaxeContext.js"),i=require("../common/api/index.js");exports.usePickaxe=()=>{const{formId:a}=t.usePickaxeContext();return r.useQuery({queryKey:["form",a],queryFn:()=>e.__awaiter(void 0,void 0,void 0,(function*(){return(r=>e.__awaiter(void 0,void 0,void 0,(function*(){if(!r)return null;const e=yield i.default.get(`/pickaxe?formid=${r}`),t=e.data;if(200!==e.status)throw new Error("[_getPickaxe] Failed to fetch pickaxe "+t);return t.pickaxe})))(a)})),enabled:!!a,staleTime:18e4})};
|
|
@@ -19,5 +19,5 @@ type MutationResponse = {
|
|
|
19
19
|
isCountedAsOwnerUse: boolean;
|
|
20
20
|
error?: string;
|
|
21
21
|
};
|
|
22
|
-
export declare const useSubmit: () => import("@tanstack/react-query
|
|
22
|
+
export declare const useSubmit: () => import("@tanstack/react-query").UseMutationResult<MutationResponse, Error, MutationParams, unknown>;
|
|
23
23
|
export {};
|
|
@@ -23,5 +23,5 @@ type MutationResponse = {
|
|
|
23
23
|
success: boolean;
|
|
24
24
|
error?: string;
|
|
25
25
|
};
|
|
26
|
-
export declare const useSubmitResult: () => import("@tanstack/react-query
|
|
26
|
+
export declare const useSubmitResult: () => import("@tanstack/react-query").UseMutationResult<MutationResponse, Error, MutationParams, unknown>;
|
|
27
27
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"axios";const s=process.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=e.create(Object.assign({baseURL:s},(!process.env.NODE_ENV||"development"===process.env.NODE_ENV)&&process.env.NEXT_PUBLIC_PICKAXE_SESSION_TOKEN&&{headers:{"x-pickaxe-session-token":process.env.NEXT_PUBLIC_PICKAXE_SESSION_TOKEN}}));export{o as default};
|
|
@@ -4,5 +4,5 @@ interface QueryResponse {
|
|
|
4
4
|
messages: ChatMessage[];
|
|
5
5
|
error?: boolean;
|
|
6
6
|
}
|
|
7
|
-
export declare const useConversation: () => import("@tanstack/react-query
|
|
7
|
+
export declare const useConversation: () => import("@tanstack/react-query").UseQueryResult<QueryResponse, Error>;
|
|
8
8
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PickaxeHistory } from "../types/history";
|
|
2
|
-
import {
|
|
2
|
+
import { UseInfiniteQueryResult } from "@tanstack/react-query";
|
|
3
3
|
type QueryInfiniteResponse = {
|
|
4
4
|
next: number | undefined;
|
|
5
5
|
data: PickaxeHistory[];
|
|
@@ -7,5 +7,5 @@ type QueryInfiniteResponse = {
|
|
|
7
7
|
interface UseHistoryQueryProps {
|
|
8
8
|
enabled?: boolean;
|
|
9
9
|
}
|
|
10
|
-
export declare const useHistory: ({ enabled }?: UseHistoryQueryProps) => UseInfiniteQueryResult<
|
|
10
|
+
export declare const useHistory: ({ enabled }?: UseHistoryQueryProps) => UseInfiniteQueryResult<QueryInfiniteResponse, Error>;
|
|
11
11
|
export {};
|
|
@@ -4,4 +4,4 @@ export type QueryResponse = {
|
|
|
4
4
|
pickaxe: Pickaxe;
|
|
5
5
|
error?: string;
|
|
6
6
|
};
|
|
7
|
-
export declare const usePickaxe: () => import("@tanstack/react-query
|
|
7
|
+
export declare const usePickaxe: () => import("@tanstack/react-query").UseQueryResult<Pickaxe | null, Error>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as t}from"../_virtual/_tslib.js";import{useQuery as e}from"@tanstack/react-query";import{usePickaxeContext as o}from"./usePickaxeContext.js";import r from"../common/api/index.js";const i=()=>{const{formId:i}=o();return e({queryKey:["form",i],queryFn:()=>t(void 0,void 0,void 0,(function*(){return(e=>t(void 0,void 0,void 0,(function*(){if(!e)return null;const t=yield r.get(`/pickaxe?formid=${e}`),o=t.data;if(200!==t.status)throw new Error("[_getPickaxe] Failed to fetch pickaxe "+o);return o.pickaxe})))(i
|
|
1
|
+
import{__awaiter as t}from"../_virtual/_tslib.js";import{useQuery as e}from"@tanstack/react-query";import{usePickaxeContext as o}from"./usePickaxeContext.js";import r from"../common/api/index.js";const i=()=>{const{formId:i}=o();return e({queryKey:["form",i],queryFn:()=>t(void 0,void 0,void 0,(function*(){return(e=>t(void 0,void 0,void 0,(function*(){if(!e)return null;const t=yield r.get(`/pickaxe?formid=${e}`),o=t.data;if(200!==t.status)throw new Error("[_getPickaxe] Failed to fetch pickaxe "+o);return o.pickaxe})))(i)})),enabled:!!i,staleTime:18e4})};export{i as usePickaxe};
|
|
@@ -19,5 +19,5 @@ type MutationResponse = {
|
|
|
19
19
|
isCountedAsOwnerUse: boolean;
|
|
20
20
|
error?: string;
|
|
21
21
|
};
|
|
22
|
-
export declare const useSubmit: () => import("@tanstack/react-query
|
|
22
|
+
export declare const useSubmit: () => import("@tanstack/react-query").UseMutationResult<MutationResponse, Error, MutationParams, unknown>;
|
|
23
23
|
export {};
|
|
@@ -23,5 +23,5 @@ type MutationResponse = {
|
|
|
23
23
|
success: boolean;
|
|
24
24
|
error?: string;
|
|
25
25
|
};
|
|
26
|
-
export declare const useSubmitResult: () => import("@tanstack/react-query
|
|
26
|
+
export declare const useSubmitResult: () => import("@tanstack/react-query").UseMutationResult<MutationResponse, Error, MutationParams, unknown>;
|
|
27
27
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pickaxeproject/react",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"description": "Client utility library for Pickaxe",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"@rollup/plugin-replace": "^6.0.2",
|
|
49
49
|
"@rollup/plugin-terser": "^0.3.0",
|
|
50
50
|
"@tailwindcss/container-queries": "^0.1.1",
|
|
51
|
-
"@tanstack/react-query": "^
|
|
51
|
+
"@tanstack/react-query": "^4.36.1",
|
|
52
52
|
"@types/node": "^18.11.18",
|
|
53
53
|
"@types/react": "^18.0.26",
|
|
54
54
|
"@types/react-dom": "^18.0.10",
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
},
|
|
89
89
|
"peerDependencies": {
|
|
90
90
|
"@tailwindcss/container-queries": "^0.1.1",
|
|
91
|
-
"@tanstack/react-query": "^
|
|
91
|
+
"@tanstack/react-query": "^4.36.1",
|
|
92
92
|
"axios": "^1.7.9",
|
|
93
93
|
"clsx": "^2.1.1",
|
|
94
94
|
"react": "^16.8.0 || ^17 || ^18",
|