Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@liff/server-api

Package Overview
Dependencies
Maintainers
2
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@liff/server-api - npm Package Compare versions

Comparing version 2.21.1 to 2.21.2

2

lib/index.cjs.js

@@ -1,1 +0,1 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("@liff/consts"),r=require("@liff/util"),a=require("@liff/store");function n(a){return e.__awaiter(this,void 0,void 0,(function(){var n,i,s;return e.__generator(this,(function(e){switch(e.label){case 0:if(!a.ok)return[3,4];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,a.json()];case 2:return[2,e.sent()];case 3:return e.sent(),[2,a];case 4:return n=String(a.status),i=r.HTTPStatusCodes.has(n)?n:t.UNKNOWN,[4,a.json().catch((function(){throw r.createLiffError(i,a.statusText)}))];case 5:throw s=e.sent(),r.createLiffError(s.error||i,s.error_description||s.message)}}))}))}function i(n){var i=function(e){if(e)return e;var n=a.getAccessToken();if(!n)throw r.createLiffError(t.UNAUTHORIZED,"Need access_token for api call, Please login first");return{"Content-Type":"application/json",Accept:"application/json",Authorization:"Bearer "+n}}(n&&n.headers);return e.__assign(e.__assign({},n),{headers:i})}function s(e,t){var r;try{r=i(t)}catch(a){return Promise.reject(a)}return fetch(e,r).then(n)}function o(e){var t=e.subdomain;return"https://"+(void 0===t?"api":t)+".line.me/"+e.pathname}var u={token:o({pathname:"oauth2/v2.1/token"}),certs:o({pathname:"oauth2/v2.1/certs"}),"openid-configuration":o({subdomain:"access",pathname:".well-known/openid-configuration"}),authorize:o({subdomain:"access",pathname:"liff/v1/authorize"}),profile:o({pathname:"v2/profile"}),message:o({pathname:"message/v3/share"}),friendship:o({pathname:"friendship/v1/status"}),shareTargetPicker:o({subdomain:"access",pathname:"oauth2/v2.1/liff/shareTargetPicker"}),shareTargetPickerOtt:o({pathname:"liff/v2/apps"}),shareTargetPickerResult:o({subdomain:"access",pathname:"oauth2/v2.1/liff/shareTargetPicker/result"}),apps:o({pathname:"liff/v2/apps"}),subWindowGetMSIT:o({pathname:"liff/v2/sub/msit"}),subWindowGetMSTByMSIT:o({pathname:"liff/v2/sub/mst"}),subWindowSubscribe:o({subdomain:"liff",pathname:"liff/v2/sub/waitResult"}),subWindowPost:o({pathname:"liff/v2/sub/result"}),subWindowGetAppData:o({pathname:"liff/v2/sub/appData"}),subWindowGetOrigin:function(e){return o({pathname:"liff/v2/sub/"+e+"/origin"})},accessTokenVerify:o({pathname:"oauth2/v2.1/verify"}),unauthorizedPermissions:o({subdomain:"liff",pathname:"liff/v2/incrementalAgreement/unauthorizedPermissions"}),permanentLink:o({subdomain:"liff",pathname:"liff/v2/permanentLink"})};function c(e){return u[e]}exports.fetch=s,exports.getEndPoint=c,exports.requestWithoutErrorHandling=function(e,t){var r;try{r=i(t)}catch(a){return Promise.reject(a)}return fetch(e,r)},exports.verifyAccessToken=function(e){return s(c("accessTokenVerify")+"?access_token="+encodeURIComponent(e),{headers:{"Content-Type":"application/json",Accept:"application/json"}})};
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("@liff/consts"),a=require("@liff/util"),n=require("@liff/store");function r(n){return e.__awaiter(this,void 0,void 0,(function(){var r,i,s;return e.__generator(this,(function(e){switch(e.label){case 0:if(!n.ok)return[3,4];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,n.json()];case 2:return[2,e.sent()];case 3:return e.sent(),[2,n];case 4:return r=String(n.status),i=a.HTTPStatusCodes.has(r)?r:t.UNKNOWN,[4,n.json().catch((function(){throw a.createLiffError(i,n.statusText)}))];case 5:throw s=e.sent(),a.createLiffError(s.error||i,s.error_description||s.message)}}))}))}function i(r){var i=function(e){if(e)return e;var r=n.getAccessToken();if(!r)throw a.createLiffError(t.UNAUTHORIZED,"Need access_token for api call, Please login first");return{"Content-Type":"application/json",Accept:"application/json",Authorization:"Bearer ".concat(r)}}(r&&r.headers);return e.__assign(e.__assign({},r),{headers:i})}function s(e,t){var a;try{a=i(t)}catch(n){return Promise.reject(n)}return fetch(e,a).then(r)}function o(e){var t=e.subdomain,a=void 0===t?"api":t,n=e.pathname;return"https://".concat(a,".").concat("line.me","/").concat(n)}var c={token:o({pathname:"oauth2/v2.1/token"}),certs:o({pathname:"oauth2/v2.1/certs"}),"openid-configuration":o({subdomain:"access",pathname:".well-known/openid-configuration"}),authorize:o({subdomain:"access",pathname:"liff/v1/authorize"}),profile:o({pathname:"v2/profile"}),message:o({pathname:"message/v3/share"}),friendship:o({pathname:"friendship/v1/status"}),shareTargetPicker:o({subdomain:"access",pathname:"oauth2/v2.1/liff/shareTargetPicker"}),shareTargetPickerOtt:o({pathname:"liff/v2/apps"}),shareTargetPickerResult:o({subdomain:"access",pathname:"oauth2/v2.1/liff/shareTargetPicker/result"}),apps:o({pathname:"liff/v2/apps"}),subWindowGetMSIT:o({pathname:"liff/v2/sub/msit"}),subWindowGetMSTByMSIT:o({pathname:"liff/v2/sub/mst"}),subWindowSubscribe:o({subdomain:"liff",pathname:"liff/v2/sub/waitResult"}),subWindowPost:o({pathname:"liff/v2/sub/result"}),subWindowGetAppData:o({pathname:"liff/v2/sub/appData"}),subWindowGetOrigin:function(e){return o({pathname:"liff/v2/sub/".concat(e,"/origin")})},accessTokenVerify:o({pathname:"oauth2/v2.1/verify"}),unauthorizedPermissions:o({subdomain:"liff",pathname:"liff/v2/incrementalAgreement/unauthorizedPermissions"}),permanentLink:o({subdomain:"liff",pathname:"liff/v2/permanentLink"})};function u(e){return c[e]}exports.fetch=s,exports.getEndPoint=u,exports.requestWithoutErrorHandling=function(e,t){var a;try{a=i(t)}catch(n){return Promise.reject(n)}return fetch(e,a)},exports.verifyAccessToken=function(e){return s("".concat(u("accessTokenVerify"),"?access_token=").concat(encodeURIComponent(e)),{headers:{"Content-Type":"application/json",Accept:"application/json"}})};

