supaapps-api-kit-client 0.1.0 → 0.3.0

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.
@@ -13,8 +13,8 @@ export declare class ApiKitClient {
13
13
  static getOne<T>(endpoint: string, params?: URLSearchParams): Promise<AxiosResponse<T>>;
14
14
  static getPaginated<T>(endpoint: string, params?: URLSearchParams): Promise<AxiosResponse<PaginatedResponse<T>>>;
15
15
  static post<T>(endpoint: string, data: T): Promise<AxiosResponse<T>>;
16
- static put<T>(endpoint: string, data: T): Promise<AxiosResponse<T>>;
17
- static patch<T>(endpoint: string, data: T): Promise<AxiosResponse<T>>;
16
+ static put<T>(endpoint: string, data: Partial<T>): Promise<AxiosResponse<T>>;
17
+ static patch<T>(endpoint: string, data: Partial<T>): Promise<AxiosResponse<T>>;
18
18
  static delete<T>(endpoint: string): Promise<AxiosResponse<T>>;
19
19
  }
20
20
  export {};
package/dist/index.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export { ApiKitClient } from './ApiKitClient';
2
+ export * from './types';
package/dist/index.js CHANGED
@@ -1,5 +1,20 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
2
16
  Object.defineProperty(exports, "__esModule", { value: true });
3
17
  exports.ApiKitClient = void 0;
4
18
  var ApiKitClient_1 = require("./ApiKitClient");
5
19
  Object.defineProperty(exports, "ApiKitClient", { enumerable: true, get: function () { return ApiKitClient_1.ApiKitClient; } });
20
+ __exportStar(require("./types"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "supaapps-api-kit-client",
3
- "version": "0.1.0",
3
+ "version": "0.3.0",
4
4
  "description": "A versatile, type-safe API kit client designed for TypeScript applications.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -45,7 +45,7 @@ export class ApiKitClient {
45
45
  this.checkInitialization();
46
46
  return this.instance!.get<T>(endpoint, { params });
47
47
  }
48
-
48
+
49
49
  public static async getOne<T>(endpoint: string, params?: URLSearchParams): Promise<AxiosResponse<T>> {
50
50
  this.checkInitialization();
51
51
  return this.instance!.get<T>(endpoint, { params });
@@ -61,12 +61,12 @@ export class ApiKitClient {
61
61
  return this.instance!.post<T>(endpoint, data);
62
62
  }
63
63
 
64
- public static async put<T>(endpoint: string, data: T): Promise<AxiosResponse<T>> {
64
+ public static async put<T>(endpoint: string, data: Partial<T>): Promise<AxiosResponse<T>> {
65
65
  this.checkInitialization();
66
66
  return this.instance!.put<T>(endpoint, data);
67
67
  }
68
68
 
69
- public static async patch<T>(endpoint: string, data: T): Promise<AxiosResponse<T>> {
69
+ public static async patch<T>(endpoint: string, data: Partial<T>): Promise<AxiosResponse<T>> {
70
70
  this.checkInitialization();
71
71
  return this.instance!.patch<T>(endpoint, data);
72
72
  }
package/src/index.ts CHANGED
@@ -1 +1,2 @@
1
- export { ApiKitClient } from './ApiKitClient';
1
+ export { ApiKitClient } from './ApiKitClient';
2
+ export * from './types';