@logto/express 2.1.1 → 2.3.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/lib/index.cjs CHANGED
@@ -63,31 +63,60 @@ const withLogto = (config) => async (request, response, next) => {
63
63
  getAccessToken: config.getAccessToken,
64
64
  resource: config.resource,
65
65
  fetchUserInfo: config.fetchUserInfo,
66
+ getOrganizationToken: config.getOrganizationToken,
66
67
  });
67
68
  // eslint-disable-next-line @silverhand/fp/no-mutating-methods
68
69
  Object.defineProperty(request, 'user', { enumerable: true, get: () => user });
69
70
  next();
70
71
  };
71
72
 
72
- Object.defineProperty(exports, 'LogtoClientError', {
73
+ Object.defineProperty(exports, "LogtoClientError", {
73
74
  enumerable: true,
74
75
  get: function () { return NodeClient.LogtoClientError; }
75
76
  });
76
- Object.defineProperty(exports, 'LogtoError', {
77
+ Object.defineProperty(exports, "LogtoError", {
77
78
  enumerable: true,
78
79
  get: function () { return NodeClient.LogtoError; }
79
80
  });
80
- Object.defineProperty(exports, 'LogtoRequestError', {
81
+ Object.defineProperty(exports, "LogtoRequestError", {
81
82
  enumerable: true,
82
83
  get: function () { return NodeClient.LogtoRequestError; }
83
84
  });
84
- Object.defineProperty(exports, 'ReservedScope', {
85
+ Object.defineProperty(exports, "OidcError", {
86
+ enumerable: true,
87
+ get: function () { return NodeClient.OidcError; }
88
+ });
89
+ Object.defineProperty(exports, "PersistKey", {
90
+ enumerable: true,
91
+ get: function () { return NodeClient.PersistKey; }
92
+ });
93
+ Object.defineProperty(exports, "Prompt", {
94
+ enumerable: true,
95
+ get: function () { return NodeClient.Prompt; }
96
+ });
97
+ Object.defineProperty(exports, "ReservedResource", {
98
+ enumerable: true,
99
+ get: function () { return NodeClient.ReservedResource; }
100
+ });
101
+ Object.defineProperty(exports, "ReservedScope", {
85
102
  enumerable: true,
86
103
  get: function () { return NodeClient.ReservedScope; }
87
104
  });
88
- Object.defineProperty(exports, 'UserScope', {
105
+ Object.defineProperty(exports, "UserScope", {
89
106
  enumerable: true,
90
107
  get: function () { return NodeClient.UserScope; }
91
108
  });
109
+ Object.defineProperty(exports, "buildOrganizationUrn", {
110
+ enumerable: true,
111
+ get: function () { return NodeClient.buildOrganizationUrn; }
112
+ });
113
+ Object.defineProperty(exports, "getOrganizationIdFromUrn", {
114
+ enumerable: true,
115
+ get: function () { return NodeClient.getOrganizationIdFromUrn; }
116
+ });
117
+ Object.defineProperty(exports, "organizationUrnPrefix", {
118
+ enumerable: true,
119
+ get: function () { return NodeClient.organizationUrnPrefix; }
120
+ });
92
121
  exports.handleAuthRoutes = handleAuthRoutes;
93
122
  exports.withLogto = withLogto;
package/lib/index.d.ts CHANGED
@@ -1,7 +1,7 @@
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, LogtoError, LogtoClientError, LogtoRequestError, } from '@logto/node';
4
+ export { LogtoError, LogtoRequestError, LogtoClientError, OidcError, Prompt, ReservedScope, ReservedResource, UserScope, organizationUrnPrefix, buildOrganizationUrn, getOrganizationIdFromUrn, PersistKey, } from '@logto/node';
5
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>;
package/lib/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import NodeClient from '@logto/node';
2
- export { LogtoClientError, LogtoError, LogtoRequestError, 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';
@@ -58,6 +58,7 @@ const withLogto = (config) => async (request, response, next) => {
58
58
  getAccessToken: config.getAccessToken,
59
59
  resource: config.resource,
60
60
  fetchUserInfo: config.fetchUserInfo,
61
+ getOrganizationToken: config.getOrganizationToken,
61
62
  });
62
63
  // eslint-disable-next-line @silverhand/fp/no-mutating-methods
63
64
  Object.defineProperty(request, 'user', { enumerable: true, get: () => user });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logto/express",
3
- "version": "2.1.1",
3
+ "version": "2.3.0",
4
4
  "type": "module",
5
5
  "main": "./lib/index.cjs",
6
6
  "module": "./lib/index.js",
@@ -21,12 +21,12 @@
21
21
  "directory": "packages/express"
22
22
  },
23
23
  "dependencies": {
24
- "@logto/node": "^2.1.2"
24
+ "@logto/node": "^2.3.0"
25
25
  },
26
26
  "devDependencies": {
27
- "@silverhand/eslint-config": "^4.0.1",
28
- "@silverhand/ts-config": "^4.0.0",
29
- "@silverhand/ts-config-react": "^4.0.0",
27
+ "@silverhand/eslint-config": "^5.0.0",
28
+ "@silverhand/ts-config": "^5.0.0",
29
+ "@silverhand/ts-config-react": "^5.0.0",
30
30
  "@swc/core": "^1.3.50",
31
31
  "@swc/jest": "^0.2.24",
32
32
  "@types/cookie-parser": "^1.4.3",
@@ -41,7 +41,7 @@
41
41
  "jest": "^29.5.0",
42
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"