@tonightpass/react 0.0.96 → 0.0.98
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/.turbo/turbo-build.log +8 -8
- package/CHANGELOG.md +14 -0
- package/dist/index.js +1 -14
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
|
|
2
|
-
> @tonightpass/react@0.0.
|
|
2
|
+
> @tonightpass/react@0.0.98 build /home/runner/work/tonightpass/tonightpass/packages/react
|
|
3
3
|
> tsup
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.ts
|
|
6
6
|
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
7
|
-
[34mCLI[39m tsup v8.3.
|
|
7
|
+
[34mCLI[39m tsup v8.3.5
|
|
8
8
|
[34mCLI[39m Using tsup config: /home/runner/work/tonightpass/tonightpass/packages/react/tsup.config.ts
|
|
9
9
|
[34mCLI[39m Target: esnext
|
|
10
10
|
[34mCJS[39m Build start
|
|
11
11
|
[34mESM[39m Build start
|
|
12
|
-
[32mCJS[39m [1mdist/index.js [22m[
|
|
13
|
-
[32mCJS[39m [1mdist/index.js.map [22m[32m2.
|
|
14
|
-
[32mCJS[39m ⚡️ Build success in
|
|
15
|
-
[32mESM[39m [1mdist/index.mjs [22m[
|
|
12
|
+
[32mCJS[39m [1mdist/index.js [22m[32m476.00 B[39m
|
|
13
|
+
[32mCJS[39m [1mdist/index.js.map [22m[32m2.09 KB[39m
|
|
14
|
+
[32mCJS[39m ⚡️ Build success in 87ms
|
|
15
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m322.00 B[39m
|
|
16
16
|
[32mESM[39m [1mdist/index.mjs.map [22m[32m2.09 KB[39m
|
|
17
|
-
[32mESM[39m ⚡️ Build success in
|
|
17
|
+
[32mESM[39m ⚡️ Build success in 88ms
|
|
18
18
|
[34mDTS[39m Build start
|
|
19
|
-
[32mDTS[39m ⚡️ Build success in
|
|
19
|
+
[32mDTS[39m ⚡️ Build success in 3066ms
|
|
20
20
|
[32mDTS[39m [1mdist/index.d.ts [22m[32m944.00 B[39m
|
|
21
21
|
[32mDTS[39m [1mdist/index.d.mts [22m[32m944.00 B[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @tonightpass/react
|
|
2
2
|
|
|
3
|
+
## 0.0.98
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`a9c46b5`](https://github.com/tonightpass/tonightpass/commit/a9c46b5b0efeb73afcc3ab1ae9a5c8ca9deec8c3)]:
|
|
8
|
+
- tonightpass@0.0.97
|
|
9
|
+
|
|
10
|
+
## 0.0.97
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Updated dependencies [[`d7f9e6c`](https://github.com/tonightpass/tonightpass/commit/d7f9e6cbd5d44fe0ac9edf09772cc4dd17d95702)]:
|
|
15
|
+
- tonightpass@0.0.96
|
|
16
|
+
|
|
3
17
|
## 0.0.96
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -1,15 +1,2 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var a = require('swr');
|
|
4
|
-
var tonightpass = require('tonightpass');
|
|
5
|
-
|
|
6
|
-
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
7
|
-
|
|
8
|
-
var a__default = /*#__PURE__*/_interopDefault(a);
|
|
9
|
-
|
|
10
|
-
var i=new tonightpass.Client({baseURL:tonightpass.DEFAULT_API_URL});function l(e,t,n){let{requestOptions:r,...o}=n||{};return a__default.default(e?[e,t]:null,async([s,p])=>await i.get(s,p,r),o)}
|
|
11
|
-
|
|
12
|
-
exports.client = i;
|
|
13
|
-
exports.useAPI = l;
|
|
14
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
'use strict';var a=require('swr'),tonightpass=require('tonightpass');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var a__default=/*#__PURE__*/_interopDefault(a);var i=new tonightpass.Client({baseURL:tonightpass.DEFAULT_API_URL});function l(e,t,n){let{requestOptions:r,...o}=n||{};return a__default.default(e?[e,t]:null,async([s,p])=>await i.get(s,p,r),o)}exports.client=i;exports.useAPI=l;//# sourceMappingURL=index.js.map
|
|
15
2
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/hooks/useAPI.ts"],"names":["client","Client","DEFAULT_API_URL","useAPI","path","query","config","requestOptions","swrConfig","useSWR","fetchPath","fetchQuery"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/hooks/useAPI.ts"],"names":["client","Client","DEFAULT_API_URL","useAPI","path","query","config","requestOptions","swrConfig","useSWR","fetchPath","fetchQuery"],"mappings":"qLAWaA,IAAAA,CAAAA,CAAS,IAAIC,kBAAAA,CAAO,CAAE,OAASC,CAAAA,2BAAgB,CAAC,EAmBtD,SAASC,CAAAA,CACdC,CACAC,CAAAA,CAAAA,CACAC,CACkD,CAAA,CAClD,GAAM,CAAE,cAAAC,CAAAA,CAAAA,CAAgB,GAAGC,CAAU,CAAA,CAAIF,CAAU,EAAA,EAUnD,CAAA,OAAOG,mBAILL,CAAO,CAAA,CAACA,CAAMC,CAAAA,CAAK,CAAI,CAAA,IAAA,CAZT,MAAO,CAACK,CAAAA,CAAWC,CAAU,CAAA,GAI1B,MAAMX,CAAAA,CAAO,GAAIU,CAAAA,CAAAA,CAAWC,CAAYJ,CAAAA,CAAc,CAQjCC,CAAAA,CAAS,CACnD","file":"index.js","sourcesContent":["import useSWR, { SWRConfiguration, SWRResponse } from \"swr\";\nimport {\n Endpoints,\n APIRequestOptions,\n Client,\n PathsFor,\n DEFAULT_API_URL,\n TonightPassAPIError,\n Query,\n} from \"tonightpass\";\n\nexport const client = new Client({ baseURL: DEFAULT_API_URL });\n\ntype AnyEndpoint = Endpoints extends infer T ? T : never;\n\ntype ForceAccept<T> = T extends never ? any : T;\n\nexport type ResponseType<Path extends PathsFor<\"GET\">> = ForceAccept<\n Extract<AnyEndpoint, { path: Path; method: \"GET\" }>[\"res\"]\n>;\n\nexport type ErrorType<Path extends PathsFor<\"GET\">> = TonightPassAPIError<\n ResponseType<Path>\n>;\n\nexport interface UseAPIConfig<Path extends PathsFor<\"GET\">>\n extends SWRConfiguration<ResponseType<Path>, ErrorType<Path>> {\n requestOptions?: APIRequestOptions;\n}\n\nexport function useAPI<Path extends PathsFor<\"GET\">>(\n path: Path | null | undefined,\n query?: Query<Path>,\n config?: UseAPIConfig<Path>,\n): SWRResponse<ResponseType<Path>, ErrorType<Path>> {\n const { requestOptions, ...swrConfig } = config || {};\n\n const fetcher = async ([fetchPath, fetchQuery]: [\n Path,\n Query<Path> | undefined,\n ]) => {\n const response = await client.get(fetchPath, fetchQuery, requestOptions);\n return response as unknown as ResponseType<Path>;\n };\n\n return useSWR<\n ResponseType<Path>,\n ErrorType<Path>,\n [Path, Query<Path> | undefined] | null\n >(path ? [path, query] : null, fetcher, swrConfig);\n}\n"]}
|
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,2 @@
|
|
|
1
|
-
import a from
|
|
2
|
-
import { Client, DEFAULT_API_URL } from 'tonightpass';
|
|
3
|
-
|
|
4
|
-
var i=new Client({baseURL:DEFAULT_API_URL});function l(e,t,n){let{requestOptions:r,...o}=n||{};return a(e?[e,t]:null,async([s,p])=>await i.get(s,p,r),o)}
|
|
5
|
-
|
|
6
|
-
export { i as client, l as useAPI };
|
|
7
|
-
//# sourceMappingURL=index.mjs.map
|
|
1
|
+
import a from'swr';import {Client,DEFAULT_API_URL}from'tonightpass';var i=new Client({baseURL:DEFAULT_API_URL});function l(e,t,n){let{requestOptions:r,...o}=n||{};return a(e?[e,t]:null,async([s,p])=>await i.get(s,p,r),o)}export{i as client,l as useAPI};//# sourceMappingURL=index.mjs.map
|
|
8
2
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/hooks/useAPI.ts"],"names":["client","Client","DEFAULT_API_URL","useAPI","path","query","config","requestOptions","swrConfig","useSWR","fetchPath","fetchQuery"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/hooks/useAPI.ts"],"names":["client","Client","DEFAULT_API_URL","useAPI","path","query","config","requestOptions","swrConfig","useSWR","fetchPath","fetchQuery"],"mappings":"oEAWaA,IAAAA,CAAAA,CAAS,IAAIC,MAAAA,CAAO,CAAE,OAASC,CAAAA,eAAgB,CAAC,EAmBtD,SAASC,CAAAA,CACdC,CACAC,CAAAA,CAAAA,CACAC,CACkD,CAAA,CAClD,GAAM,CAAE,cAAAC,CAAAA,CAAAA,CAAgB,GAAGC,CAAU,CAAA,CAAIF,CAAU,EAAA,EAUnD,CAAA,OAAOG,EAILL,CAAO,CAAA,CAACA,CAAMC,CAAAA,CAAK,CAAI,CAAA,IAAA,CAZT,MAAO,CAACK,CAAAA,CAAWC,CAAU,CAAA,GAI1B,MAAMX,CAAAA,CAAO,GAAIU,CAAAA,CAAAA,CAAWC,CAAYJ,CAAAA,CAAc,CAQjCC,CAAAA,CAAS,CACnD","file":"index.mjs","sourcesContent":["import useSWR, { SWRConfiguration, SWRResponse } from \"swr\";\nimport {\n Endpoints,\n APIRequestOptions,\n Client,\n PathsFor,\n DEFAULT_API_URL,\n TonightPassAPIError,\n Query,\n} from \"tonightpass\";\n\nexport const client = new Client({ baseURL: DEFAULT_API_URL });\n\ntype AnyEndpoint = Endpoints extends infer T ? T : never;\n\ntype ForceAccept<T> = T extends never ? any : T;\n\nexport type ResponseType<Path extends PathsFor<\"GET\">> = ForceAccept<\n Extract<AnyEndpoint, { path: Path; method: \"GET\" }>[\"res\"]\n>;\n\nexport type ErrorType<Path extends PathsFor<\"GET\">> = TonightPassAPIError<\n ResponseType<Path>\n>;\n\nexport interface UseAPIConfig<Path extends PathsFor<\"GET\">>\n extends SWRConfiguration<ResponseType<Path>, ErrorType<Path>> {\n requestOptions?: APIRequestOptions;\n}\n\nexport function useAPI<Path extends PathsFor<\"GET\">>(\n path: Path | null | undefined,\n query?: Query<Path>,\n config?: UseAPIConfig<Path>,\n): SWRResponse<ResponseType<Path>, ErrorType<Path>> {\n const { requestOptions, ...swrConfig } = config || {};\n\n const fetcher = async ([fetchPath, fetchQuery]: [\n Path,\n Query<Path> | undefined,\n ]) => {\n const response = await client.get(fetchPath, fetchQuery, requestOptions);\n return response as unknown as ResponseType<Path>;\n };\n\n return useSWR<\n ResponseType<Path>,\n ErrorType<Path>,\n [Path, Query<Path> | undefined] | null\n >(path ? [path, query] : null, fetcher, swrConfig);\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tonightpass/react",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.98",
|
|
4
4
|
"description": "@tonightpass react sdk.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"types": "dist/index.d.ts",
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"swr": "^2.2.5",
|
|
18
|
-
"tonightpass": "^0.0.
|
|
18
|
+
"tonightpass": "^0.0.97"
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|
|
21
21
|
"react": "*"
|