kauth-sdk-node 2.0.5 → 2.0.8

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.
@@ -26,6 +26,8 @@ export interface KauthConfig {
26
26
  mockHandler?: (ctx: any) => Promise<void>;
27
27
  lruMaxAge?: number;
28
28
  lruMax?: number;
29
+ apiInjected?: boolean;
30
+ tracerInjected?: boolean;
29
31
  marmotTenantId?: number;
30
32
  marmotAccessKeyId?: string;
31
33
  marmotAccessKeySecret?: string;
@@ -1,6 +1,10 @@
1
1
  /// <reference types="node" />
2
2
  import { ParsedUrlQueryInput } from 'querystring';
3
3
  import { MarmotOptions, MarmotPagination } from '../tool/marmot';
4
+ export declare enum RoleExtendValueType {
5
+ NotFilteredByAnyRoles,
6
+ FilteredByGlobalRoles
7
+ }
4
8
  export interface KauthAuthenticateRequest extends ParsedUrlQueryInput, MarmotOptions {
5
9
  code: string;
6
10
  redirect_uri: string;
@@ -90,6 +94,6 @@ export interface KauthBindRoleWithUsersRequest extends MarmotOptions {
90
94
  export interface KauthSearchUsersWithUserAccountsAndRoleRequest extends MarmotOptions {
91
95
  name?: string;
92
96
  role_name?: string;
93
- role_extend_value?: string;
97
+ role_extend_value: RoleExtendValueType | string;
94
98
  pagination: Partial<MarmotPagination>;
95
99
  }
@@ -1,2 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RoleExtendValueType = void 0;
4
+ var RoleExtendValueType;
5
+ (function (RoleExtendValueType) {
6
+ RoleExtendValueType[RoleExtendValueType["NotFilteredByAnyRoles"] = undefined] = "NotFilteredByAnyRoles";
7
+ RoleExtendValueType[RoleExtendValueType["FilteredByGlobalRoles"] = null] = "FilteredByGlobalRoles";
8
+ })(RoleExtendValueType = exports.RoleExtendValueType || (exports.RoleExtendValueType = {}));
@@ -38,7 +38,7 @@ class MarmotUtil {
38
38
  }
39
39
  async get(path, params) {
40
40
  // 兼容老的写法
41
- if (params.userId) {
41
+ if (params && params.userId) {
42
42
  this.setUserId(String(params.userId));
43
43
  }
44
44
  const uri = this.resolveUri(path, params);
@@ -49,7 +49,7 @@ class MarmotUtil {
49
49
  }
50
50
  async post(path, params, config) {
51
51
  // 兼容老的写法
52
- if (params.userId) {
52
+ if (params && params.userId) {
53
53
  this.setUserId(String(params.userId));
54
54
  }
55
55
  const uri = this.resolveUri(path);
@@ -61,7 +61,7 @@ class MarmotUtil {
61
61
  }
62
62
  async del(path, params) {
63
63
  // 兼容老的写法
64
- if (params.userId) {
64
+ if (params && params.userId) {
65
65
  this.setUserId(String(params.userId));
66
66
  }
67
67
  const uri = this.resolveUri(path, params);
package/dist/index.d.ts CHANGED
@@ -1,6 +1,8 @@
1
1
  export { KauthConfig } from './common/config/config';
2
2
  export { KauthApi } from './common/http/kauth';
3
3
  export { KflowApi } from './common/http/kflow';
4
+ export * from './common/http/request/kauth';
5
+ export * from './common/http/request/kflow';
4
6
  export { GoogleAuthenticator, MoziAuthenticator, MiniprogramAuthenticator, AuthenticationInformation, PrimaryPrincipal, JsonWebTokenSubjectProvider, JsonWebTokenAuthenticationProvider, } from './authenticator';
5
7
  export { PermissionCore } from './authorizer';
6
8
  export { MoziAuthenticationInformation, MoziPrincipal, MoziCredential } from './authenticator/mozi';
package/dist/index.js CHANGED
@@ -1,9 +1,21 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
11
+ };
2
12
  Object.defineProperty(exports, "__esModule", { value: true });
3
13
  var kauth_1 = require("./common/http/kauth");
4
14
  Object.defineProperty(exports, "KauthApi", { enumerable: true, get: function () { return kauth_1.KauthApi; } });
5
15
  var kflow_1 = require("./common/http/kflow");
6
16
  Object.defineProperty(exports, "KflowApi", { enumerable: true, get: function () { return kflow_1.KflowApi; } });
17
+ __exportStar(require("./common/http/request/kauth"), exports);
18
+ __exportStar(require("./common/http/request/kflow"), exports);
7
19
  var authenticator_1 = require("./authenticator");
8
20
  Object.defineProperty(exports, "GoogleAuthenticator", { enumerable: true, get: function () { return authenticator_1.GoogleAuthenticator; } });
9
21
  Object.defineProperty(exports, "MoziAuthenticator", { enumerable: true, get: function () { return authenticator_1.MoziAuthenticator; } });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kauth-sdk-node",
3
- "version": "2.0.5",
3
+ "version": "2.0.8",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "files": [