@stacksjs/api 0.67.0 → 0.68.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.
package/dist/ofetch.d.ts CHANGED
@@ -1,17 +1,26 @@
1
- interface Params {
2
- [key: string]: any;
1
+ declare interface Params {
2
+ [key: string]: any
3
3
  }
4
- interface ApiFetch {
5
- get: (url: string, params?: Params, header?: Headers) => Promise<FetchResponse>;
6
- post: (url: string, params?: Params, header?: Headers) => Promise<FetchResponse>;
7
- destroy: (url: string, params?: Params, header?: Headers) => Promise<FetchResponse>;
8
- patch: (url: string, params?: Params, header?: Headers) => Promise<FetchResponse>;
9
- put: (url: string, params?: Params, header?: Headers) => Promise<FetchResponse>;
10
- setToken: (authToken: string) => void;
11
- baseURL: "/" | string;
12
- loading: boolean;
13
- token: string;
4
+ declare interface ApiFetch {
5
+ get: (url: string, params?: Params, header?: Headers) => Promise<FetchResponse>
6
+ post: (url: string, params?: Params, header?: Headers) => Promise<FetchResponse>
7
+ destroy: (url: string, params?: Params, header?: Headers) => Promise<FetchResponse>
8
+ patch: (url: string, params?: Params, header?: Headers) => Promise<FetchResponse>
9
+ put: (url: string, params?: Params, header?: Headers) => Promise<FetchResponse>
10
+ setToken: (authToken: string) => void
11
+ baseURL: '/' | string
12
+ loading: boolean
13
+ token: string
14
14
  }
15
- type FetchResponse = string | Blob | ArrayBuffer | ReadableStream<Uint8Array>;
16
- export declare const Fetch: ApiFetch;
17
- export {};
15
+ declare type FetchResponse = string | Blob | ArrayBuffer | ReadableStream<Uint8Array>
16
+
17
+ let loading = false
18
+ let token = ''
19
+ const baseURL = '/'
20
+ declare function get(url: string, params?: Params, headers?: Headers): Promise<FetchResponse>;
21
+ declare function post(url: string, params?: Params, headers?: Headers): Promise<any>;
22
+ declare function patch(url: string, params?: Params, headers?: Headers): Promise<FetchResponse>;
23
+ declare function put(url: string, params?: Params, headers?: Headers): Promise<FetchResponse>;
24
+ declare function destroy(url: string, params?: Params, headers?: Headers): Promise<FetchResponse>;
25
+ declare function setToken(authToken: string): void;
26
+ export declare const Fetch: ApiFetch;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/api",
3
3
  "type": "module",
4
- "version": "0.67.0",
4
+ "version": "0.68.0",
5
5
  "description": "The Stacks array utilities.",
6
6
  "author": "Chris Breuer",
7
7
  "contributors": ["Chris Breuer <chris@stacksjs.org>"],
@@ -44,7 +44,7 @@
44
44
  "dependencies": {
45
45
  "@stacksjs/utils": "0.67.0",
46
46
  "ofetch": "^1.4.1",
47
- "openapi-typescript": "^7.4.1"
47
+ "openapi-typescript": "^7.4.2"
48
48
  },
49
49
  "devDependencies": {
50
50
  "@stacksjs/development": "0.67.0"