@nhost/nhost-js 0.3.6 → 0.3.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.
Files changed (47) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +4 -5
  3. package/dist/{cjs/clients → clients}/functions.d.ts +2 -2
  4. package/dist/{esm/clients → clients}/graphql.d.ts +2 -2
  5. package/dist/{cjs/core → core}/index.d.ts +0 -0
  6. package/dist/{esm/core → core}/nhost-client.d.ts +3 -12
  7. package/dist/{cjs/index.d.ts → index.d.ts} +1 -2
  8. package/dist/index.es.js +4507 -0
  9. package/dist/index.umd.js +4 -0
  10. package/dist/{cjs/types.d.ts → types.d.ts} +5 -5
  11. package/package.json +45 -34
  12. package/src/index.ts +4 -7
  13. package/dist/cjs/clients/functions.js +0 -113
  14. package/dist/cjs/clients/functions.js.map +0 -1
  15. package/dist/cjs/clients/graphql.d.ts +0 -15
  16. package/dist/cjs/clients/graphql.js +0 -133
  17. package/dist/cjs/clients/graphql.js.map +0 -1
  18. package/dist/cjs/core/index.js +0 -14
  19. package/dist/cjs/core/index.js.map +0 -1
  20. package/dist/cjs/core/nhost-client.d.ts +0 -28
  21. package/dist/cjs/core/nhost-client.js +0 -59
  22. package/dist/cjs/core/nhost-client.js.map +0 -1
  23. package/dist/cjs/index.js +0 -20
  24. package/dist/cjs/index.js.map +0 -1
  25. package/dist/cjs/types.js +0 -3
  26. package/dist/cjs/types.js.map +0 -1
  27. package/dist/esm/clients/functions.d.ts +0 -13
  28. package/dist/esm/clients/functions.js +0 -107
  29. package/dist/esm/clients/functions.js.map +0 -1
  30. package/dist/esm/clients/graphql.js +0 -127
  31. package/dist/esm/clients/graphql.js.map +0 -1
  32. package/dist/esm/core/index.d.ts +0 -1
  33. package/dist/esm/core/index.js +0 -2
  34. package/dist/esm/core/index.js.map +0 -1
  35. package/dist/esm/core/nhost-client.js +0 -56
  36. package/dist/esm/core/nhost-client.js.map +0 -1
  37. package/dist/esm/index.d.ts +0 -5
  38. package/dist/esm/index.js +0 -7
  39. package/dist/esm/index.js.map +0 -1
  40. package/dist/esm/types.d.ts +0 -19
  41. package/dist/esm/types.js +0 -2
  42. package/dist/esm/types.js.map +0 -1
  43. package/src/clients/functions.ts +0 -68
  44. package/src/clients/graphql.ts +0 -102
  45. package/src/core/index.ts +0 -1
  46. package/src/core/nhost-client.ts +0 -84
  47. package/src/types.ts +0 -26
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) Nhost
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -25,11 +25,11 @@ yarn add @nhost/nhost-js
25
25
  ### Initialize
26
26
 
27
27
  ```js
28
- import { NhostClient } from '@nhost/nhost-js';
28
+ import { NhostClient } from '@nhost/nhost-js'
29
29
 
30
30
  const nhost = new NhostClient({
31
- backendUrl: 'https://xxx.nhost.run',
32
- });
31
+ backendUrl: 'https://xxx.nhost.run'
32
+ })
33
33
  ```
34
34
 
35
35
  ## Features
@@ -52,5 +52,4 @@ Access Nhost Functions methods via `nhost.functions`.
52
52
 
53
53
  ## Documentation
54
54
 
55
- [Coming soon](https://docs.nhost.io)
56
-
55
+ [https://docs.nhost.io/reference/sdk](https://docs.nhost.io/reference/sdk)
@@ -1,8 +1,8 @@
1
1
  import { AxiosRequestConfig } from 'axios';
2
2
  import { FunctionCallResponse } from '../types';
3
- export declare type NhostFunctionsConstructorParams = {
3
+ export interface NhostFunctionsConstructorParams {
4
4
  url: string;
5
- };
5
+ }
6
6
  export declare class NhostFunctionsClient {
7
7
  private instance;
8
8
  private accessToken;
@@ -1,8 +1,8 @@
1
1
  import { AxiosRequestConfig } from 'axios';
2
2
  import { GraphqlRequestResponse } from '../types';
3
- export declare type NhostGraphqlConstructorParams = {
3
+ export interface NhostGraphqlConstructorParams {
4
4
  url: string;
5
- };
5
+ }
6
6
  export declare class NhostGraphqlClient {
7
7
  private url;
8
8
  private instance;
File without changes
@@ -1,28 +1,19 @@
1
- import { HasuraAuthClient } from '@nhost/hasura-auth-js';
1
+ import { ClientStorage, ClientStorageType, HasuraAuthClient } from '@nhost/hasura-auth-js';
2
2
  import { HasuraStorageClient } from '@nhost/hasura-storage-js';
3
- import { ClientStorage, ClientStorageType } from '@nhost/hasura-auth-js';
4
3
  import { NhostFunctionsClient } from '../clients/functions';
5
4
  import { NhostGraphqlClient } from '../clients/graphql';
6
- export declare type NhostClientConstructorParams = {
5
+ export interface NhostClientConstructorParams {
7
6
  backendUrl: string;
8
7
  refreshIntervalTime?: number;
9
8
  clientStorage?: ClientStorage;
10
9
  clientStorageType?: ClientStorageType;
11
10
  autoRefreshToken?: boolean;
12
11
  autoLogin?: boolean;
13
- };
12
+ }
14
13
  export declare class NhostClient {
15
14
  auth: HasuraAuthClient;
16
15
  storage: HasuraStorageClient;
17
16
  functions: NhostFunctionsClient;
18
17
  graphql: NhostGraphqlClient;
19
- /**
20
- * Nhost Client
21
- *
22
- * @example
23
- * const nhost = new NhostClient({ url });
24
- *
25
- * @docs https://docs.nhost.io/TODO
26
- */
27
18
  constructor(params: NhostClientConstructorParams);
28
19
  }
@@ -1,5 +1,4 @@
1
- import { NhostClient } from '.';
2
- import { NhostClientConstructorParams } from '.';
1
+ import { NhostClient, NhostClientConstructorParams } from './core';
3
2
  declare const createClient: (config: NhostClientConstructorParams) => NhostClient;
4
3
  export * from './core';
5
4
  export { createClient };