@wix/identity_authentication
Advanced tools
Comparing version 1.0.7 to 1.0.8
@@ -6,3 +6,2 @@ "use strict"; | ||
const register = (...args) => { | ||
var _a; | ||
const context = | ||
@@ -19,3 +18,3 @@ // @ts-expect-error | ||
return context | ||
.initWixModules(iam_authentication_v1_authentication_authentication_public_1.register, ((_a = args[1]) === null || _a === void 0 ? void 0 : _a.supressAuth) ? true : false) | ||
.initWixModules(iam_authentication_v1_authentication_authentication_public_1.register, args[1]?.supressAuth ? true : false) | ||
.apply(undefined, args); | ||
@@ -25,3 +24,2 @@ }; | ||
const login = (...args) => { | ||
var _a; | ||
const context = | ||
@@ -38,3 +36,3 @@ // @ts-expect-error | ||
return context | ||
.initWixModules(iam_authentication_v1_authentication_authentication_public_1.login, ((_a = args[1]) === null || _a === void 0 ? void 0 : _a.supressAuth) ? true : false) | ||
.initWixModules(iam_authentication_v1_authentication_authentication_public_1.login, args[1]?.supressAuth ? true : false) | ||
.apply(undefined, args); | ||
@@ -44,3 +42,2 @@ }; | ||
const registerV2 = (...args) => { | ||
var _a; | ||
const context = | ||
@@ -57,3 +54,3 @@ // @ts-expect-error | ||
return context | ||
.initWixModules(iam_authentication_v1_authentication_authentication_public_1.registerV2, ((_a = args[1]) === null || _a === void 0 ? void 0 : _a.supressAuth) ? true : false) | ||
.initWixModules(iam_authentication_v1_authentication_authentication_public_1.registerV2, args[1]?.supressAuth ? true : false) | ||
.apply(undefined, args); | ||
@@ -63,3 +60,2 @@ }; | ||
const loginV2 = (...args) => { | ||
var _a; | ||
const context = | ||
@@ -76,3 +72,3 @@ // @ts-expect-error | ||
return context | ||
.initWixModules(iam_authentication_v1_authentication_authentication_public_1.loginV2, ((_a = args[1]) === null || _a === void 0 ? void 0 : _a.supressAuth) ? true : false) | ||
.initWixModules(iam_authentication_v1_authentication_authentication_public_1.loginV2, args[1]?.supressAuth ? true : false) | ||
.apply(undefined, args); | ||
@@ -82,3 +78,2 @@ }; | ||
const changePassword = (...args) => { | ||
var _a; | ||
const context = | ||
@@ -95,3 +90,3 @@ // @ts-expect-error | ||
return context | ||
.initWixModules(iam_authentication_v1_authentication_authentication_public_1.changePassword, ((_a = args[1]) === null || _a === void 0 ? void 0 : _a.supressAuth) ? true : false) | ||
.initWixModules(iam_authentication_v1_authentication_authentication_public_1.changePassword, args[1]?.supressAuth ? true : false) | ||
.apply(undefined, args); | ||
@@ -101,3 +96,2 @@ }; | ||
const loginWithIdpConnectionTokenParams = (...args) => { | ||
var _a; | ||
const context = | ||
@@ -114,3 +108,3 @@ // @ts-expect-error | ||
return context | ||
.initWixModules(iam_authentication_v1_authentication_authentication_public_1.loginWithIdpConnectionTokenParams, ((_a = args[1]) === null || _a === void 0 ? void 0 : _a.supressAuth) ? true : false) | ||
.initWixModules(iam_authentication_v1_authentication_authentication_public_1.loginWithIdpConnectionTokenParams, args[1]?.supressAuth ? true : false) | ||
.apply(undefined, args); | ||
@@ -120,3 +114,2 @@ }; | ||
const proceedToNextState = (...args) => { | ||
var _a; | ||
const context = | ||
@@ -133,3 +126,3 @@ // @ts-expect-error | ||
return context | ||
.initWixModules(iam_authentication_v1_authentication_authentication_public_1.proceedToNextState, ((_a = args[1]) === null || _a === void 0 ? void 0 : _a.supressAuth) ? true : false) | ||
.initWixModules(iam_authentication_v1_authentication_authentication_public_1.proceedToNextState, args[1]?.supressAuth ? true : false) | ||
.apply(undefined, args); | ||
@@ -139,3 +132,2 @@ }; | ||
const signOn = (...args) => { | ||
var _a; | ||
const context = | ||
@@ -152,3 +144,3 @@ // @ts-expect-error | ||
return context | ||
.initWixModules(iam_authentication_v1_authentication_authentication_public_1.signOn, ((_a = args[1]) === null || _a === void 0 ? void 0 : _a.supressAuth) ? true : false) | ||
.initWixModules(iam_authentication_v1_authentication_authentication_public_1.signOn, args[1]?.supressAuth ? true : false) | ||
.apply(undefined, args); | ||
@@ -158,3 +150,2 @@ }; | ||
const logout = (...args) => { | ||
var _a; | ||
const context = | ||
@@ -171,3 +162,3 @@ // @ts-expect-error | ||
return context | ||
.initWixModules(iam_authentication_v1_authentication_authentication_public_1.logout, ((_a = args[1]) === null || _a === void 0 ? void 0 : _a.supressAuth) ? true : false) | ||
.initWixModules(iam_authentication_v1_authentication_authentication_public_1.logout, args[1]?.supressAuth ? true : false) | ||
.apply(undefined, args); | ||
@@ -174,0 +165,0 @@ }; |
@@ -25,11 +25,2 @@ "use strict"; | ||
}; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -145,46 +136,42 @@ exports.logout = exports.signOn = exports.proceedToNextState = exports.loginWithIdpConnectionTokenParams = exports.changePassword = exports.loginV2 = exports.registerV2 = exports.login = exports.register = exports.onAuthenticationSuccessfulLoginEvent = exports.TenantType = exports.StateType = exports.StateStatus = exports.Reason = exports.StatusName = exports.AddressTag = exports.PhoneTag = exports.EmailTag = exports.PrivacyStatus = void 0; | ||
*/ | ||
function register(identity, options) { | ||
var arguments_1 = arguments; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
var _a, _b, _c; | ||
// @ts-ignore | ||
const { httpClient, sideEffects } = arguments_1[2]; | ||
const payload = (0, transform_paths_1.transformPaths)((0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({ | ||
identity: identity, | ||
authenticatorId: options === null || options === void 0 ? void 0 : options.authenticatorId, | ||
inputs: options === null || options === void 0 ? void 0 : options.inputs, | ||
captchaTokens: options === null || options === void 0 ? void 0 : options.captchaTokens, | ||
}), [ | ||
async function register(identity, options) { | ||
// @ts-ignore | ||
const { httpClient, sideEffects } = arguments[2]; | ||
const payload = (0, transform_paths_1.transformPaths)((0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({ | ||
identity: identity, | ||
authenticatorId: options?.authenticatorId, | ||
inputs: options?.inputs, | ||
captchaTokens: options?.captchaTokens, | ||
}), [ | ||
{ | ||
transformFn: address_1.transformSDKAddressToRESTAddress, | ||
paths: [{ path: 'identity.identityProfile.addresses.address' }], | ||
}, | ||
]); | ||
const reqOpts = ambassadorWixIamAuthenticationV1Authentication.register(payload); | ||
sideEffects?.onSiteCall?.(); | ||
try { | ||
const result = await httpClient.request(reqOpts); | ||
sideEffects?.onSuccess?.(result); | ||
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [ | ||
{ | ||
transformFn: address_1.transformSDKAddressToRESTAddress, | ||
transformFn: address_2.transformRESTAddressToSDKAddress, | ||
paths: [{ path: 'identity.identityProfile.addresses.address' }], | ||
}, | ||
]); | ||
const reqOpts = ambassadorWixIamAuthenticationV1Authentication.register(payload); | ||
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects); | ||
try { | ||
const result = yield httpClient.request(reqOpts); | ||
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result); | ||
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [ | ||
{ | ||
transformFn: address_2.transformRESTAddressToSDKAddress, | ||
paths: [{ path: 'identity.identityProfile.addresses.address' }], | ||
}, | ||
])); | ||
} | ||
catch (err) { | ||
const transformedError = (0, transform_error_1.transformError)(err, { | ||
spreadPathsToArguments: {}, | ||
explicitPathsToArguments: { | ||
identity: '$[0]', | ||
authenticatorId: '$[1].authenticatorId', | ||
inputs: '$[1].inputs', | ||
captchaTokens: '$[1].captchaTokens', | ||
}, | ||
singleArgumentUnchanged: false, | ||
}, ['identity', 'options']); | ||
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err); | ||
throw transformedError; | ||
} | ||
}); | ||
])); | ||
} | ||
catch (err) { | ||
const transformedError = (0, transform_error_1.transformError)(err, { | ||
spreadPathsToArguments: {}, | ||
explicitPathsToArguments: { | ||
identity: '$[0]', | ||
authenticatorId: '$[1].authenticatorId', | ||
inputs: '$[1].inputs', | ||
captchaTokens: '$[1].captchaTokens', | ||
}, | ||
singleArgumentUnchanged: false, | ||
}, ['identity', 'options']); | ||
sideEffects?.onError?.(err); | ||
throw transformedError; | ||
} | ||
} | ||
@@ -196,43 +183,39 @@ exports.register = register; | ||
*/ | ||
function login(identifier, options) { | ||
var arguments_2 = arguments; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
var _a, _b, _c; | ||
// @ts-ignore | ||
const { httpClient, sideEffects } = arguments_2[2]; | ||
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({ | ||
identifier: identifier, | ||
authenticatorId: options === null || options === void 0 ? void 0 : options.authenticatorId, | ||
inputs: options === null || options === void 0 ? void 0 : options.inputs, | ||
captchaTokens: options === null || options === void 0 ? void 0 : options.captchaTokens, | ||
loginId: options === null || options === void 0 ? void 0 : options.loginId, | ||
}); | ||
const reqOpts = ambassadorWixIamAuthenticationV1Authentication.login(payload); | ||
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects); | ||
try { | ||
const result = yield httpClient.request(reqOpts); | ||
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result); | ||
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [ | ||
{ | ||
transformFn: address_2.transformRESTAddressToSDKAddress, | ||
paths: [{ path: 'identity.identityProfile.addresses.address' }], | ||
}, | ||
])); | ||
} | ||
catch (err) { | ||
const transformedError = (0, transform_error_1.transformError)(err, { | ||
spreadPathsToArguments: {}, | ||
explicitPathsToArguments: { | ||
identifier: '$[0]', | ||
authenticatorId: '$[1].authenticatorId', | ||
inputs: '$[1].inputs', | ||
captchaTokens: '$[1].captchaTokens', | ||
loginId: '$[1].loginId', | ||
}, | ||
singleArgumentUnchanged: false, | ||
}, ['identifier', 'options']); | ||
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err); | ||
throw transformedError; | ||
} | ||
async function login(identifier, options) { | ||
// @ts-ignore | ||
const { httpClient, sideEffects } = arguments[2]; | ||
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({ | ||
identifier: identifier, | ||
authenticatorId: options?.authenticatorId, | ||
inputs: options?.inputs, | ||
captchaTokens: options?.captchaTokens, | ||
loginId: options?.loginId, | ||
}); | ||
const reqOpts = ambassadorWixIamAuthenticationV1Authentication.login(payload); | ||
sideEffects?.onSiteCall?.(); | ||
try { | ||
const result = await httpClient.request(reqOpts); | ||
sideEffects?.onSuccess?.(result); | ||
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [ | ||
{ | ||
transformFn: address_2.transformRESTAddressToSDKAddress, | ||
paths: [{ path: 'identity.identityProfile.addresses.address' }], | ||
}, | ||
])); | ||
} | ||
catch (err) { | ||
const transformedError = (0, transform_error_1.transformError)(err, { | ||
spreadPathsToArguments: {}, | ||
explicitPathsToArguments: { | ||
identifier: '$[0]', | ||
authenticatorId: '$[1].authenticatorId', | ||
inputs: '$[1].inputs', | ||
captchaTokens: '$[1].captchaTokens', | ||
loginId: '$[1].loginId', | ||
}, | ||
singleArgumentUnchanged: false, | ||
}, ['identifier', 'options']); | ||
sideEffects?.onError?.(err); | ||
throw transformedError; | ||
} | ||
} | ||
@@ -253,48 +236,44 @@ exports.login = login; | ||
*/ | ||
function registerV2(loginId, options) { | ||
var arguments_3 = arguments; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
var _a, _b, _c; | ||
// @ts-ignore | ||
const { httpClient, sideEffects } = arguments_3[2]; | ||
const payload = (0, transform_paths_1.transformPaths)((0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({ | ||
loginId: loginId, | ||
password: options === null || options === void 0 ? void 0 : options.password, | ||
profile: options === null || options === void 0 ? void 0 : options.profile, | ||
captchaTokens: options === null || options === void 0 ? void 0 : options.captchaTokens, | ||
clientMetaData: options === null || options === void 0 ? void 0 : options.clientMetaData, | ||
}), [ | ||
async function registerV2(loginId, options) { | ||
// @ts-ignore | ||
const { httpClient, sideEffects } = arguments[2]; | ||
const payload = (0, transform_paths_1.transformPaths)((0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({ | ||
loginId: loginId, | ||
password: options?.password, | ||
profile: options?.profile, | ||
captchaTokens: options?.captchaTokens, | ||
clientMetaData: options?.clientMetaData, | ||
}), [ | ||
{ | ||
transformFn: address_1.transformSDKAddressToRESTAddress, | ||
paths: [{ path: 'profile.addresses.address' }], | ||
}, | ||
]); | ||
const reqOpts = ambassadorWixIamAuthenticationV1Authentication.registerV2(payload); | ||
sideEffects?.onSiteCall?.(); | ||
try { | ||
const result = await httpClient.request(reqOpts); | ||
sideEffects?.onSuccess?.(result); | ||
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [ | ||
{ | ||
transformFn: address_1.transformSDKAddressToRESTAddress, | ||
paths: [{ path: 'profile.addresses.address' }], | ||
transformFn: address_2.transformRESTAddressToSDKAddress, | ||
paths: [{ path: 'identity.identityProfile.addresses.address' }], | ||
}, | ||
]); | ||
const reqOpts = ambassadorWixIamAuthenticationV1Authentication.registerV2(payload); | ||
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects); | ||
try { | ||
const result = yield httpClient.request(reqOpts); | ||
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result); | ||
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [ | ||
{ | ||
transformFn: address_2.transformRESTAddressToSDKAddress, | ||
paths: [{ path: 'identity.identityProfile.addresses.address' }], | ||
}, | ||
])); | ||
} | ||
catch (err) { | ||
const transformedError = (0, transform_error_1.transformError)(err, { | ||
spreadPathsToArguments: {}, | ||
explicitPathsToArguments: { | ||
loginId: '$[0]', | ||
password: '$[1].password', | ||
profile: '$[1].profile', | ||
captchaTokens: '$[1].captchaTokens', | ||
clientMetaData: '$[1].clientMetaData', | ||
}, | ||
singleArgumentUnchanged: false, | ||
}, ['loginId', 'options']); | ||
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err); | ||
throw transformedError; | ||
} | ||
}); | ||
])); | ||
} | ||
catch (err) { | ||
const transformedError = (0, transform_error_1.transformError)(err, { | ||
spreadPathsToArguments: {}, | ||
explicitPathsToArguments: { | ||
loginId: '$[0]', | ||
password: '$[1].password', | ||
profile: '$[1].profile', | ||
captchaTokens: '$[1].captchaTokens', | ||
clientMetaData: '$[1].clientMetaData', | ||
}, | ||
singleArgumentUnchanged: false, | ||
}, ['loginId', 'options']); | ||
sideEffects?.onError?.(err); | ||
throw transformedError; | ||
} | ||
} | ||
@@ -312,39 +291,35 @@ exports.registerV2 = registerV2; | ||
*/ | ||
function loginV2(loginId, options) { | ||
var arguments_4 = arguments; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
var _a, _b, _c; | ||
// @ts-ignore | ||
const { httpClient, sideEffects } = arguments_4[2]; | ||
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({ | ||
loginId: loginId, | ||
password: options === null || options === void 0 ? void 0 : options.password, | ||
captchaTokens: options === null || options === void 0 ? void 0 : options.captchaTokens, | ||
}); | ||
const reqOpts = ambassadorWixIamAuthenticationV1Authentication.loginV2(payload); | ||
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects); | ||
try { | ||
const result = yield httpClient.request(reqOpts); | ||
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result); | ||
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [ | ||
{ | ||
transformFn: address_2.transformRESTAddressToSDKAddress, | ||
paths: [{ path: 'identity.identityProfile.addresses.address' }], | ||
}, | ||
])); | ||
} | ||
catch (err) { | ||
const transformedError = (0, transform_error_1.transformError)(err, { | ||
spreadPathsToArguments: {}, | ||
explicitPathsToArguments: { | ||
loginId: '$[0]', | ||
password: '$[1].password', | ||
captchaTokens: '$[1].captchaTokens', | ||
}, | ||
singleArgumentUnchanged: false, | ||
}, ['loginId', 'options']); | ||
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err); | ||
throw transformedError; | ||
} | ||
async function loginV2(loginId, options) { | ||
// @ts-ignore | ||
const { httpClient, sideEffects } = arguments[2]; | ||
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({ | ||
loginId: loginId, | ||
password: options?.password, | ||
captchaTokens: options?.captchaTokens, | ||
}); | ||
const reqOpts = ambassadorWixIamAuthenticationV1Authentication.loginV2(payload); | ||
sideEffects?.onSiteCall?.(); | ||
try { | ||
const result = await httpClient.request(reqOpts); | ||
sideEffects?.onSuccess?.(result); | ||
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [ | ||
{ | ||
transformFn: address_2.transformRESTAddressToSDKAddress, | ||
paths: [{ path: 'identity.identityProfile.addresses.address' }], | ||
}, | ||
])); | ||
} | ||
catch (err) { | ||
const transformedError = (0, transform_error_1.transformError)(err, { | ||
spreadPathsToArguments: {}, | ||
explicitPathsToArguments: { | ||
loginId: '$[0]', | ||
password: '$[1].password', | ||
captchaTokens: '$[1].captchaTokens', | ||
}, | ||
singleArgumentUnchanged: false, | ||
}, ['loginId', 'options']); | ||
sideEffects?.onError?.(err); | ||
throw transformedError; | ||
} | ||
} | ||
@@ -359,27 +334,23 @@ exports.loginV2 = loginV2; | ||
*/ | ||
function changePassword(newPassword) { | ||
var arguments_5 = arguments; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
var _a, _b, _c; | ||
// @ts-ignore | ||
const { httpClient, sideEffects } = arguments_5[1]; | ||
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({ | ||
newPassword: newPassword, | ||
}); | ||
const reqOpts = ambassadorWixIamAuthenticationV1Authentication.changePassword(payload); | ||
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects); | ||
try { | ||
const result = yield httpClient.request(reqOpts); | ||
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result); | ||
} | ||
catch (err) { | ||
const transformedError = (0, transform_error_1.transformError)(err, { | ||
spreadPathsToArguments: {}, | ||
explicitPathsToArguments: { newPassword: '$[0]' }, | ||
singleArgumentUnchanged: false, | ||
}, ['newPassword']); | ||
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err); | ||
throw transformedError; | ||
} | ||
async function changePassword(newPassword) { | ||
// @ts-ignore | ||
const { httpClient, sideEffects } = arguments[1]; | ||
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({ | ||
newPassword: newPassword, | ||
}); | ||
const reqOpts = ambassadorWixIamAuthenticationV1Authentication.changePassword(payload); | ||
sideEffects?.onSiteCall?.(); | ||
try { | ||
const result = await httpClient.request(reqOpts); | ||
sideEffects?.onSuccess?.(result); | ||
} | ||
catch (err) { | ||
const transformedError = (0, transform_error_1.transformError)(err, { | ||
spreadPathsToArguments: {}, | ||
explicitPathsToArguments: { newPassword: '$[0]' }, | ||
singleArgumentUnchanged: false, | ||
}, ['newPassword']); | ||
sideEffects?.onError?.(err); | ||
throw transformedError; | ||
} | ||
} | ||
@@ -390,37 +361,33 @@ exports.changePassword = changePassword; | ||
*/ | ||
function loginWithIdpConnectionTokenParams(options) { | ||
var arguments_6 = arguments; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
var _a, _b, _c; | ||
// @ts-ignore | ||
const { httpClient, sideEffects } = arguments_6[1]; | ||
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({ | ||
idpConnectionId: options === null || options === void 0 ? void 0 : options.idpConnectionId, | ||
tokenParams: options === null || options === void 0 ? void 0 : options.tokenParams, | ||
}); | ||
const reqOpts = ambassadorWixIamAuthenticationV1Authentication.loginWithIdpConnectionTokenParams(payload); | ||
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects); | ||
try { | ||
const result = yield httpClient.request(reqOpts); | ||
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result); | ||
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [ | ||
{ | ||
transformFn: address_2.transformRESTAddressToSDKAddress, | ||
paths: [{ path: 'identity.identityProfile.addresses.address' }], | ||
}, | ||
])); | ||
} | ||
catch (err) { | ||
const transformedError = (0, transform_error_1.transformError)(err, { | ||
spreadPathsToArguments: {}, | ||
explicitPathsToArguments: { | ||
idpConnectionId: '$[0].idpConnectionId', | ||
tokenParams: '$[0].tokenParams', | ||
}, | ||
singleArgumentUnchanged: false, | ||
}, ['options']); | ||
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err); | ||
throw transformedError; | ||
} | ||
async function loginWithIdpConnectionTokenParams(options) { | ||
// @ts-ignore | ||
const { httpClient, sideEffects } = arguments[1]; | ||
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({ | ||
idpConnectionId: options?.idpConnectionId, | ||
tokenParams: options?.tokenParams, | ||
}); | ||
const reqOpts = ambassadorWixIamAuthenticationV1Authentication.loginWithIdpConnectionTokenParams(payload); | ||
sideEffects?.onSiteCall?.(); | ||
try { | ||
const result = await httpClient.request(reqOpts); | ||
sideEffects?.onSuccess?.(result); | ||
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [ | ||
{ | ||
transformFn: address_2.transformRESTAddressToSDKAddress, | ||
paths: [{ path: 'identity.identityProfile.addresses.address' }], | ||
}, | ||
])); | ||
} | ||
catch (err) { | ||
const transformedError = (0, transform_error_1.transformError)(err, { | ||
spreadPathsToArguments: {}, | ||
explicitPathsToArguments: { | ||
idpConnectionId: '$[0].idpConnectionId', | ||
tokenParams: '$[0].tokenParams', | ||
}, | ||
singleArgumentUnchanged: false, | ||
}, ['options']); | ||
sideEffects?.onError?.(err); | ||
throw transformedError; | ||
} | ||
} | ||
@@ -431,33 +398,29 @@ exports.loginWithIdpConnectionTokenParams = loginWithIdpConnectionTokenParams; | ||
*/ | ||
function proceedToNextState(options) { | ||
var arguments_7 = arguments; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
var _a, _b, _c; | ||
// @ts-ignore | ||
const { httpClient, sideEffects } = arguments_7[1]; | ||
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({ | ||
stateToken: options === null || options === void 0 ? void 0 : options.stateToken, | ||
}); | ||
const reqOpts = ambassadorWixIamAuthenticationV1Authentication.proceedToNextState(payload); | ||
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects); | ||
try { | ||
const result = yield httpClient.request(reqOpts); | ||
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result); | ||
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [ | ||
{ | ||
transformFn: address_2.transformRESTAddressToSDKAddress, | ||
paths: [{ path: 'identity.identityProfile.addresses.address' }], | ||
}, | ||
])); | ||
} | ||
catch (err) { | ||
const transformedError = (0, transform_error_1.transformError)(err, { | ||
spreadPathsToArguments: {}, | ||
explicitPathsToArguments: { stateToken: '$[0].stateToken' }, | ||
singleArgumentUnchanged: false, | ||
}, ['options']); | ||
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err); | ||
throw transformedError; | ||
} | ||
async function proceedToNextState(options) { | ||
// @ts-ignore | ||
const { httpClient, sideEffects } = arguments[1]; | ||
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({ | ||
stateToken: options?.stateToken, | ||
}); | ||
const reqOpts = ambassadorWixIamAuthenticationV1Authentication.proceedToNextState(payload); | ||
sideEffects?.onSiteCall?.(); | ||
try { | ||
const result = await httpClient.request(reqOpts); | ||
sideEffects?.onSuccess?.(result); | ||
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [ | ||
{ | ||
transformFn: address_2.transformRESTAddressToSDKAddress, | ||
paths: [{ path: 'identity.identityProfile.addresses.address' }], | ||
}, | ||
])); | ||
} | ||
catch (err) { | ||
const transformedError = (0, transform_error_1.transformError)(err, { | ||
spreadPathsToArguments: {}, | ||
explicitPathsToArguments: { stateToken: '$[0].stateToken' }, | ||
singleArgumentUnchanged: false, | ||
}, ['options']); | ||
sideEffects?.onError?.(err); | ||
throw transformedError; | ||
} | ||
} | ||
@@ -470,46 +433,42 @@ exports.proceedToNextState = proceedToNextState; | ||
*/ | ||
function signOn(loginId, options) { | ||
var arguments_8 = arguments; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
var _a, _b, _c; | ||
// @ts-ignore | ||
const { httpClient, sideEffects } = arguments_8[2]; | ||
const payload = (0, transform_paths_1.transformPaths)((0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({ | ||
loginId: loginId, | ||
profile: options === null || options === void 0 ? void 0 : options.profile, | ||
verifyEmail: options === null || options === void 0 ? void 0 : options.verifyEmail, | ||
mergeExistingContact: options === null || options === void 0 ? void 0 : options.mergeExistingContact, | ||
}), [ | ||
async function signOn(loginId, options) { | ||
// @ts-ignore | ||
const { httpClient, sideEffects } = arguments[2]; | ||
const payload = (0, transform_paths_1.transformPaths)((0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({ | ||
loginId: loginId, | ||
profile: options?.profile, | ||
verifyEmail: options?.verifyEmail, | ||
mergeExistingContact: options?.mergeExistingContact, | ||
}), [ | ||
{ | ||
transformFn: address_1.transformSDKAddressToRESTAddress, | ||
paths: [{ path: 'profile.addresses.address' }], | ||
}, | ||
]); | ||
const reqOpts = ambassadorWixIamAuthenticationV1Authentication.signOn(payload); | ||
sideEffects?.onSiteCall?.(); | ||
try { | ||
const result = await httpClient.request(reqOpts); | ||
sideEffects?.onSuccess?.(result); | ||
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [ | ||
{ | ||
transformFn: address_1.transformSDKAddressToRESTAddress, | ||
paths: [{ path: 'profile.addresses.address' }], | ||
transformFn: address_2.transformRESTAddressToSDKAddress, | ||
paths: [{ path: 'identity.identityProfile.addresses.address' }], | ||
}, | ||
]); | ||
const reqOpts = ambassadorWixIamAuthenticationV1Authentication.signOn(payload); | ||
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects); | ||
try { | ||
const result = yield httpClient.request(reqOpts); | ||
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result); | ||
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [ | ||
{ | ||
transformFn: address_2.transformRESTAddressToSDKAddress, | ||
paths: [{ path: 'identity.identityProfile.addresses.address' }], | ||
}, | ||
])); | ||
} | ||
catch (err) { | ||
const transformedError = (0, transform_error_1.transformError)(err, { | ||
spreadPathsToArguments: {}, | ||
explicitPathsToArguments: { | ||
loginId: '$[0]', | ||
profile: '$[1].profile', | ||
verifyEmail: '$[1].verifyEmail', | ||
mergeExistingContact: '$[1].mergeExistingContact', | ||
}, | ||
singleArgumentUnchanged: false, | ||
}, ['loginId', 'options']); | ||
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err); | ||
throw transformedError; | ||
} | ||
}); | ||
])); | ||
} | ||
catch (err) { | ||
const transformedError = (0, transform_error_1.transformError)(err, { | ||
spreadPathsToArguments: {}, | ||
explicitPathsToArguments: { | ||
loginId: '$[0]', | ||
profile: '$[1].profile', | ||
verifyEmail: '$[1].verifyEmail', | ||
mergeExistingContact: '$[1].mergeExistingContact', | ||
}, | ||
singleArgumentUnchanged: false, | ||
}, ['loginId', 'options']); | ||
sideEffects?.onError?.(err); | ||
throw transformedError; | ||
} | ||
} | ||
@@ -522,34 +481,30 @@ exports.signOn = signOn; | ||
*/ | ||
function logout(options) { | ||
var arguments_9 = arguments; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
var _a, _b, _c; | ||
// @ts-ignore | ||
const { httpClient, sideEffects } = arguments_9[1]; | ||
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({ | ||
postLogoutRedirectUri: options === null || options === void 0 ? void 0 : options.postLogoutRedirectUri, | ||
clientId: options === null || options === void 0 ? void 0 : options.clientId, | ||
}); | ||
const reqOpts = ambassadorWixIamAuthenticationV1Authentication.logout(payload); | ||
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects); | ||
try { | ||
const result = yield httpClient.request(reqOpts); | ||
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result); | ||
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data); | ||
} | ||
catch (err) { | ||
const transformedError = (0, transform_error_1.transformError)(err, { | ||
spreadPathsToArguments: {}, | ||
explicitPathsToArguments: { | ||
postLogoutRedirectUri: '$[0].postLogoutRedirectUri', | ||
clientId: '$[0].clientId', | ||
}, | ||
singleArgumentUnchanged: false, | ||
}, ['options']); | ||
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err); | ||
throw transformedError; | ||
} | ||
async function logout(options) { | ||
// @ts-ignore | ||
const { httpClient, sideEffects } = arguments[1]; | ||
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({ | ||
postLogoutRedirectUri: options?.postLogoutRedirectUri, | ||
clientId: options?.clientId, | ||
}); | ||
const reqOpts = ambassadorWixIamAuthenticationV1Authentication.logout(payload); | ||
sideEffects?.onSiteCall?.(); | ||
try { | ||
const result = await httpClient.request(reqOpts); | ||
sideEffects?.onSuccess?.(result); | ||
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data); | ||
} | ||
catch (err) { | ||
const transformedError = (0, transform_error_1.transformError)(err, { | ||
spreadPathsToArguments: {}, | ||
explicitPathsToArguments: { | ||
postLogoutRedirectUri: '$[0].postLogoutRedirectUri', | ||
clientId: '$[0].clientId', | ||
}, | ||
singleArgumentUnchanged: false, | ||
}, ['options']); | ||
sideEffects?.onError?.(err); | ||
throw transformedError; | ||
} | ||
} | ||
exports.logout = logout; | ||
//# sourceMappingURL=iam-authentication-v1-authentication-authentication.universal.js.map |
import { register as publicRegister, login as publicLogin, registerV2 as publicRegisterV2, loginV2 as publicLoginV2, changePassword as publicChangePassword, loginWithIdpConnectionTokenParams as publicLoginWithIdpConnectionTokenParams, proceedToNextState as publicProceedToNextState, signOn as publicSignOn, logout as publicLogout, } from './iam-authentication-v1-authentication-authentication.public'; | ||
export const register = (...args) => { | ||
var _a; | ||
const context = | ||
@@ -15,7 +14,6 @@ // @ts-expect-error | ||
return context | ||
.initWixModules(publicRegister, ((_a = args[1]) === null || _a === void 0 ? void 0 : _a.supressAuth) ? true : false) | ||
.initWixModules(publicRegister, args[1]?.supressAuth ? true : false) | ||
.apply(undefined, args); | ||
}; | ||
export const login = (...args) => { | ||
var _a; | ||
const context = | ||
@@ -32,7 +30,6 @@ // @ts-expect-error | ||
return context | ||
.initWixModules(publicLogin, ((_a = args[1]) === null || _a === void 0 ? void 0 : _a.supressAuth) ? true : false) | ||
.initWixModules(publicLogin, args[1]?.supressAuth ? true : false) | ||
.apply(undefined, args); | ||
}; | ||
export const registerV2 = (...args) => { | ||
var _a; | ||
const context = | ||
@@ -49,7 +46,6 @@ // @ts-expect-error | ||
return context | ||
.initWixModules(publicRegisterV2, ((_a = args[1]) === null || _a === void 0 ? void 0 : _a.supressAuth) ? true : false) | ||
.initWixModules(publicRegisterV2, args[1]?.supressAuth ? true : false) | ||
.apply(undefined, args); | ||
}; | ||
export const loginV2 = (...args) => { | ||
var _a; | ||
const context = | ||
@@ -66,7 +62,6 @@ // @ts-expect-error | ||
return context | ||
.initWixModules(publicLoginV2, ((_a = args[1]) === null || _a === void 0 ? void 0 : _a.supressAuth) ? true : false) | ||
.initWixModules(publicLoginV2, args[1]?.supressAuth ? true : false) | ||
.apply(undefined, args); | ||
}; | ||
export const changePassword = (...args) => { | ||
var _a; | ||
const context = | ||
@@ -83,7 +78,6 @@ // @ts-expect-error | ||
return context | ||
.initWixModules(publicChangePassword, ((_a = args[1]) === null || _a === void 0 ? void 0 : _a.supressAuth) ? true : false) | ||
.initWixModules(publicChangePassword, args[1]?.supressAuth ? true : false) | ||
.apply(undefined, args); | ||
}; | ||
export const loginWithIdpConnectionTokenParams = (...args) => { | ||
var _a; | ||
const context = | ||
@@ -100,7 +94,6 @@ // @ts-expect-error | ||
return context | ||
.initWixModules(publicLoginWithIdpConnectionTokenParams, ((_a = args[1]) === null || _a === void 0 ? void 0 : _a.supressAuth) ? true : false) | ||
.initWixModules(publicLoginWithIdpConnectionTokenParams, args[1]?.supressAuth ? true : false) | ||
.apply(undefined, args); | ||
}; | ||
export const proceedToNextState = (...args) => { | ||
var _a; | ||
const context = | ||
@@ -117,7 +110,6 @@ // @ts-expect-error | ||
return context | ||
.initWixModules(publicProceedToNextState, ((_a = args[1]) === null || _a === void 0 ? void 0 : _a.supressAuth) ? true : false) | ||
.initWixModules(publicProceedToNextState, args[1]?.supressAuth ? true : false) | ||
.apply(undefined, args); | ||
}; | ||
export const signOn = (...args) => { | ||
var _a; | ||
const context = | ||
@@ -134,7 +126,6 @@ // @ts-expect-error | ||
return context | ||
.initWixModules(publicSignOn, ((_a = args[1]) === null || _a === void 0 ? void 0 : _a.supressAuth) ? true : false) | ||
.initWixModules(publicSignOn, args[1]?.supressAuth ? true : false) | ||
.apply(undefined, args); | ||
}; | ||
export const logout = (...args) => { | ||
var _a; | ||
const context = | ||
@@ -151,5 +142,5 @@ // @ts-expect-error | ||
return context | ||
.initWixModules(publicLogout, ((_a = args[1]) === null || _a === void 0 ? void 0 : _a.supressAuth) ? true : false) | ||
.initWixModules(publicLogout, args[1]?.supressAuth ? true : false) | ||
.apply(undefined, args); | ||
}; | ||
//# sourceMappingURL=iam-authentication-v1-authentication-authentication.context.js.map |
@@ -1,10 +0,1 @@ | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error'; | ||
@@ -118,46 +109,42 @@ import { renameKeysFromSDKRequestToRESTRequest, renameKeysFromRESTResponseToSDKResponse, } from '@wix/sdk-runtime/rename-all-nested-keys'; | ||
*/ | ||
export function register(identity, options) { | ||
var arguments_1 = arguments; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
var _a, _b, _c; | ||
// @ts-ignore | ||
const { httpClient, sideEffects } = arguments_1[2]; | ||
const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({ | ||
identity: identity, | ||
authenticatorId: options === null || options === void 0 ? void 0 : options.authenticatorId, | ||
inputs: options === null || options === void 0 ? void 0 : options.inputs, | ||
captchaTokens: options === null || options === void 0 ? void 0 : options.captchaTokens, | ||
}), [ | ||
export async function register(identity, options) { | ||
// @ts-ignore | ||
const { httpClient, sideEffects } = arguments[2]; | ||
const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({ | ||
identity: identity, | ||
authenticatorId: options?.authenticatorId, | ||
inputs: options?.inputs, | ||
captchaTokens: options?.captchaTokens, | ||
}), [ | ||
{ | ||
transformFn: transformSDKAddressToRESTAddress, | ||
paths: [{ path: 'identity.identityProfile.addresses.address' }], | ||
}, | ||
]); | ||
const reqOpts = ambassadorWixIamAuthenticationV1Authentication.register(payload); | ||
sideEffects?.onSiteCall?.(); | ||
try { | ||
const result = await httpClient.request(reqOpts); | ||
sideEffects?.onSuccess?.(result); | ||
return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [ | ||
{ | ||
transformFn: transformSDKAddressToRESTAddress, | ||
transformFn: transformRESTAddressToSDKAddress, | ||
paths: [{ path: 'identity.identityProfile.addresses.address' }], | ||
}, | ||
]); | ||
const reqOpts = ambassadorWixIamAuthenticationV1Authentication.register(payload); | ||
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects); | ||
try { | ||
const result = yield httpClient.request(reqOpts); | ||
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result); | ||
return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [ | ||
{ | ||
transformFn: transformRESTAddressToSDKAddress, | ||
paths: [{ path: 'identity.identityProfile.addresses.address' }], | ||
}, | ||
])); | ||
} | ||
catch (err) { | ||
const transformedError = sdkTransformError(err, { | ||
spreadPathsToArguments: {}, | ||
explicitPathsToArguments: { | ||
identity: '$[0]', | ||
authenticatorId: '$[1].authenticatorId', | ||
inputs: '$[1].inputs', | ||
captchaTokens: '$[1].captchaTokens', | ||
}, | ||
singleArgumentUnchanged: false, | ||
}, ['identity', 'options']); | ||
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err); | ||
throw transformedError; | ||
} | ||
}); | ||
])); | ||
} | ||
catch (err) { | ||
const transformedError = sdkTransformError(err, { | ||
spreadPathsToArguments: {}, | ||
explicitPathsToArguments: { | ||
identity: '$[0]', | ||
authenticatorId: '$[1].authenticatorId', | ||
inputs: '$[1].inputs', | ||
captchaTokens: '$[1].captchaTokens', | ||
}, | ||
singleArgumentUnchanged: false, | ||
}, ['identity', 'options']); | ||
sideEffects?.onError?.(err); | ||
throw transformedError; | ||
} | ||
} | ||
@@ -168,43 +155,39 @@ /** @public | ||
*/ | ||
export function login(identifier, options) { | ||
var arguments_2 = arguments; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
var _a, _b, _c; | ||
// @ts-ignore | ||
const { httpClient, sideEffects } = arguments_2[2]; | ||
const payload = renameKeysFromSDKRequestToRESTRequest({ | ||
identifier: identifier, | ||
authenticatorId: options === null || options === void 0 ? void 0 : options.authenticatorId, | ||
inputs: options === null || options === void 0 ? void 0 : options.inputs, | ||
captchaTokens: options === null || options === void 0 ? void 0 : options.captchaTokens, | ||
loginId: options === null || options === void 0 ? void 0 : options.loginId, | ||
}); | ||
const reqOpts = ambassadorWixIamAuthenticationV1Authentication.login(payload); | ||
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects); | ||
try { | ||
const result = yield httpClient.request(reqOpts); | ||
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result); | ||
return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [ | ||
{ | ||
transformFn: transformRESTAddressToSDKAddress, | ||
paths: [{ path: 'identity.identityProfile.addresses.address' }], | ||
}, | ||
])); | ||
} | ||
catch (err) { | ||
const transformedError = sdkTransformError(err, { | ||
spreadPathsToArguments: {}, | ||
explicitPathsToArguments: { | ||
identifier: '$[0]', | ||
authenticatorId: '$[1].authenticatorId', | ||
inputs: '$[1].inputs', | ||
captchaTokens: '$[1].captchaTokens', | ||
loginId: '$[1].loginId', | ||
}, | ||
singleArgumentUnchanged: false, | ||
}, ['identifier', 'options']); | ||
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err); | ||
throw transformedError; | ||
} | ||
export async function login(identifier, options) { | ||
// @ts-ignore | ||
const { httpClient, sideEffects } = arguments[2]; | ||
const payload = renameKeysFromSDKRequestToRESTRequest({ | ||
identifier: identifier, | ||
authenticatorId: options?.authenticatorId, | ||
inputs: options?.inputs, | ||
captchaTokens: options?.captchaTokens, | ||
loginId: options?.loginId, | ||
}); | ||
const reqOpts = ambassadorWixIamAuthenticationV1Authentication.login(payload); | ||
sideEffects?.onSiteCall?.(); | ||
try { | ||
const result = await httpClient.request(reqOpts); | ||
sideEffects?.onSuccess?.(result); | ||
return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [ | ||
{ | ||
transformFn: transformRESTAddressToSDKAddress, | ||
paths: [{ path: 'identity.identityProfile.addresses.address' }], | ||
}, | ||
])); | ||
} | ||
catch (err) { | ||
const transformedError = sdkTransformError(err, { | ||
spreadPathsToArguments: {}, | ||
explicitPathsToArguments: { | ||
identifier: '$[0]', | ||
authenticatorId: '$[1].authenticatorId', | ||
inputs: '$[1].inputs', | ||
captchaTokens: '$[1].captchaTokens', | ||
loginId: '$[1].loginId', | ||
}, | ||
singleArgumentUnchanged: false, | ||
}, ['identifier', 'options']); | ||
sideEffects?.onError?.(err); | ||
throw transformedError; | ||
} | ||
} | ||
@@ -224,48 +207,44 @@ /** | ||
*/ | ||
export function registerV2(loginId, options) { | ||
var arguments_3 = arguments; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
var _a, _b, _c; | ||
// @ts-ignore | ||
const { httpClient, sideEffects } = arguments_3[2]; | ||
const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({ | ||
loginId: loginId, | ||
password: options === null || options === void 0 ? void 0 : options.password, | ||
profile: options === null || options === void 0 ? void 0 : options.profile, | ||
captchaTokens: options === null || options === void 0 ? void 0 : options.captchaTokens, | ||
clientMetaData: options === null || options === void 0 ? void 0 : options.clientMetaData, | ||
}), [ | ||
export async function registerV2(loginId, options) { | ||
// @ts-ignore | ||
const { httpClient, sideEffects } = arguments[2]; | ||
const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({ | ||
loginId: loginId, | ||
password: options?.password, | ||
profile: options?.profile, | ||
captchaTokens: options?.captchaTokens, | ||
clientMetaData: options?.clientMetaData, | ||
}), [ | ||
{ | ||
transformFn: transformSDKAddressToRESTAddress, | ||
paths: [{ path: 'profile.addresses.address' }], | ||
}, | ||
]); | ||
const reqOpts = ambassadorWixIamAuthenticationV1Authentication.registerV2(payload); | ||
sideEffects?.onSiteCall?.(); | ||
try { | ||
const result = await httpClient.request(reqOpts); | ||
sideEffects?.onSuccess?.(result); | ||
return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [ | ||
{ | ||
transformFn: transformSDKAddressToRESTAddress, | ||
paths: [{ path: 'profile.addresses.address' }], | ||
transformFn: transformRESTAddressToSDKAddress, | ||
paths: [{ path: 'identity.identityProfile.addresses.address' }], | ||
}, | ||
]); | ||
const reqOpts = ambassadorWixIamAuthenticationV1Authentication.registerV2(payload); | ||
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects); | ||
try { | ||
const result = yield httpClient.request(reqOpts); | ||
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result); | ||
return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [ | ||
{ | ||
transformFn: transformRESTAddressToSDKAddress, | ||
paths: [{ path: 'identity.identityProfile.addresses.address' }], | ||
}, | ||
])); | ||
} | ||
catch (err) { | ||
const transformedError = sdkTransformError(err, { | ||
spreadPathsToArguments: {}, | ||
explicitPathsToArguments: { | ||
loginId: '$[0]', | ||
password: '$[1].password', | ||
profile: '$[1].profile', | ||
captchaTokens: '$[1].captchaTokens', | ||
clientMetaData: '$[1].clientMetaData', | ||
}, | ||
singleArgumentUnchanged: false, | ||
}, ['loginId', 'options']); | ||
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err); | ||
throw transformedError; | ||
} | ||
}); | ||
])); | ||
} | ||
catch (err) { | ||
const transformedError = sdkTransformError(err, { | ||
spreadPathsToArguments: {}, | ||
explicitPathsToArguments: { | ||
loginId: '$[0]', | ||
password: '$[1].password', | ||
profile: '$[1].profile', | ||
captchaTokens: '$[1].captchaTokens', | ||
clientMetaData: '$[1].clientMetaData', | ||
}, | ||
singleArgumentUnchanged: false, | ||
}, ['loginId', 'options']); | ||
sideEffects?.onError?.(err); | ||
throw transformedError; | ||
} | ||
} | ||
@@ -282,39 +261,35 @@ /** | ||
*/ | ||
export function loginV2(loginId, options) { | ||
var arguments_4 = arguments; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
var _a, _b, _c; | ||
// @ts-ignore | ||
const { httpClient, sideEffects } = arguments_4[2]; | ||
const payload = renameKeysFromSDKRequestToRESTRequest({ | ||
loginId: loginId, | ||
password: options === null || options === void 0 ? void 0 : options.password, | ||
captchaTokens: options === null || options === void 0 ? void 0 : options.captchaTokens, | ||
}); | ||
const reqOpts = ambassadorWixIamAuthenticationV1Authentication.loginV2(payload); | ||
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects); | ||
try { | ||
const result = yield httpClient.request(reqOpts); | ||
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result); | ||
return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [ | ||
{ | ||
transformFn: transformRESTAddressToSDKAddress, | ||
paths: [{ path: 'identity.identityProfile.addresses.address' }], | ||
}, | ||
])); | ||
} | ||
catch (err) { | ||
const transformedError = sdkTransformError(err, { | ||
spreadPathsToArguments: {}, | ||
explicitPathsToArguments: { | ||
loginId: '$[0]', | ||
password: '$[1].password', | ||
captchaTokens: '$[1].captchaTokens', | ||
}, | ||
singleArgumentUnchanged: false, | ||
}, ['loginId', 'options']); | ||
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err); | ||
throw transformedError; | ||
} | ||
export async function loginV2(loginId, options) { | ||
// @ts-ignore | ||
const { httpClient, sideEffects } = arguments[2]; | ||
const payload = renameKeysFromSDKRequestToRESTRequest({ | ||
loginId: loginId, | ||
password: options?.password, | ||
captchaTokens: options?.captchaTokens, | ||
}); | ||
const reqOpts = ambassadorWixIamAuthenticationV1Authentication.loginV2(payload); | ||
sideEffects?.onSiteCall?.(); | ||
try { | ||
const result = await httpClient.request(reqOpts); | ||
sideEffects?.onSuccess?.(result); | ||
return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [ | ||
{ | ||
transformFn: transformRESTAddressToSDKAddress, | ||
paths: [{ path: 'identity.identityProfile.addresses.address' }], | ||
}, | ||
])); | ||
} | ||
catch (err) { | ||
const transformedError = sdkTransformError(err, { | ||
spreadPathsToArguments: {}, | ||
explicitPathsToArguments: { | ||
loginId: '$[0]', | ||
password: '$[1].password', | ||
captchaTokens: '$[1].captchaTokens', | ||
}, | ||
singleArgumentUnchanged: false, | ||
}, ['loginId', 'options']); | ||
sideEffects?.onError?.(err); | ||
throw transformedError; | ||
} | ||
} | ||
@@ -328,27 +303,23 @@ /** | ||
*/ | ||
export function changePassword(newPassword) { | ||
var arguments_5 = arguments; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
var _a, _b, _c; | ||
// @ts-ignore | ||
const { httpClient, sideEffects } = arguments_5[1]; | ||
const payload = renameKeysFromSDKRequestToRESTRequest({ | ||
newPassword: newPassword, | ||
}); | ||
const reqOpts = ambassadorWixIamAuthenticationV1Authentication.changePassword(payload); | ||
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects); | ||
try { | ||
const result = yield httpClient.request(reqOpts); | ||
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result); | ||
} | ||
catch (err) { | ||
const transformedError = sdkTransformError(err, { | ||
spreadPathsToArguments: {}, | ||
explicitPathsToArguments: { newPassword: '$[0]' }, | ||
singleArgumentUnchanged: false, | ||
}, ['newPassword']); | ||
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err); | ||
throw transformedError; | ||
} | ||
export async function changePassword(newPassword) { | ||
// @ts-ignore | ||
const { httpClient, sideEffects } = arguments[1]; | ||
const payload = renameKeysFromSDKRequestToRESTRequest({ | ||
newPassword: newPassword, | ||
}); | ||
const reqOpts = ambassadorWixIamAuthenticationV1Authentication.changePassword(payload); | ||
sideEffects?.onSiteCall?.(); | ||
try { | ||
const result = await httpClient.request(reqOpts); | ||
sideEffects?.onSuccess?.(result); | ||
} | ||
catch (err) { | ||
const transformedError = sdkTransformError(err, { | ||
spreadPathsToArguments: {}, | ||
explicitPathsToArguments: { newPassword: '$[0]' }, | ||
singleArgumentUnchanged: false, | ||
}, ['newPassword']); | ||
sideEffects?.onError?.(err); | ||
throw transformedError; | ||
} | ||
} | ||
@@ -358,37 +329,33 @@ /** @public | ||
*/ | ||
export function loginWithIdpConnectionTokenParams(options) { | ||
var arguments_6 = arguments; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
var _a, _b, _c; | ||
// @ts-ignore | ||
const { httpClient, sideEffects } = arguments_6[1]; | ||
const payload = renameKeysFromSDKRequestToRESTRequest({ | ||
idpConnectionId: options === null || options === void 0 ? void 0 : options.idpConnectionId, | ||
tokenParams: options === null || options === void 0 ? void 0 : options.tokenParams, | ||
}); | ||
const reqOpts = ambassadorWixIamAuthenticationV1Authentication.loginWithIdpConnectionTokenParams(payload); | ||
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects); | ||
try { | ||
const result = yield httpClient.request(reqOpts); | ||
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result); | ||
return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [ | ||
{ | ||
transformFn: transformRESTAddressToSDKAddress, | ||
paths: [{ path: 'identity.identityProfile.addresses.address' }], | ||
}, | ||
])); | ||
} | ||
catch (err) { | ||
const transformedError = sdkTransformError(err, { | ||
spreadPathsToArguments: {}, | ||
explicitPathsToArguments: { | ||
idpConnectionId: '$[0].idpConnectionId', | ||
tokenParams: '$[0].tokenParams', | ||
}, | ||
singleArgumentUnchanged: false, | ||
}, ['options']); | ||
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err); | ||
throw transformedError; | ||
} | ||
export async function loginWithIdpConnectionTokenParams(options) { | ||
// @ts-ignore | ||
const { httpClient, sideEffects } = arguments[1]; | ||
const payload = renameKeysFromSDKRequestToRESTRequest({ | ||
idpConnectionId: options?.idpConnectionId, | ||
tokenParams: options?.tokenParams, | ||
}); | ||
const reqOpts = ambassadorWixIamAuthenticationV1Authentication.loginWithIdpConnectionTokenParams(payload); | ||
sideEffects?.onSiteCall?.(); | ||
try { | ||
const result = await httpClient.request(reqOpts); | ||
sideEffects?.onSuccess?.(result); | ||
return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [ | ||
{ | ||
transformFn: transformRESTAddressToSDKAddress, | ||
paths: [{ path: 'identity.identityProfile.addresses.address' }], | ||
}, | ||
])); | ||
} | ||
catch (err) { | ||
const transformedError = sdkTransformError(err, { | ||
spreadPathsToArguments: {}, | ||
explicitPathsToArguments: { | ||
idpConnectionId: '$[0].idpConnectionId', | ||
tokenParams: '$[0].tokenParams', | ||
}, | ||
singleArgumentUnchanged: false, | ||
}, ['options']); | ||
sideEffects?.onError?.(err); | ||
throw transformedError; | ||
} | ||
} | ||
@@ -398,33 +365,29 @@ /** @public | ||
*/ | ||
export function proceedToNextState(options) { | ||
var arguments_7 = arguments; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
var _a, _b, _c; | ||
// @ts-ignore | ||
const { httpClient, sideEffects } = arguments_7[1]; | ||
const payload = renameKeysFromSDKRequestToRESTRequest({ | ||
stateToken: options === null || options === void 0 ? void 0 : options.stateToken, | ||
}); | ||
const reqOpts = ambassadorWixIamAuthenticationV1Authentication.proceedToNextState(payload); | ||
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects); | ||
try { | ||
const result = yield httpClient.request(reqOpts); | ||
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result); | ||
return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [ | ||
{ | ||
transformFn: transformRESTAddressToSDKAddress, | ||
paths: [{ path: 'identity.identityProfile.addresses.address' }], | ||
}, | ||
])); | ||
} | ||
catch (err) { | ||
const transformedError = sdkTransformError(err, { | ||
spreadPathsToArguments: {}, | ||
explicitPathsToArguments: { stateToken: '$[0].stateToken' }, | ||
singleArgumentUnchanged: false, | ||
}, ['options']); | ||
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err); | ||
throw transformedError; | ||
} | ||
export async function proceedToNextState(options) { | ||
// @ts-ignore | ||
const { httpClient, sideEffects } = arguments[1]; | ||
const payload = renameKeysFromSDKRequestToRESTRequest({ | ||
stateToken: options?.stateToken, | ||
}); | ||
const reqOpts = ambassadorWixIamAuthenticationV1Authentication.proceedToNextState(payload); | ||
sideEffects?.onSiteCall?.(); | ||
try { | ||
const result = await httpClient.request(reqOpts); | ||
sideEffects?.onSuccess?.(result); | ||
return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [ | ||
{ | ||
transformFn: transformRESTAddressToSDKAddress, | ||
paths: [{ path: 'identity.identityProfile.addresses.address' }], | ||
}, | ||
])); | ||
} | ||
catch (err) { | ||
const transformedError = sdkTransformError(err, { | ||
spreadPathsToArguments: {}, | ||
explicitPathsToArguments: { stateToken: '$[0].stateToken' }, | ||
singleArgumentUnchanged: false, | ||
}, ['options']); | ||
sideEffects?.onError?.(err); | ||
throw transformedError; | ||
} | ||
} | ||
@@ -436,46 +399,42 @@ /** @param loginId - the identifier of the identity | ||
*/ | ||
export function signOn(loginId, options) { | ||
var arguments_8 = arguments; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
var _a, _b, _c; | ||
// @ts-ignore | ||
const { httpClient, sideEffects } = arguments_8[2]; | ||
const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({ | ||
loginId: loginId, | ||
profile: options === null || options === void 0 ? void 0 : options.profile, | ||
verifyEmail: options === null || options === void 0 ? void 0 : options.verifyEmail, | ||
mergeExistingContact: options === null || options === void 0 ? void 0 : options.mergeExistingContact, | ||
}), [ | ||
export async function signOn(loginId, options) { | ||
// @ts-ignore | ||
const { httpClient, sideEffects } = arguments[2]; | ||
const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({ | ||
loginId: loginId, | ||
profile: options?.profile, | ||
verifyEmail: options?.verifyEmail, | ||
mergeExistingContact: options?.mergeExistingContact, | ||
}), [ | ||
{ | ||
transformFn: transformSDKAddressToRESTAddress, | ||
paths: [{ path: 'profile.addresses.address' }], | ||
}, | ||
]); | ||
const reqOpts = ambassadorWixIamAuthenticationV1Authentication.signOn(payload); | ||
sideEffects?.onSiteCall?.(); | ||
try { | ||
const result = await httpClient.request(reqOpts); | ||
sideEffects?.onSuccess?.(result); | ||
return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [ | ||
{ | ||
transformFn: transformSDKAddressToRESTAddress, | ||
paths: [{ path: 'profile.addresses.address' }], | ||
transformFn: transformRESTAddressToSDKAddress, | ||
paths: [{ path: 'identity.identityProfile.addresses.address' }], | ||
}, | ||
]); | ||
const reqOpts = ambassadorWixIamAuthenticationV1Authentication.signOn(payload); | ||
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects); | ||
try { | ||
const result = yield httpClient.request(reqOpts); | ||
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result); | ||
return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [ | ||
{ | ||
transformFn: transformRESTAddressToSDKAddress, | ||
paths: [{ path: 'identity.identityProfile.addresses.address' }], | ||
}, | ||
])); | ||
} | ||
catch (err) { | ||
const transformedError = sdkTransformError(err, { | ||
spreadPathsToArguments: {}, | ||
explicitPathsToArguments: { | ||
loginId: '$[0]', | ||
profile: '$[1].profile', | ||
verifyEmail: '$[1].verifyEmail', | ||
mergeExistingContact: '$[1].mergeExistingContact', | ||
}, | ||
singleArgumentUnchanged: false, | ||
}, ['loginId', 'options']); | ||
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err); | ||
throw transformedError; | ||
} | ||
}); | ||
])); | ||
} | ||
catch (err) { | ||
const transformedError = sdkTransformError(err, { | ||
spreadPathsToArguments: {}, | ||
explicitPathsToArguments: { | ||
loginId: '$[0]', | ||
profile: '$[1].profile', | ||
verifyEmail: '$[1].verifyEmail', | ||
mergeExistingContact: '$[1].mergeExistingContact', | ||
}, | ||
singleArgumentUnchanged: false, | ||
}, ['loginId', 'options']); | ||
sideEffects?.onError?.(err); | ||
throw transformedError; | ||
} | ||
} | ||
@@ -487,33 +446,29 @@ /** | ||
*/ | ||
export function logout(options) { | ||
var arguments_9 = arguments; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
var _a, _b, _c; | ||
// @ts-ignore | ||
const { httpClient, sideEffects } = arguments_9[1]; | ||
const payload = renameKeysFromSDKRequestToRESTRequest({ | ||
postLogoutRedirectUri: options === null || options === void 0 ? void 0 : options.postLogoutRedirectUri, | ||
clientId: options === null || options === void 0 ? void 0 : options.clientId, | ||
}); | ||
const reqOpts = ambassadorWixIamAuthenticationV1Authentication.logout(payload); | ||
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects); | ||
try { | ||
const result = yield httpClient.request(reqOpts); | ||
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result); | ||
return renameKeysFromRESTResponseToSDKResponse(result.data); | ||
} | ||
catch (err) { | ||
const transformedError = sdkTransformError(err, { | ||
spreadPathsToArguments: {}, | ||
explicitPathsToArguments: { | ||
postLogoutRedirectUri: '$[0].postLogoutRedirectUri', | ||
clientId: '$[0].clientId', | ||
}, | ||
singleArgumentUnchanged: false, | ||
}, ['options']); | ||
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err); | ||
throw transformedError; | ||
} | ||
export async function logout(options) { | ||
// @ts-ignore | ||
const { httpClient, sideEffects } = arguments[1]; | ||
const payload = renameKeysFromSDKRequestToRESTRequest({ | ||
postLogoutRedirectUri: options?.postLogoutRedirectUri, | ||
clientId: options?.clientId, | ||
}); | ||
const reqOpts = ambassadorWixIamAuthenticationV1Authentication.logout(payload); | ||
sideEffects?.onSiteCall?.(); | ||
try { | ||
const result = await httpClient.request(reqOpts); | ||
sideEffects?.onSuccess?.(result); | ||
return renameKeysFromRESTResponseToSDKResponse(result.data); | ||
} | ||
catch (err) { | ||
const transformedError = sdkTransformError(err, { | ||
spreadPathsToArguments: {}, | ||
explicitPathsToArguments: { | ||
postLogoutRedirectUri: '$[0].postLogoutRedirectUri', | ||
clientId: '$[0].clientId', | ||
}, | ||
singleArgumentUnchanged: false, | ||
}, ['options']); | ||
sideEffects?.onError?.(err); | ||
throw transformedError; | ||
} | ||
} | ||
//# sourceMappingURL=iam-authentication-v1-authentication-authentication.universal.js.map |
{ | ||
"name": "@wix/identity_authentication", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"publishConfig": { | ||
@@ -42,3 +42,3 @@ "registry": "https://registry.npmjs.org/", | ||
}, | ||
"falconPackageHash": "65a9df56693dd78aa13304eae1851f55e3e39676dcacb959b3bb9bed" | ||
"falconPackageHash": "93377f2ab49592f997612bc2b3f25cc89b3c1fd1db719c3bb29cb448" | ||
} |
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
308484
6207