@@ -1,1 +0,1 @@

import{__assign as e,__awaiter as t,__generator as a}from"tslib";import{UNKNOWN as n,UNAUTHORIZED as r}from"@liff/consts";import{createLiffError as i,HTTPStatusCodes as s}from"@liff/util";import{getAccessToken as o}from"@liff/store";function u(e){return t(this,void 0,void 0,(function(){var t,r,o;return a(this,(function(a){switch(a.label){case 0:if(!e.ok)return[3,4];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,e.json()];case 2:return[2,a.sent()];case 3:return a.sent(),[2,e];case 4:return t=String(e.status),r=s.has(t)?t:n,[4,e.json().catch((function(){throw i(r,e.statusText)}))];case 5:throw o=a.sent(),i(o.error||r,o.error_description||o.message)}}))}))}function f(t){var a=function(e){if(e)return e;var t=o();if(!t)throw i(r,"Need access_token for api call, Please login first");return{"Content-Type":"application/json",Accept:"application/json",Authorization:"Bearer "+t}}(t&&t.headers);return e(e({},t),{headers:a})}function c(e,t){var a;try{a=f(t)}catch(n){return Promise.reject(n)}return fetch(e,a).then(u)}function p(e,t){var a;try{a=f(t)}catch(n){return Promise.reject(n)}return fetch(e,a)}function h(e){var t=e.subdomain;return"https://"+(void 0===t?"api":t)+".line.me/"+e.pathname}var m={token:h({pathname:"oauth2/v2.1/token"}),certs:h({pathname:"oauth2/v2.1/certs"}),"openid-configuration":h({subdomain:"access",pathname:".well-known/openid-configuration"}),authorize:h({subdomain:"access",pathname:"liff/v1/authorize"}),profile:h({pathname:"v2/profile"}),message:h({pathname:"message/v3/share"}),friendship:h({pathname:"friendship/v1/status"}),shareTargetPicker:h({subdomain:"access",pathname:"oauth2/v2.1/liff/shareTargetPicker"}),shareTargetPickerOtt:h({pathname:"liff/v2/apps"}),shareTargetPickerResult:h({subdomain:"access",pathname:"oauth2/v2.1/liff/shareTargetPicker/result"}),apps:h({pathname:"liff/v2/apps"}),subWindowGetMSIT:h({pathname:"liff/v2/sub/msit"}),subWindowGetMSTByMSIT:h({pathname:"liff/v2/sub/mst"}),subWindowSubscribe:h({subdomain:"liff",pathname:"liff/v2/sub/waitResult"}),subWindowPost:h({pathname:"liff/v2/sub/result"}),subWindowGetAppData:h({pathname:"liff/v2/sub/appData"}),subWindowGetOrigin:function(e){return h({pathname:"liff/v2/sub/"+e+"/origin"})},accessTokenVerify:h({pathname:"oauth2/v2.1/verify"}),unauthorizedPermissions:h({subdomain:"liff",pathname:"liff/v2/incrementalAgreement/unauthorizedPermissions"}),permanentLink:h({subdomain:"liff",pathname:"liff/v2/permanentLink"})};function l(e){return m[e]}function v(e){return c(l("accessTokenVerify")+"?access_token="+encodeURIComponent(e),{headers:{"Content-Type":"application/json",Accept:"application/json"}})}export{c as fetch,l as getEndPoint,p as requestWithoutErrorHandling,v as verifyAccessToken};
import{__awaiter as e,__generator as t,__assign as a}from"tslib";import{UNKNOWN as n,UNAUTHORIZED as r}from"@liff/consts";import{createLiffError as i,HTTPStatusCodes as s}from"@liff/util";import{getAccessToken as o}from"@liff/store";function c(a){return e(this,void 0,void 0,(function(){var e,r,o;return t(this,(function(t){switch(t.label){case 0:if(!a.ok)return[3,4];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,a.json()];case 2:return[2,t.sent()];case 3:return t.sent(),[2,a];case 4:return e=String(a.status),r=s.has(e)?e:n,[4,a.json().catch((function(){throw i(r,a.statusText)}))];case 5:throw o=t.sent(),i(o.error||r,o.error_description||o.message)}}))}))}function u(e){var t=function(e){if(e)return e;var t=o();if(!t)throw i(r,"Need access_token for api call, Please login first");return{"Content-Type":"application/json",Accept:"application/json",Authorization:"Bearer ".concat(t)}}(e&&e.headers);return a(a({},e),{headers:t})}function f(e,t){var a;try{a=u(t)}catch(n){return Promise.reject(n)}return fetch(e,a).then(c)}function p(e,t){var a;try{a=u(t)}catch(n){return Promise.reject(n)}return fetch(e,a)}function h(e){var t=e.subdomain,a=void 0===t?"api":t,n=e.pathname;return"https://".concat(a,".").concat("line.me","/").concat(n)}var m={token:h({pathname:"oauth2/v2.1/token"}),certs:h({pathname:"oauth2/v2.1/certs"}),"openid-configuration":h({subdomain:"access",pathname:".well-known/openid-configuration"}),authorize:h({subdomain:"access",pathname:"liff/v1/authorize"}),profile:h({pathname:"v2/profile"}),message:h({pathname:"message/v3/share"}),friendship:h({pathname:"friendship/v1/status"}),shareTargetPicker:h({subdomain:"access",pathname:"oauth2/v2.1/liff/shareTargetPicker"}),shareTargetPickerOtt:h({pathname:"liff/v2/apps"}),shareTargetPickerResult:h({subdomain:"access",pathname:"oauth2/v2.1/liff/shareTargetPicker/result"}),apps:h({pathname:"liff/v2/apps"}),subWindowGetMSIT:h({pathname:"liff/v2/sub/msit"}),subWindowGetMSTByMSIT:h({pathname:"liff/v2/sub/mst"}),subWindowSubscribe:h({subdomain:"liff",pathname:"liff/v2/sub/waitResult"}),subWindowPost:h({pathname:"liff/v2/sub/result"}),subWindowGetAppData:h({pathname:"liff/v2/sub/appData"}),subWindowGetOrigin:function(e){return h({pathname:"liff/v2/sub/".concat(e,"/origin")})},accessTokenVerify:h({pathname:"oauth2/v2.1/verify"}),unauthorizedPermissions:h({subdomain:"liff",pathname:"liff/v2/incrementalAgreement/unauthorizedPermissions"}),permanentLink:h({subdomain:"liff",pathname:"liff/v2/permanentLink"})};function l(e){return m[e]}function v(e){return f("".concat(l("accessTokenVerify"),"?access_token=").concat(encodeURIComponent(e)),{headers:{"Content-Type":"application/json",Accept:"application/json"}})}export{f as fetch,l as getEndPoint,p as requestWithoutErrorHandling,v as verifyAccessToken};
{
"name": "@liff/server-api",
"version": "2.21.1",
"version": "2.21.2",
"description": "@liff/server-api",

@@ -24,5 +24,5 @@ "license": "SEE LICENSE IN README.md",

"build:npm": "rollup -c rollup.config.js",
"build:watch": "yarn build:npm -w --watch.include './src/**'",
"dev-server": "yarn build:watch",
"dev-server:https": "yarn build:watch",
"build:watch": "npm run build:npm -- --watch",
"dev-server": "npm run build:watch",
"dev-server:https": "npm run build:watch",
"build:prerelease": "rollup -c rollup.config.prerelease.js",

@@ -32,5 +32,5 @@ "clean": "rm -rf ./lib ./tsconfig.tsbuildinfo"

"dependencies": {
"@liff/consts": "2.21.1",
"@liff/store": "2.21.1",
"@liff/util": "2.21.1"
"@liff/consts": "2.21.2",
"@liff/store": "2.21.2",
"@liff/util": "2.21.2"
},

@@ -40,3 +40,3 @@ "peerDependencies": {

},
"gitHead": "9af2e0816a5cd5547b99e8cadba3ee274b270a9a"
"gitHead": "b43eee22bc2c90b85e9919820c557cc15fb9712c"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc