larapi 0.0.3 → 0.0.5

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/lib/index.d.ts CHANGED
@@ -37,5 +37,9 @@ declare class API extends Core {
37
37
  static setToken: (token: string) => void;
38
38
  static addListener: (event: import("./types").TListenerEvents, callback: (data: any) => void) => import("easy-event-emitter").Event;
39
39
  static setInitData: (data: import("./types").TGroupsData) => void;
40
+ static deleteCacheGroup: (group: string) => void;
41
+ static getToken: () => string;
42
+ static user: TUser;
43
+ static uid: number;
40
44
  }
41
45
  export default API;
package/lib/index.js CHANGED
@@ -21,6 +21,7 @@ class API extends Core_1.default {
21
21
  this.setUser = this.setUser.bind(this);
22
22
  this.updateUser = this.updateUser.bind(this);
23
23
  this.logout = this.logout.bind(this);
24
+ this.getToken = this.getToken.bind(this);
24
25
  this.get = this.get.bind(this);
25
26
  this.post = this.post.bind(this);
26
27
  }
@@ -142,5 +143,29 @@ Object.defineProperty(API, "setInitData", {
142
143
  writable: true,
143
144
  value: _a.instance.setInitData
144
145
  });
146
+ Object.defineProperty(API, "deleteCacheGroup", {
147
+ enumerable: true,
148
+ configurable: true,
149
+ writable: true,
150
+ value: _a.instance.deleteCacheGroup
151
+ });
152
+ Object.defineProperty(API, "getToken", {
153
+ enumerable: true,
154
+ configurable: true,
155
+ writable: true,
156
+ value: _a.instance.getToken
157
+ });
158
+ Object.defineProperty(API, "user", {
159
+ enumerable: true,
160
+ configurable: true,
161
+ writable: true,
162
+ value: _a.instance.user
163
+ });
164
+ Object.defineProperty(API, "uid", {
165
+ enumerable: true,
166
+ configurable: true,
167
+ writable: true,
168
+ value: _a.instance.uid
169
+ });
145
170
  globalThis.apiSetInitData = API.setInitData;
146
171
  exports.default = API;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "larapi",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "description": "API client for laravel",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
package/src/index.ts CHANGED
@@ -25,6 +25,7 @@ class API extends Core {
25
25
  this.setUser = this.setUser.bind(this);
26
26
  this.updateUser = this.updateUser.bind(this);
27
27
  this.logout = this.logout.bind(this);
28
+ this.getToken = this.getToken.bind(this);
28
29
  this.get = this.get.bind(this);
29
30
  this.post = this.post.bind(this);
30
31
  }
@@ -98,6 +99,10 @@ class API extends Core {
98
99
  public static setToken = this.instance.setToken;
99
100
  public static addListener = this.instance.addListener;
100
101
  public static setInitData = this.instance.setInitData;
102
+ public static deleteCacheGroup = this.instance.deleteCacheGroup;
103
+ public static getToken = this.instance.getToken;
104
+ public static user = this.instance.user;
105
+ public static uid = this.instance.uid;
101
106
  }
102
107
 
103
108
  (globalThis as any).apiSetInitData = API.setInitData;