@logto/express 2.1.0 → 2.2.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/README.md CHANGED
@@ -5,8 +5,6 @@
5
5
 
6
6
  The Logto Express SDK written in TypeScript. Check out our [integration guide](https://docs.logto.io/docs/recipes/integrate-logto/express) or [docs](https://docs.logto.io/sdk/JavaScript/express/) for more information.
7
7
 
8
- We also provide [集成指南](https://docs.logto.io/zh-cn/docs/recipes/integrate-logto/express/) and [文档](https://docs.logto.io/zh-cn/sdk/JavaScript/express/) in Simplified Chinese.
9
-
10
8
  ## Installation
11
9
 
12
10
  ### Using npm
package/lib/index.cjs CHANGED
@@ -69,6 +69,34 @@ const withLogto = (config) => async (request, response, next) => {
69
69
  next();
70
70
  };
71
71
 
72
+ Object.defineProperty(exports, 'LogtoClientError', {
73
+ enumerable: true,
74
+ get: function () { return NodeClient.LogtoClientError; }
75
+ });
76
+ Object.defineProperty(exports, 'LogtoError', {
77
+ enumerable: true,
78
+ get: function () { return NodeClient.LogtoError; }
79
+ });
80
+ Object.defineProperty(exports, 'LogtoRequestError', {
81
+ enumerable: true,
82
+ get: function () { return NodeClient.LogtoRequestError; }
83
+ });
84
+ Object.defineProperty(exports, 'OidcError', {
85
+ enumerable: true,
86
+ get: function () { return NodeClient.OidcError; }
87
+ });
88
+ Object.defineProperty(exports, 'PersistKey', {
89
+ enumerable: true,
90
+ get: function () { return NodeClient.PersistKey; }
91
+ });
92
+ Object.defineProperty(exports, 'Prompt', {
93
+ enumerable: true,
94
+ get: function () { return NodeClient.Prompt; }
95
+ });
96
+ Object.defineProperty(exports, 'ReservedResource', {
97
+ enumerable: true,
98
+ get: function () { return NodeClient.ReservedResource; }
99
+ });
72
100
  Object.defineProperty(exports, 'ReservedScope', {
73
101
  enumerable: true,
74
102
  get: function () { return NodeClient.ReservedScope; }
@@ -77,5 +105,17 @@ Object.defineProperty(exports, 'UserScope', {
77
105
  enumerable: true,
78
106
  get: function () { return NodeClient.UserScope; }
79
107
  });
108
+ Object.defineProperty(exports, 'buildOrganizationUrn', {
109
+ enumerable: true,
110
+ get: function () { return NodeClient.buildOrganizationUrn; }
111
+ });
112
+ Object.defineProperty(exports, 'getOrganizationIdFromUrn', {
113
+ enumerable: true,
114
+ get: function () { return NodeClient.getOrganizationIdFromUrn; }
115
+ });
116
+ Object.defineProperty(exports, 'organizationUrnPrefix', {
117
+ enumerable: true,
118
+ get: function () { return NodeClient.organizationUrnPrefix; }
119
+ });
80
120
  exports.handleAuthRoutes = handleAuthRoutes;
81
121
  exports.withLogto = withLogto;
package/lib/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import type { Request, Response, NextFunction } from 'express';
2
2
  import { Router } from 'express';
3
3
  import type { LogtoExpressConfig } from './types.js';
4
- export { ReservedScope, UserScope } from '@logto/node';
5
- export type { LogtoContext, InteractionMode } from '@logto/node';
4
+ export { LogtoError, LogtoRequestError, LogtoClientError, OidcError, Prompt, ReservedScope, ReservedResource, UserScope, organizationUrnPrefix, buildOrganizationUrn, getOrganizationIdFromUrn, PersistKey, } from '@logto/node';
5
+ export type { LogtoContext, InteractionMode, LogtoErrorCode } from '@logto/node';
6
6
  export type { LogtoExpressConfig } from './types.js';
7
7
  export type Middleware = (request: Request, response: Response, next: NextFunction) => Promise<void>;
8
8
  export declare const handleAuthRoutes: (config: LogtoExpressConfig) => Router;
package/lib/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import NodeClient from '@logto/node';
2
- export { ReservedScope, UserScope } from '@logto/node';
2
+ export { LogtoClientError, LogtoError, LogtoRequestError, OidcError, PersistKey, Prompt, ReservedResource, ReservedScope, UserScope, buildOrganizationUrn, getOrganizationIdFromUrn, organizationUrnPrefix } from '@logto/node';
3
3
  import { Router } from 'express';
4
4
  import { LogtoExpressError } from './errors.js';
5
5
  import ExpressStorage from './storage.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logto/express",
3
- "version": "2.1.0",
3
+ "version": "2.2.0",
4
4
  "type": "module",
5
5
  "main": "./lib/index.cjs",
6
6
  "module": "./lib/index.js",
@@ -21,7 +21,7 @@
21
21
  "directory": "packages/express"
22
22
  },
23
23
  "dependencies": {
24
- "@logto/node": "^2.1.1"
24
+ "@logto/node": "^2.2.0"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@silverhand/eslint-config": "^4.0.1",
@@ -39,9 +39,9 @@
39
39
  "express": "^4.18.1",
40
40
  "express-session": "^1.17.3",
41
41
  "jest": "^29.5.0",
42
- "jest-location-mock": "^1.0.9",
42
+ "jest-location-mock": "^2.0.0",
43
43
  "jest-matcher-specific-error": "^1.0.0",
44
- "lint-staged": "^14.0.0",
44
+ "lint-staged": "^15.0.0",
45
45
  "prettier": "^3.0.0",
46
46
  "supertest": "^6.3.3",
47
47
  "typescript": "^5.0.0"