@forgerock/javascript-sdk
Advanced tools
Comparing version 3.3.1 to 3.4.0
@@ -31,2 +31,3 @@ /** | ||
TermsAndConditionsCallback = "TermsAndConditionsCallback", | ||
TextInputCallback = "TextInputCallback", | ||
TextOutputCallback = "TextOutputCallback", | ||
@@ -33,0 +34,0 @@ ValidatedCreatePasswordCallback = "ValidatedCreatePasswordCallback", |
@@ -17,3 +17,3 @@ import FRCallback from '.'; | ||
/** | ||
* Gets the polling interval in seconds. | ||
* Gets the polling interval in milliseconds. | ||
*/ | ||
@@ -20,0 +20,0 @@ getWaitTime(): number; |
@@ -24,2 +24,3 @@ import Auth from './auth'; | ||
import TermsAndConditionsCallback from './fr-auth/callbacks/terms-and-conditions-callback'; | ||
import TextInputCallback from './fr-auth/callbacks/text-input-callback'; | ||
import TextOutputCallback from './fr-auth/callbacks/text-output-callback'; | ||
@@ -50,2 +51,2 @@ import ValidatedCreatePasswordCallback from './fr-auth/callbacks/validated-create-password-callback'; | ||
import LocalStorage from './util/storage'; | ||
export { defaultMessageCreator, AttributeInputCallback, Auth, AuthResponse, Callback, CallbackContainer, CallbackType, ChoiceCallback, Config, ConfigOptions, ConfirmationCallback, Deferred, DeviceProfileCallback, Dispatcher, ErrorCode, FailureDetail, FRAuth, FRCallback, FRCallbackFactory, FRDevice, FREvent, FRLoginFailure, FRLoginSuccess, FRPolicy, FRRecoveryCodes, FRStep, FRStepHandler, FRUI, FRUser, FRWebAuthn, GetAuthorizationUrlOptions, GetOAuth2TokensOptions, GetTokensOptions, HiddenValueCallback, HttpClient, IdPValue, KbaCreateCallback, Listener, LocalStorage, MessageCreator, MetadataCallback, NameCallback, NameValue, OAuth2Client, OAuth2Tokens, PasswordCallback, PKCE, PolicyKey, PolicyRequirement, PollingWaitCallback, ProcessedPropertyError, ReCaptchaCallback, RedirectCallback, RelyingParty, ResponseType, SelectIdPCallback, SessionManager, Step, StepDetail, StepType, SuspendedTextOutputCallback, TermsAndConditionsCallback, TextOutputCallback, TokenManager, Tokens, TokenStorage, UserManager, ValidatedCreatePasswordCallback, ValidatedCreateUsernameCallback, ValidConfigOptions, WebAuthnAuthenticationMetadata, WebAuthnCallbacks, WebAuthnOutcome, WebAuthnRegistrationMetadata, WebAuthnStepType, }; | ||
export { defaultMessageCreator, AttributeInputCallback, Auth, AuthResponse, Callback, CallbackContainer, CallbackType, ChoiceCallback, Config, ConfigOptions, ConfirmationCallback, Deferred, DeviceProfileCallback, Dispatcher, ErrorCode, FailureDetail, FRAuth, FRCallback, FRCallbackFactory, FRDevice, FREvent, FRLoginFailure, FRLoginSuccess, FRPolicy, FRRecoveryCodes, FRStep, FRStepHandler, FRUI, FRUser, FRWebAuthn, GetAuthorizationUrlOptions, GetOAuth2TokensOptions, GetTokensOptions, HiddenValueCallback, HttpClient, IdPValue, KbaCreateCallback, Listener, LocalStorage, MessageCreator, MetadataCallback, NameCallback, NameValue, OAuth2Client, OAuth2Tokens, PasswordCallback, PKCE, PolicyKey, PolicyRequirement, PollingWaitCallback, ProcessedPropertyError, ReCaptchaCallback, RedirectCallback, RelyingParty, ResponseType, SelectIdPCallback, SessionManager, Step, StepDetail, StepType, SuspendedTextOutputCallback, TermsAndConditionsCallback, TextInputCallback, TextOutputCallback, TokenManager, Tokens, TokenStorage, UserManager, ValidatedCreatePasswordCallback, ValidatedCreateUsernameCallback, ValidConfigOptions, WebAuthnAuthenticationMetadata, WebAuthnCallbacks, WebAuthnOutcome, WebAuthnRegistrationMetadata, WebAuthnStepType, }; |
{ | ||
"name": "@forgerock/javascript-sdk", | ||
"version": "3.3.1", | ||
"version": "3.4.0", | ||
"description": "ForgeRock JavaScript SDK", | ||
"module": "./index.esm.js", | ||
"main": "./index.umd.js", | ||
"module": "./index.js", | ||
"main": "./index.cjs", | ||
"files": [ | ||
@@ -24,6 +24,6 @@ "bundles/**", | ||
"devDependencies": { | ||
"rollup-plugin-terser": "^7.0.2", | ||
"rollup-plugin-visualizer": "^5.5.2" | ||
}, | ||
"typings": "./index.d.ts" | ||
"type": "module", | ||
"types": "./index.d.ts" | ||
} |
@@ -31,2 +31,3 @@ /** | ||
TermsAndConditionsCallback = "TermsAndConditionsCallback", | ||
TextInputCallback = "TextInputCallback", | ||
TextOutputCallback = "TextOutputCallback", | ||
@@ -33,0 +34,0 @@ ValidatedCreatePasswordCallback = "ValidatedCreatePasswordCallback", |
@@ -42,2 +42,3 @@ /* | ||
CallbackType["TermsAndConditionsCallback"] = "TermsAndConditionsCallback"; | ||
CallbackType["TextInputCallback"] = "TextInputCallback"; | ||
CallbackType["TextOutputCallback"] = "TextOutputCallback"; | ||
@@ -44,0 +45,0 @@ CallbackType["ValidatedCreatePasswordCallback"] = "ValidatedCreatePasswordCallback"; |
@@ -120,6 +120,6 @@ /* | ||
headers: new Headers({ | ||
accept: 'application/json', | ||
'accept-api-version': 'protocol=1.0,resource=2.1', | ||
'content-type': 'application/json', | ||
'x-requested-with': REQUESTED_WITH, | ||
Accept: 'application/json', | ||
'Accept-API-Version': 'protocol=1.0,resource=2.1', | ||
'Content-Type': 'application/json', | ||
'X-Requested-With': REQUESTED_WITH, | ||
}), | ||
@@ -126,0 +126,0 @@ method: 'POST', |
@@ -27,2 +27,3 @@ /* | ||
import TermsAndConditionsCallback from './terms-and-conditions-callback'; | ||
import TextInputCallback from './text-input-callback'; | ||
import TextOutputCallback from './text-output-callback'; | ||
@@ -70,2 +71,4 @@ import ValidatedCreatePasswordCallback from './validated-create-password-callback'; | ||
return new TermsAndConditionsCallback(callback); | ||
case CallbackType.TextInputCallback: | ||
return new TextInputCallback(callback); | ||
case CallbackType.TextOutputCallback: | ||
@@ -72,0 +75,0 @@ return new TextOutputCallback(callback); |
@@ -17,3 +17,3 @@ import FRCallback from '.'; | ||
/** | ||
* Gets the polling interval in seconds. | ||
* Gets the polling interval in milliseconds. | ||
*/ | ||
@@ -20,0 +20,0 @@ getWaitTime(): number; |
@@ -46,3 +46,3 @@ /* | ||
/** | ||
* Gets the polling interval in seconds. | ||
* Gets the polling interval in milliseconds. | ||
*/ | ||
@@ -49,0 +49,0 @@ PollingWaitCallback.prototype.getWaitTime = function () { |
@@ -118,3 +118,3 @@ /* | ||
FRDevice.prototype.getBrowserMeta = function () { | ||
if (!navigator) { | ||
if (typeof navigator === 'undefined') { | ||
console.warn('Cannot collect browser metadata. navigator is not defined.'); | ||
@@ -126,3 +126,3 @@ return {}; | ||
FRDevice.prototype.getBrowserPluginsNames = function () { | ||
if (!(navigator && navigator.plugins)) { | ||
if (!(typeof navigator !== 'undefined' && navigator.plugins)) { | ||
console.warn('Cannot collect browser plugin information. navigator.plugins is not defined.'); | ||
@@ -134,3 +134,3 @@ return ''; | ||
FRDevice.prototype.getDeviceName = function () { | ||
if (!navigator) { | ||
if (typeof navigator === 'undefined') { | ||
console.warn('Cannot collect device name. navigator is not defined.'); | ||
@@ -159,4 +159,5 @@ return ''; | ||
FRDevice.prototype.getDisplayMeta = function () { | ||
if (!screen) { | ||
if (typeof screen === 'undefined') { | ||
console.warn('Cannot collect screen information. screen is not defined.'); | ||
return {}; | ||
} | ||
@@ -166,3 +167,3 @@ return this.reduceToObject(this.config.displayProps, screen); | ||
FRDevice.prototype.getHardwareMeta = function () { | ||
if (!navigator) { | ||
if (typeof navigator === 'undefined') { | ||
console.warn('Cannot collect OS metadata. Navigator is not defined.'); | ||
@@ -174,3 +175,3 @@ return {}; | ||
FRDevice.prototype.getIdentifier = function () { | ||
if (!(window.crypto && window.crypto.getRandomValues)) { | ||
if (!(typeof globalThis.crypto !== 'undefined' && globalThis.crypto.getRandomValues)) { | ||
console.warn('Cannot generate profile ID. Crypto and/or getRandomValues is not supported.'); | ||
@@ -186,3 +187,3 @@ return ''; | ||
// generate ID, 3 sections of random numbers: "714524572-2799534390-3707617532" | ||
id = window.crypto.getRandomValues(new Uint32Array(3)).join('-'); | ||
id = globalThis.crypto.getRandomValues(new Uint32Array(3)).join('-'); | ||
localStorage.setItem('profile-id', id); | ||
@@ -193,2 +194,6 @@ } | ||
FRDevice.prototype.getInstalledFonts = function () { | ||
if (typeof document === undefined) { | ||
console.warn('Cannot collect font data. Global document object is undefined.'); | ||
return ''; | ||
} | ||
var canvas = document.createElement('canvas'); | ||
@@ -221,3 +226,3 @@ if (!canvas) { | ||
return __generator(this, function (_a) { | ||
if (!(navigator && navigator.geolocation)) { | ||
if (!(typeof navigator !== 'undefined' && navigator.geolocation)) { | ||
console.warn('Cannot collect geolocation information. navigator.geolocation is not defined.'); | ||
@@ -249,3 +254,3 @@ return [2 /*return*/, Promise.resolve({})]; | ||
FRDevice.prototype.getOSMeta = function () { | ||
if (!navigator) { | ||
if (typeof navigator === 'undefined') { | ||
console.warn('Cannot collect OS metadata. navigator is not defined.'); | ||
@@ -252,0 +257,0 @@ return {}; |
@@ -50,9 +50,9 @@ /* | ||
if (advices.AuthenticateToServiceConditionAdvice) { | ||
headers.set('x-tree', advices.AuthenticateToServiceConditionAdvice[0]); | ||
headers.set('X-Tree', advices.AuthenticateToServiceConditionAdvice[0]); | ||
} | ||
else if (advices.TransactionConditionAdvice) { | ||
headers.set('x-txid', advices.TransactionConditionAdvice[0]); | ||
headers.set('X-TxID', advices.TransactionConditionAdvice[0]); | ||
} | ||
if (tokens && tokens.idToken) { | ||
headers.set('x-idtoken', tokens.idToken); | ||
headers.set('X-IdToken', tokens.idToken); | ||
} | ||
@@ -59,0 +59,0 @@ return headers; |
@@ -24,2 +24,3 @@ import Auth from './auth'; | ||
import TermsAndConditionsCallback from './fr-auth/callbacks/terms-and-conditions-callback'; | ||
import TextInputCallback from './fr-auth/callbacks/text-input-callback'; | ||
import TextOutputCallback from './fr-auth/callbacks/text-output-callback'; | ||
@@ -50,2 +51,2 @@ import ValidatedCreatePasswordCallback from './fr-auth/callbacks/validated-create-password-callback'; | ||
import LocalStorage from './util/storage'; | ||
export { defaultMessageCreator, AttributeInputCallback, Auth, AuthResponse, Callback, CallbackContainer, CallbackType, ChoiceCallback, Config, ConfigOptions, ConfirmationCallback, Deferred, DeviceProfileCallback, Dispatcher, ErrorCode, FailureDetail, FRAuth, FRCallback, FRCallbackFactory, FRDevice, FREvent, FRLoginFailure, FRLoginSuccess, FRPolicy, FRRecoveryCodes, FRStep, FRStepHandler, FRUI, FRUser, FRWebAuthn, GetAuthorizationUrlOptions, GetOAuth2TokensOptions, GetTokensOptions, HiddenValueCallback, HttpClient, IdPValue, KbaCreateCallback, Listener, LocalStorage, MessageCreator, MetadataCallback, NameCallback, NameValue, OAuth2Client, OAuth2Tokens, PasswordCallback, PKCE, PolicyKey, PolicyRequirement, PollingWaitCallback, ProcessedPropertyError, ReCaptchaCallback, RedirectCallback, RelyingParty, ResponseType, SelectIdPCallback, SessionManager, Step, StepDetail, StepType, SuspendedTextOutputCallback, TermsAndConditionsCallback, TextOutputCallback, TokenManager, Tokens, TokenStorage, UserManager, ValidatedCreatePasswordCallback, ValidatedCreateUsernameCallback, ValidConfigOptions, WebAuthnAuthenticationMetadata, WebAuthnCallbacks, WebAuthnOutcome, WebAuthnRegistrationMetadata, WebAuthnStepType, }; | ||
export { defaultMessageCreator, AttributeInputCallback, Auth, AuthResponse, Callback, CallbackContainer, CallbackType, ChoiceCallback, Config, ConfigOptions, ConfirmationCallback, Deferred, DeviceProfileCallback, Dispatcher, ErrorCode, FailureDetail, FRAuth, FRCallback, FRCallbackFactory, FRDevice, FREvent, FRLoginFailure, FRLoginSuccess, FRPolicy, FRRecoveryCodes, FRStep, FRStepHandler, FRUI, FRUser, FRWebAuthn, GetAuthorizationUrlOptions, GetOAuth2TokensOptions, GetTokensOptions, HiddenValueCallback, HttpClient, IdPValue, KbaCreateCallback, Listener, LocalStorage, MessageCreator, MetadataCallback, NameCallback, NameValue, OAuth2Client, OAuth2Tokens, PasswordCallback, PKCE, PolicyKey, PolicyRequirement, PollingWaitCallback, ProcessedPropertyError, ReCaptchaCallback, RedirectCallback, RelyingParty, ResponseType, SelectIdPCallback, SessionManager, Step, StepDetail, StepType, SuspendedTextOutputCallback, TermsAndConditionsCallback, TextInputCallback, TextOutputCallback, TokenManager, Tokens, TokenStorage, UserManager, ValidatedCreatePasswordCallback, ValidatedCreateUsernameCallback, ValidConfigOptions, WebAuthnAuthenticationMetadata, WebAuthnCallbacks, WebAuthnOutcome, WebAuthnRegistrationMetadata, WebAuthnStepType, }; |
@@ -31,2 +31,3 @@ /* | ||
import TermsAndConditionsCallback from './fr-auth/callbacks/terms-and-conditions-callback'; | ||
import TextInputCallback from './fr-auth/callbacks/text-input-callback'; | ||
import TextOutputCallback from './fr-auth/callbacks/text-output-callback'; | ||
@@ -56,3 +57,3 @@ // eslint-disable-next-line max-len | ||
import LocalStorage from './util/storage'; | ||
export { defaultMessageCreator, AttributeInputCallback, Auth, CallbackType, ChoiceCallback, Config, ConfirmationCallback, Deferred, DeviceProfileCallback, Dispatcher, ErrorCode, FRAuth, FRCallback, FRDevice, FRLoginFailure, FRLoginSuccess, FRPolicy, FRRecoveryCodes, FRStep, FRUser, FRWebAuthn, HiddenValueCallback, HttpClient, KbaCreateCallback, LocalStorage, MetadataCallback, NameCallback, OAuth2Client, PasswordCallback, PKCE, PolicyKey, PollingWaitCallback, ReCaptchaCallback, RedirectCallback, ResponseType, SelectIdPCallback, SessionManager, StepType, SuspendedTextOutputCallback, TermsAndConditionsCallback, TextOutputCallback, TokenManager, TokenStorage, UserManager, ValidatedCreatePasswordCallback, ValidatedCreateUsernameCallback, WebAuthnOutcome, WebAuthnStepType, }; | ||
export { defaultMessageCreator, AttributeInputCallback, Auth, CallbackType, ChoiceCallback, Config, ConfirmationCallback, Deferred, DeviceProfileCallback, Dispatcher, ErrorCode, FRAuth, FRCallback, FRDevice, FRLoginFailure, FRLoginSuccess, FRPolicy, FRRecoveryCodes, FRStep, FRUser, FRWebAuthn, HiddenValueCallback, HttpClient, KbaCreateCallback, LocalStorage, MetadataCallback, NameCallback, OAuth2Client, PasswordCallback, PKCE, PolicyKey, PollingWaitCallback, ReCaptchaCallback, RedirectCallback, ResponseType, SelectIdPCallback, SessionManager, StepType, SuspendedTextOutputCallback, TermsAndConditionsCallback, TextInputCallback, TextOutputCallback, TokenManager, TokenStorage, UserManager, ValidatedCreatePasswordCallback, ValidatedCreateUsernameCallback, WebAuthnOutcome, WebAuthnStepType, }; | ||
//# sourceMappingURL=index.js.map |
@@ -191,4 +191,4 @@ /* | ||
headers: new Headers({ | ||
'content-length': body.length.toString(), | ||
'content-type': 'application/x-www-form-urlencoded', | ||
'Content-Length': body.length.toString(), | ||
'Content-Type': 'application/x-www-form-urlencoded', | ||
}), | ||
@@ -291,3 +291,3 @@ method: 'POST', | ||
credentials: 'include', | ||
headers: new Headers({ 'content-type': 'application/x-www-form-urlencoded' }), | ||
headers: new Headers({ 'Content-Type': 'application/x-www-form-urlencoded' }), | ||
method: 'POST', | ||
@@ -333,3 +333,3 @@ }; | ||
init.headers = (init.headers || new Headers()); | ||
init.headers.set('authorization', "Bearer ".concat(accessToken)); | ||
init.headers.set('Authorization', "Bearer ".concat(accessToken)); | ||
_b.label = 2; | ||
@@ -357,3 +357,3 @@ case 2: | ||
case 0: | ||
contentType = response.headers.get('content-type'); | ||
contentType = response.headers.get('Content-Type'); | ||
if (!(contentType && contentType.indexOf('application/json') > -1)) return [3 /*break*/, 2]; | ||
@@ -360,0 +360,0 @@ return [4 /*yield*/, response.json()]; |
@@ -72,4 +72,4 @@ /* | ||
headers: new Headers({ | ||
'accept-api-version': 'protocol=1.0,resource=2.0', | ||
'x-requested-with': REQUESTED_WITH, | ||
'Accept-API-Version': 'protocol=1.0,resource=2.0', | ||
'X-Requested-With': REQUESTED_WITH, | ||
}), | ||
@@ -76,0 +76,0 @@ method: 'POST', |
@@ -31,2 +31,3 @@ /** | ||
TermsAndConditionsCallback = "TermsAndConditionsCallback", | ||
TextInputCallback = "TextInputCallback", | ||
TextOutputCallback = "TextOutputCallback", | ||
@@ -33,0 +34,0 @@ ValidatedCreatePasswordCallback = "ValidatedCreatePasswordCallback", |
@@ -46,2 +46,3 @@ "use strict"; | ||
CallbackType["TermsAndConditionsCallback"] = "TermsAndConditionsCallback"; | ||
CallbackType["TextInputCallback"] = "TextInputCallback"; | ||
CallbackType["TextOutputCallback"] = "TextOutputCallback"; | ||
@@ -48,0 +49,0 @@ CallbackType["ValidatedCreatePasswordCallback"] = "ValidatedCreatePasswordCallback"; |
@@ -122,6 +122,6 @@ "use strict"; | ||
headers: new Headers({ | ||
accept: 'application/json', | ||
'accept-api-version': 'protocol=1.0,resource=2.1', | ||
'content-type': 'application/json', | ||
'x-requested-with': constants_1.REQUESTED_WITH, | ||
Accept: 'application/json', | ||
'Accept-API-Version': 'protocol=1.0,resource=2.1', | ||
'Content-Type': 'application/json', | ||
'X-Requested-With': constants_1.REQUESTED_WITH, | ||
}), | ||
@@ -128,0 +128,0 @@ method: 'POST', |
@@ -29,2 +29,3 @@ "use strict"; | ||
var terms_and_conditions_callback_1 = require("./terms-and-conditions-callback"); | ||
var text_input_callback_1 = require("./text-input-callback"); | ||
var text_output_callback_1 = require("./text-output-callback"); | ||
@@ -72,2 +73,4 @@ var validated_create_password_callback_1 = require("./validated-create-password-callback"); | ||
return new terms_and_conditions_callback_1.default(callback); | ||
case enums_1.CallbackType.TextInputCallback: | ||
return new text_input_callback_1.default(callback); | ||
case enums_1.CallbackType.TextOutputCallback: | ||
@@ -74,0 +77,0 @@ return new text_output_callback_1.default(callback); |
@@ -17,3 +17,3 @@ import FRCallback from '.'; | ||
/** | ||
* Gets the polling interval in seconds. | ||
* Gets the polling interval in milliseconds. | ||
*/ | ||
@@ -20,0 +20,0 @@ getWaitTime(): number; |
@@ -48,3 +48,3 @@ "use strict"; | ||
/** | ||
* Gets the polling interval in seconds. | ||
* Gets the polling interval in milliseconds. | ||
*/ | ||
@@ -51,0 +51,0 @@ PollingWaitCallback.prototype.getWaitTime = function () { |
@@ -120,3 +120,3 @@ "use strict"; | ||
FRDevice.prototype.getBrowserMeta = function () { | ||
if (!navigator) { | ||
if (typeof navigator === 'undefined') { | ||
console.warn('Cannot collect browser metadata. navigator is not defined.'); | ||
@@ -128,3 +128,3 @@ return {}; | ||
FRDevice.prototype.getBrowserPluginsNames = function () { | ||
if (!(navigator && navigator.plugins)) { | ||
if (!(typeof navigator !== 'undefined' && navigator.plugins)) { | ||
console.warn('Cannot collect browser plugin information. navigator.plugins is not defined.'); | ||
@@ -136,3 +136,3 @@ return ''; | ||
FRDevice.prototype.getDeviceName = function () { | ||
if (!navigator) { | ||
if (typeof navigator === 'undefined') { | ||
console.warn('Cannot collect device name. navigator is not defined.'); | ||
@@ -161,4 +161,5 @@ return ''; | ||
FRDevice.prototype.getDisplayMeta = function () { | ||
if (!screen) { | ||
if (typeof screen === 'undefined') { | ||
console.warn('Cannot collect screen information. screen is not defined.'); | ||
return {}; | ||
} | ||
@@ -168,3 +169,3 @@ return this.reduceToObject(this.config.displayProps, screen); | ||
FRDevice.prototype.getHardwareMeta = function () { | ||
if (!navigator) { | ||
if (typeof navigator === 'undefined') { | ||
console.warn('Cannot collect OS metadata. Navigator is not defined.'); | ||
@@ -176,3 +177,3 @@ return {}; | ||
FRDevice.prototype.getIdentifier = function () { | ||
if (!(window.crypto && window.crypto.getRandomValues)) { | ||
if (!(typeof globalThis.crypto !== 'undefined' && globalThis.crypto.getRandomValues)) { | ||
console.warn('Cannot generate profile ID. Crypto and/or getRandomValues is not supported.'); | ||
@@ -188,3 +189,3 @@ return ''; | ||
// generate ID, 3 sections of random numbers: "714524572-2799534390-3707617532" | ||
id = window.crypto.getRandomValues(new Uint32Array(3)).join('-'); | ||
id = globalThis.crypto.getRandomValues(new Uint32Array(3)).join('-'); | ||
localStorage.setItem('profile-id', id); | ||
@@ -195,2 +196,6 @@ } | ||
FRDevice.prototype.getInstalledFonts = function () { | ||
if (typeof document === undefined) { | ||
console.warn('Cannot collect font data. Global document object is undefined.'); | ||
return ''; | ||
} | ||
var canvas = document.createElement('canvas'); | ||
@@ -223,3 +228,3 @@ if (!canvas) { | ||
return __generator(this, function (_a) { | ||
if (!(navigator && navigator.geolocation)) { | ||
if (!(typeof navigator !== 'undefined' && navigator.geolocation)) { | ||
console.warn('Cannot collect geolocation information. navigator.geolocation is not defined.'); | ||
@@ -251,3 +256,3 @@ return [2 /*return*/, Promise.resolve({})]; | ||
FRDevice.prototype.getOSMeta = function () { | ||
if (!navigator) { | ||
if (typeof navigator === 'undefined') { | ||
console.warn('Cannot collect OS metadata. navigator is not defined.'); | ||
@@ -254,0 +259,0 @@ return {}; |
@@ -53,9 +53,9 @@ "use strict"; | ||
if (advices.AuthenticateToServiceConditionAdvice) { | ||
headers.set('x-tree', advices.AuthenticateToServiceConditionAdvice[0]); | ||
headers.set('X-Tree', advices.AuthenticateToServiceConditionAdvice[0]); | ||
} | ||
else if (advices.TransactionConditionAdvice) { | ||
headers.set('x-txid', advices.TransactionConditionAdvice[0]); | ||
headers.set('X-TxID', advices.TransactionConditionAdvice[0]); | ||
} | ||
if (tokens && tokens.idToken) { | ||
headers.set('x-idtoken', tokens.idToken); | ||
headers.set('X-IdToken', tokens.idToken); | ||
} | ||
@@ -62,0 +62,0 @@ return headers; |
@@ -24,2 +24,3 @@ import Auth from './auth'; | ||
import TermsAndConditionsCallback from './fr-auth/callbacks/terms-and-conditions-callback'; | ||
import TextInputCallback from './fr-auth/callbacks/text-input-callback'; | ||
import TextOutputCallback from './fr-auth/callbacks/text-output-callback'; | ||
@@ -50,2 +51,2 @@ import ValidatedCreatePasswordCallback from './fr-auth/callbacks/validated-create-password-callback'; | ||
import LocalStorage from './util/storage'; | ||
export { defaultMessageCreator, AttributeInputCallback, Auth, AuthResponse, Callback, CallbackContainer, CallbackType, ChoiceCallback, Config, ConfigOptions, ConfirmationCallback, Deferred, DeviceProfileCallback, Dispatcher, ErrorCode, FailureDetail, FRAuth, FRCallback, FRCallbackFactory, FRDevice, FREvent, FRLoginFailure, FRLoginSuccess, FRPolicy, FRRecoveryCodes, FRStep, FRStepHandler, FRUI, FRUser, FRWebAuthn, GetAuthorizationUrlOptions, GetOAuth2TokensOptions, GetTokensOptions, HiddenValueCallback, HttpClient, IdPValue, KbaCreateCallback, Listener, LocalStorage, MessageCreator, MetadataCallback, NameCallback, NameValue, OAuth2Client, OAuth2Tokens, PasswordCallback, PKCE, PolicyKey, PolicyRequirement, PollingWaitCallback, ProcessedPropertyError, ReCaptchaCallback, RedirectCallback, RelyingParty, ResponseType, SelectIdPCallback, SessionManager, Step, StepDetail, StepType, SuspendedTextOutputCallback, TermsAndConditionsCallback, TextOutputCallback, TokenManager, Tokens, TokenStorage, UserManager, ValidatedCreatePasswordCallback, ValidatedCreateUsernameCallback, ValidConfigOptions, WebAuthnAuthenticationMetadata, WebAuthnCallbacks, WebAuthnOutcome, WebAuthnRegistrationMetadata, WebAuthnStepType, }; | ||
export { defaultMessageCreator, AttributeInputCallback, Auth, AuthResponse, Callback, CallbackContainer, CallbackType, ChoiceCallback, Config, ConfigOptions, ConfirmationCallback, Deferred, DeviceProfileCallback, Dispatcher, ErrorCode, FailureDetail, FRAuth, FRCallback, FRCallbackFactory, FRDevice, FREvent, FRLoginFailure, FRLoginSuccess, FRPolicy, FRRecoveryCodes, FRStep, FRStepHandler, FRUI, FRUser, FRWebAuthn, GetAuthorizationUrlOptions, GetOAuth2TokensOptions, GetTokensOptions, HiddenValueCallback, HttpClient, IdPValue, KbaCreateCallback, Listener, LocalStorage, MessageCreator, MetadataCallback, NameCallback, NameValue, OAuth2Client, OAuth2Tokens, PasswordCallback, PKCE, PolicyKey, PolicyRequirement, PollingWaitCallback, ProcessedPropertyError, ReCaptchaCallback, RedirectCallback, RelyingParty, ResponseType, SelectIdPCallback, SessionManager, Step, StepDetail, StepType, SuspendedTextOutputCallback, TermsAndConditionsCallback, TextInputCallback, TextOutputCallback, TokenManager, Tokens, TokenStorage, UserManager, ValidatedCreatePasswordCallback, ValidatedCreateUsernameCallback, ValidConfigOptions, WebAuthnAuthenticationMetadata, WebAuthnCallbacks, WebAuthnOutcome, WebAuthnRegistrationMetadata, WebAuthnStepType, }; |
@@ -12,3 +12,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.WebAuthnStepType = exports.WebAuthnOutcome = exports.ValidatedCreateUsernameCallback = exports.ValidatedCreatePasswordCallback = exports.UserManager = exports.TokenStorage = exports.TokenManager = exports.TextOutputCallback = exports.TermsAndConditionsCallback = exports.SuspendedTextOutputCallback = exports.StepType = exports.SessionManager = exports.SelectIdPCallback = exports.ResponseType = exports.RedirectCallback = exports.ReCaptchaCallback = exports.PollingWaitCallback = exports.PolicyKey = exports.PKCE = exports.PasswordCallback = exports.OAuth2Client = exports.NameCallback = exports.MetadataCallback = exports.LocalStorage = exports.KbaCreateCallback = exports.HttpClient = exports.HiddenValueCallback = exports.FRWebAuthn = exports.FRUser = exports.FRStep = exports.FRRecoveryCodes = exports.FRPolicy = exports.FRLoginSuccess = exports.FRLoginFailure = exports.FRDevice = exports.FRCallback = exports.FRAuth = exports.ErrorCode = exports.Dispatcher = exports.DeviceProfileCallback = exports.Deferred = exports.ConfirmationCallback = exports.Config = exports.ChoiceCallback = exports.CallbackType = exports.Auth = exports.AttributeInputCallback = exports.defaultMessageCreator = void 0; | ||
exports.WebAuthnStepType = exports.WebAuthnOutcome = exports.ValidatedCreateUsernameCallback = exports.ValidatedCreatePasswordCallback = exports.UserManager = exports.TokenStorage = exports.TokenManager = exports.TextOutputCallback = exports.TextInputCallback = exports.TermsAndConditionsCallback = exports.SuspendedTextOutputCallback = exports.StepType = exports.SessionManager = exports.SelectIdPCallback = exports.ResponseType = exports.RedirectCallback = exports.ReCaptchaCallback = exports.PollingWaitCallback = exports.PolicyKey = exports.PKCE = exports.PasswordCallback = exports.OAuth2Client = exports.NameCallback = exports.MetadataCallback = exports.LocalStorage = exports.KbaCreateCallback = exports.HttpClient = exports.HiddenValueCallback = exports.FRWebAuthn = exports.FRUser = exports.FRStep = exports.FRRecoveryCodes = exports.FRPolicy = exports.FRLoginSuccess = exports.FRLoginFailure = exports.FRDevice = exports.FRCallback = exports.FRAuth = exports.ErrorCode = exports.Dispatcher = exports.DeviceProfileCallback = exports.Deferred = exports.ConfirmationCallback = exports.Config = exports.ChoiceCallback = exports.CallbackType = exports.Auth = exports.AttributeInputCallback = exports.defaultMessageCreator = void 0; | ||
var auth_1 = require("./auth"); | ||
@@ -57,2 +57,4 @@ exports.Auth = auth_1.default; | ||
exports.TermsAndConditionsCallback = terms_and_conditions_callback_1.default; | ||
var text_input_callback_1 = require("./fr-auth/callbacks/text-input-callback"); | ||
exports.TextInputCallback = text_input_callback_1.default; | ||
var text_output_callback_1 = require("./fr-auth/callbacks/text-output-callback"); | ||
@@ -59,0 +61,0 @@ exports.TextOutputCallback = text_output_callback_1.default; |
@@ -196,4 +196,4 @@ "use strict"; | ||
headers: new Headers({ | ||
'content-length': body.length.toString(), | ||
'content-type': 'application/x-www-form-urlencoded', | ||
'Content-Length': body.length.toString(), | ||
'Content-Type': 'application/x-www-form-urlencoded', | ||
}), | ||
@@ -296,3 +296,3 @@ method: 'POST', | ||
credentials: 'include', | ||
headers: new Headers({ 'content-type': 'application/x-www-form-urlencoded' }), | ||
headers: new Headers({ 'Content-Type': 'application/x-www-form-urlencoded' }), | ||
method: 'POST', | ||
@@ -338,3 +338,3 @@ }; | ||
init.headers = (init.headers || new Headers()); | ||
init.headers.set('authorization', "Bearer ".concat(accessToken)); | ||
init.headers.set('Authorization', "Bearer ".concat(accessToken)); | ||
_b.label = 2; | ||
@@ -362,3 +362,3 @@ case 2: | ||
case 0: | ||
contentType = response.headers.get('content-type'); | ||
contentType = response.headers.get('Content-Type'); | ||
if (!(contentType && contentType.indexOf('application/json') > -1)) return [3 /*break*/, 2]; | ||
@@ -365,0 +365,0 @@ return [4 /*yield*/, response.json()]; |
@@ -74,4 +74,4 @@ "use strict"; | ||
headers: new Headers({ | ||
'accept-api-version': 'protocol=1.0,resource=2.0', | ||
'x-requested-with': constants_1.REQUESTED_WITH, | ||
'Accept-API-Version': 'protocol=1.0,resource=2.0', | ||
'X-Requested-With': constants_1.REQUESTED_WITH, | ||
}), | ||
@@ -78,0 +78,0 @@ method: 'POST', |
{ | ||
"name": "@forgerock/javascript-sdk", | ||
"version": "3.3.1", | ||
"version": "3.4.0", | ||
"description": "ForgeRock JavaScript SDK", | ||
@@ -24,5 +24,4 @@ "module": "./lib-esm/index.js", | ||
"devDependencies": { | ||
"rollup-plugin-terser": "^7.0.2", | ||
"rollup-plugin-visualizer": "^5.5.2" | ||
} | ||
} |
Sorry, the diff of this file is too big to display
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
Sorry, the diff of this file is not supported yet
1640806
1
650
32177