@priceos/react 0.0.3 → 0.0.6
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/index.cjs +37 -24
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +13 -4
- package/dist/index.d.ts +13 -4
- package/dist/index.js +27 -25
- package/dist/index.js.map +1 -1
- package/package.json +4 -2
package/dist/index.cjs
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
5
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
8
|
var __export = (target, all) => {
|
|
7
9
|
for (var name in all)
|
|
@@ -15,22 +17,35 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
17
|
}
|
|
16
18
|
return to;
|
|
17
19
|
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
18
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
29
|
|
|
20
30
|
// src/index.ts
|
|
21
31
|
var index_exports = {};
|
|
22
32
|
__export(index_exports, {
|
|
33
|
+
PriceOSProvider: () => PriceOSProvider,
|
|
23
34
|
useCustomer: () => useCustomer
|
|
24
35
|
});
|
|
25
36
|
module.exports = __toCommonJS(index_exports);
|
|
26
37
|
var import_react = require("react");
|
|
38
|
+
var import_swr = __toESM(require("swr"), 1);
|
|
39
|
+
var DEFAULT_BASE_URL = "/api/priceos";
|
|
40
|
+
var PriceOSContext = (0, import_react.createContext)({});
|
|
27
41
|
var normalizeBaseUrl = (baseUrl) => baseUrl.replace(/\/$/, "");
|
|
28
42
|
var buildUrl = (baseUrl) => {
|
|
29
43
|
const normalizedBase = normalizeBaseUrl(baseUrl);
|
|
30
44
|
return `${normalizedBase}/v1/customer`;
|
|
31
45
|
};
|
|
32
|
-
var requestCustomer = async (fetchFn, url) => {
|
|
33
|
-
const
|
|
46
|
+
var requestCustomer = async (fetchFn, url, bearerToken) => {
|
|
47
|
+
const headers = bearerToken ? { Authorization: `Bearer ${bearerToken}` } : void 0;
|
|
48
|
+
const response = await fetchFn(url, headers ? { headers } : void 0);
|
|
34
49
|
const text = await response.text();
|
|
35
50
|
const data = text ? JSON.parse(text) : null;
|
|
36
51
|
if (!response.ok) {
|
|
@@ -39,34 +54,32 @@ var requestCustomer = async (fetchFn, url) => {
|
|
|
39
54
|
}
|
|
40
55
|
return data;
|
|
41
56
|
};
|
|
57
|
+
function PriceOSProvider({ children, getBearerToken }) {
|
|
58
|
+
return (0, import_react.createElement)(PriceOSContext.Provider, { value: { getBearerToken } }, children);
|
|
59
|
+
}
|
|
42
60
|
function useCustomer(options = {}) {
|
|
43
|
-
const
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
setLoading(false);
|
|
61
|
+
const { getBearerToken } = (0, import_react.useContext)(PriceOSContext);
|
|
62
|
+
const fetcher = async (url) => {
|
|
63
|
+
const bearerToken = getBearerToken ? await getBearerToken() : void 0;
|
|
64
|
+
return requestCustomer(fetch, url, bearerToken);
|
|
65
|
+
};
|
|
66
|
+
const { data, error, isLoading, mutate } = (0, import_swr.default)(
|
|
67
|
+
buildUrl(DEFAULT_BASE_URL),
|
|
68
|
+
fetcher,
|
|
69
|
+
options.swr
|
|
70
|
+
);
|
|
71
|
+
return {
|
|
72
|
+
customer: data ?? null,
|
|
73
|
+
error,
|
|
74
|
+
loading: isLoading,
|
|
75
|
+
refetch: async () => {
|
|
76
|
+
await mutate();
|
|
60
77
|
}
|
|
61
78
|
};
|
|
62
|
-
(0, import_react.useEffect)(() => {
|
|
63
|
-
if (!enabled) return;
|
|
64
|
-
void refetch();
|
|
65
|
-
}, [enabled, baseUrl, fetchFn]);
|
|
66
|
-
return { customer, error, loading, refetch };
|
|
67
79
|
}
|
|
68
80
|
// Annotate the CommonJS export names for ESM import in node:
|
|
69
81
|
0 && (module.exports = {
|
|
82
|
+
PriceOSProvider,
|
|
70
83
|
useCustomer
|
|
71
84
|
});
|
|
72
85
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { createContext, createElement, useContext, type ReactNode } from \"react\";\nimport useSWR, { type SWRConfiguration } from \"swr\";\nimport type { GetCustomerResponse } from \"priceos\";\n\nexport type UseCustomerOptions = {\n swr?: SWRConfiguration<GetCustomerResponse | null, Error>;\n};\n\nexport type PriceOSProviderProps = {\n children: ReactNode;\n getBearerToken?: () => Promise<string | null | undefined>;\n};\n\nexport type UseCustomerResult = {\n customer: GetCustomerResponse | null;\n error: Error | null;\n loading: boolean;\n refetch: () => Promise<void>;\n};\n\nconst DEFAULT_BASE_URL = \"/api/priceos\";\n\ntype PriceOSContextValue = {\n getBearerToken?: () => Promise<string | null | undefined>;\n};\n\nconst PriceOSContext = createContext<PriceOSContextValue>({});\n\nconst normalizeBaseUrl = (baseUrl: string) => baseUrl.replace(/\\/$/, \"\");\n\nconst buildUrl = (baseUrl: string) => {\n const normalizedBase = normalizeBaseUrl(baseUrl);\n return `${normalizedBase}/v1/customer`;\n};\n\nconst requestCustomer = async (\n fetchFn: typeof fetch,\n url: string,\n bearerToken?: string | null\n): Promise<GetCustomerResponse | null> => {\n const headers = bearerToken ? { Authorization: `Bearer ${bearerToken}` } : undefined;\n const response = await fetchFn(url, headers ? { headers } : undefined);\n const text = await response.text();\n const data = text ? (JSON.parse(text) as unknown) : null;\n if (!response.ok) {\n const message =\n data && typeof data === \"object\" && \"error\" in data\n ? String((data as { error?: unknown }).error)\n : response.statusText;\n throw new Error(message || \"Request failed\");\n }\n return data as GetCustomerResponse | null;\n};\n\nexport function PriceOSProvider({ children, getBearerToken }: PriceOSProviderProps) {\n return createElement(PriceOSContext.Provider, { value: { getBearerToken } }, children);\n}\n\nexport function useCustomer(options: UseCustomerOptions = {}): UseCustomerResult {\n const { getBearerToken } = useContext(PriceOSContext);\n const fetcher = async (url: string) => {\n const bearerToken = getBearerToken ? await getBearerToken() : undefined;\n return requestCustomer(fetch, url, bearerToken);\n };\n const { data, error, isLoading, mutate } = useSWR(\n buildUrl(DEFAULT_BASE_URL),\n fetcher,\n options.swr\n );\n\n return {\n customer: data ?? null,\n error,\n loading: isLoading,\n refetch: async () => {\n await mutate();\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAyE;AACzE,iBAA8C;AAmB9C,IAAM,mBAAmB;AAMzB,IAAM,qBAAiB,4BAAmC,CAAC,CAAC;AAE5D,IAAM,mBAAmB,CAAC,YAAoB,QAAQ,QAAQ,OAAO,EAAE;AAEvE,IAAM,WAAW,CAAC,YAAoB;AACpC,QAAM,iBAAiB,iBAAiB,OAAO;AAC/C,SAAO,GAAG,cAAc;AAC1B;AAEA,IAAM,kBAAkB,OACtB,SACA,KACA,gBACwC;AACxC,QAAM,UAAU,cAAc,EAAE,eAAe,UAAU,WAAW,GAAG,IAAI;AAC3E,QAAM,WAAW,MAAM,QAAQ,KAAK,UAAU,EAAE,QAAQ,IAAI,MAAS;AACrE,QAAM,OAAO,MAAM,SAAS,KAAK;AACjC,QAAM,OAAO,OAAQ,KAAK,MAAM,IAAI,IAAgB;AACpD,MAAI,CAAC,SAAS,IAAI;AAChB,UAAM,UACJ,QAAQ,OAAO,SAAS,YAAY,WAAW,OAC3C,OAAQ,KAA6B,KAAK,IAC1C,SAAS;AACf,UAAM,IAAI,MAAM,WAAW,gBAAgB;AAAA,EAC7C;AACA,SAAO;AACT;AAEO,SAAS,gBAAgB,EAAE,UAAU,eAAe,GAAyB;AAClF,aAAO,4BAAc,eAAe,UAAU,EAAE,OAAO,EAAE,eAAe,EAAE,GAAG,QAAQ;AACvF;AAEO,SAAS,YAAY,UAA8B,CAAC,GAAsB;AAC/E,QAAM,EAAE,eAAe,QAAI,yBAAW,cAAc;AACpD,QAAM,UAAU,OAAO,QAAgB;AACrC,UAAM,cAAc,iBAAiB,MAAM,eAAe,IAAI;AAC9D,WAAO,gBAAgB,OAAO,KAAK,WAAW;AAAA,EAChD;AACA,QAAM,EAAE,MAAM,OAAO,WAAW,OAAO,QAAI,WAAAA;AAAA,IACzC,SAAS,gBAAgB;AAAA,IACzB;AAAA,IACA,QAAQ;AAAA,EACV;AAEA,SAAO;AAAA,IACL,UAAU,QAAQ;AAAA,IAClB;AAAA,IACA,SAAS;AAAA,IACT,SAAS,YAAY;AACnB,YAAM,OAAO;AAAA,IACf;AAAA,EACF;AACF;","names":["useSWR"]}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { SWRConfiguration } from 'swr';
|
|
1
4
|
import { GetCustomerResponse } from 'priceos';
|
|
2
5
|
|
|
3
6
|
type UseCustomerOptions = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
+
swr?: SWRConfiguration<GetCustomerResponse | null, Error>;
|
|
8
|
+
};
|
|
9
|
+
type PriceOSProviderProps = {
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
getBearerToken?: () => Promise<string | null | undefined>;
|
|
7
12
|
};
|
|
8
13
|
type UseCustomerResult = {
|
|
9
14
|
customer: GetCustomerResponse | null;
|
|
@@ -11,6 +16,10 @@ type UseCustomerResult = {
|
|
|
11
16
|
loading: boolean;
|
|
12
17
|
refetch: () => Promise<void>;
|
|
13
18
|
};
|
|
19
|
+
type PriceOSContextValue = {
|
|
20
|
+
getBearerToken?: () => Promise<string | null | undefined>;
|
|
21
|
+
};
|
|
22
|
+
declare function PriceOSProvider({ children, getBearerToken }: PriceOSProviderProps): react.FunctionComponentElement<react.ProviderProps<PriceOSContextValue>>;
|
|
14
23
|
declare function useCustomer(options?: UseCustomerOptions): UseCustomerResult;
|
|
15
24
|
|
|
16
|
-
export { type UseCustomerOptions, type UseCustomerResult, useCustomer };
|
|
25
|
+
export { PriceOSProvider, type PriceOSProviderProps, type UseCustomerOptions, type UseCustomerResult, useCustomer };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { SWRConfiguration } from 'swr';
|
|
1
4
|
import { GetCustomerResponse } from 'priceos';
|
|
2
5
|
|
|
3
6
|
type UseCustomerOptions = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
+
swr?: SWRConfiguration<GetCustomerResponse | null, Error>;
|
|
8
|
+
};
|
|
9
|
+
type PriceOSProviderProps = {
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
getBearerToken?: () => Promise<string | null | undefined>;
|
|
7
12
|
};
|
|
8
13
|
type UseCustomerResult = {
|
|
9
14
|
customer: GetCustomerResponse | null;
|
|
@@ -11,6 +16,10 @@ type UseCustomerResult = {
|
|
|
11
16
|
loading: boolean;
|
|
12
17
|
refetch: () => Promise<void>;
|
|
13
18
|
};
|
|
19
|
+
type PriceOSContextValue = {
|
|
20
|
+
getBearerToken?: () => Promise<string | null | undefined>;
|
|
21
|
+
};
|
|
22
|
+
declare function PriceOSProvider({ children, getBearerToken }: PriceOSProviderProps): react.FunctionComponentElement<react.ProviderProps<PriceOSContextValue>>;
|
|
14
23
|
declare function useCustomer(options?: UseCustomerOptions): UseCustomerResult;
|
|
15
24
|
|
|
16
|
-
export { type UseCustomerOptions, type UseCustomerResult, useCustomer };
|
|
25
|
+
export { PriceOSProvider, type PriceOSProviderProps, type UseCustomerOptions, type UseCustomerResult, useCustomer };
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
// src/index.ts
|
|
2
|
-
import {
|
|
2
|
+
import { createContext, createElement, useContext } from "react";
|
|
3
|
+
import useSWR from "swr";
|
|
4
|
+
var DEFAULT_BASE_URL = "/api/priceos";
|
|
5
|
+
var PriceOSContext = createContext({});
|
|
3
6
|
var normalizeBaseUrl = (baseUrl) => baseUrl.replace(/\/$/, "");
|
|
4
7
|
var buildUrl = (baseUrl) => {
|
|
5
8
|
const normalizedBase = normalizeBaseUrl(baseUrl);
|
|
6
9
|
return `${normalizedBase}/v1/customer`;
|
|
7
10
|
};
|
|
8
|
-
var requestCustomer = async (fetchFn, url) => {
|
|
9
|
-
const
|
|
11
|
+
var requestCustomer = async (fetchFn, url, bearerToken) => {
|
|
12
|
+
const headers = bearerToken ? { Authorization: `Bearer ${bearerToken}` } : void 0;
|
|
13
|
+
const response = await fetchFn(url, headers ? { headers } : void 0);
|
|
10
14
|
const text = await response.text();
|
|
11
15
|
const data = text ? JSON.parse(text) : null;
|
|
12
16
|
if (!response.ok) {
|
|
@@ -15,33 +19,31 @@ var requestCustomer = async (fetchFn, url) => {
|
|
|
15
19
|
}
|
|
16
20
|
return data;
|
|
17
21
|
};
|
|
22
|
+
function PriceOSProvider({ children, getBearerToken }) {
|
|
23
|
+
return createElement(PriceOSContext.Provider, { value: { getBearerToken } }, children);
|
|
24
|
+
}
|
|
18
25
|
function useCustomer(options = {}) {
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
setLoading(false);
|
|
26
|
+
const { getBearerToken } = useContext(PriceOSContext);
|
|
27
|
+
const fetcher = async (url) => {
|
|
28
|
+
const bearerToken = getBearerToken ? await getBearerToken() : void 0;
|
|
29
|
+
return requestCustomer(fetch, url, bearerToken);
|
|
30
|
+
};
|
|
31
|
+
const { data, error, isLoading, mutate } = useSWR(
|
|
32
|
+
buildUrl(DEFAULT_BASE_URL),
|
|
33
|
+
fetcher,
|
|
34
|
+
options.swr
|
|
35
|
+
);
|
|
36
|
+
return {
|
|
37
|
+
customer: data ?? null,
|
|
38
|
+
error,
|
|
39
|
+
loading: isLoading,
|
|
40
|
+
refetch: async () => {
|
|
41
|
+
await mutate();
|
|
36
42
|
}
|
|
37
43
|
};
|
|
38
|
-
useEffect(() => {
|
|
39
|
-
if (!enabled) return;
|
|
40
|
-
void refetch();
|
|
41
|
-
}, [enabled, baseUrl, fetchFn]);
|
|
42
|
-
return { customer, error, loading, refetch };
|
|
43
44
|
}
|
|
44
45
|
export {
|
|
46
|
+
PriceOSProvider,
|
|
45
47
|
useCustomer
|
|
46
48
|
};
|
|
47
49
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { createContext, createElement, useContext, type ReactNode } from \"react\";\nimport useSWR, { type SWRConfiguration } from \"swr\";\nimport type { GetCustomerResponse } from \"priceos\";\n\nexport type UseCustomerOptions = {\n swr?: SWRConfiguration<GetCustomerResponse | null, Error>;\n};\n\nexport type PriceOSProviderProps = {\n children: ReactNode;\n getBearerToken?: () => Promise<string | null | undefined>;\n};\n\nexport type UseCustomerResult = {\n customer: GetCustomerResponse | null;\n error: Error | null;\n loading: boolean;\n refetch: () => Promise<void>;\n};\n\nconst DEFAULT_BASE_URL = \"/api/priceos\";\n\ntype PriceOSContextValue = {\n getBearerToken?: () => Promise<string | null | undefined>;\n};\n\nconst PriceOSContext = createContext<PriceOSContextValue>({});\n\nconst normalizeBaseUrl = (baseUrl: string) => baseUrl.replace(/\\/$/, \"\");\n\nconst buildUrl = (baseUrl: string) => {\n const normalizedBase = normalizeBaseUrl(baseUrl);\n return `${normalizedBase}/v1/customer`;\n};\n\nconst requestCustomer = async (\n fetchFn: typeof fetch,\n url: string,\n bearerToken?: string | null\n): Promise<GetCustomerResponse | null> => {\n const headers = bearerToken ? { Authorization: `Bearer ${bearerToken}` } : undefined;\n const response = await fetchFn(url, headers ? { headers } : undefined);\n const text = await response.text();\n const data = text ? (JSON.parse(text) as unknown) : null;\n if (!response.ok) {\n const message =\n data && typeof data === \"object\" && \"error\" in data\n ? String((data as { error?: unknown }).error)\n : response.statusText;\n throw new Error(message || \"Request failed\");\n }\n return data as GetCustomerResponse | null;\n};\n\nexport function PriceOSProvider({ children, getBearerToken }: PriceOSProviderProps) {\n return createElement(PriceOSContext.Provider, { value: { getBearerToken } }, children);\n}\n\nexport function useCustomer(options: UseCustomerOptions = {}): UseCustomerResult {\n const { getBearerToken } = useContext(PriceOSContext);\n const fetcher = async (url: string) => {\n const bearerToken = getBearerToken ? await getBearerToken() : undefined;\n return requestCustomer(fetch, url, bearerToken);\n };\n const { data, error, isLoading, mutate } = useSWR(\n buildUrl(DEFAULT_BASE_URL),\n fetcher,\n options.swr\n );\n\n return {\n customer: data ?? null,\n error,\n loading: isLoading,\n refetch: async () => {\n await mutate();\n },\n };\n}\n"],"mappings":";AAAA,SAAS,eAAe,eAAe,kBAAkC;AACzE,OAAO,YAAuC;AAmB9C,IAAM,mBAAmB;AAMzB,IAAM,iBAAiB,cAAmC,CAAC,CAAC;AAE5D,IAAM,mBAAmB,CAAC,YAAoB,QAAQ,QAAQ,OAAO,EAAE;AAEvE,IAAM,WAAW,CAAC,YAAoB;AACpC,QAAM,iBAAiB,iBAAiB,OAAO;AAC/C,SAAO,GAAG,cAAc;AAC1B;AAEA,IAAM,kBAAkB,OACtB,SACA,KACA,gBACwC;AACxC,QAAM,UAAU,cAAc,EAAE,eAAe,UAAU,WAAW,GAAG,IAAI;AAC3E,QAAM,WAAW,MAAM,QAAQ,KAAK,UAAU,EAAE,QAAQ,IAAI,MAAS;AACrE,QAAM,OAAO,MAAM,SAAS,KAAK;AACjC,QAAM,OAAO,OAAQ,KAAK,MAAM,IAAI,IAAgB;AACpD,MAAI,CAAC,SAAS,IAAI;AAChB,UAAM,UACJ,QAAQ,OAAO,SAAS,YAAY,WAAW,OAC3C,OAAQ,KAA6B,KAAK,IAC1C,SAAS;AACf,UAAM,IAAI,MAAM,WAAW,gBAAgB;AAAA,EAC7C;AACA,SAAO;AACT;AAEO,SAAS,gBAAgB,EAAE,UAAU,eAAe,GAAyB;AAClF,SAAO,cAAc,eAAe,UAAU,EAAE,OAAO,EAAE,eAAe,EAAE,GAAG,QAAQ;AACvF;AAEO,SAAS,YAAY,UAA8B,CAAC,GAAsB;AAC/E,QAAM,EAAE,eAAe,IAAI,WAAW,cAAc;AACpD,QAAM,UAAU,OAAO,QAAgB;AACrC,UAAM,cAAc,iBAAiB,MAAM,eAAe,IAAI;AAC9D,WAAO,gBAAgB,OAAO,KAAK,WAAW;AAAA,EAChD;AACA,QAAM,EAAE,MAAM,OAAO,WAAW,OAAO,IAAI;AAAA,IACzC,SAAS,gBAAgB;AAAA,IACzB;AAAA,IACA,QAAQ;AAAA,EACV;AAEA,SAAO;AAAA,IACL,UAAU,QAAQ;AAAA,IAClB;AAAA,IACA,SAAS;AAAA,IACT,SAAS,YAAY;AACnB,YAAM,OAAO;AAAA,IACf;AAAA,EACF;AACF;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@priceos/react",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -25,11 +25,13 @@
|
|
|
25
25
|
"priceos": "^0.0.5"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
|
-
"react": ">=18"
|
|
28
|
+
"react": ">=18",
|
|
29
|
+
"swr": ">=2"
|
|
29
30
|
},
|
|
30
31
|
"devDependencies": {
|
|
31
32
|
"@types/node": "^25.0.10",
|
|
32
33
|
"@types/react": "^19.0.0",
|
|
34
|
+
"swr": "^2.3.2",
|
|
33
35
|
"tsup": "^8.0.0",
|
|
34
36
|
"typescript": "^5.0.0"
|
|
35
37
|
}
|