@tonightpass/react 0.0.3 → 0.0.5

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,5 +1,5 @@
1
1
 
2
- > @tonightpass/react@0.0.3 build /home/runner/work/tonightpass/tonightpass/packages/react
2
+ > @tonightpass/react@0.0.5 build /home/runner/work/tonightpass/tonightpass/packages/react
3
3
  > tsup
4
4
 
5
5
  CLI Building entry: src/index.ts
@@ -9,13 +9,13 @@
9
9
  CLI Target: esnext
10
10
  CJS Build start
11
11
  ESM Build start
12
- CJS dist/index.js 438.00 B
13
- CJS dist/index.js.map 940.00 B
14
- CJS ⚡️ Build success in 48ms
15
12
  ESM dist/index.mjs 258.00 B
16
- ESM dist/index.mjs.map 940.00 B
17
- ESM ⚡️ Build success in 48ms
13
+ ESM dist/index.mjs.map 948.00 B
14
+ ESM ⚡️ Build success in 53ms
15
+ CJS dist/index.js 438.00 B
16
+ CJS dist/index.js.map 948.00 B
17
+ CJS ⚡️ Build success in 53ms
18
18
  DTS Build start
19
- DTS ⚡️ Build success in 1285ms
20
- DTS dist/index.d.ts 2.70 KB
21
- DTS dist/index.d.mts 2.70 KB
19
+ DTS ⚡️ Build success in 1354ms
20
+ DTS dist/index.d.ts 2.84 KB
21
+ DTS dist/index.d.mts 2.84 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @tonightpass/react
2
2
 
