line-node 1.0.2 → 1.0.3
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/dist/index.cjs
CHANGED
|
@@ -1,15 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
3
|
var got = require('got');
|
|
6
4
|
var jwt = require('jsonwebtoken');
|
|
7
5
|
|
|
8
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
9
|
-
|
|
10
|
-
var got__default = /*#__PURE__*/_interopDefaultLegacy(got);
|
|
11
|
-
var jwt__default = /*#__PURE__*/_interopDefaultLegacy(jwt);
|
|
12
|
-
|
|
13
6
|
/**
|
|
14
7
|
* Generates a non-safe random string which can have duplicates around 7 million generations.
|
|
15
8
|
*/
|
|
@@ -56,7 +49,7 @@ function getParamsFromLoginCallback(callbackUrlTriggered) {
|
|
|
56
49
|
return queryObject;
|
|
57
50
|
}
|
|
58
51
|
|
|
59
|
-
const post =
|
|
52
|
+
const post = got.post;
|
|
60
53
|
/**
|
|
61
54
|
* (Node only) Makes a POST request to retrieve an access token from LINE. This uses GOT as a dependency to make the request.
|
|
62
55
|
* Can throw errors.
|
|
@@ -85,7 +78,7 @@ async function issueAccessToken(params) {
|
|
|
85
78
|
return body;
|
|
86
79
|
}
|
|
87
80
|
|
|
88
|
-
const { decode } =
|
|
81
|
+
const { decode } = jwt;
|
|
89
82
|
/**
|
|
90
83
|
* (Node only) Returns a decoded LINE id token. Uses the nodeJS 'jsonwebtoken' dependency.
|
|
91
84
|
* This id Token should be validated!
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* https://developers.line.biz/en/docs/line-login/integrate-line-login/#making-an-authorization-request
|
|
3
3
|
*/
|
|
4
|
-
export
|
|
4
|
+
export type LineLoginUrlParams = {
|
|
5
5
|
/**
|
|
6
6
|
* (Optional - default 'code') code. This tells the LINE Platform to return an authorization code.
|
|
7
7
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type LoginCallbackParamsSuccess = {
|
|
2
2
|
/**
|
|
3
3
|
* Authorization code used to get an access token. Valid for 10 minutes. This authorization code can only be used once.
|
|
4
4
|
*/
|
|
@@ -12,7 +12,7 @@ export declare type LoginCallbackParamsSuccess = {
|
|
|
12
12
|
*/
|
|
13
13
|
friendship_status_changed?: boolean;
|
|
14
14
|
};
|
|
15
|
-
export
|
|
15
|
+
export type LoginCallbackParamsError = {
|
|
16
16
|
/**
|
|
17
17
|
* (Optional) Error code.
|
|
18
18
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type IssueAccessTokenParams = {
|
|
2
2
|
/**
|
|
3
3
|
* (Optional - default: 'authorization_code') authorization_code. Specifies the grant type.
|
|
4
4
|
*/
|
|
@@ -27,7 +27,7 @@ export declare type IssueAccessTokenParams = {
|
|
|
27
27
|
*
|
|
28
28
|
* Returns status code 200 and a JSON object with the following information.
|
|
29
29
|
*/
|
|
30
|
-
export
|
|
30
|
+
export type IssueAccessTokenResponse = {
|
|
31
31
|
/**
|
|
32
32
|
* Access token. Valid for 30 days.
|
|
33
33
|
*/
|
package/package.json
CHANGED
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
"name": "line-node",
|
|
3
3
|
"sideEffects": false,
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "1.0.
|
|
5
|
+
"version": "1.0.3",
|
|
6
6
|
"description": "LINE SDK for TypeScript",
|
|
7
7
|
"module": "./dist/index.es.js",
|
|
8
8
|
"main": "./dist/index.cjs",
|
|
9
9
|
"types": "./dist/types/index.d.ts",
|
|
10
10
|
"exports": {
|
|
11
11
|
".": {
|
|
12
|
+
"types": "./dist/types/index.d.ts",
|
|
12
13
|
"import": "./dist/index.es.js",
|
|
13
|
-
"require": "./dist/index.cjs"
|
|
14
|
-
"types": "./dist/types/index.d.ts"
|
|
14
|
+
"require": "./dist/index.cjs"
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
17
|
"files": [
|
|
@@ -23,27 +23,27 @@
|
|
|
23
23
|
"scripts": {
|
|
24
24
|
"test": "echo na",
|
|
25
25
|
"lint": "tsc --noEmit && eslint ./src --ext .ts",
|
|
26
|
-
"build": "rollup -c ./scripts/build.js",
|
|
26
|
+
"build": "rollup --bundleConfigAsCjs -c ./scripts/build.js",
|
|
27
27
|
"release": "npm run lint && del dist && npm run build && np"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"got": "^11.8.
|
|
30
|
+
"got": "^11.8.6",
|
|
31
31
|
"jsonwebtoken": "^8.5.1"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@types/jsonwebtoken": "^8.5.
|
|
35
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
36
|
-
"@typescript-eslint/parser": "^5.
|
|
34
|
+
"@types/jsonwebtoken": "^8.5.9",
|
|
35
|
+
"@typescript-eslint/eslint-plugin": "^5.59.2",
|
|
36
|
+
"@typescript-eslint/parser": "^5.59.2",
|
|
37
37
|
"del-cli": "^4.0.1",
|
|
38
|
-
"eslint": "^8.
|
|
39
|
-
"eslint-config-prettier": "^8.
|
|
38
|
+
"eslint": "^8.40.0",
|
|
39
|
+
"eslint-config-prettier": "^8.8.0",
|
|
40
40
|
"eslint-plugin-tree-shaking": "^1.10.0",
|
|
41
|
-
"np": "^7.
|
|
42
|
-
"prettier": "^2.
|
|
43
|
-
"rollup": "^
|
|
44
|
-
"rollup-plugin-typescript2": "^0.
|
|
45
|
-
"typescript": "^4.
|
|
46
|
-
"vitest": "^0.
|
|
41
|
+
"np": "^7.7.0",
|
|
42
|
+
"prettier": "^2.8.8",
|
|
43
|
+
"rollup": "^3.21.5",
|
|
44
|
+
"rollup-plugin-typescript2": "^0.34.1",
|
|
45
|
+
"typescript": "^4.9.5",
|
|
46
|
+
"vitest": "^0.31.0"
|
|
47
47
|
},
|
|
48
48
|
"keywords": [
|
|
49
49
|
"line",
|