larapi 0.0.4 → 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
@@ -38,5 +38,8 @@ declare class API extends Core {
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
40
  static deleteCacheGroup: (group: string) => void;
41
+ static getToken: () => string;
42
+ static user: TUser;
43
+ static uid: number;
41
44
  }
42
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
  }
@@ -148,5 +149,23 @@ Object.defineProperty(API, "deleteCacheGroup", {
148
149
  writable: true,
149
150
  value: _a.instance.deleteCacheGroup
150
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
+ });
151
170
  globalThis.apiSetInitData = API.setInitData;
152
171
  exports.default = API;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "larapi",
3
- "version": "0.0.4",
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
  }
@@ -99,6 +100,9 @@ class API extends Core {
99
100
  public static addListener = this.instance.addListener;
100
101
  public static setInitData = this.instance.setInitData;
101
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;
102
106
  }
103
107
 
104
108
  (globalThis as any).apiSetInitData = API.setInitData;