@line/liff
Advanced tools
Comparing version 2.11.1 to 2.12.0
@@ -1,7 +0,23 @@ | ||
/** | ||
* Performs the LINE Login process (web login) for the Web app. | ||
* @export | ||
*/ | ||
export default function login(loginConfig?: { | ||
import { LiffModule } from '../core/types'; | ||
import { ModuleDriver } from '../core/driver'; | ||
declare type Login = (config?: { | ||
redirectUri?: string; | ||
}): void; | ||
}) => void; | ||
export interface ExtendLiffCore { | ||
login: Login; | ||
} | ||
export declare type Option = void | { | ||
redirectUri?: string; | ||
}; | ||
export declare class LoginModule implements LiffModule<Login> { | ||
private driver; | ||
constructor(driver: ModuleDriver); | ||
get name(): string; | ||
install(): Login; | ||
/** | ||
* Performs the LINE Login process (web login) for the Web app. | ||
* @export | ||
*/ | ||
private login; | ||
} | ||
export {}; |
import { LiffCore } from '../liff'; | ||
import { ModuleDriverImpl } from './driver'; | ||
import { ExtendLiffCore as ExtendLiffCoreInit } from '../init'; | ||
import { ExtendLiffCore as ExtendLiffCoreAnalytics } from '../analytics'; | ||
import { ExtendLiffCore as ExtendLiffCoreIsInSubWindow } from '../common/isInSubWindow'; | ||
import { ExtendLiffCorePermanentLink } from '../../lib/auth/permanentLink'; | ||
export declare type LiffModules = ExtendLiffCoreIsInSubWindow & ExtendLiffCorePermanentLink; | ||
export declare const driver: ModuleDriverImpl; | ||
import { ExtendLiffCorePermanentLink } from '../auth/permanentLink'; | ||
import { ExtendLiffCore as ExtendLiffCoreLogin } from '../auth/login'; | ||
import { LiffExtendableFunctions } from '../init/definition/LiffExtension'; | ||
export declare type LiffModules = LiffExtendableFunctions & ExtendLiffCoreIsInSubWindow & ExtendLiffCorePermanentLink & ExtendLiffCoreInit & ExtendLiffCoreAnalytics & ExtendLiffCoreLogin; | ||
export declare function injectModules(liff: LiffCore): void; |
import { ModuleContext } from './context'; | ||
import { Query } from '../util/qs/parse'; | ||
import { Option } from '../auth/login'; | ||
export declare type SyncHookFunc<T extends readonly unknown[] = []> = (...args: T) => void; | ||
@@ -6,6 +8,9 @@ export declare type AsyncHookFunc<T extends readonly unknown[] = []> = (...args: T) => Promise<void>; | ||
export interface AsyncHooks { | ||
startInit?: HookFunc<[Query]>; | ||
beforeInitFinished?: HookFunc; | ||
beforeInitSuccess?: HookFunc; | ||
initError?: HookFunc<[Error]>; | ||
} | ||
export interface SyncHooks { | ||
[name: string]: SyncHookFunc; | ||
beforeLogin?: SyncHookFunc<[Option]>; | ||
} | ||
@@ -12,0 +17,0 @@ export declare type Hooks = AsyncHooks & SyncHooks; |
import { LiffCore } from '../liff'; | ||
import { Analytics } from '../uts'; | ||
import { LiffModule } from '../core/types'; | ||
import { ModuleDriver } from '../core/driver'; | ||
import { AnalyticsOption } from '../analytics/types'; | ||
export interface Config { | ||
liffId: string; | ||
analytics?: Analytics; | ||
analytics?: AnalyticsOption; | ||
} | ||
/** | ||
* Initializes a LIFF app. | ||
* You can only call other LIFF SDK methods after calling liff.init(). | ||
* The LIFF SDK gets access tokens and ID tokens from the LINE platform | ||
* when you initialize the LIFF app. | ||
*/ | ||
export default function init(this: LiffCore, config: Config, successCallback?: () => void, errorCallback?: (error: Error) => void): Promise<void>; | ||
declare type Init = (config: Config, successCallback?: () => void, errorCallback?: (error: Error) => void) => Promise<void>; | ||
export declare type ExtendLiffCore = { | ||
init: Init; | ||
}; | ||
export declare class InitModule implements LiffModule<Init> { | ||
private liffCore; | ||
private moduleDriver; | ||
constructor(liffCore: LiffCore, moduleDriver: ModuleDriver); | ||
get name(): string; | ||
install(): Init; | ||
/** | ||
* Initializes a LIFF app. | ||
* You can only call other LIFF SDK methods after calling liff.init(). | ||
* The LIFF SDK gets access tokens and ID tokens from the LINE platform | ||
* when you initialize the LIFF app. | ||
* @export | ||
* @param { liffId: string } config | ||
* @param {Function} [successCallback] | ||
* @param {Function} [errorCallback] | ||
* @returns {Promise<any>} | ||
*/ | ||
private init; | ||
} | ||
export {}; |
@@ -1,4 +0,4 @@ | ||
import { LiffCore } from '../liff'; | ||
import { Config } from './index'; | ||
import { ModuleDriver } from '../core/driver'; | ||
export declare type SubsequentInit = (config: Config) => Promise<void>; | ||
export default function subsequentInit(liff: LiffCore, config: Config): Promise<void>; | ||
export default function subsequentInit(config: Config, moduleDriver: ModuleDriver): Promise<void>; |
@@ -1,2 +0,1 @@ | ||
import init from './init'; | ||
import getOS from './common/getOS'; | ||
@@ -7,6 +6,4 @@ import getVersion from './common/getVersion'; | ||
import isLoggedIn from './auth/isLoggedIn'; | ||
import login from './auth/login'; | ||
import logout from './auth/logout'; | ||
import { getAccessToken, getContext, getIDToken, getDecodedIDToken } from './store'; | ||
import { LiffUTS } from './uts/types'; | ||
import { dispatch, call, postMessage, addListener, removeListener } from './client/bridge'; | ||
@@ -23,9 +20,4 @@ import openWindow from './client/openWindow'; | ||
import getFriendship from './api/getFriendship'; | ||
import { LiffExtendableFunctions } from './init/definition/LiffExtension'; | ||
import { LiffModules } from './core'; | ||
interface LiffUts { | ||
analytics: LiffUTS; | ||
} | ||
declare const liffCore: { | ||
init: typeof init; | ||
getOS: typeof getOS; | ||
@@ -36,3 +28,2 @@ getVersion: typeof getVersion; | ||
isLoggedIn: typeof isLoggedIn; | ||
login: typeof login; | ||
logout: typeof logout; | ||
@@ -75,5 +66,5 @@ getAccessToken: typeof getAccessToken; | ||
}; | ||
export declare type LiffCore = typeof liffCore & Partial<LiffUts>; | ||
declare type Liff = LiffCore & LiffExtendableFunctions & LiffModules; | ||
export declare type LiffCore = typeof liffCore; | ||
declare type Liff = LiffCore & LiffModules; | ||
declare const liff: Liff; | ||
export default liff; |
@@ -6,2 +6,3 @@ import get from './get'; | ||
import { Config } from '../init'; | ||
import { Permission } from './isPermissionAvailable'; | ||
declare const _default: { | ||
@@ -154,2 +155,6 @@ get: typeof get; | ||
}; | ||
skipChannelVerificationScreen: { | ||
permission: boolean; | ||
minVer: string; | ||
}; | ||
}; | ||
@@ -176,2 +181,3 @@ /** | ||
}; | ||
scope: Array<Permission>; | ||
} | ||
@@ -201,22 +207,1 @@ export declare function getContext(): Context | null; | ||
export declare function getIsSubsequentLiffApp(): boolean; | ||
/** | ||
* store referrer from URL [memory] | ||
*/ | ||
export declare function setReferrer(obj: Record<string, string>): void; | ||
export declare function getReferrer(): undefined | Record<string, string>; | ||
declare const utsExtra: { | ||
isLiffSuccessful: boolean; | ||
isLoggedIn: boolean; | ||
id: string; | ||
version: string; | ||
}; | ||
declare type DeepPartial<T> = { | ||
[P in keyof T]?: DeepPartial<T[P]>; | ||
}; | ||
declare type UtsExtra = typeof utsExtra; | ||
/** | ||
* store value for uts.setExtra('liff') | ||
* @param _utsExtra | ||
*/ | ||
export declare function assignUtsExtra(_utsExtra: DeepPartial<UtsExtra>): void; | ||
export declare function getUtsExtra(): UtsExtra; |
export declare type ElementType<T extends ReadonlyArray<unknown>> = T extends ReadonlyArray<infer ElementType> ? ElementType : never; | ||
export declare type DeepPartial<T> = { | ||
[P in keyof T]?: DeepPartial<T[P]>; | ||
}; |
{ | ||
"name": "@line/liff", | ||
"version": "2.11.1", | ||
"version": "2.12.0", | ||
"main": "dist/lib/index.js", | ||
@@ -17,4 +17,4 @@ "types": "dist/lib", | ||
"dev:watch:sdk": "webpack -w -c ./webpack.config.js", | ||
"dev-server": "port=${PORT:-8080}; protocol=${PROTOCOL:-http}; webpack-dev-server --entry=./lib/liff --output-filename=liff.js --output-library=liff --output-public-path=\"${protocol}://localhost:${port}/dist/\" --port ${port}", | ||
"dev-server:https": "PROTOCOL=https yarn dev-server --https --key=./.cert/localhost-key.pem --cert=./.cert/localhost.pem", | ||
"dev-server": "port=${PORT:-8080}; protocol=${PROTOCOL:-http}; host=${HOST:-localhost}; webpack-dev-server --entry=./lib/liff --output-filename=liff.js --output-library=liff --output-public-path=\"${protocol}://${host}:${port}/dist/\" --port ${port} --host 0.0.0.0 --disable-host-check", | ||
"dev-server:https": "key=${CERTIFICATE_KEY_FILE:-./.cert/localhost-key.pem}; cert=${CERTIFICATE_CERT_FILE:-./.cert/localhost.pem}; PROTOCOL=https yarn dev-server --https --key=${key} --cert=${cert}", | ||
"ds": "npm run dev-server", | ||
@@ -24,3 +24,4 @@ "check:forbidden-urls": "node .circleci/check-forbidden-url.js", | ||
"typecheck": "tsc --noEmit", | ||
"build:test": "NODE_ENV=test webpack --c ./webpack.config.js", | ||
"rm:dist": "rm -rf dist", | ||
"build_for_deploy": "webpack && cp -r dist/${NODE_ENV}/ dist/${NODE_ENV}-copied", | ||
"build:qa": "./script/build-qa.sh", | ||
@@ -31,3 +32,4 @@ "build:beta": "NODE_ENV=beta yarn build_for_deploy", | ||
"build:branch": "NODE_ENV=branch yarn build_for_deploy", | ||
"build_for_deploy": "webpack --c ./webpack.config.js && cp -r dist/${NODE_ENV}/ dist/${NODE_ENV}-copied", | ||
"prebuild:npm": "npm run rm:dist", | ||
"build:npm": "webpack --config webpack.config.npm.js", | ||
"deploy": "./script/deploy.sh", | ||
@@ -50,3 +52,3 @@ "deploy:test": "npm run deploy -- test", | ||
"deploy:branch": "npm run deploy -- branch", | ||
"prepublishOnly": "./script/build-package.sh" | ||
"prepublishOnly": "npm run build:npm" | ||
}, | ||
@@ -58,2 +60,3 @@ "dependencies": { | ||
"tiny-sha256": "^1.0.2", | ||
"tslib": "^2.3.0", | ||
"whatwg-fetch": "^3.0.0" | ||
@@ -87,8 +90,7 @@ }, | ||
"ts-loader": "6.2.2", | ||
"tslib": "2.1.0", | ||
"typescript": "3.8.3", | ||
"webpack": "4.42.1", | ||
"webpack-bundle-analyzer": "3.6.1", | ||
"webpack-cli": "3.3.11", | ||
"webpack-dev-server": "3.11.2" | ||
"webpack-dev-server": "3.11.2", | ||
"webpack-node-externals": "3.0.0" | ||
}, | ||
@@ -95,0 +97,0 @@ "husky": { |
Sorry, the diff of this file is too big to display
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
30
0
1829
130764
6
161
1
+ Addedtslib@^2.3.0
+ Addedtslib@2.8.1(transitive)