@luminix/support 0.0.1-beta.2 → 0.0.1-beta.4

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/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "@luminix/support",
3
- "version": "0.0.1-beta.2",
3
+ "version": "0.0.1-beta.4",
4
4
  "module": "dist/support.js",
5
5
  "types": "types/index.d.ts",
6
6
  "type": "module",
7
7
  "scripts": {
8
+ "prebuild": "rm -rf types",
8
9
  "build": "tsc && vite build",
9
10
  "lint": "eslint . --report-unused-disable-directives --max-warnings 0",
10
11
  "lint:fix": "eslint . --report-unused-disable-directives --max-warnings 0 --fix",
@@ -17,16 +18,18 @@
17
18
  "@types/lodash-es": "^4.17.12",
18
19
  "@typescript-eslint/eslint-plugin": "^8.4.0",
19
20
  "@typescript-eslint/parser": "^8.4.0",
20
- "axios": "^1.7.7",
21
21
  "eslint": "^9.9.1",
22
22
  "jest": "^29.7.0",
23
23
  "lodash-es": "^4.17.21",
24
- "nanoevents": "^9.0.0",
25
24
  "ts-jest": "^29.2.5",
26
25
  "typescript": "^5.5.4",
27
26
  "vite": "^5.4.3",
28
27
  "vite-plugin-dts": "^4.1.0"
29
28
  },
29
+ "dependencies": {
30
+ "axios": "^1.7.7",
31
+ "nanoevents": "^9.0.0"
32
+ },
30
33
  "peerDependencies": {
31
34
  "immer": "^10.1.1"
32
35
  }
@@ -15,6 +15,8 @@ export default class Client {
15
15
  replaceOptions(options: RequestOptions): this;
16
16
  withQueryParameters(params: string | object): this;
17
17
  replaceQueryParameters(params: string | object): this;
18
+ withData(data: object): this;
19
+ replaceData(data: object): this;
18
20
  withBasicAuth(username: string, password: string): this;
19
21
  withToken(token: string): this;
20
22
  get<TResponse = any>(url: string, query?: string | object): Request<TResponse, any>;
@@ -21,5 +21,5 @@ declare class HttpStatic {
21
21
  patch<TResponse = any, TData = any>(url: string, data?: TData): Request<TResponse, TData>;
22
22
  delete<TResponse = any>(url: string, query?: string | object): Request<TResponse, any>;
23
23
  }
24
- declare const Http: HttpStatic & import('../Mixins/Macroable').MacroMethodMap & import('../Mixins/Macroable').MacroableInterface<import('../Mixins/Macroable').MacroMethodMap>;
24
+ declare const Http: HttpStatic & Record<string, () => Client> & import('../Mixins/Macroable').MacroableInterface<Record<string, () => Client>>;
25
25
  export default Http;
package/types/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { default as Collection } from './Collection';
2
2
  import { default as EventSource } from './Contracts/EventSource';
3
- import { default as Http } from './Http';
3
+ import { default as Http } from './Http/index';
4
4
  import { default as PropertyBag } from './PropertyBag';
5
5
  import { default as Reducible } from './Mixins/Reducible';
6
6
  import { default as Macroable } from './Mixins/Macroable';
package/types/Http.d.ts DELETED
@@ -1,30 +0,0 @@
1
- import { AxiosResponse } from 'axios';
2
- declare class Response<T = any, D = any> {
3
- _response: AxiosResponse<T, D>;
4
- constructor(_response: AxiosResponse<T, D>);
5
- body(): string;
6
- json(): D;
7
- status(): number;
8
- successful(): boolean;
9
- failed(): boolean;
10
- header(header: string): string;
11
- headers(): Record<string, string>;
12
- ok(): boolean;
13
- created(): boolean;
14
- accepted(): boolean;
15
- noContent(): boolean;
16
- movedPermanently(): boolean;
17
- found(): boolean;
18
- badRequest(): boolean;
19
- unauthorized(): boolean;
20
- paymentRequired(): boolean;
21
- forbidden(): boolean;
22
- notFound(): boolean;
23
- requestTimeout(): boolean;
24
- conflict(): boolean;
25
- unprocessableEntity(): boolean;
26
- tooManyRequests(): boolean;
27
- serverError(): boolean;
28
- }
29
- export declare function get(url: string, query?: string | object): Promise<Response>;
30
- export {};