@tachybase/sdk 1.3.19 → 1.3.21

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.
@@ -21,6 +21,7 @@ export declare class Auth {
21
21
  token: string;
22
22
  authenticator: string;
23
23
  theme: string;
24
+ mainToken: string;
24
25
  };
25
26
  protected options: {
26
27
  locale: any;
@@ -36,6 +37,8 @@ export declare class Auth {
36
37
  set role(value: string);
37
38
  get token(): string;
38
39
  set token(value: string);
40
+ get mainToken(): string;
41
+ set mainToken(value: string);
39
42
  get authenticator(): string;
40
43
  set authenticator(value: string);
41
44
  getOption(key: string): string;
@@ -46,6 +49,8 @@ export declare class Auth {
46
49
  setRole(role: string): void;
47
50
  getToken(): string;
48
51
  setToken(token: string): void;
52
+ getMainToken(): string;
53
+ setMainToken(token: string): void;
49
54
  getAuthenticator(): string;
50
55
  setAuthenticator(authenticator: string): void;
51
56
  middleware(config: AxiosRequestConfig): AxiosRequestConfig<any>;
package/lib/APIClient.js CHANGED
@@ -44,7 +44,8 @@ const _Auth = class _Auth {
44
44
  role: "TACHYBASE_ROLE",
45
45
  token: "TACHYBASE_TOKEN",
46
46
  authenticator: "TACHYBASE_AUTH",
47
- theme: "TACHYBASE_THEME"
47
+ theme: "TACHYBASE_THEME",
48
+ mainToken: "TACHYBASE_TOKEN"
48
49
  };
49
50
  this.options = {
50
51
  locale: null,
@@ -88,6 +89,12 @@ const _Auth = class _Auth {
88
89
  set token(value) {
89
90
  this.setToken(value);
90
91
  }
92
+ get mainToken() {
93
+ return this.getMainToken();
94
+ }
95
+ set mainToken(value) {
96
+ this.setMainToken(value);
97
+ }
91
98
  get authenticator() {
92
99
  return this.getAuthenticator();
93
100
  }
@@ -125,6 +132,12 @@ const _Auth = class _Auth {
125
132
  setToken(token) {
126
133
  this.setOption("token", token);
127
134
  }
135
+ getMainToken() {
136
+ return this.getOption("mainToken");
137
+ }
138
+ setMainToken(token) {
139
+ this.setOption("mainToken", token);
140
+ }
128
141
  getAuthenticator() {
129
142
  return this.getOption("authenticator");
130
143
  }
@@ -276,6 +289,9 @@ const _APIClient = class _APIClient {
276
289
  const target = {};
277
290
  const handler = {
278
291
  get: /* @__PURE__ */ __name((_, actionName) => {
292
+ if (typeof actionName !== "string") {
293
+ return null;
294
+ }
279
295
  let url = name.split(".").join(`/${of || "_"}/`);
280
296
  url += `:${actionName}`;
281
297
  const config = { url };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tachybase/sdk",
3
- "version": "1.3.19",
3
+ "version": "1.3.21",
4
4
  "license": "Apache-2.0",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",