@logto/node 2.1.1 → 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 +0 -2
- package/lib/edge/index.cjs +4 -0
- package/lib/edge/index.d.ts +1 -0
- package/lib/edge/index.js +1 -0
- package/lib/src/client.d.ts +1 -1
- package/lib/src/index.cjs +20 -0
- package/lib/src/index.d.ts +1 -1
- package/lib/src/index.js +1 -1
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -6,8 +6,6 @@
|
|
|
6
6
|
|
|
7
7
|
The Logto Node.js SDK written in TypeScript. Check out our [docs](https://docs.logto.io/sdk/JavaScript/node/) for more information.
|
|
8
8
|
|
|
9
|
-
We also provide [文档](https://docs.logto.io/zh-cn/sdk/JavaScript/node/) in Simplified Chinese.
|
|
10
|
-
|
|
11
9
|
## Installation
|
|
12
10
|
|
|
13
11
|
### Using npm
|
package/lib/edge/index.cjs
CHANGED
package/lib/edge/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { LogtoConfig, ClientAdapter } from '@logto/client';
|
|
2
2
|
import BaseClient from '../src/client.js';
|
|
3
|
+
export { PersistKey } from '@logto/client';
|
|
3
4
|
export default class LogtoClient extends BaseClient {
|
|
4
5
|
constructor(config: LogtoConfig, adapter: Pick<ClientAdapter, 'navigate' | 'storage'>);
|
|
5
6
|
}
|
package/lib/edge/index.js
CHANGED
package/lib/src/client.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import BaseClient from '@logto/client';
|
|
|
2
2
|
import type { GetContextParameters, LogtoContext } from './types.js';
|
|
3
3
|
export type { LogtoContext, GetContextParameters } from './types.js';
|
|
4
4
|
export type { IdTokenClaims, LogtoErrorCode, LogtoConfig, LogtoClientErrorCode, Storage, StorageKey, InteractionMode, } from '@logto/client';
|
|
5
|
-
export { LogtoError,
|
|
5
|
+
export { LogtoError, LogtoRequestError, LogtoClientError, OidcError, Prompt, ReservedScope, UserScope, } from '@logto/client';
|
|
6
6
|
export default class LogtoNodeBaseClient extends BaseClient {
|
|
7
7
|
getContext: ({ getAccessToken, resource, fetchUserInfo, }?: GetContextParameters) => Promise<LogtoContext>;
|
|
8
8
|
}
|
package/lib/src/index.cjs
CHANGED
|
@@ -52,10 +52,18 @@ Object.defineProperty(exports, 'OidcError', {
|
|
|
52
52
|
enumerable: true,
|
|
53
53
|
get: function () { return BaseClient.OidcError; }
|
|
54
54
|
});
|
|
55
|
+
Object.defineProperty(exports, 'PersistKey', {
|
|
56
|
+
enumerable: true,
|
|
57
|
+
get: function () { return BaseClient.PersistKey; }
|
|
58
|
+
});
|
|
55
59
|
Object.defineProperty(exports, 'Prompt', {
|
|
56
60
|
enumerable: true,
|
|
57
61
|
get: function () { return BaseClient.Prompt; }
|
|
58
62
|
});
|
|
63
|
+
Object.defineProperty(exports, 'ReservedResource', {
|
|
64
|
+
enumerable: true,
|
|
65
|
+
get: function () { return BaseClient.ReservedResource; }
|
|
66
|
+
});
|
|
59
67
|
Object.defineProperty(exports, 'ReservedScope', {
|
|
60
68
|
enumerable: true,
|
|
61
69
|
get: function () { return BaseClient.ReservedScope; }
|
|
@@ -64,4 +72,16 @@ Object.defineProperty(exports, 'UserScope', {
|
|
|
64
72
|
enumerable: true,
|
|
65
73
|
get: function () { return BaseClient.UserScope; }
|
|
66
74
|
});
|
|
75
|
+
Object.defineProperty(exports, 'buildOrganizationUrn', {
|
|
76
|
+
enumerable: true,
|
|
77
|
+
get: function () { return BaseClient.buildOrganizationUrn; }
|
|
78
|
+
});
|
|
79
|
+
Object.defineProperty(exports, 'getOrganizationIdFromUrn', {
|
|
80
|
+
enumerable: true,
|
|
81
|
+
get: function () { return BaseClient.getOrganizationIdFromUrn; }
|
|
82
|
+
});
|
|
83
|
+
Object.defineProperty(exports, 'organizationUrnPrefix', {
|
|
84
|
+
enumerable: true,
|
|
85
|
+
get: function () { return BaseClient.organizationUrnPrefix; }
|
|
86
|
+
});
|
|
67
87
|
exports.default = LogtoClient;
|
package/lib/src/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { LogtoConfig, ClientAdapter } from '@logto/client';
|
|
|
2
2
|
import BaseClient from './client.js';
|
|
3
3
|
export type { LogtoContext, GetContextParameters } from './types.js';
|
|
4
4
|
export type { IdTokenClaims, LogtoErrorCode, LogtoConfig, LogtoClientErrorCode, Storage, StorageKey, InteractionMode, } from '@logto/client';
|
|
5
|
-
export { LogtoError,
|
|
5
|
+
export { LogtoError, LogtoRequestError, LogtoClientError, OidcError, Prompt, ReservedScope, ReservedResource, UserScope, organizationUrnPrefix, buildOrganizationUrn, getOrganizationIdFromUrn, PersistKey, } from '@logto/client';
|
|
6
6
|
export default class LogtoClient extends BaseClient {
|
|
7
7
|
constructor(config: LogtoConfig, adapter: Pick<ClientAdapter, 'navigate' | 'storage'>);
|
|
8
8
|
}
|
package/lib/src/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequester } from '@logto/client';
|
|
2
|
-
export { LogtoClientError, LogtoError, LogtoRequestError, OidcError, Prompt, ReservedScope, UserScope } from '@logto/client';
|
|
2
|
+
export { LogtoClientError, LogtoError, LogtoRequestError, OidcError, PersistKey, Prompt, ReservedResource, ReservedScope, UserScope, buildOrganizationUrn, getOrganizationIdFromUrn, organizationUrnPrefix } from '@logto/client';
|
|
3
3
|
import fetch from 'node-fetch';
|
|
4
4
|
import LogtoNodeBaseClient from './client.js';
|
|
5
5
|
import { generateCodeChallenge, generateCodeVerifier, generateState } from './utils/generators.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@logto/node",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./lib/src/index.cjs",
|
|
6
6
|
"module": "./lib/src/index.js",
|
|
@@ -27,24 +27,24 @@
|
|
|
27
27
|
"directory": "packages/node"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@logto/client": "^2.
|
|
30
|
+
"@logto/client": "^2.3.0",
|
|
31
31
|
"@silverhand/essentials": "^2.6.2",
|
|
32
32
|
"js-base64": "^3.7.4",
|
|
33
33
|
"node-fetch": "^2.6.7"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@silverhand/eslint-config": "^
|
|
37
|
-
"@silverhand/ts-config": "^
|
|
36
|
+
"@silverhand/eslint-config": "^4.0.1",
|
|
37
|
+
"@silverhand/ts-config": "^4.0.0",
|
|
38
38
|
"@swc/core": "^1.3.7",
|
|
39
39
|
"@swc/jest": "^0.2.24",
|
|
40
40
|
"@types/jest": "^29.5.0",
|
|
41
41
|
"@types/node": "^18.15.11",
|
|
42
|
-
"eslint": "^8.
|
|
42
|
+
"eslint": "^8.44.0",
|
|
43
43
|
"jest": "^29.5.0",
|
|
44
|
-
"jest-location-mock": "^
|
|
44
|
+
"jest-location-mock": "^2.0.0",
|
|
45
45
|
"jest-matcher-specific-error": "^1.0.0",
|
|
46
|
-
"lint-staged": "^
|
|
47
|
-
"prettier": "^
|
|
46
|
+
"lint-staged": "^15.0.0",
|
|
47
|
+
"prettier": "^3.0.0",
|
|
48
48
|
"typescript": "^5.0.0"
|
|
49
49
|
},
|
|
50
50
|
"eslintConfig": {
|