@openpass/openpass-js-sdk
Advanced tools
Comparing version 4.5.4-pre-release to 4.5.4
@@ -6,3 +6,3 @@ { | ||
"license": "MIT", | ||
"version": "4.5.4-pre-release", | ||
"version": "4.5.4", | ||
"repository": { | ||
@@ -9,0 +9,0 @@ "type": "git", |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.INLINE_SIGN_IN_OUTGOING_MESSAGE_TYPE = exports.QUICK_AUTH_MESSAGE_TYPE = exports.PARAM_CODE_INLINE_SIGN_IN_FORM_AUTH_MODE = exports.PARAM_CODE_INLINE_SIGN_IN_FORM_HIDE_HEADER_TEXT = exports.PARAM_CODE_INLINE_SIGN_IN_FORM_HIDE_CLIENT_APPLICATION_LOGO = exports.PARAM_CODE_INLINE_SIGN_IN_FORM_SIGN_IN_BUTTON_BACKGROUND_HEX_COLOUR = exports.PARAM_CODE_INLINE_SIGN_IN_FORM_SIGN_IN_BUTTON_TEXT = exports.PARAM_CODE_DISABLE_LOGIN_HINT_EDITING = exports.PARAM_CODE_CONSENT_TOKEN_JWT = exports.PARAM_CODE_LOGIN_HINT = exports.POPUP_MESSAGE_SOURCE = exports.PARAM_SIGN_IN_SOURCE = exports.PARAM_CODE_RESPONSE_MODE_MESSAGE = exports.PARAM_CODE_RESPONSE_MODE = exports.PARAM_ERROR_URI = exports.PARAM_ERROR_DESCRIPTION = exports.PARAM_ERROR = exports.PARAM_GRANT_TYPE_VALUE = exports.PARAM_CODE = exports.PARAM_SCOPE_VALUE = exports.PARAM_SCOPE = exports.PARAM_RESPONSE_TYPE_VALUE = exports.PARAM_CODE_CHALLENGE_METHOD_VALUE = exports.PARAM_CODE_CHALLENGE_METHOD = exports.PARAM_CODE_CHALLENGE = exports.PARAM_CLIENT_ID = exports.PARAM_RESPONSE_TYPE = exports.PARAM_REDIRECT_URI = exports.PARAM_STATE = exports.PARAM_SDK_VERSION = exports.PARAM_SDK_NAME = exports.HEADER_SDK_VERSION = exports.HEADER_SDK_NAME = exports.SDK_NAME = void 0; | ||
exports.INLINE_SIGN_IN_OUTGOING_MESSAGE_TYPE = exports.QUICK_AUTH_MESSAGE_TYPE = exports.PARAM_CODE_INLINE_SIGN_IN_FORM_DARK_MODE = exports.PARAM_CODE_INLINE_SIGN_IN_FORM_AUTH_MODE = exports.PARAM_CODE_INLINE_SIGN_IN_FORM_HIDE_HEADER_TEXT = exports.PARAM_CODE_INLINE_SIGN_IN_FORM_HIDE_CLIENT_APPLICATION_LOGO = exports.PARAM_CODE_INLINE_SIGN_IN_FORM_SIGN_IN_BUTTON_BACKGROUND_HEX_COLOUR = exports.PARAM_CODE_INLINE_SIGN_IN_FORM_SIGN_IN_BUTTON_TEXT = exports.PARAM_CODE_DISABLE_LOGIN_HINT_EDITING = exports.PARAM_CODE_CONSENT_TOKEN_JWT = exports.PARAM_CODE_LOGIN_HINT = exports.POPUP_MESSAGE_SOURCE = exports.PARAM_SIGN_IN_SOURCE = exports.PARAM_CODE_RESPONSE_MODE_MESSAGE = exports.PARAM_CODE_RESPONSE_MODE = exports.PARAM_ERROR_URI = exports.PARAM_ERROR_DESCRIPTION = exports.PARAM_ERROR = exports.PARAM_GRANT_TYPE_VALUE = exports.PARAM_CODE = exports.PARAM_SCOPE_VALUE = exports.PARAM_SCOPE = exports.PARAM_RESPONSE_TYPE_VALUE = exports.PARAM_CODE_CHALLENGE_METHOD_VALUE = exports.PARAM_CODE_CHALLENGE_METHOD = exports.PARAM_CODE_CHALLENGE = exports.PARAM_CLIENT_ID = exports.PARAM_RESPONSE_TYPE = exports.PARAM_REDIRECT_URI = exports.PARAM_STATE = exports.PARAM_SDK_VERSION = exports.PARAM_SDK_NAME = exports.HEADER_SDK_VERSION = exports.HEADER_SDK_NAME = exports.SDK_NAME = void 0; | ||
exports.SDK_NAME = "openpass-js-sdk"; | ||
@@ -36,2 +36,3 @@ exports.HEADER_SDK_NAME = "OpenPass-SDK-Name"; | ||
exports.PARAM_CODE_INLINE_SIGN_IN_FORM_AUTH_MODE = "auth_mode"; | ||
exports.PARAM_CODE_INLINE_SIGN_IN_FORM_DARK_MODE = "dark_mode_enabled"; | ||
// The owner of this is the API, all changes to values should be introduced there first | ||
@@ -38,0 +39,0 @@ exports.QUICK_AUTH_MESSAGE_TYPE = { |
@@ -61,2 +61,5 @@ "use strict"; | ||
} | ||
if (!["boolean", "undefined"].includes(typeof inlineSignInOptions.darkModeEnabled)) { | ||
throw new errors_1.SdkError("Invalid darkModeEnabled value. Must be true or false."); | ||
} | ||
const popupSuccessCallback = inlineSignInOptions.popupSuccessCallback; | ||
@@ -152,2 +155,5 @@ const popupFailureCallback = inlineSignInOptions.popupFailureCallback; | ||
} | ||
if (inlineSignInOptions.darkModeEnabled) { | ||
inlineSignInFrameUrl.searchParams.append(constants_1.PARAM_CODE_INLINE_SIGN_IN_FORM_DARK_MODE, inlineSignInOptions.darkModeEnabled.toString()); | ||
} | ||
inlineSignInIFrame.src = inlineSignInFrameUrl.toString(); | ||
@@ -154,0 +160,0 @@ inlineSignInIFrame.width = (_d = (_c = inlineSignInOptions.widthInPixels) === null || _c === void 0 ? void 0 : _c.toString()) !== null && _d !== void 0 ? _d : "100%"; |
@@ -155,2 +155,3 @@ "use strict"; | ||
* @param {number} [options.heightInPixels] Sets the height of the inline sign-in form iFrame. Defaults to 100% if not specified. | ||
* @param {boolean} [options.darkModeEnabled] Enables dark mode for the inline sign-in form. Defaults to false if not specified. | ||
* @throws {SdkError} If the required options are missing. | ||
@@ -157,0 +158,0 @@ */ |
@@ -6,3 +6,3 @@ { | ||
"license": "MIT", | ||
"version": "4.5.4-pre-release", | ||
"version": "4.5.4", | ||
"repository": { | ||
@@ -9,0 +9,0 @@ "type": "git", |
@@ -33,2 +33,3 @@ export const SDK_NAME = "openpass-js-sdk"; | ||
export const PARAM_CODE_INLINE_SIGN_IN_FORM_AUTH_MODE = "auth_mode"; | ||
export const PARAM_CODE_INLINE_SIGN_IN_FORM_DARK_MODE = "dark_mode_enabled"; | ||
// The owner of this is the API, all changes to values should be introduced there first | ||
@@ -35,0 +36,0 @@ export const QUICK_AUTH_MESSAGE_TYPE = { |
@@ -11,3 +11,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
import { getOpenPassApiBaseUrl } from "../config"; | ||
import { INLINE_SIGN_IN_OUTGOING_MESSAGE_TYPE, PARAM_CODE_INLINE_SIGN_IN_FORM_AUTH_MODE, PARAM_CODE_INLINE_SIGN_IN_FORM_HIDE_CLIENT_APPLICATION_LOGO, PARAM_CODE_INLINE_SIGN_IN_FORM_HIDE_HEADER_TEXT, PARAM_CODE_INLINE_SIGN_IN_FORM_SIGN_IN_BUTTON_BACKGROUND_HEX_COLOUR, PARAM_CODE_INLINE_SIGN_IN_FORM_SIGN_IN_BUTTON_TEXT, } from "./constants"; | ||
import { INLINE_SIGN_IN_OUTGOING_MESSAGE_TYPE, PARAM_CODE_INLINE_SIGN_IN_FORM_AUTH_MODE, PARAM_CODE_INLINE_SIGN_IN_FORM_DARK_MODE, PARAM_CODE_INLINE_SIGN_IN_FORM_HIDE_CLIENT_APPLICATION_LOGO, PARAM_CODE_INLINE_SIGN_IN_FORM_HIDE_HEADER_TEXT, PARAM_CODE_INLINE_SIGN_IN_FORM_SIGN_IN_BUTTON_BACKGROUND_HEX_COLOUR, PARAM_CODE_INLINE_SIGN_IN_FORM_SIGN_IN_BUTTON_TEXT, } from "./constants"; | ||
import { SdkError } from "./error/errors"; | ||
@@ -60,2 +60,5 @@ import { matchesEventOrigin } from "./url"; | ||
} | ||
if (!["boolean", "undefined"].includes(typeof inlineSignInOptions.darkModeEnabled)) { | ||
throw new SdkError("Invalid darkModeEnabled value. Must be true or false."); | ||
} | ||
const popupSuccessCallback = inlineSignInOptions.popupSuccessCallback; | ||
@@ -151,2 +154,5 @@ const popupFailureCallback = inlineSignInOptions.popupFailureCallback; | ||
} | ||
if (inlineSignInOptions.darkModeEnabled) { | ||
inlineSignInFrameUrl.searchParams.append(PARAM_CODE_INLINE_SIGN_IN_FORM_DARK_MODE, inlineSignInOptions.darkModeEnabled.toString()); | ||
} | ||
inlineSignInIFrame.src = inlineSignInFrameUrl.toString(); | ||
@@ -153,0 +159,0 @@ inlineSignInIFrame.width = (_d = (_c = inlineSignInOptions.widthInPixels) === null || _c === void 0 ? void 0 : _c.toString()) !== null && _d !== void 0 ? _d : "100%"; |
@@ -150,2 +150,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
* @param {number} [options.heightInPixels] Sets the height of the inline sign-in form iFrame. Defaults to 100% if not specified. | ||
* @param {boolean} [options.darkModeEnabled] Enables dark mode for the inline sign-in form. Defaults to false if not specified. | ||
* @throws {SdkError} If the required options are missing. | ||
@@ -152,0 +153,0 @@ */ |
@@ -33,2 +33,3 @@ export declare const SDK_NAME = "openpass-js-sdk"; | ||
export declare const PARAM_CODE_INLINE_SIGN_IN_FORM_AUTH_MODE = "auth_mode"; | ||
export declare const PARAM_CODE_INLINE_SIGN_IN_FORM_DARK_MODE = "dark_mode_enabled"; | ||
export declare const QUICK_AUTH_MESSAGE_TYPE: { | ||
@@ -35,0 +36,0 @@ readonly Continue: "openpass-quick-auth-continue-button-message"; |
@@ -107,2 +107,3 @@ import { InlineSignInOptions, OpenPassClientAuth, SignInButtonOptions, OpenPassOptions, RedirectSignInOptions, PopupSignInOptions, SignInResponse, QuickAuthSignInOptions, AuthorizeDeviceData, AuthorizeDeviceOptions, DeviceTokenWithStatus, DeviceTokenOptions } from "../types"; | ||
* @param {number} [options.heightInPixels] Sets the height of the inline sign-in form iFrame. Defaults to 100% if not specified. | ||
* @param {boolean} [options.darkModeEnabled] Enables dark mode for the inline sign-in form. Defaults to false if not specified. | ||
* @throws {SdkError} If the required options are missing. | ||
@@ -109,0 +110,0 @@ */ |
@@ -202,2 +202,6 @@ import { SdkError } from "./auth/error/errors"; | ||
/** | ||
* Enables dark mode for the inline sign-in form. Defaults to false if not specified. | ||
*/ | ||
darkModeEnabled?: boolean; | ||
/** | ||
* Applies only to the popup option. This function is called when sign-in is successful. It receives a SignInResponse object as a parameter. | ||
@@ -204,0 +208,0 @@ * @param response |
@@ -6,3 +6,3 @@ { | ||
"license": "MIT", | ||
"version": "4.5.4-pre-release", | ||
"version": "4.5.4", | ||
"repository": { | ||
@@ -9,0 +9,0 @@ "type": "git", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1091811
7161
1