@fill-easy/api 1.0.6 → 1.0.8

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/README.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  Type-safe SDK for Fill Easy API, generated from OpenAPI specification.
4
4
 
5
+ Read full docs here: https://fill-easy.gitbook.io/fill-easy-docs
6
+
7
+ Made with https://openapi-ts.dev/
8
+
5
9
  ## Installation
6
10
 
7
11
  ```bash
@@ -11,13 +15,20 @@ npm install @fill-easy/api
11
15
  ## Usage
12
16
 
13
17
  ```typescript
14
- import createApiClient from "@fill-easy/api"
18
+ import { createApiClient } from "@fill-easy/api"
15
19
 
16
- const client = createApiClient("https://api.fill-easy.com")
20
+ const client = createApiClient({
21
+ baseUrl: "https://sandbox.staging-api.fill-easy.com",
22
+ clientId: "your-client-id",
23
+ clientSecret: "your-client-secret",
24
+ })
17
25
 
18
26
  // Fully typed API calls
19
27
  const { data, error } = await client.POST("/iamsmart/v2/request/auth", {
20
- params: { body: {} },
28
+ body: {
29
+ redirect: "https://example.com/callback",
30
+ source: "Android_Chrome",
31
+ },
21
32
  })
22
33
 
23
34
  if (error) {
@@ -26,10 +37,3 @@ if (error) {
26
37
  console.log(data)
27
38
  }
28
39
  ```
29
-
30
- ## Features
31
-
32
- - ✅ Fully type-safe with TypeScript
33
- - ✅ Auto-completion for all API endpoints
34
- - ✅ Lightweight - uses native fetch API
35
- - ✅ Generated from OpenAPI specification
package/dist/index.d.ts CHANGED
@@ -1,4 +1,10 @@
1
1
  import type { paths } from "./openapi.d.ts";
2
2
  export type { paths };
3
- export declare function createApiClient(baseUrl: string, options?: RequestInit): import("openapi-fetch").Client<paths, `${string}/${string}`>;
3
+ export interface ApiClientConfig {
4
+ baseUrl: string;
5
+ clientId: string;
6
+ clientSecret: string;
7
+ headers?: HeadersInit;
8
+ }
9
+ export declare function createApiClient(config: ApiClientConfig): import("openapi-fetch").Client<paths, `${string}/${string}`>;
4
10
  export default createApiClient;
package/dist/index.js CHANGED
@@ -1,6 +1,13 @@
1
1
  /* global RequestInit */
2
2
  import createClient from "openapi-fetch";
3
- export function createApiClient(baseUrl, options) {
4
- return createClient({ baseUrl, ...options });
3
+ export function createApiClient(config) {
4
+ return createClient({
5
+ baseUrl: config.baseUrl,
6
+ headers: {
7
+ "x-client-id": config.clientId,
8
+ "x-client-secret": config.clientSecret,
9
+ ...config.headers,
10
+ },
11
+ });
5
12
  }
6
13
  export default createApiClient;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fill-easy/api",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "type": "module",
5
5
  "description": "Type-safe SDK for Fill Easy API",
6
6
  "main": "dist/index.js",