3
+ ## 0.0.5
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`595b40e`](https://github.com/tonightpass/tonightpass/commit/595b40eae03123358dfe659e97087144df9052cc)]:
8
+ - tonightpass@0.0.4
9
+
10
+ ## 0.0.4
11
+
12
+ ### Patch Changes
13
+
14
+ - [`ef3cb97`](https://github.com/tonightpass/tonightpass/commit/ef3cb9700747e815bd9ec1757003e4eb1774865a) Thanks [@AntoineKM](https://github.com/AntoineKM)! - Update api hook path types
15
+
3
16
  ## 0.0.3
4
17
 
5
18
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -3,7 +3,7 @@ import * as tonightpass from 'tonightpass';
3
3
  import { Client, Query, APIRequestOptions } from 'tonightpass';
4
4
 
5
5
  declare const client: Client;
6
- declare const useAPI: <Path extends "/careers/categories" | "/careers/employmentTypes" | "/careers/jobs" | "/careers/jobs/:id" | "/careers/offices" | "/health/database" | "/health/http" | "/profiles/:username" | "/users" | "/users/:id" | "/users/me" | "/check/:identifier">(path: Path, query?: Query<Path>, options?: APIRequestOptions) => swr.SWRResponse<(Extract<tonightpass.Endpoint<"GET", "/careers/categories", tonightpass.CareersCategory[], {
6
+ declare const useAPI: <Path extends "/careers/categories" | "/careers/employmentTypes" | "/careers/jobs" | "/careers/jobs/:id" | "/careers/offices" | "/health/database" | "/health/http" | "/profiles/:username" | "/users" | "/users/:id" | "/users/me" | "/users/check/:identifier">(path?: Path | null, query?: Query<Path>, options?: APIRequestOptions) => swr.SWRResponse<(Extract<tonightpass.Endpoint<"GET", "/careers/categories", tonightpass.CareersCategory[], {
7
7
  language?: string | undefined;
8
8
  }>, {
9
9
  path: Path;
@@ -61,8 +61,13 @@ declare const useAPI: <Path extends "/careers/categories" | "/careers/employment
61
61
  }> | Extract<tonightpass.Endpoint<"GET", "/users/me", tonightpass.User, undefined>, {
62
62
  path: Path;
63
63
  method: "GET";
64
- }> | Extract<tonightpass.Endpoint<"GET", "/check/:identifier", tonightpass.UserIdentifier, {
65
- identifier: string;
64
+ }> | Extract<tonightpass.Endpoint<"GET", "/users/check/:identifier", {
65
+ exists: boolean;
66
+ identifier: tonightpass.UserIdentifier;
67
+ suggestions?: string[] | undefined;
68
+ }, {
69
+ identifier: boolean;
70
+ suggestions?: boolean | undefined;
66
71
  }>, {
67
72
  path: Path;
68
73
  method: "GET";
package/dist/index.d.ts CHANGED
@@ -3,7 +3,7 @@ import * as tonightpass from 'tonightpass';
3
3
  import { Client, Query, APIRequestOptions } from 'tonightpass';
4
4
 
5
5
  declare const client: Client;
6
- declare const useAPI: <Path extends "/careers/categories" | "/careers/employmentTypes" | "/careers/jobs" | "/careers/jobs/:id" | "/careers/offices" | "/health/database" | "/health/http" | "/profiles/:username" | "/users" | "/users/:id" | "/users/me" | "/check/:identifier">(path: Path, query?: Query<Path>, options?: APIRequestOptions) => swr.SWRResponse<(Extract<tonightpass.Endpoint<"GET", "/careers/categories", tonightpass.CareersCategory[], {
6
+ declare const useAPI: <Path extends "/careers/categories" | "/careers/employmentTypes" | "/careers/jobs" | "/careers/jobs/:id" | "/careers/offices" | "/health/database" | "/health/http" | "/profiles/:username" | "/users" | "/users/:id" | "/users/me" | "/users/check/:identifier">(path?: Path | null, query?: Query<Path>, options?: APIRequestOptions) => swr.SWRResponse<(Extract<tonightpass.Endpoint<"GET", "/careers/categories", tonightpass.CareersCategory[], {
7
7
  language?: string | undefined;
8
8
  }>, {
9
9
  path: Path;
@@ -61,8 +61,13 @@ declare const useAPI: <Path extends "/careers/categories" | "/careers/employment
61
61
  }> | Extract<tonightpass.Endpoint<"GET", "/users/me", tonightpass.User, undefined>, {
62
62
  path: Path;
63
63
  method: "GET";
64
- }> | Extract<tonightpass.Endpoint<"GET", "/check/:identifier", tonightpass.UserIdentifier, {
65
- identifier: string;
64
+ }> | Extract<tonightpass.Endpoint<"GET", "/users/check/:identifier", {
65
+ exists: boolean;
66
+ identifier: tonightpass.UserIdentifier;
67
+ suggestions?: string[] | undefined;
68
+ }, {
69
+ identifier: boolean;
70
+ suggestions?: boolean | undefined;
66
71
  }>, {
67
72
  path: Path;
68
73
  method: "GET";
package/dist/index.js CHANGED
@@ -1,13 +1,13 @@
1
1
  'use strict';
2
2
 
3
- var s = require('swr');
3
+ var n = require('swr');
4
4
  var tonightpass = require('tonightpass');
5
5
 
6
6
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
7
7
 
8
- var s__default = /*#__PURE__*/_interopDefault(s);
8
+ var n__default = /*#__PURE__*/_interopDefault(n);
9
9
 
10
- var a=new tonightpass.Client({baseURL:tonightpass.DEFAULT_API_URL}),E=(t,e,r)=>s__default.default(t,o=>a.get(o,e,r));
10
+ var a=new tonightpass.Client({baseURL:tonightpass.DEFAULT_API_URL}),E=(t,e,r)=>n__default.default(t,o=>a.get(o,e,r));
11
11
 
12
12
  exports.client = a;
13
13
  exports.useAPI = E;
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/hooks/useAPI.ts"],"names":["useSWR","Client","DEFAULT_API_URL","client","useAPI","path","query","options","key"],"mappings":"AAAA,OAAOA,MAAyB,MAChC,OAGE,UAAAC,EAGA,mBAAAC,MACK,cAEA,IAAMC,EAAS,IAAIF,EAAO,CAAE,QAASC,CAAgB,CAAC,EAEhDE,EAAS,CACpBC,EACAC,EACAC,IAIOP,EACLK,EAH6BG,GAAcL,EAAO,IAAIK,EAAKF,EAAOC,CAAO,CAK3E","sourcesContent":["import useSWR, { Fetcher } from \"swr\";\nimport {\n Endpoints,\n APIRequestOptions,\n Client,\n PathsFor,\n Query,\n DEFAULT_API_URL,\n} from \"tonightpass\";\n\nexport const client = new Client({ baseURL: DEFAULT_API_URL });\n\nexport const useAPI = <Path extends PathsFor<\"GET\">>(\n path: Path,\n query?: Query<Path>,\n options?: APIRequestOptions,\n) => {\n const fetcher: Fetcher<any> = (key: Path) => client.get(key, query, options);\n\n return useSWR<Extract<Endpoints, { path: Path; method: \"GET\" }>[\"res\"]>(\n path,\n fetcher,\n );\n};\n"]}
1
+ {"version":3,"sources":["../src/hooks/useAPI.ts"],"names":["useSWR","Client","DEFAULT_API_URL","client","useAPI","path","query","options","key"],"mappings":"AAAA,OAAOA,MAAyB,MAChC,OAGE,UAAAC,EAGA,mBAAAC,MACK,cAEA,IAAMC,EAAS,IAAIF,EAAO,CAAE,QAASC,CAAgB,CAAC,EAEhDE,EAAS,CACpBC,EACAC,EACAC,IAIOP,EACLK,EAH6BG,GAAcL,EAAO,IAAIK,EAAKF,EAAOC,CAAO,CAK3E","sourcesContent":["import useSWR, { Fetcher } from \"swr\";\nimport {\n Endpoints,\n APIRequestOptions,\n Client,\n PathsFor,\n Query,\n DEFAULT_API_URL,\n} from \"tonightpass\";\n\nexport const client = new Client({ baseURL: DEFAULT_API_URL });\n\nexport const useAPI = <Path extends PathsFor<\"GET\">>(\n path?: Path | null,\n query?: Query<Path>,\n options?: APIRequestOptions,\n) => {\n const fetcher: Fetcher<any> = (key: Path) => client.get(key, query, options);\n\n return useSWR<Extract<Endpoints, { path: Path; method: \"GET\" }>[\"res\"]>(\n path,\n fetcher,\n );\n};\n"]}
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
- import s from 'swr';
1
+ import n from 'swr';
2
2
  import { Client, DEFAULT_API_URL } from 'tonightpass';
3
3
 
4
- var a=new Client({baseURL:DEFAULT_API_URL}),E=(t,e,r)=>s(t,o=>a.get(o,e,r));
4
+ var a=new Client({baseURL:DEFAULT_API_URL}),E=(t,e,r)=>n(t,o=>a.get(o,e,r));
5
5
 
6
6
  export { a as client, E as useAPI };
7
7
  //# sourceMappingURL=out.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/hooks/useAPI.ts"],"names":["useSWR","Client","DEFAULT_API_URL","client","useAPI","path","query","options","key"],"mappings":"AAAA,OAAOA,MAAyB,MAChC,OAGE,UAAAC,EAGA,mBAAAC,MACK,cAEA,IAAMC,EAAS,IAAIF,EAAO,CAAE,QAASC,CAAgB,CAAC,EAEhDE,EAAS,CACpBC,EACAC,EACAC,IAIOP,EACLK,EAH6BG,GAAcL,EAAO,IAAIK,EAAKF,EAAOC,CAAO,CAK3E","sourcesContent":["import useSWR, { Fetcher } from \"swr\";\nimport {\n Endpoints,\n APIRequestOptions,\n Client,\n PathsFor,\n Query,\n DEFAULT_API_URL,\n} from \"tonightpass\";\n\nexport const client = new Client({ baseURL: DEFAULT_API_URL });\n\nexport const useAPI = <Path extends PathsFor<\"GET\">>(\n path: Path,\n query?: Query<Path>,\n options?: APIRequestOptions,\n) => {\n const fetcher: Fetcher<any> = (key: Path) => client.get(key, query, options);\n\n return useSWR<Extract<Endpoints, { path: Path; method: \"GET\" }>[\"res\"]>(\n path,\n fetcher,\n );\n};\n"]}
1
+ {"version":3,"sources":["../src/hooks/useAPI.ts"],"names":["useSWR","Client","DEFAULT_API_URL","client","useAPI","path","query","options","key"],"mappings":"AAAA,OAAOA,MAAyB,MAChC,OAGE,UAAAC,EAGA,mBAAAC,MACK,cAEA,IAAMC,EAAS,IAAIF,EAAO,CAAE,QAASC,CAAgB,CAAC,EAEhDE,EAAS,CACpBC,EACAC,EACAC,IAIOP,EACLK,EAH6BG,GAAcL,EAAO,IAAIK,EAAKF,EAAOC,CAAO,CAK3E","sourcesContent":["import useSWR, { Fetcher } from \"swr\";\nimport {\n Endpoints,\n APIRequestOptions,\n Client,\n PathsFor,\n Query,\n DEFAULT_API_URL,\n} from \"tonightpass\";\n\nexport const client = new Client({ baseURL: DEFAULT_API_URL });\n\nexport const useAPI = <Path extends PathsFor<\"GET\">>(\n path?: Path | null,\n query?: Query<Path>,\n options?: APIRequestOptions,\n) => {\n const fetcher: Fetcher<any> = (key: Path) => client.get(key, query, options);\n\n return useSWR<Extract<Endpoints, { path: Path; method: \"GET\" }>[\"res\"]>(\n path,\n fetcher,\n );\n};\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tonightpass/react",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
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.3"
18
+ "tonightpass": "^0.0.4"
19
19
  },
20
20
  "peerDependencies": {
21
21
  "react": "*"
@@ -11,7 +11,7 @@ import {
11
11
  export const client = new Client({ baseURL: DEFAULT_API_URL });
12
12
 
13
13
  export const useAPI = <Path extends PathsFor<"GET">>(
14
- path: Path,
14
+ path?: Path | null,
15
15
  query?: Query<Path>,
16
16
  options?: APIRequestOptions,
17
17
  ) => {