@tonightpass/react 0.0.97 → 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.
@@ -1,21 +1,21 @@
1
1
 
2
- > @tonightpass/react@0.0.97 build /home/runner/work/tonightpass/tonightpass/packages/react
2
+ > @tonightpass/react@0.0.98 build /home/runner/work/tonightpass/tonightpass/packages/react
3
3
  > tsup
4
4
 
5
5
  CLI Building entry: src/index.ts
6
6
  CLI Using tsconfig: tsconfig.json
7
- CLI tsup v8.3.0
7
+ CLI tsup v8.3.5
8
8
  CLI Using tsup config: /home/runner/work/tonightpass/tonightpass/packages/react/tsup.config.ts
9
9
  CLI Target: esnext
10
10
  CJS Build start
11
11
  ESM Build start
12
- CJS dist/index.js 517.00 B
13
- CJS dist/index.js.map 2.10 KB
14
- CJS ⚡️ Build success in 85ms
15
- ESM dist/index.mjs 338.00 B
12
+ CJS dist/index.js 476.00 B
13
+ CJS dist/index.js.map 2.09 KB
14
+ CJS ⚡️ Build success in 87ms
15
+ ESM dist/index.mjs 322.00 B
16
16
  ESM dist/index.mjs.map 2.09 KB
17
- ESM ⚡️ Build success in 86ms
17
+ ESM ⚡️ Build success in 88ms
18
18
  DTS Build start
19
- DTS ⚡️ Build success in 3226ms
19
+ DTS ⚡️ Build success in 3066ms
20
20
  DTS dist/index.d.ts 944.00 B
21
21
  DTS dist/index.d.mts 944.00 B
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
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
+
3
10
  ## 0.0.97
4
11
 
5
12
  ### 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":";;;;;;;;;AAWaA,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"]}
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 'swr';
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
@@ -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":";;;AAWaA,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"]}
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.97",
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.96"
18
+ "tonightpass": "^0.0.97"
19
19
  },
20
20
  "peerDependencies": {
21
21
  "react": "*"