@logto/js 2.1.1 → 2.1.2
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/consts/index.cjs +10 -0
- package/lib/consts/index.d.ts +10 -0
- package/lib/consts/index.js +10 -0
- package/lib/types/index.d.ts +11 -0
- package/package.json +5 -5
package/lib/consts/index.cjs
CHANGED
|
@@ -32,9 +32,19 @@ exports.QueryKey = void 0;
|
|
|
32
32
|
// Need to align with the OIDC extraParams settings in core
|
|
33
33
|
QueryKey["InteractionMode"] = "interaction_mode";
|
|
34
34
|
})(exports.QueryKey || (exports.QueryKey = {}));
|
|
35
|
+
/** The prompt parameter to be used for the authorization request. */
|
|
35
36
|
exports.Prompt = void 0;
|
|
36
37
|
(function (Prompt) {
|
|
38
|
+
/**
|
|
39
|
+
* The Authorization Server MUST prompt the End-User for consent
|
|
40
|
+
* before returning information to the Client.
|
|
41
|
+
*/
|
|
37
42
|
Prompt["Consent"] = "consent";
|
|
43
|
+
/**
|
|
44
|
+
* The Authorization Server MUST prompt the End-User for re-authentication,
|
|
45
|
+
* forcing the user to log in again. Note the there'll be no Refresh Token
|
|
46
|
+
* returned in this case.
|
|
47
|
+
*/
|
|
38
48
|
Prompt["Login"] = "login";
|
|
39
49
|
})(exports.Prompt || (exports.Prompt = {}));
|
|
40
50
|
// TODO: @sijie @charles find a proper way to sync scopes constants with core
|
package/lib/consts/index.d.ts
CHANGED
|
@@ -29,8 +29,18 @@ export declare enum QueryKey {
|
|
|
29
29
|
Token = "token",
|
|
30
30
|
InteractionMode = "interaction_mode"
|
|
31
31
|
}
|
|
32
|
+
/** The prompt parameter to be used for the authorization request. */
|
|
32
33
|
export declare enum Prompt {
|
|
34
|
+
/**
|
|
35
|
+
* The Authorization Server MUST prompt the End-User for consent
|
|
36
|
+
* before returning information to the Client.
|
|
37
|
+
*/
|
|
33
38
|
Consent = "consent",
|
|
39
|
+
/**
|
|
40
|
+
* The Authorization Server MUST prompt the End-User for re-authentication,
|
|
41
|
+
* forcing the user to log in again. Note the there'll be no Refresh Token
|
|
42
|
+
* returned in this case.
|
|
43
|
+
*/
|
|
34
44
|
Login = "login"
|
|
35
45
|
}
|
|
36
46
|
export declare enum ReservedScope {
|
package/lib/consts/index.js
CHANGED
|
@@ -30,9 +30,19 @@ var QueryKey;
|
|
|
30
30
|
// Need to align with the OIDC extraParams settings in core
|
|
31
31
|
QueryKey["InteractionMode"] = "interaction_mode";
|
|
32
32
|
})(QueryKey || (QueryKey = {}));
|
|
33
|
+
/** The prompt parameter to be used for the authorization request. */
|
|
33
34
|
var Prompt;
|
|
34
35
|
(function (Prompt) {
|
|
36
|
+
/**
|
|
37
|
+
* The Authorization Server MUST prompt the End-User for consent
|
|
38
|
+
* before returning information to the Client.
|
|
39
|
+
*/
|
|
35
40
|
Prompt["Consent"] = "consent";
|
|
41
|
+
/**
|
|
42
|
+
* The Authorization Server MUST prompt the End-User for re-authentication,
|
|
43
|
+
* forcing the user to log in again. Note the there'll be no Refresh Token
|
|
44
|
+
* returned in this case.
|
|
45
|
+
*/
|
|
36
46
|
Prompt["Login"] = "login";
|
|
37
47
|
})(Prompt || (Prompt = {}));
|
|
38
48
|
// TODO: @sijie @charles find a proper way to sync scopes constants with core
|
package/lib/types/index.d.ts
CHANGED
|
@@ -2,5 +2,16 @@ export type LogtoRequestErrorBody = {
|
|
|
2
2
|
code: string;
|
|
3
3
|
message: string;
|
|
4
4
|
};
|
|
5
|
+
/**
|
|
6
|
+
* A request function that accepts a `fetch`-like function parameters and returns
|
|
7
|
+
* a promise with the parsed response body.
|
|
8
|
+
*/
|
|
5
9
|
export type Requester = <T>(...args: Parameters<typeof fetch>) => Promise<T>;
|
|
10
|
+
/**
|
|
11
|
+
* The interaction mode to be used for the authorization request. Note it's not
|
|
12
|
+
* a part of the OIDC standard, but a Logto-specific extension.
|
|
13
|
+
*
|
|
14
|
+
* - `signIn`: The authorization request will be initiated with a sign-in page.
|
|
15
|
+
* - `signUp`: The authorization request will be initiated with a sign-up page.
|
|
16
|
+
*/
|
|
6
17
|
export type InteractionMode = 'signIn' | 'signUp';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@logto/js",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./lib/index.cjs",
|
|
6
6
|
"module": "./lib/index.js",
|
|
@@ -25,19 +25,19 @@
|
|
|
25
25
|
"jose": "^4.13.2"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@silverhand/eslint-config": "^
|
|
29
|
-
"@silverhand/ts-config": "^
|
|
28
|
+
"@silverhand/eslint-config": "^4.0.1",
|
|
29
|
+
"@silverhand/ts-config": "^4.0.0",
|
|
30
30
|
"@swc/core": "^1.3.50",
|
|
31
31
|
"@swc/jest": "^0.2.24",
|
|
32
32
|
"@types/jest": "^29.5.1",
|
|
33
33
|
"@types/node": "^18.0.0",
|
|
34
|
-
"eslint": "^8.
|
|
34
|
+
"eslint": "^8.44.0",
|
|
35
35
|
"jest": "^29.5.0",
|
|
36
36
|
"jest-environment-jsdom": "^29.5.0",
|
|
37
37
|
"jest-matcher-specific-error": "^1.0.0",
|
|
38
38
|
"lint-staged": "^13.0.0",
|
|
39
39
|
"nock": "^13.3.0",
|
|
40
|
-
"prettier": "^
|
|
40
|
+
"prettier": "^3.0.0",
|
|
41
41
|
"rollup": "^3.20.2",
|
|
42
42
|
"text-encoder": "^0.0.4",
|
|
43
43
|
"type-fest": "^3.0.0",
|