@frontegg/rest-api 2.10.27 → 2.10.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [2.10.28](https://github.com/frontegg/typescript-rest-api/compare/v2.10.27...v2.10.28) (2021-09-23)
6
+
5
7
  ### [2.10.27](https://github.com/frontegg/typescript-rest-api/compare/v2.10.26...v2.10.27) (2021-09-22)
6
8
 
7
9
  ### [2.10.26](https://github.com/frontegg/typescript-rest-api/compare/v2.10.25...v2.10.26) (2021-09-20)
@@ -3,7 +3,8 @@ export * from './secutiry-poilicy/interfaces';
3
3
  export declare enum AuthStrategyEnum {
4
4
  EmailAndPassword = "EmailAndPassword",
5
5
  MagicLink = "MagicLink",
6
- Code = "Code"
6
+ Code = "Code",
7
+ NoLocalAuthentication = "NoLocalAuthentication"
7
8
  }
8
9
  export declare type IPreLogin = {
9
10
  email: string;
@@ -94,6 +95,7 @@ export declare type ISamlConfiguration = {
94
95
  updatedAt?: Date;
95
96
  acsUrl?: string;
96
97
  spEntityId?: string;
98
+ isSamlActive?: boolean;
97
99
  oidcClientId?: string;
98
100
  oidcSecret?: string;
99
101
  type?: string;
@@ -8,6 +8,7 @@ var AuthStrategyEnum;
8
8
  AuthStrategyEnum["EmailAndPassword"] = "EmailAndPassword";
9
9
  AuthStrategyEnum["MagicLink"] = "MagicLink";
10
10
  AuthStrategyEnum["Code"] = "Code";
11
+ AuthStrategyEnum["NoLocalAuthentication"] = "NoLocalAuthentication";
11
12
  })(AuthStrategyEnum = exports.AuthStrategyEnum || (exports.AuthStrategyEnum = {}));
12
13
  var SocialLoginProviders;
13
14
  (function (SocialLoginProviders) {
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/auth/interfaces.ts"],"names":[],"mappings":";;;;AAEA,wEAA8C;AAE9C,IAAY,gBAIX;AAJD,WAAY,gBAAgB;IAC1B,yDAAqC,CAAA;IACrC,2CAAuB,CAAA;IACvB,iCAAa,CAAA;AACf,CAAC,EAJW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAI3B;AAgID,IAAY,oBAKX;AALD,WAAY,oBAAoB;IAC9B,+CAAuB,CAAA;IACvB,6CAAqB,CAAA;IACrB,yCAAiB,CAAA;IACjB,yCAAiB,CAAA;AACnB,CAAC,EALW,oBAAoB,GAApB,4BAAoB,KAApB,4BAAoB,QAK/B;AA4IA,CAAC"}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/auth/interfaces.ts"],"names":[],"mappings":";;;;AAEA,wEAA8C;AAE9C,IAAY,gBAKX;AALD,WAAY,gBAAgB;IAC1B,yDAAqC,CAAA;IACrC,2CAAuB,CAAA;IACvB,iCAAa,CAAA;IACb,mEAA+C,CAAA;AACjD,CAAC,EALW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAK3B;AAiID,IAAY,oBAKX;AALD,WAAY,oBAAoB;IAC9B,+CAAuB,CAAA;IACvB,6CAAqB,CAAA;IACrB,yCAAiB,CAAA;IACjB,yCAAiB,CAAA;AACnB,CAAC,EALW,oBAAoB,GAApB,4BAAoB,KAApB,4BAAoB,QAK/B;AA4IA,CAAC"}
@@ -3,7 +3,8 @@ export * from './secutiry-poilicy/interfaces';
3
3
  export declare enum AuthStrategyEnum {
4
4
  EmailAndPassword = "EmailAndPassword",
5
5
  MagicLink = "MagicLink",
6
- Code = "Code"
6
+ Code = "Code",
7
+ NoLocalAuthentication = "NoLocalAuthentication"
7
8
  }
8
9
  export declare type IPreLogin = {
9
10
  email: string;
@@ -94,6 +95,7 @@ export declare type ISamlConfiguration = {
94
95
  updatedAt?: Date;
95
96
  acsUrl?: string;
96
97
  spEntityId?: string;
98
+ isSamlActive?: boolean;
97
99
  oidcClientId?: string;
98
100
  oidcSecret?: string;
99
101
  type?: string;
@@ -4,6 +4,7 @@ export var AuthStrategyEnum;
4
4
  AuthStrategyEnum["EmailAndPassword"] = "EmailAndPassword";
5
5
  AuthStrategyEnum["MagicLink"] = "MagicLink";
6
6
  AuthStrategyEnum["Code"] = "Code";
7
+ AuthStrategyEnum["NoLocalAuthentication"] = "NoLocalAuthentication";
7
8
  })(AuthStrategyEnum || (AuthStrategyEnum = {}));
8
9
  export var SocialLoginProviders;
9
10
  (function (SocialLoginProviders) {
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/auth/interfaces.ts"],"names":[],"mappings":"AAEA,cAAc,+BAA+B,CAAC;AAE9C,MAAM,CAAN,IAAY,gBAIX;AAJD,WAAY,gBAAgB;IAC1B,yDAAqC,CAAA;IACrC,2CAAuB,CAAA;IACvB,iCAAa,CAAA;AACf,CAAC,EAJW,gBAAgB,KAAhB,gBAAgB,QAI3B;AAgID,MAAM,CAAN,IAAY,oBAKX;AALD,WAAY,oBAAoB;IAC9B,+CAAuB,CAAA;IACvB,6CAAqB,CAAA;IACrB,yCAAiB,CAAA;IACjB,yCAAiB,CAAA;AACnB,CAAC,EALW,oBAAoB,KAApB,oBAAoB,QAK/B;AA4IA,CAAC"}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/auth/interfaces.ts"],"names":[],"mappings":"AAEA,cAAc,+BAA+B,CAAC;AAE9C,MAAM,CAAN,IAAY,gBAKX;AALD,WAAY,gBAAgB;IAC1B,yDAAqC,CAAA;IACrC,2CAAuB,CAAA;IACvB,iCAAa,CAAA;IACb,mEAA+C,CAAA;AACjD,CAAC,EALW,gBAAgB,KAAhB,gBAAgB,QAK3B;AAiID,MAAM,CAAN,IAAY,oBAKX;AALD,WAAY,oBAAoB;IAC9B,+CAAuB,CAAA;IACvB,6CAAqB,CAAA;IACrB,yCAAiB,CAAA;IACjB,yCAAiB,CAAA;AACnB,CAAC,EALW,oBAAoB,KAApB,oBAAoB,QAK/B;AA4IA,CAAC"}
@@ -3,7 +3,8 @@ export * from './secutiry-poilicy/interfaces';
3
3
  export declare enum AuthStrategyEnum {
4
4
  EmailAndPassword = "EmailAndPassword",
5
5
  MagicLink = "MagicLink",
6
- Code = "Code"
6
+ Code = "Code",
7
+ NoLocalAuthentication = "NoLocalAuthentication"
7
8
  }
8
9
  export declare type IPreLogin = {
9
10
  email: string;
@@ -94,6 +95,7 @@ export declare type ISamlConfiguration = {
94
95
  updatedAt?: Date;
95
96
  acsUrl?: string;
96
97
  spEntityId?: string;
98
+ isSamlActive?: boolean;
97
99
  oidcClientId?: string;
98
100
  oidcSecret?: string;
99
101
  type?: string;
@@ -4,6 +4,7 @@ export var AuthStrategyEnum;
4
4
  AuthStrategyEnum["EmailAndPassword"] = "EmailAndPassword";
5
5
  AuthStrategyEnum["MagicLink"] = "MagicLink";
6
6
  AuthStrategyEnum["Code"] = "Code";
7
+ AuthStrategyEnum["NoLocalAuthentication"] = "NoLocalAuthentication";
7
8
  })(AuthStrategyEnum || (AuthStrategyEnum = {}));
8
9
  export var SocialLoginProviders;
9
10
  (function (SocialLoginProviders) {
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/auth/interfaces.ts"],"names":[],"mappings":"AAEA,cAAc,+BAA+B,CAAC;AAE9C,MAAM,CAAN,IAAY,gBAIX;AAJD,WAAY,gBAAgB;IAC1B,yDAAqC,CAAA;IACrC,2CAAuB,CAAA;IACvB,iCAAa,CAAA;AACf,CAAC,EAJW,gBAAgB,KAAhB,gBAAgB,QAI3B;AAgID,MAAM,CAAN,IAAY,oBAKX;AALD,WAAY,oBAAoB;IAC9B,+CAAuB,CAAA;IACvB,6CAAqB,CAAA;IACrB,yCAAiB,CAAA;IACjB,yCAAiB,CAAA;AACnB,CAAC,EALW,oBAAoB,KAApB,oBAAoB,QAK/B;AA4IA,CAAC"}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/auth/interfaces.ts"],"names":[],"mappings":"AAEA,cAAc,+BAA+B,CAAC;AAE9C,MAAM,CAAN,IAAY,gBAKX;AALD,WAAY,gBAAgB;IAC1B,yDAAqC,CAAA;IACrC,2CAAuB,CAAA;IACvB,iCAAa,CAAA;IACb,mEAA+C,CAAA;AACjD,CAAC,EALW,gBAAgB,KAAhB,gBAAgB,QAK3B;AAiID,MAAM,CAAN,IAAY,oBAKX;AALD,WAAY,oBAAoB;IAC9B,+CAAuB,CAAA;IACvB,6CAAqB,CAAA;IACrB,yCAAiB,CAAA;IACjB,yCAAiB,CAAA;AACnB,CAAC,EALW,oBAAoB,KAApB,oBAAoB,QAK/B;AA4IA,CAAC"}
package/dist/umd/index.js CHANGED
@@ -12,4 +12,4 @@
12
12
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
13
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
14
  PERFORMANCE OF THIS SOFTWARE.
15
- ***************************************************************************** */function o(e,o){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&o.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)o.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(t[n[i]]=e[n[i]])}return t}function t(e,o,t,n){return new(t||(t=Promise))((function(i,r){function s(e){try{c(n.next(e))}catch(e){r(e)}}function u(e){try{c(n.throw(e))}catch(e){r(e)}}function c(e){var o;e.done?i(e.value):(o=e.value,o instanceof t?o:new t((function(e){e(o)}))).then(s,u)}c((n=n.apply(e,o||[])).next())}))}class n{constructor(){this.context=null,this.accessToken=null,this.user=null,this.onRedirectTo=e=>window.location.href=e,this.logout=()=>window.location.href="/account/logout"}static getInstance(){return n.instance||(n.instance=new n),n.instance}static setContext(e){n.getInstance().context=e}static setAccessToken(e){n.getInstance().accessToken=e}static setUser(e){n.getInstance().user=e}static setOnRedirectTo(e){n.getInstance().onRedirectTo=e}static setLogout(e,o){n.getInstance().logout=t=>{t?e(t):n.onRedirectTo(o)}}static getContext(){var e;return null!==(e=n.getInstance().context)&&void 0!==e?e:{baseUrl:window.location.href,tokenResolver:()=>"my-authentication-token",logLevel:"error"}}static getAccessToken(){return n.getInstance().accessToken}static getUser(){return n.getInstance().user}static onRedirectTo(e,o){return n.getInstance().onRedirectTo(e,o)}static logout(e){return n.getInstance().logout(e)}}const i={getContext:()=>n.getContext(),getAccessToken:()=>n.getAccessToken(),getUser:()=>n.getUser(),onRedirectTo:(e,o)=>n.onRedirectTo(e,o),logout:e=>n.logout(e)};class r extends Error{constructor(e,o){super(e),this._statusCode=o}get statusCode(){return this._statusCode}}function s(e,o,n){return t(this,void 0,void 0,(function*(){const i=yield function(e){return t(this,void 0,void 0,(function*(){let o=e.baseUrl;const t=e.urlPrefix||"frontegg";return o.endsWith("/")||(o+="/"),o.endsWith(t)||(o+=t),o}))}(e),r=yield function(e,o){return t(this,void 0,void 0,(function*(){o||(o={});const n=yield function(e){return t(this,void 0,void 0,(function*(){let o=[];return e.additionalQueryParamsResolver&&(o=yield e.additionalQueryParamsResolver()),o}))}(e);for(const e of n)o[e.key]=e.value;const i=Object.keys(o);for(const e of i){const t=o[e];o[e]="object"==typeof t?JSON.stringify(t):t}return o}))}(e,n);let s=o.startsWith("http")?o:`${i}${o}`;const u=Object.keys(r).length>0;if(r&&u){s+=`?${new URLSearchParams(r)}`}return s}))}function u(e,o){var i;return t(this,void 0,void 0,(function*(){const r=yield(null!==(i=null==e?void 0:e.tokenResolver)&&void 0!==i?i:n.getAccessToken)(),s={};r&&(s.Authorization=`Bearer ${r}`),o&&(s["Content-Type"]=o);for(const o of yield function(e){return t(this,void 0,void 0,(function*(){let o=[];return e.additionalHeadersResolver&&(o=yield e.additionalHeadersResolver()),o}))}(e))s[`${o.key}`]=`${o.value}`;return s["x-frontegg-source"]="frontegg-react",s}))}const c=e=>t(void 0,void 0,void 0,(function*(){var o,t,i,c,a;const d=n.getContext(),l=yield u(d,e.contentType),v=yield s(d,e.url,e.params),g=yield fetch(v,{body:e.body?"application/json"===e.contentType?JSON.stringify(e.body):e.body:null,method:null!==(o=e.method)&&void 0!==o?o:"GET",headers:Object.assign(Object.assign({},l),e.headers),credentials:null!==(i=null!==(t=e.credentials)&&void 0!==t?t:d.requestCredentials)&&void 0!==i?i:"same-origin"});if(302===g.status)return window.location.href=yield g.text(),new Promise((()=>{}));if(!g.ok){if(413===g.status)throw new r("Error request is too large",g.status);let e;try{e=yield g.text(),e=JSON.parse(e)}catch(e){}throw e.errors?e=e.errors.join(", "):"string"!=typeof e&&(e=`Error ${g.status} - ${g.statusText}`),g.status>=400&&g.status<500&&["warn"].includes(null!==(c=d.logLevel)&&void 0!==c?c:"")?console.warn(e):500===g.status&&["warn","error"].includes(null!==(a=d.logLevel)&&void 0!==a?a:"")&&console.error(e),new r(e,g.status)}if(e.responseType&&"json"!==e.responseType){if("blob"===e.responseType){const{outputFileName:o}=e.params;return yield g.blob().then((e=>URL.createObjectURL(e))).then((e=>{const t=document.createElement("a");t.href=e,t.setAttribute("download",o||"output"),t.click()}))}return yield g.text()}try{return yield g.json()}catch(e){return{}}})),a=(e,o,n)=>t(void 0,void 0,void 0,(function*(){return c(Object.assign({url:e,method:"GET",contentType:"application/json",params:o},n))})),d=(e,o,n)=>t(void 0,void 0,void 0,(function*(){return c(Object.assign({url:e,method:"POST",contentType:"application/json",body:o},n))})),l=(e,o,n)=>t(void 0,void 0,void 0,(function*(){return c(Object.assign({url:e,method:"PATCH",contentType:"application/json",body:o},n))})),v=(e,o,n)=>t(void 0,void 0,void 0,(function*(){return c(Object.assign({url:e,method:"PUT",contentType:"application/json",body:o},n))})),g=(e,o,n)=>t(void 0,void 0,void 0,(function*(){return c(Object.assign({url:e,method:"DELETE",contentType:"application/json",body:o},n))})),f=(e,o,n,i)=>t(void 0,void 0,void 0,(function*(){return c(Object.assign({url:e,method:"POST",contentType:"application/json",responseType:"blob",body:o,params:n},i))}));var p=Object.freeze({__proto__:null,Get:a,Post:d,Patch:l,Put:v,Delete:g,PostDownload:f});const b="/vendors",h={auth:{v1:"/identity/resources/auth/v1"},users:{v1:"/identity/resources/users/v1",v2:"/identity/resources/users/v2",apiTokens:{v1:"/identity/resources/users/api-tokens/v1"}},configurations:{v1:"/identity/resources/configurations/v1"},sso:{v1:"/identity/resources/sso/v1"},permissions:{v1:"/identity/resources/permissions/v1"},tenants:{apiTokens:{v1:"/identity/resources/tenants/api-tokens/v1",v2:"/identity/resources/tenants/api-tokens/v2"},invites:{verify:{v1:"/identity/resources/tenants/invites/v1/verify"}}},roles:{v1:"/identity/resources/roles/v1"}},m={sso:{v1:"/team/resources/sso/v1",v2:"/team/resources/sso/v2"},members:{v1:"/team/resources/members/v1"},roles:{v1:"/team/resources/roles/v1"},stats:{v1:"/team/resources/stats/v1"},profile:{v1:"/team/resources/profile"}},y={accountSettings:{v1:"/tenants/resources/account-settings/v1"}},$={configurations:{v1:"/integrations/resources/configurations/v1",v2:"/integrations/resources/configurations/v2"}},S={billing:{subscriptions:{v1:"/subscriptions/resources/billing/subscriptions/v1"},plans:{v1:"/subscriptions/resources/billing/plans/v1"},invoices:{v1:"/subscriptions/resources/billing/invoices/v1"},paymentMethods:{v1:"/subscriptions/resources/billing/payment-methods/v1"},summaries:{v1:"/subscriptions/resources/billing/summaries/v1"},tenantConfiguration:{v1:"/subscriptions/resources/billing/tenant-configurations/v1"},paymentProviders:{stripe:{customers:{v1:"/subscriptions/resources/billing/payment-providers/stripe/customers/v1"},publicConfigurations:{v1:"/subscriptions/resources/billing/payment-providers/stripe/public-configurations/v1"},subscriptions:{v1:"/subscriptions/resources/billing/payment-providers/stripe/subscriptions/v1"},setupIntents:{v1:"/subscriptions/resources/billing/payment-providers/stripe/setup-intents/v1"}}}},paymentProviders:{v1:"/subscriptions/resources/payment-providers/v1"}},P={v1:"/notification"},k={v1:"/audits"},T={configurations:{v1:"/event/resources/configurations/v1"}},C={v1:"/webhook"};class w extends Error{constructor(e){super(e)}}const I="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(e){const o=String(e).replace(/=+$/,"");if(o.length%4==1)throw new w("'atob' failed: The string to be decoded is not correctly encoded.");let t="";for(let e,n,i=0,r=0;n=o.charAt(r++);~n&&(e=i%4?64*e+n:n,i++%4)?t+=String.fromCharCode(255&e>>(-2*i&6)):0)n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(n);return t};const O=e=>{let o=e.replace(/-/g,"+").replace(/_/g,"/");switch(o.length%4){case 0:break;case 2:o+="==";break;case 3:o+="=";break;default:throw new Error("Illegal base64url string!")}try{return function(e){return decodeURIComponent(I(e).replace(/(.)/g,((e,o)=>{let t=o.charCodeAt(0).toString(16).toUpperCase();return t.length<2&&(t="0"+t),"%"+t})))}(o)}catch(e){return I(o)}};class A extends Error{constructor(e){super(e)}}function _(e){return t(this,void 0,void 0,(function*(){if(!e.accessToken)return e;n.setAccessToken(e.accessToken);const o=yield a(`${h.users.v2}/me`),t=e.accessToken?((e,o={})=>{const t=o.header?0:1;try{return JSON.parse(O(e.split(".")[t]))}catch(e){throw new A("Invalid token specified: "+e.message)}})(e.accessToken):{},i=Object.assign(Object.assign(Object.assign({},e),t),o);return n.setUser(i),i}))}var j=Object.freeze({__proto__:null,generateLoginResponse:_,preLogin:function(e){return t(this,void 0,void 0,(function*(){console.info("preLogin()",e);try{const{address:o}=yield d(`${h.auth.v1}/user/saml/prelogin`,e);return o}catch(e){return null}}))},preLoginWithIdpType:function(e){return t(this,void 0,void 0,(function*(){return console.info("preLoginWithIdpType()",e),d(`${h.auth.v1}/user/saml/prelogin`,e)}))},postLogin:function(e){return t(this,void 0,void 0,(function*(){console.debug("postLogin()");return _(yield d(`${h.auth.v1}/user/saml/postlogin`,e))}))},oidcPostLogin:function(e){return t(this,void 0,void 0,(function*(){console.debug("oidcPostLogin()");return _(yield d(`${h.auth.v1}/user/oidc/postlogin`,e))}))},login:function(e){return t(this,void 0,void 0,(function*(){console.debug("login()");return _(yield d(`${h.auth.v1}/user`,e))}))},loginWithMfa:function(e){return t(this,void 0,void 0,(function*(){console.debug("loginWithMfa()");return _(yield d(`${h.auth.v1}/user/mfa/verify`,e))}))},activateAccount:function(e){return t(this,void 0,void 0,(function*(){return console.debug("activateAccount()"),d(`${h.users.v1}/activate`,e)}))},getActivateAccountStrategy:function(e){return t(this,void 0,void 0,(function*(){return console.debug("getActivateAccountStrategy()"),a(`${h.users.v1}/activate/strategy`,e)}))},resendActivationEmail:function(e){return t(this,void 0,void 0,(function*(){return console.debug("resendActivationEmail()"),d(`${h.users.v1}/activate/reset`,e)}))},acceptInvitation:function(e){return t(this,void 0,void 0,(function*(){return console.debug("acceptInvitation()"),d(`${h.users.v1}/invitation/accept`,e)}))},refreshToken:function(){return t(this,void 0,void 0,(function*(){console.debug("refreshToken()");return _(yield d(`${h.auth.v1}/user/token/refresh`))}))},logout:function(){return t(this,void 0,void 0,(function*(){return console.debug("logout()"),d(`${h.auth.v1}/logout`)}))},forgotPassword:function(e){return t(this,void 0,void 0,(function*(){return console.debug("forgotPassword()",e),d(`${h.users.v1}/passwords/reset`,e)}))},resetPassword:function(e){return t(this,void 0,void 0,(function*(){return console.debug("resetPassword()"),d(`${h.users.v1}/passwords/reset/verify`,e)}))},loadPasswordConfig:function(e){return t(this,void 0,void 0,(function*(){return console.debug("loadPasswordConfig()"),a(`${h.users.v1}/passwords/config`,e)}))},recoverMfaToken:function(e){return t(this,void 0,void 0,(function*(){return console.debug("recoverMfaToken()",e),d(`${h.auth.v1}/user/mfa/recover`,e)}))},enrollMfa:function(){return t(this,void 0,void 0,(function*(){return console.debug("enrollMfa()"),d(`${h.users.v1}/mfa/enroll`)}))},verifyMfa:function(e){return t(this,void 0,void 0,(function*(){return console.debug("verifyMfa()",e),d(`${h.users.v1}/mfa/enroll/verify`,e)}))},disableMfa:function(e){return t(this,void 0,void 0,(function*(){return console.debug("disableMfa()",e),d(`${h.users.v1}/mfa/disable`,e)}))},getSamlConfiguration:function(){return t(this,void 0,void 0,(function*(){return console.debug("getSamlConfiguration()"),a(`${m.sso.v1}/saml/configurations`)}))},updateSamlConfiguration:function(e){return t(this,void 0,void 0,(function*(){return console.debug("updateSamlConfiguration()",e),d(`${m.sso.v1}/saml/configurations`,e)}))},getSamlVendorConfiguration:function(){return t(this,void 0,void 0,(function*(){return console.debug("getSamlVendorConfiguration()"),a(`${m.sso.v1}/saml/configurations/vendor-config`)}))},updateSamlVendorMetadata:function(e){return t(this,void 0,void 0,(function*(){return console.debug("updateSamlVendorMetadata()",e),v(`${m.sso.v1}/saml/configurations/metadata`,e)}))},validateSamlDomain:function(){return t(this,void 0,void 0,(function*(){return console.debug("validateSamlDomain()"),v(`${m.sso.v1}/saml/validations/domain`)}))},getSamlRoles:function(){return t(this,void 0,void 0,(function*(){return console.debug("getSamlRoles()"),a(`${m.sso.v1}/saml/configurations/roles/default`)}))},getSamlRolesGroups:function(){return t(this,void 0,void 0,(function*(){return console.debug("getSamlRoles()"),a(`${m.sso.v2}/saml/configurations/groups`)}))},updateSamlRoles:function({roleIds:e}){return t(this,void 0,void 0,(function*(){return console.debug("updateSamlRoles()"),d(`${m.sso.v1}/saml/configurations/roles/default`,{roleIds:e})}))},createSamlGroup:function({roleIds:e,group:o}){return t(this,void 0,void 0,(function*(){return console.debug("createSamlGroup()"),d(`${m.sso.v2}/saml/configurations/groups`,{group:o,roleIds:e})}))},updateSamlGroup:function({roleIds:e,group:o,id:n}){return t(this,void 0,void 0,(function*(){return console.debug("updateSamlGroup()"),l(`${m.sso.v2}/saml/configurations/groups/${n}`,{group:o,roleIds:e})}))},deleteSamlGroup:function({id:e}){return t(this,void 0,void 0,(function*(){return console.debug("deleteSamlGroup()"),g(`${m.sso.v2}/saml/configurations/groups/${e}`)}))},getOidcConfiguration:function(){return t(this,void 0,void 0,(function*(){return console.debug("getSamlConfiguration()"),a(`${m.sso.v1}/oidc/configurations`)}))},getSSOPublicConfiguration:function(){return t(this,void 0,void 0,(function*(){return console.debug("getSSOPublicConfiguration()"),a(`${m.sso.v2}/configurations/public`)}))},getSocialLoginProviders:function(){return t(this,void 0,void 0,(function*(){return console.debug("getSocialLoginProviders()"),a(h.sso.v1)}))},loginViaSocialLogin:function({provider:e,code:o,redirectUri:n,codeVerifier:i,metadata:r,invitationToken:s}){return t(this,void 0,void 0,(function*(){console.debug("loginViaSocialLogin()");const t={code:o};return n&&(t.redirectUri=n),i&&(t.code_verifier=i),d(`${h.auth.v1}/user/sso/${e}/postlogin`,{metadata:r,invitationToken:s},{params:t})}))},getVendorConfig:function(){return t(this,void 0,void 0,(function*(){return console.debug("getVendorConfig()"),a(`${h.configurations.v1}/public`)}))},signUpUser:function(e){return t(this,void 0,void 0,(function*(){console.debug("signUpUser()",e);const{shouldActivate:o,authResponse:t}=yield d(`${h.users.v1}/signUp`,e);return{shouldActivate:o,user:!o&&t?yield _(t):void 0}}))},getUserApiTokensData:function(){return t(this,void 0,void 0,(function*(){return console.debug("getUserApiTokensData()"),a(h.users.apiTokens.v1)}))},getTenantApiTokensData:function(){return t(this,void 0,void 0,(function*(){return console.debug("geTenantApiTokensData()"),a(h.tenants.apiTokens.v1)}))},updateUserApiTokensData:function(e){return t(this,void 0,void 0,(function*(){return console.debug("updateUserApiTokensData()",e),d(h.users.apiTokens.v1,e)}))},updateTenantApiTokensData:function(e){return t(this,void 0,void 0,(function*(){return console.debug("updateTenantApiTokensData()",e),d(h.tenants.apiTokens.v2,e)}))},deleteTenantApiToken:function({tokenId:e}){return t(this,void 0,void 0,(function*(){return console.debug("deleteTenantApiToken()",e),g(`${h.tenants.apiTokens.v1}/${e}`)}))},deleteUserApiToken:function({tokenId:e}){return t(this,void 0,void 0,(function*(){return console.debug("deleteUserApiToken()",e),g(`${h.users.apiTokens.v1}/${e}`)}))},getUserById:function({userId:e}){return t(this,void 0,void 0,(function*(){return console.debug("getUserById()"),a(`${h.users.v1}/${e}`)}))},checkIfAllowToRememberMfaDevice:function(e){return t(this,void 0,void 0,(function*(){return console.debug("checkIfAllowToRememberMfaDevice()"),a(`${h.configurations.v1}/mfa-policy/allow-remember-device`,{mfaToken:e})}))},passwordlessPreLogin:function(e){var{type:n}=e,i=o(e,["type"]);return t(this,void 0,void 0,(function*(){return console.debug("passwordlessPrelogin()"),d(`${h.auth.v1}/passwordless/${n.toLocaleLowerCase()}/prelogin`,i)}))},passwordlessPostLogin:function(e){var{type:n}=e,i=o(e,["type"]);return t(this,void 0,void 0,(function*(){return console.debug("passwordlessPostLogin()"),d(`${h.auth.v1}/passwordless/${n.toLocaleLowerCase()}/postlogin`,i)}))},verifyInviteToken:function({token:e}){return t(this,void 0,void 0,(function*(){return console.debug("verifyInviteToken()"),d(h.tenants.invites.verify.v1,{token:e})}))},getGlobalSecurityPolicy:function(){return t(this,void 0,void 0,(function*(){return console.debug("getGlobalSecurityPolicy()"),a(h.configurations.v1)}))},getMfaPolicy:function(){return t(this,void 0,void 0,(function*(){return console.debug("getMfaPolicy()"),a(`${h.configurations.v1}/mfa-policy`)}))},saveMfaPolicy:function(e){return t(this,void 0,void 0,(function*(){return console.debug("saveMfaPolicy()"),e.id?l(`${h.configurations.v1}/mfa-policy`,e):d(`${h.configurations.v1}/mfa-policy`,e)}))},getLockoutPolicy:function(){return t(this,void 0,void 0,(function*(){return console.debug("getLockoutPolicy()"),a(`${h.configurations.v1}/lockout-policy`)}))},saveLockoutPolicy:function(e){return t(this,void 0,void 0,(function*(){return console.debug("saveLockoutPolicy()"),e.id?l(`${h.configurations.v1}/lockout-policy`,e):d(`${h.configurations.v1}/lockout-policy`,e)}))},getCaptchaPolicy:function(){return t(this,void 0,void 0,(function*(){try{return yield a(`${h.configurations.v1}/captcha-policy/public`)}catch(e){return null}}))},getPasswordHistoryPolicy:function(){return t(this,void 0,void 0,(function*(){return console.debug("getPasswordHistoryPolicy()"),a(`${h.configurations.v1}/password-history-policy`)}))},savePasswordHistoryPolicy:function(e){return t(this,void 0,void 0,(function*(){return console.debug("savePasswordHistoryPolicy()"),e.id?l(`${h.configurations.v1}/password-history-policy`,e):d(`${h.configurations.v1}/password-history-policy`,e)}))},getPasswordConfigPolicy:function(){return t(this,void 0,void 0,(function*(){return console.debug("getPasswordConfigPolicy()"),a(`${h.configurations.v1}/password`)}))}});var M=Object.freeze({__proto__:null,getProfile:function(e){return t(this,void 0,void 0,(function*(){return console.debug("getProfile()"),a(`${h.users.v2}/me`,null!=e?e:{addRoles:!0})}))},updateProfile:function(e){return t(this,void 0,void 0,(function*(){return console.debug("updateProfile()",e),v(`${h.users.v2}/me`,e)}))},updateProfileImage:function(e){return t(this,void 0,void 0,(function*(){return console.debug("updateProfileImage()",e),v(`${m.profile.v1}/me/image/v1`,e,{responseType:"plain",contentType:void 0})}))},changePassword:function(e){return t(this,void 0,void 0,(function*(){return console.debug("changePassword()"),d(`${h.users.v1}/passwords/change`,e)}))},loadUsers:function(e){var o,n,i,r,s,u;return t(this,void 0,void 0,(function*(){const t=(e.filter||[]).reduce(((e,o)=>Object.assign(Object.assign({},e),{[o.id]:o.value})),{}),c=(null===(o=e.sort)||void 0===o?void 0:o.length)?{sortBy:null!==(r=null===(i=null===(n=e.sort)||void 0===n?void 0:n[0])||void 0===i?void 0:i.id)&&void 0!==r?r:"name",sortDirection:(null===(u=null===(s=e.sort)||void 0===s?void 0:s[0])||void 0===u?void 0:u.desc)?"desc":"asc"}:null;return a(m.members.v1,Object.assign(Object.assign({pageOffset:e.pageOffset,pageSize:e.pageSize},t),c))}))},addUser:function(e){return t(this,void 0,void 0,(function*(){return console.debug("addUser()",e),d(h.users.v2,Object.assign(Object.assign({},e),{provider:"local"}))}))},deleteUser:function(e){return t(this,void 0,void 0,(function*(){return console.debug("deleteUser()",e),g(`${m.members.v1}/${e.userId}`)}))},updateUser:function(e){return t(this,void 0,void 0,(function*(){return console.debug("editUser()",e),v(m.members.v1,e)}))},loadAvailableRoles:function(){return t(this,void 0,void 0,(function*(){return console.debug("loadAvailableRoles()"),a(m.roles.v1)}))},loadAvailablePermissions:function(){return t(this,void 0,void 0,(function*(){return console.debug("loadAvailablePermissions()"),a(h.permissions.v1)}))},loadStats:function(){return t(this,void 0,void 0,(function*(){return console.debug("loadStats()"),a(`${m.stats.v1}/members`)}))},resendActivationLink:function(e){return t(this,void 0,void 0,(function*(){return console.debug("resendActivationLink()",e),d(`${m.members.v1}/${e.userId}/resendActivationEmail`,{})}))},resendInvitationLink:function(e){return t(this,void 0,void 0,(function*(){return console.debug("resendInvitationLink()",e),d(h.users.v2,Object.assign(Object.assign({},e),{provider:"local"}))}))}});function R(e){var o,n;return t(this,void 0,void 0,(function*(){const t=yield a("/metadata",e);if(null===(o=null==t?void 0:t.rows)||void 0===o?void 0:o[0])return null===(n=null==t?void 0:t.rows)||void 0===n?void 0:n[0];throw new Error(`metadata not found: ${e.entityName}`)}))}var E=Object.freeze({__proto__:null,getNotificationsMetadata:()=>t(void 0,void 0,void 0,(function*(){return R({entityName:"notifications"})})),getSamlMetadata:()=>t(void 0,void 0,void 0,(function*(){return R({entityName:"saml"})})),getAuditsMetadata:()=>t(void 0,void 0,void 0,(function*(){return R({entityName:"audits"})})),getIpAdressMetadata:e=>t(void 0,void 0,void 0,(function*(){return function(e){return t(this,void 0,void 0,(function*(){const o=yield a(`/metadata/ip/${e}`);if(o)return o;throw new Error("ip metadata not found")}))}(e)}))}),L=Object.freeze({__proto__:null});var U=Object.freeze({__proto__:null,getNotifications:function(e){return t(this,void 0,void 0,(function*(){return console.debug("getNotifications()"),a(P.v1,{params:e})}))},updateNotificationStatus:function(e){return t(this,void 0,void 0,(function*(){return console.debug("getNotifications()"),v(`${P.v1}/status`,{params:e})}))},updateNotificationIsPinned:function(e){return t(this,void 0,void 0,(function*(){const{notificationId:o,pinStatus:t}=e;return console.debug("getNotifications()"),v(`${P.v1}/${t}`,{notificationId:o})}))},markAllAsRead:function(){return t(this,void 0,void 0,(function*(){return console.debug("getNotifications()"),d(`${P.v1}/status/mark-all-read`)}))}});var x=Object.freeze({__proto__:null,getAudits:function(e){return t(this,void 0,void 0,(function*(){return console.debug("getAudits()"),a(k.v1,e)}))},getAuditsStats:function(e){return t(this,void 0,void 0,(function*(){return console.debug("getAuditsStats()"),a(`${k.v1}/stats`,e)}))},exportAudits:function(e){return t(this,void 0,void 0,(function*(){const{endpoint:t,headerProps:n}=e,i=o(e,["endpoint","headerProps"]);return f(`${k.v1}/export/${t}`,{properties:n},i)}))}});var N=Object.freeze({__proto__:null,getSlackConfiguration:()=>(console.debug("getSlackConfiguration()"),a(`${$.configurations.v1}/slack`)),getSlackScope:()=>(console.debug("getSlackScope()"),a(`${$.configurations.v1}/slack/applications`)),getSlackChannels:()=>(console.debug("getSlackChannels()"),a(`${$.configurations.v1}/slack/channels`)),postSlackConfiguration:e=>(console.debug("postSlackConfiguration()",e),e.id?l(`${$.configurations.v1}/slack/subscription/${e.id}`,e):d(`${$.configurations.v1}/slack/subscriptions`,e)),deleteSlackConfiguration:e=>(console.debug("deleteSlackConfiguration()",e),g(`${$.configurations.v1}/slack/subscriptions/${e.id}`)),postSlackCode:e=>(console.debug("postSlackCode()",{code:e}),d(`${$.configurations.v1}/slack/applications/registrations`,{code:e})),getEmailConfiguration:()=>(console.debug("getEmailConfiguration()"),a(`${$.configurations.v1}/emails`)),postEmailConfiguration:e=>{var{eventKey:t}=e,n=o(e,["eventKey"]);return console.debug("postEmailConfiguration()",Object.assign(Object.assign({},n),{eventKey:t})),d(`${$.configurations.v1}/emails/${t}`,n)},patchEmailConfiguration:({eventKey:e,enabled:o})=>(console.debug("patchEmailConfiguration()",{eventKey:e,enabled:o}),l(`${$.configurations.v1}/emails/${e}`,{enabled:o})),deleteEmailSubscriptions:(e,o)=>(console.debug("deleteEmailSubscriptions()",{eventKey:e,subscriptionId:o}),g(`${$.configurations.v1}/emails/${e}/subscriptions/${o}`)),putEmailSubscriptions:(e,o,t)=>(console.debug("putEmailSubscriptions()",Object.assign(Object.assign({},t),{subscriptionId:e,eventKey:o})),v(`${$.configurations.v1}/emails/${o}/subscriptions/${e}`,t)),deleteEmailConfiguration:e=>(console.debug("deleteEmailConfiguration()",{eventKey:e}),g(`${$.configurations.v1}/emails/${e}`)),getSMSConfiguration:()=>(console.debug("getSMSConfiguration()"),a(`${$.configurations.v2}/sms`)),postSMSConfiguration:e=>{var{eventKey:t}=e,n=o(e,["eventKey"]);return console.debug("postSMSConfiguration()",Object.assign(Object.assign({},n),{eventKey:t})),d(`${$.configurations.v2}/sms/${t}`,n)},patchSMSConfiguration:({eventKey:e,enabled:o})=>(console.debug("patchSMSConfiguration()",{eventKey:e,enabled:o}),l(`${$.configurations.v2}/sms/${e}`,{enabled:o})),deleteSMSSubscriptions:(e,o)=>(console.debug("deleteSMSSubscriptions()",{eventKey:e,subscriptionId:o}),g(`${$.configurations.v2}/sms/${e}/subscriptions/${o}`)),putSMSSubscriptions:(e,o,t)=>(console.debug("putSMSSubscriptions()",Object.assign(Object.assign({},t),{subscriptionId:e,eventKey:o})),v(`${$.configurations.v2}/sms/${o}/subscriptions/${e}`,t)),deleteSMSConfiguration:e=>(console.debug("deleteSMSConfiguration()",{eventKey:e}),g(`${$.configurations.v2}/sms/${e}`)),getWebhooksConfigurations:()=>(console.debug("getWebhooksConfigurations()"),a(C.v1)),postWebhooksConfiguration:e=>(console.debug("postWebhooksConfiguration()",e),e._id?l(`${C.v1}/${e._id}`,e):d(`${C.v1}/custom`,e)),deleteWebhooksConfiguration:e=>(console.debug("deleteWebhooksConfiguration()",e),g(`${C.v1}/${e}`)),getWebhookLog:(e,o=0,t=10)=>{console.debug("getWebhookLog()",e);const n=new URLSearchParams({id:e,offset:`${o}`,limit:`${t}`});return a(`${C.v1}/logs/?${n.toString()}`)},postWebhookTest:e=>(console.debug("postWebhookTest",e),d(`${C.v1}/test`,e)),postWebhookRetry:e=>(console.debug("postWebhookRetry",e),d(`${C.v1}/logs/${e}/retries`)),getCategories:()=>(console.debug("getCategories()"),a(`${T.configurations.v1}/categories`)),getChannelMaps:e=>(console.debug("getChannelMaps()",e),a(T.configurations.v1,{channels:e}))});var D=Object.freeze({__proto__:null,switchTenant:function(e){return t(this,void 0,void 0,(function*(){return console.debug("switchTenant()",e),v(`${h.users.v1}/tenant`,e)}))},getTenants:function(){return t(this,void 0,void 0,(function*(){return console.debug("getTenants()"),a(`${h.users.v2}/me/tenants`)}))}});var W=Object.freeze({__proto__:null,updateSettings:function(e){return t(this,void 0,void 0,(function*(){return console.debug("updateSettings()",e),v(y.accountSettings.v1,e)}))},getSettings:function(){return t(this,void 0,void 0,(function*(){return console.debug("getSettings()"),a(y.accountSettings.v1)}))}});var K=Object.freeze({__proto__:null,getRoles:function(){return t(this,void 0,void 0,(function*(){return console.debug("getRoles()"),a(h.roles.v1)}))},addRole:function(e){return t(this,void 0,void 0,(function*(){return console.debug("addRole()",e),d(h.roles.v1,e)}))},deleteRole:function({roleId:e}){return t(this,void 0,void 0,(function*(){return console.debug("deleteRole()",e),g(`${h.roles.v1}/${e}`)}))},updateRole:function(e){var{roleId:n}=e,i=o(e,["roleId"]);return t(this,void 0,void 0,(function*(){return console.debug("updateRole()",n,i),l(`${h.roles.v1}/${n}`,i)}))},attachPermissionsToRole:function(e){var{roleId:n}=e,i=o(e,["roleId"]);return t(this,void 0,void 0,(function*(){return console.debug("attachPermissionsToRole()",n,i),v(`${h.roles.v1}/${n}/permissions`,i)}))},getPermissions:function(){return t(this,void 0,void 0,(function*(){return console.debug("getPermissions()"),a(h.permissions.v1)}))},attachPermissionToRoles:function(e){var{permissionId:n}=e,i=o(e,["permissionId"]);return t(this,void 0,void 0,(function*(){return console.debug("attachPermissionToRoles()"),v(`${h.permissions.v1}/${n}/roles`,i)}))},getPermissionCategories:function(){return t(this,void 0,void 0,(function*(){return console.debug("getPermissionCategories()"),a(`${h.permissions.v1}/categories`)}))}});var z=Object.freeze({__proto__:null,getSubscriptions:function(){return t(this,void 0,void 0,(function*(){return console.debug("getSubscriptions()"),a(S.billing.subscriptions.v1)}))},getSubscription:function(e){return t(this,void 0,void 0,(function*(){return console.debug("getSubscription()",{subscriptionId:e}),a(`${S.billing.subscriptions.v1}/${e}`)}))},cancelSubscription:function(e){return t(this,void 0,void 0,(function*(){return console.debug("cancelSubscription()",{subscriptionId:e}),v(`${S.billing.subscriptions.v1}/${e}/cancellations/`,{})}))},renewSubscription:function(e){return t(this,void 0,void 0,(function*(){return console.debug("renewSubscription()",{subscriptionId:e}),v(`${S.billing.subscriptions.v1}/${e}/renewals/`,{})}))},updateSubscription:function(e,{paymentMethodId:o,items:n}){return t(this,void 0,void 0,(function*(){return console.debug("updateSubscription()",{subscriptionId:e}),v(`${S.billing.subscriptions.v1}/${e}`,{paymentMethodId:o,items:n})}))},getSubscriptionPlans:function(){return t(this,void 0,void 0,(function*(){return console.debug("getSubscriptionPlans()"),a(S.billing.plans.v1)}))},getSubscriptionPlan:function(e){return t(this,void 0,void 0,(function*(){return console.debug("getSubscriptionPlan()"),a(`${S.billing.plans.v1}/${e}`)}))},getSubscriptionInvoices:function(){return t(this,void 0,void 0,(function*(){return console.debug("getSubscriptionInvoices()"),a(S.billing.invoices.v1)}))},getSubscriptionInvoice:function(e){return t(this,void 0,void 0,(function*(){return console.debug("getSubscriptionInvoice()",{invoiceId:e}),a(`${S.billing.invoices.v1}/${e}`)}))},getSubscriptionInvoicePdf:function(e,o){return t(this,void 0,void 0,(function*(){return console.debug("getSubscriptionInvoicePdf()",{invoiceId:e}),a(`${S.billing.invoices.v1}/${e}/pdf`,{outputFileName:o},{responseType:"blob"})}))},getPaymentMethods:function(){return t(this,void 0,void 0,(function*(){return console.debug("getPaymentMethods()"),a(S.billing.paymentMethods.v1)}))},getPaymentMethod:function(e){return t(this,void 0,void 0,(function*(){return console.debug("getPaymentMethod()",{paymentMethodId:e}),a(`${S.billing.paymentMethods.v1}/${e}`)}))},updatePaymentMethodBillingDetails:function(e,n){var{email:i}=n,r=o(n,["email"]);return t(this,void 0,void 0,(function*(){return console.debug("updatePaymentMethodBillingDetails()",{paymentMethodId:e,email:i,address:r}),l(`${S.billing.paymentMethods.v1}/${e}/billing-details`,{email:i,address:r})}))},createSubscription:function(e){return t(this,void 0,void 0,(function*(){return console.debug("createSubscription()"),d(S.billing.paymentProviders.stripe.subscriptions.v1,e)}))},getStripeCustomer:function(e){return t(this,void 0,void 0,(function*(){return console.debug("getStripeCustomer()"),a(`${S.billing.paymentProviders.stripe.customers.v1}/${e}`)}))},createStripeCustomer:function(e){return t(this,void 0,void 0,(function*(){return console.debug("createStripeCustomer()"),d(`${S.billing.paymentProviders.stripe.customers.v1}`,e)}))},getStripePaymentProviderConfiguration:function(){return t(this,void 0,void 0,(function*(){return console.debug("getStripePaymentProviderConfiguration()"),a(`${S.billing.paymentProviders.stripe.publicConfigurations.v1}`)}))},createStripePaymentMethodSetupIntentSecret:function(e){return t(this,void 0,void 0,(function*(){return console.debug("createStripePaymentMethodSetupIntentSecret()"),d(`${S.billing.paymentProviders.stripe.setupIntents.v1}`,e)}))},getSubscriptionSummaries:function(e){return t(this,void 0,void 0,(function*(){return console.debug("getSubscriptionSummaries()"),a(`${S.billing.summaries.v1}/${e}`)}))},getTenantConfiguration:function(e){return t(this,void 0,void 0,(function*(){return console.debug("getTenantConfiguration()"),a(`${S.billing.tenantConfiguration.v1}/${e}`)}))},createTenantConfiguration:function(e){return t(this,void 0,void 0,(function*(){return console.debug("createTenantConfiguration()"),d(`${S.billing.tenantConfiguration.v1}`,e)}))},getPaymentProviders:function(){return t(this,void 0,void 0,(function*(){return console.debug("getPaymentProviders()"),a(S.paymentProviders.v1)}))}});var G,V,H,B,F=Object.freeze({__proto__:null,getVendorPublicInfo:function(){return t(this,void 0,void 0,(function*(){return console.debug("getVendorPublicInfo()"),a(`${b}/public`)}))}});e.AuthStrategyEnum=void 0,(G=e.AuthStrategyEnum||(e.AuthStrategyEnum={})).EmailAndPassword="EmailAndPassword",G.MagicLink="MagicLink",G.Code="Code",e.SocialLoginProviders=void 0,(V=e.SocialLoginProviders||(e.SocialLoginProviders={})).Microsoft="microsoft",V.Facebook="facebook",V.Google="google",V.Github="github",e.ISubscriptionStatus=void 0,(H=e.ISubscriptionStatus||(e.ISubscriptionStatus={})).ACTIVE="active",H.CANCELED="canceled",H.INCOMPLETE="incomplete",H.EXPIRED="expired",e.ISubscriptionCancellationPolicy=void 0,(e.ISubscriptionCancellationPolicy||(e.ISubscriptionCancellationPolicy={})).AT_PERIOD_END="atPeriodEnd",e.ProviderType=void 0,(e.ProviderType||(e.ProviderType={})).Stripe="Stripe",e.PaymentMethodType=void 0,(B=e.PaymentMethodType||(e.PaymentMethodType={})).UNKNWON="unknown",B.CARD="card";const J={auth:j,teams:M,metadata:E,reports:L,connectivity:N,notifications:U,audits:x,tenants:D,accountSettings:W,roles:K,subscriptions:z,vendor:F};e.ContextHolder=n,e.FronteggApiError=r,e.FronteggContext=i,e.api=J,e.fetch=p,Object.defineProperty(e,"__esModule",{value:!0})}));
15
+ ***************************************************************************** */function o(e,o){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&o.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)o.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(t[n[i]]=e[n[i]])}return t}function t(e,o,t,n){return new(t||(t=Promise))((function(i,r){function s(e){try{c(n.next(e))}catch(e){r(e)}}function u(e){try{c(n.throw(e))}catch(e){r(e)}}function c(e){var o;e.done?i(e.value):(o=e.value,o instanceof t?o:new t((function(e){e(o)}))).then(s,u)}c((n=n.apply(e,o||[])).next())}))}class n{constructor(){this.context=null,this.accessToken=null,this.user=null,this.onRedirectTo=e=>window.location.href=e,this.logout=()=>window.location.href="/account/logout"}static getInstance(){return n.instance||(n.instance=new n),n.instance}static setContext(e){n.getInstance().context=e}static setAccessToken(e){n.getInstance().accessToken=e}static setUser(e){n.getInstance().user=e}static setOnRedirectTo(e){n.getInstance().onRedirectTo=e}static setLogout(e,o){n.getInstance().logout=t=>{t?e(t):n.onRedirectTo(o)}}static getContext(){var e;return null!==(e=n.getInstance().context)&&void 0!==e?e:{baseUrl:window.location.href,tokenResolver:()=>"my-authentication-token",logLevel:"error"}}static getAccessToken(){return n.getInstance().accessToken}static getUser(){return n.getInstance().user}static onRedirectTo(e,o){return n.getInstance().onRedirectTo(e,o)}static logout(e){return n.getInstance().logout(e)}}const i={getContext:()=>n.getContext(),getAccessToken:()=>n.getAccessToken(),getUser:()=>n.getUser(),onRedirectTo:(e,o)=>n.onRedirectTo(e,o),logout:e=>n.logout(e)};class r extends Error{constructor(e,o){super(e),this._statusCode=o}get statusCode(){return this._statusCode}}function s(e,o,n){return t(this,void 0,void 0,(function*(){const i=yield function(e){return t(this,void 0,void 0,(function*(){let o=e.baseUrl;const t=e.urlPrefix||"frontegg";return o.endsWith("/")||(o+="/"),o.endsWith(t)||(o+=t),o}))}(e),r=yield function(e,o){return t(this,void 0,void 0,(function*(){o||(o={});const n=yield function(e){return t(this,void 0,void 0,(function*(){let o=[];return e.additionalQueryParamsResolver&&(o=yield e.additionalQueryParamsResolver()),o}))}(e);for(const e of n)o[e.key]=e.value;const i=Object.keys(o);for(const e of i){const t=o[e];o[e]="object"==typeof t?JSON.stringify(t):t}return o}))}(e,n);let s=o.startsWith("http")?o:`${i}${o}`;const u=Object.keys(r).length>0;if(r&&u){s+=`?${new URLSearchParams(r)}`}return s}))}function u(e,o){var i;return t(this,void 0,void 0,(function*(){const r=yield(null!==(i=null==e?void 0:e.tokenResolver)&&void 0!==i?i:n.getAccessToken)(),s={};r&&(s.Authorization=`Bearer ${r}`),o&&(s["Content-Type"]=o);for(const o of yield function(e){return t(this,void 0,void 0,(function*(){let o=[];return e.additionalHeadersResolver&&(o=yield e.additionalHeadersResolver()),o}))}(e))s[`${o.key}`]=`${o.value}`;return s["x-frontegg-source"]="frontegg-react",s}))}const c=e=>t(void 0,void 0,void 0,(function*(){var o,t,i,c,a;const d=n.getContext(),l=yield u(d,e.contentType),v=yield s(d,e.url,e.params),g=yield fetch(v,{body:e.body?"application/json"===e.contentType?JSON.stringify(e.body):e.body:null,method:null!==(o=e.method)&&void 0!==o?o:"GET",headers:Object.assign(Object.assign({},l),e.headers),credentials:null!==(i=null!==(t=e.credentials)&&void 0!==t?t:d.requestCredentials)&&void 0!==i?i:"same-origin"});if(302===g.status)return window.location.href=yield g.text(),new Promise((()=>{}));if(!g.ok){if(413===g.status)throw new r("Error request is too large",g.status);let e;try{e=yield g.text(),e=JSON.parse(e)}catch(e){}throw e.errors?e=e.errors.join(", "):"string"!=typeof e&&(e=`Error ${g.status} - ${g.statusText}`),g.status>=400&&g.status<500&&["warn"].includes(null!==(c=d.logLevel)&&void 0!==c?c:"")?console.warn(e):500===g.status&&["warn","error"].includes(null!==(a=d.logLevel)&&void 0!==a?a:"")&&console.error(e),new r(e,g.status)}if(e.responseType&&"json"!==e.responseType){if("blob"===e.responseType){const{outputFileName:o}=e.params;return yield g.blob().then((e=>URL.createObjectURL(e))).then((e=>{const t=document.createElement("a");t.href=e,t.setAttribute("download",o||"output"),t.click()}))}return yield g.text()}try{return yield g.json()}catch(e){return{}}})),a=(e,o,n)=>t(void 0,void 0,void 0,(function*(){return c(Object.assign({url:e,method:"GET",contentType:"application/json",params:o},n))})),d=(e,o,n)=>t(void 0,void 0,void 0,(function*(){return c(Object.assign({url:e,method:"POST",contentType:"application/json",body:o},n))})),l=(e,o,n)=>t(void 0,void 0,void 0,(function*(){return c(Object.assign({url:e,method:"PATCH",contentType:"application/json",body:o},n))})),v=(e,o,n)=>t(void 0,void 0,void 0,(function*(){return c(Object.assign({url:e,method:"PUT",contentType:"application/json",body:o},n))})),g=(e,o,n)=>t(void 0,void 0,void 0,(function*(){return c(Object.assign({url:e,method:"DELETE",contentType:"application/json",body:o},n))})),f=(e,o,n,i)=>t(void 0,void 0,void 0,(function*(){return c(Object.assign({url:e,method:"POST",contentType:"application/json",responseType:"blob",body:o,params:n},i))}));var p=Object.freeze({__proto__:null,Get:a,Post:d,Patch:l,Put:v,Delete:g,PostDownload:f});const b="/vendors",h={auth:{v1:"/identity/resources/auth/v1"},users:{v1:"/identity/resources/users/v1",v2:"/identity/resources/users/v2",apiTokens:{v1:"/identity/resources/users/api-tokens/v1"}},configurations:{v1:"/identity/resources/configurations/v1"},sso:{v1:"/identity/resources/sso/v1"},permissions:{v1:"/identity/resources/permissions/v1"},tenants:{apiTokens:{v1:"/identity/resources/tenants/api-tokens/v1",v2:"/identity/resources/tenants/api-tokens/v2"},invites:{verify:{v1:"/identity/resources/tenants/invites/v1/verify"}}},roles:{v1:"/identity/resources/roles/v1"}},m={sso:{v1:"/team/resources/sso/v1",v2:"/team/resources/sso/v2"},members:{v1:"/team/resources/members/v1"},roles:{v1:"/team/resources/roles/v1"},stats:{v1:"/team/resources/stats/v1"},profile:{v1:"/team/resources/profile"}},y={accountSettings:{v1:"/tenants/resources/account-settings/v1"}},$={configurations:{v1:"/integrations/resources/configurations/v1",v2:"/integrations/resources/configurations/v2"}},S={billing:{subscriptions:{v1:"/subscriptions/resources/billing/subscriptions/v1"},plans:{v1:"/subscriptions/resources/billing/plans/v1"},invoices:{v1:"/subscriptions/resources/billing/invoices/v1"},paymentMethods:{v1:"/subscriptions/resources/billing/payment-methods/v1"},summaries:{v1:"/subscriptions/resources/billing/summaries/v1"},tenantConfiguration:{v1:"/subscriptions/resources/billing/tenant-configurations/v1"},paymentProviders:{stripe:{customers:{v1:"/subscriptions/resources/billing/payment-providers/stripe/customers/v1"},publicConfigurations:{v1:"/subscriptions/resources/billing/payment-providers/stripe/public-configurations/v1"},subscriptions:{v1:"/subscriptions/resources/billing/payment-providers/stripe/subscriptions/v1"},setupIntents:{v1:"/subscriptions/resources/billing/payment-providers/stripe/setup-intents/v1"}}}},paymentProviders:{v1:"/subscriptions/resources/payment-providers/v1"}},P={v1:"/notification"},k={v1:"/audits"},T={configurations:{v1:"/event/resources/configurations/v1"}},C={v1:"/webhook"};class w extends Error{constructor(e){super(e)}}const I="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(e){const o=String(e).replace(/=+$/,"");if(o.length%4==1)throw new w("'atob' failed: The string to be decoded is not correctly encoded.");let t="";for(let e,n,i=0,r=0;n=o.charAt(r++);~n&&(e=i%4?64*e+n:n,i++%4)?t+=String.fromCharCode(255&e>>(-2*i&6)):0)n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(n);return t};const O=e=>{let o=e.replace(/-/g,"+").replace(/_/g,"/");switch(o.length%4){case 0:break;case 2:o+="==";break;case 3:o+="=";break;default:throw new Error("Illegal base64url string!")}try{return function(e){return decodeURIComponent(I(e).replace(/(.)/g,((e,o)=>{let t=o.charCodeAt(0).toString(16).toUpperCase();return t.length<2&&(t="0"+t),"%"+t})))}(o)}catch(e){return I(o)}};class A extends Error{constructor(e){super(e)}}function _(e){return t(this,void 0,void 0,(function*(){if(!e.accessToken)return e;n.setAccessToken(e.accessToken);const o=yield a(`${h.users.v2}/me`),t=e.accessToken?((e,o={})=>{const t=o.header?0:1;try{return JSON.parse(O(e.split(".")[t]))}catch(e){throw new A("Invalid token specified: "+e.message)}})(e.accessToken):{},i=Object.assign(Object.assign(Object.assign({},e),t),o);return n.setUser(i),i}))}var j=Object.freeze({__proto__:null,generateLoginResponse:_,preLogin:function(e){return t(this,void 0,void 0,(function*(){console.info("preLogin()",e);try{const{address:o}=yield d(`${h.auth.v1}/user/saml/prelogin`,e);return o}catch(e){return null}}))},preLoginWithIdpType:function(e){return t(this,void 0,void 0,(function*(){return console.info("preLoginWithIdpType()",e),d(`${h.auth.v1}/user/saml/prelogin`,e)}))},postLogin:function(e){return t(this,void 0,void 0,(function*(){console.debug("postLogin()");return _(yield d(`${h.auth.v1}/user/saml/postlogin`,e))}))},oidcPostLogin:function(e){return t(this,void 0,void 0,(function*(){console.debug("oidcPostLogin()");return _(yield d(`${h.auth.v1}/user/oidc/postlogin`,e))}))},login:function(e){return t(this,void 0,void 0,(function*(){console.debug("login()");return _(yield d(`${h.auth.v1}/user`,e))}))},loginWithMfa:function(e){return t(this,void 0,void 0,(function*(){console.debug("loginWithMfa()");return _(yield d(`${h.auth.v1}/user/mfa/verify`,e))}))},activateAccount:function(e){return t(this,void 0,void 0,(function*(){return console.debug("activateAccount()"),d(`${h.users.v1}/activate`,e)}))},getActivateAccountStrategy:function(e){return t(this,void 0,void 0,(function*(){return console.debug("getActivateAccountStrategy()"),a(`${h.users.v1}/activate/strategy`,e)}))},resendActivationEmail:function(e){return t(this,void 0,void 0,(function*(){return console.debug("resendActivationEmail()"),d(`${h.users.v1}/activate/reset`,e)}))},acceptInvitation:function(e){return t(this,void 0,void 0,(function*(){return console.debug("acceptInvitation()"),d(`${h.users.v1}/invitation/accept`,e)}))},refreshToken:function(){return t(this,void 0,void 0,(function*(){console.debug("refreshToken()");return _(yield d(`${h.auth.v1}/user/token/refresh`))}))},logout:function(){return t(this,void 0,void 0,(function*(){return console.debug("logout()"),d(`${h.auth.v1}/logout`)}))},forgotPassword:function(e){return t(this,void 0,void 0,(function*(){return console.debug("forgotPassword()",e),d(`${h.users.v1}/passwords/reset`,e)}))},resetPassword:function(e){return t(this,void 0,void 0,(function*(){return console.debug("resetPassword()"),d(`${h.users.v1}/passwords/reset/verify`,e)}))},loadPasswordConfig:function(e){return t(this,void 0,void 0,(function*(){return console.debug("loadPasswordConfig()"),a(`${h.users.v1}/passwords/config`,e)}))},recoverMfaToken:function(e){return t(this,void 0,void 0,(function*(){return console.debug("recoverMfaToken()",e),d(`${h.auth.v1}/user/mfa/recover`,e)}))},enrollMfa:function(){return t(this,void 0,void 0,(function*(){return console.debug("enrollMfa()"),d(`${h.users.v1}/mfa/enroll`)}))},verifyMfa:function(e){return t(this,void 0,void 0,(function*(){return console.debug("verifyMfa()",e),d(`${h.users.v1}/mfa/enroll/verify`,e)}))},disableMfa:function(e){return t(this,void 0,void 0,(function*(){return console.debug("disableMfa()",e),d(`${h.users.v1}/mfa/disable`,e)}))},getSamlConfiguration:function(){return t(this,void 0,void 0,(function*(){return console.debug("getSamlConfiguration()"),a(`${m.sso.v1}/saml/configurations`)}))},updateSamlConfiguration:function(e){return t(this,void 0,void 0,(function*(){return console.debug("updateSamlConfiguration()",e),d(`${m.sso.v1}/saml/configurations`,e)}))},getSamlVendorConfiguration:function(){return t(this,void 0,void 0,(function*(){return console.debug("getSamlVendorConfiguration()"),a(`${m.sso.v1}/saml/configurations/vendor-config`)}))},updateSamlVendorMetadata:function(e){return t(this,void 0,void 0,(function*(){return console.debug("updateSamlVendorMetadata()",e),v(`${m.sso.v1}/saml/configurations/metadata`,e)}))},validateSamlDomain:function(){return t(this,void 0,void 0,(function*(){return console.debug("validateSamlDomain()"),v(`${m.sso.v1}/saml/validations/domain`)}))},getSamlRoles:function(){return t(this,void 0,void 0,(function*(){return console.debug("getSamlRoles()"),a(`${m.sso.v1}/saml/configurations/roles/default`)}))},getSamlRolesGroups:function(){return t(this,void 0,void 0,(function*(){return console.debug("getSamlRoles()"),a(`${m.sso.v2}/saml/configurations/groups`)}))},updateSamlRoles:function({roleIds:e}){return t(this,void 0,void 0,(function*(){return console.debug("updateSamlRoles()"),d(`${m.sso.v1}/saml/configurations/roles/default`,{roleIds:e})}))},createSamlGroup:function({roleIds:e,group:o}){return t(this,void 0,void 0,(function*(){return console.debug("createSamlGroup()"),d(`${m.sso.v2}/saml/configurations/groups`,{group:o,roleIds:e})}))},updateSamlGroup:function({roleIds:e,group:o,id:n}){return t(this,void 0,void 0,(function*(){return console.debug("updateSamlGroup()"),l(`${m.sso.v2}/saml/configurations/groups/${n}`,{group:o,roleIds:e})}))},deleteSamlGroup:function({id:e}){return t(this,void 0,void 0,(function*(){return console.debug("deleteSamlGroup()"),g(`${m.sso.v2}/saml/configurations/groups/${e}`)}))},getOidcConfiguration:function(){return t(this,void 0,void 0,(function*(){return console.debug("getSamlConfiguration()"),a(`${m.sso.v1}/oidc/configurations`)}))},getSSOPublicConfiguration:function(){return t(this,void 0,void 0,(function*(){return console.debug("getSSOPublicConfiguration()"),a(`${m.sso.v2}/configurations/public`)}))},getSocialLoginProviders:function(){return t(this,void 0,void 0,(function*(){return console.debug("getSocialLoginProviders()"),a(h.sso.v1)}))},loginViaSocialLogin:function({provider:e,code:o,redirectUri:n,codeVerifier:i,metadata:r,invitationToken:s}){return t(this,void 0,void 0,(function*(){console.debug("loginViaSocialLogin()");const t={code:o};return n&&(t.redirectUri=n),i&&(t.code_verifier=i),d(`${h.auth.v1}/user/sso/${e}/postlogin`,{metadata:r,invitationToken:s},{params:t})}))},getVendorConfig:function(){return t(this,void 0,void 0,(function*(){return console.debug("getVendorConfig()"),a(`${h.configurations.v1}/public`)}))},signUpUser:function(e){return t(this,void 0,void 0,(function*(){console.debug("signUpUser()",e);const{shouldActivate:o,authResponse:t}=yield d(`${h.users.v1}/signUp`,e);return{shouldActivate:o,user:!o&&t?yield _(t):void 0}}))},getUserApiTokensData:function(){return t(this,void 0,void 0,(function*(){return console.debug("getUserApiTokensData()"),a(h.users.apiTokens.v1)}))},getTenantApiTokensData:function(){return t(this,void 0,void 0,(function*(){return console.debug("geTenantApiTokensData()"),a(h.tenants.apiTokens.v1)}))},updateUserApiTokensData:function(e){return t(this,void 0,void 0,(function*(){return console.debug("updateUserApiTokensData()",e),d(h.users.apiTokens.v1,e)}))},updateTenantApiTokensData:function(e){return t(this,void 0,void 0,(function*(){return console.debug("updateTenantApiTokensData()",e),d(h.tenants.apiTokens.v2,e)}))},deleteTenantApiToken:function({tokenId:e}){return t(this,void 0,void 0,(function*(){return console.debug("deleteTenantApiToken()",e),g(`${h.tenants.apiTokens.v1}/${e}`)}))},deleteUserApiToken:function({tokenId:e}){return t(this,void 0,void 0,(function*(){return console.debug("deleteUserApiToken()",e),g(`${h.users.apiTokens.v1}/${e}`)}))},getUserById:function({userId:e}){return t(this,void 0,void 0,(function*(){return console.debug("getUserById()"),a(`${h.users.v1}/${e}`)}))},checkIfAllowToRememberMfaDevice:function(e){return t(this,void 0,void 0,(function*(){return console.debug("checkIfAllowToRememberMfaDevice()"),a(`${h.configurations.v1}/mfa-policy/allow-remember-device`,{mfaToken:e})}))},passwordlessPreLogin:function(e){var{type:n}=e,i=o(e,["type"]);return t(this,void 0,void 0,(function*(){return console.debug("passwordlessPrelogin()"),d(`${h.auth.v1}/passwordless/${n.toLocaleLowerCase()}/prelogin`,i)}))},passwordlessPostLogin:function(e){var{type:n}=e,i=o(e,["type"]);return t(this,void 0,void 0,(function*(){return console.debug("passwordlessPostLogin()"),d(`${h.auth.v1}/passwordless/${n.toLocaleLowerCase()}/postlogin`,i)}))},verifyInviteToken:function({token:e}){return t(this,void 0,void 0,(function*(){return console.debug("verifyInviteToken()"),d(h.tenants.invites.verify.v1,{token:e})}))},getGlobalSecurityPolicy:function(){return t(this,void 0,void 0,(function*(){return console.debug("getGlobalSecurityPolicy()"),a(h.configurations.v1)}))},getMfaPolicy:function(){return t(this,void 0,void 0,(function*(){return console.debug("getMfaPolicy()"),a(`${h.configurations.v1}/mfa-policy`)}))},saveMfaPolicy:function(e){return t(this,void 0,void 0,(function*(){return console.debug("saveMfaPolicy()"),e.id?l(`${h.configurations.v1}/mfa-policy`,e):d(`${h.configurations.v1}/mfa-policy`,e)}))},getLockoutPolicy:function(){return t(this,void 0,void 0,(function*(){return console.debug("getLockoutPolicy()"),a(`${h.configurations.v1}/lockout-policy`)}))},saveLockoutPolicy:function(e){return t(this,void 0,void 0,(function*(){return console.debug("saveLockoutPolicy()"),e.id?l(`${h.configurations.v1}/lockout-policy`,e):d(`${h.configurations.v1}/lockout-policy`,e)}))},getCaptchaPolicy:function(){return t(this,void 0,void 0,(function*(){try{return yield a(`${h.configurations.v1}/captcha-policy/public`)}catch(e){return null}}))},getPasswordHistoryPolicy:function(){return t(this,void 0,void 0,(function*(){return console.debug("getPasswordHistoryPolicy()"),a(`${h.configurations.v1}/password-history-policy`)}))},savePasswordHistoryPolicy:function(e){return t(this,void 0,void 0,(function*(){return console.debug("savePasswordHistoryPolicy()"),e.id?l(`${h.configurations.v1}/password-history-policy`,e):d(`${h.configurations.v1}/password-history-policy`,e)}))},getPasswordConfigPolicy:function(){return t(this,void 0,void 0,(function*(){return console.debug("getPasswordConfigPolicy()"),a(`${h.configurations.v1}/password`)}))}});var M=Object.freeze({__proto__:null,getProfile:function(e){return t(this,void 0,void 0,(function*(){return console.debug("getProfile()"),a(`${h.users.v2}/me`,null!=e?e:{addRoles:!0})}))},updateProfile:function(e){return t(this,void 0,void 0,(function*(){return console.debug("updateProfile()",e),v(`${h.users.v2}/me`,e)}))},updateProfileImage:function(e){return t(this,void 0,void 0,(function*(){return console.debug("updateProfileImage()",e),v(`${m.profile.v1}/me/image/v1`,e,{responseType:"plain",contentType:void 0})}))},changePassword:function(e){return t(this,void 0,void 0,(function*(){return console.debug("changePassword()"),d(`${h.users.v1}/passwords/change`,e)}))},loadUsers:function(e){var o,n,i,r,s,u;return t(this,void 0,void 0,(function*(){const t=(e.filter||[]).reduce(((e,o)=>Object.assign(Object.assign({},e),{[o.id]:o.value})),{}),c=(null===(o=e.sort)||void 0===o?void 0:o.length)?{sortBy:null!==(r=null===(i=null===(n=e.sort)||void 0===n?void 0:n[0])||void 0===i?void 0:i.id)&&void 0!==r?r:"name",sortDirection:(null===(u=null===(s=e.sort)||void 0===s?void 0:s[0])||void 0===u?void 0:u.desc)?"desc":"asc"}:null;return a(m.members.v1,Object.assign(Object.assign({pageOffset:e.pageOffset,pageSize:e.pageSize},t),c))}))},addUser:function(e){return t(this,void 0,void 0,(function*(){return console.debug("addUser()",e),d(h.users.v2,Object.assign(Object.assign({},e),{provider:"local"}))}))},deleteUser:function(e){return t(this,void 0,void 0,(function*(){return console.debug("deleteUser()",e),g(`${m.members.v1}/${e.userId}`)}))},updateUser:function(e){return t(this,void 0,void 0,(function*(){return console.debug("editUser()",e),v(m.members.v1,e)}))},loadAvailableRoles:function(){return t(this,void 0,void 0,(function*(){return console.debug("loadAvailableRoles()"),a(m.roles.v1)}))},loadAvailablePermissions:function(){return t(this,void 0,void 0,(function*(){return console.debug("loadAvailablePermissions()"),a(h.permissions.v1)}))},loadStats:function(){return t(this,void 0,void 0,(function*(){return console.debug("loadStats()"),a(`${m.stats.v1}/members`)}))},resendActivationLink:function(e){return t(this,void 0,void 0,(function*(){return console.debug("resendActivationLink()",e),d(`${m.members.v1}/${e.userId}/resendActivationEmail`,{})}))},resendInvitationLink:function(e){return t(this,void 0,void 0,(function*(){return console.debug("resendInvitationLink()",e),d(h.users.v2,Object.assign(Object.assign({},e),{provider:"local"}))}))}});function R(e){var o,n;return t(this,void 0,void 0,(function*(){const t=yield a("/metadata",e);if(null===(o=null==t?void 0:t.rows)||void 0===o?void 0:o[0])return null===(n=null==t?void 0:t.rows)||void 0===n?void 0:n[0];throw new Error(`metadata not found: ${e.entityName}`)}))}var L=Object.freeze({__proto__:null,getNotificationsMetadata:()=>t(void 0,void 0,void 0,(function*(){return R({entityName:"notifications"})})),getSamlMetadata:()=>t(void 0,void 0,void 0,(function*(){return R({entityName:"saml"})})),getAuditsMetadata:()=>t(void 0,void 0,void 0,(function*(){return R({entityName:"audits"})})),getIpAdressMetadata:e=>t(void 0,void 0,void 0,(function*(){return function(e){return t(this,void 0,void 0,(function*(){const o=yield a(`/metadata/ip/${e}`);if(o)return o;throw new Error("ip metadata not found")}))}(e)}))}),E=Object.freeze({__proto__:null});var U=Object.freeze({__proto__:null,getNotifications:function(e){return t(this,void 0,void 0,(function*(){return console.debug("getNotifications()"),a(P.v1,{params:e})}))},updateNotificationStatus:function(e){return t(this,void 0,void 0,(function*(){return console.debug("getNotifications()"),v(`${P.v1}/status`,{params:e})}))},updateNotificationIsPinned:function(e){return t(this,void 0,void 0,(function*(){const{notificationId:o,pinStatus:t}=e;return console.debug("getNotifications()"),v(`${P.v1}/${t}`,{notificationId:o})}))},markAllAsRead:function(){return t(this,void 0,void 0,(function*(){return console.debug("getNotifications()"),d(`${P.v1}/status/mark-all-read`)}))}});var x=Object.freeze({__proto__:null,getAudits:function(e){return t(this,void 0,void 0,(function*(){return console.debug("getAudits()"),a(k.v1,e)}))},getAuditsStats:function(e){return t(this,void 0,void 0,(function*(){return console.debug("getAuditsStats()"),a(`${k.v1}/stats`,e)}))},exportAudits:function(e){return t(this,void 0,void 0,(function*(){const{endpoint:t,headerProps:n}=e,i=o(e,["endpoint","headerProps"]);return f(`${k.v1}/export/${t}`,{properties:n},i)}))}});var N=Object.freeze({__proto__:null,getSlackConfiguration:()=>(console.debug("getSlackConfiguration()"),a(`${$.configurations.v1}/slack`)),getSlackScope:()=>(console.debug("getSlackScope()"),a(`${$.configurations.v1}/slack/applications`)),getSlackChannels:()=>(console.debug("getSlackChannels()"),a(`${$.configurations.v1}/slack/channels`)),postSlackConfiguration:e=>(console.debug("postSlackConfiguration()",e),e.id?l(`${$.configurations.v1}/slack/subscription/${e.id}`,e):d(`${$.configurations.v1}/slack/subscriptions`,e)),deleteSlackConfiguration:e=>(console.debug("deleteSlackConfiguration()",e),g(`${$.configurations.v1}/slack/subscriptions/${e.id}`)),postSlackCode:e=>(console.debug("postSlackCode()",{code:e}),d(`${$.configurations.v1}/slack/applications/registrations`,{code:e})),getEmailConfiguration:()=>(console.debug("getEmailConfiguration()"),a(`${$.configurations.v1}/emails`)),postEmailConfiguration:e=>{var{eventKey:t}=e,n=o(e,["eventKey"]);return console.debug("postEmailConfiguration()",Object.assign(Object.assign({},n),{eventKey:t})),d(`${$.configurations.v1}/emails/${t}`,n)},patchEmailConfiguration:({eventKey:e,enabled:o})=>(console.debug("patchEmailConfiguration()",{eventKey:e,enabled:o}),l(`${$.configurations.v1}/emails/${e}`,{enabled:o})),deleteEmailSubscriptions:(e,o)=>(console.debug("deleteEmailSubscriptions()",{eventKey:e,subscriptionId:o}),g(`${$.configurations.v1}/emails/${e}/subscriptions/${o}`)),putEmailSubscriptions:(e,o,t)=>(console.debug("putEmailSubscriptions()",Object.assign(Object.assign({},t),{subscriptionId:e,eventKey:o})),v(`${$.configurations.v1}/emails/${o}/subscriptions/${e}`,t)),deleteEmailConfiguration:e=>(console.debug("deleteEmailConfiguration()",{eventKey:e}),g(`${$.configurations.v1}/emails/${e}`)),getSMSConfiguration:()=>(console.debug("getSMSConfiguration()"),a(`${$.configurations.v2}/sms`)),postSMSConfiguration:e=>{var{eventKey:t}=e,n=o(e,["eventKey"]);return console.debug("postSMSConfiguration()",Object.assign(Object.assign({},n),{eventKey:t})),d(`${$.configurations.v2}/sms/${t}`,n)},patchSMSConfiguration:({eventKey:e,enabled:o})=>(console.debug("patchSMSConfiguration()",{eventKey:e,enabled:o}),l(`${$.configurations.v2}/sms/${e}`,{enabled:o})),deleteSMSSubscriptions:(e,o)=>(console.debug("deleteSMSSubscriptions()",{eventKey:e,subscriptionId:o}),g(`${$.configurations.v2}/sms/${e}/subscriptions/${o}`)),putSMSSubscriptions:(e,o,t)=>(console.debug("putSMSSubscriptions()",Object.assign(Object.assign({},t),{subscriptionId:e,eventKey:o})),v(`${$.configurations.v2}/sms/${o}/subscriptions/${e}`,t)),deleteSMSConfiguration:e=>(console.debug("deleteSMSConfiguration()",{eventKey:e}),g(`${$.configurations.v2}/sms/${e}`)),getWebhooksConfigurations:()=>(console.debug("getWebhooksConfigurations()"),a(C.v1)),postWebhooksConfiguration:e=>(console.debug("postWebhooksConfiguration()",e),e._id?l(`${C.v1}/${e._id}`,e):d(`${C.v1}/custom`,e)),deleteWebhooksConfiguration:e=>(console.debug("deleteWebhooksConfiguration()",e),g(`${C.v1}/${e}`)),getWebhookLog:(e,o=0,t=10)=>{console.debug("getWebhookLog()",e);const n=new URLSearchParams({id:e,offset:`${o}`,limit:`${t}`});return a(`${C.v1}/logs/?${n.toString()}`)},postWebhookTest:e=>(console.debug("postWebhookTest",e),d(`${C.v1}/test`,e)),postWebhookRetry:e=>(console.debug("postWebhookRetry",e),d(`${C.v1}/logs/${e}/retries`)),getCategories:()=>(console.debug("getCategories()"),a(`${T.configurations.v1}/categories`)),getChannelMaps:e=>(console.debug("getChannelMaps()",e),a(T.configurations.v1,{channels:e}))});var D=Object.freeze({__proto__:null,switchTenant:function(e){return t(this,void 0,void 0,(function*(){return console.debug("switchTenant()",e),v(`${h.users.v1}/tenant`,e)}))},getTenants:function(){return t(this,void 0,void 0,(function*(){return console.debug("getTenants()"),a(`${h.users.v2}/me/tenants`)}))}});var W=Object.freeze({__proto__:null,updateSettings:function(e){return t(this,void 0,void 0,(function*(){return console.debug("updateSettings()",e),v(y.accountSettings.v1,e)}))},getSettings:function(){return t(this,void 0,void 0,(function*(){return console.debug("getSettings()"),a(y.accountSettings.v1)}))}});var K=Object.freeze({__proto__:null,getRoles:function(){return t(this,void 0,void 0,(function*(){return console.debug("getRoles()"),a(h.roles.v1)}))},addRole:function(e){return t(this,void 0,void 0,(function*(){return console.debug("addRole()",e),d(h.roles.v1,e)}))},deleteRole:function({roleId:e}){return t(this,void 0,void 0,(function*(){return console.debug("deleteRole()",e),g(`${h.roles.v1}/${e}`)}))},updateRole:function(e){var{roleId:n}=e,i=o(e,["roleId"]);return t(this,void 0,void 0,(function*(){return console.debug("updateRole()",n,i),l(`${h.roles.v1}/${n}`,i)}))},attachPermissionsToRole:function(e){var{roleId:n}=e,i=o(e,["roleId"]);return t(this,void 0,void 0,(function*(){return console.debug("attachPermissionsToRole()",n,i),v(`${h.roles.v1}/${n}/permissions`,i)}))},getPermissions:function(){return t(this,void 0,void 0,(function*(){return console.debug("getPermissions()"),a(h.permissions.v1)}))},attachPermissionToRoles:function(e){var{permissionId:n}=e,i=o(e,["permissionId"]);return t(this,void 0,void 0,(function*(){return console.debug("attachPermissionToRoles()"),v(`${h.permissions.v1}/${n}/roles`,i)}))},getPermissionCategories:function(){return t(this,void 0,void 0,(function*(){return console.debug("getPermissionCategories()"),a(`${h.permissions.v1}/categories`)}))}});var z=Object.freeze({__proto__:null,getSubscriptions:function(){return t(this,void 0,void 0,(function*(){return console.debug("getSubscriptions()"),a(S.billing.subscriptions.v1)}))},getSubscription:function(e){return t(this,void 0,void 0,(function*(){return console.debug("getSubscription()",{subscriptionId:e}),a(`${S.billing.subscriptions.v1}/${e}`)}))},cancelSubscription:function(e){return t(this,void 0,void 0,(function*(){return console.debug("cancelSubscription()",{subscriptionId:e}),v(`${S.billing.subscriptions.v1}/${e}/cancellations/`,{})}))},renewSubscription:function(e){return t(this,void 0,void 0,(function*(){return console.debug("renewSubscription()",{subscriptionId:e}),v(`${S.billing.subscriptions.v1}/${e}/renewals/`,{})}))},updateSubscription:function(e,{paymentMethodId:o,items:n}){return t(this,void 0,void 0,(function*(){return console.debug("updateSubscription()",{subscriptionId:e}),v(`${S.billing.subscriptions.v1}/${e}`,{paymentMethodId:o,items:n})}))},getSubscriptionPlans:function(){return t(this,void 0,void 0,(function*(){return console.debug("getSubscriptionPlans()"),a(S.billing.plans.v1)}))},getSubscriptionPlan:function(e){return t(this,void 0,void 0,(function*(){return console.debug("getSubscriptionPlan()"),a(`${S.billing.plans.v1}/${e}`)}))},getSubscriptionInvoices:function(){return t(this,void 0,void 0,(function*(){return console.debug("getSubscriptionInvoices()"),a(S.billing.invoices.v1)}))},getSubscriptionInvoice:function(e){return t(this,void 0,void 0,(function*(){return console.debug("getSubscriptionInvoice()",{invoiceId:e}),a(`${S.billing.invoices.v1}/${e}`)}))},getSubscriptionInvoicePdf:function(e,o){return t(this,void 0,void 0,(function*(){return console.debug("getSubscriptionInvoicePdf()",{invoiceId:e}),a(`${S.billing.invoices.v1}/${e}/pdf`,{outputFileName:o},{responseType:"blob"})}))},getPaymentMethods:function(){return t(this,void 0,void 0,(function*(){return console.debug("getPaymentMethods()"),a(S.billing.paymentMethods.v1)}))},getPaymentMethod:function(e){return t(this,void 0,void 0,(function*(){return console.debug("getPaymentMethod()",{paymentMethodId:e}),a(`${S.billing.paymentMethods.v1}/${e}`)}))},updatePaymentMethodBillingDetails:function(e,n){var{email:i}=n,r=o(n,["email"]);return t(this,void 0,void 0,(function*(){return console.debug("updatePaymentMethodBillingDetails()",{paymentMethodId:e,email:i,address:r}),l(`${S.billing.paymentMethods.v1}/${e}/billing-details`,{email:i,address:r})}))},createSubscription:function(e){return t(this,void 0,void 0,(function*(){return console.debug("createSubscription()"),d(S.billing.paymentProviders.stripe.subscriptions.v1,e)}))},getStripeCustomer:function(e){return t(this,void 0,void 0,(function*(){return console.debug("getStripeCustomer()"),a(`${S.billing.paymentProviders.stripe.customers.v1}/${e}`)}))},createStripeCustomer:function(e){return t(this,void 0,void 0,(function*(){return console.debug("createStripeCustomer()"),d(`${S.billing.paymentProviders.stripe.customers.v1}`,e)}))},getStripePaymentProviderConfiguration:function(){return t(this,void 0,void 0,(function*(){return console.debug("getStripePaymentProviderConfiguration()"),a(`${S.billing.paymentProviders.stripe.publicConfigurations.v1}`)}))},createStripePaymentMethodSetupIntentSecret:function(e){return t(this,void 0,void 0,(function*(){return console.debug("createStripePaymentMethodSetupIntentSecret()"),d(`${S.billing.paymentProviders.stripe.setupIntents.v1}`,e)}))},getSubscriptionSummaries:function(e){return t(this,void 0,void 0,(function*(){return console.debug("getSubscriptionSummaries()"),a(`${S.billing.summaries.v1}/${e}`)}))},getTenantConfiguration:function(e){return t(this,void 0,void 0,(function*(){return console.debug("getTenantConfiguration()"),a(`${S.billing.tenantConfiguration.v1}/${e}`)}))},createTenantConfiguration:function(e){return t(this,void 0,void 0,(function*(){return console.debug("createTenantConfiguration()"),d(`${S.billing.tenantConfiguration.v1}`,e)}))},getPaymentProviders:function(){return t(this,void 0,void 0,(function*(){return console.debug("getPaymentProviders()"),a(S.paymentProviders.v1)}))}});var G,V,H,B,F=Object.freeze({__proto__:null,getVendorPublicInfo:function(){return t(this,void 0,void 0,(function*(){return console.debug("getVendorPublicInfo()"),a(`${b}/public`)}))}});e.AuthStrategyEnum=void 0,(G=e.AuthStrategyEnum||(e.AuthStrategyEnum={})).EmailAndPassword="EmailAndPassword",G.MagicLink="MagicLink",G.Code="Code",G.NoLocalAuthentication="NoLocalAuthentication",e.SocialLoginProviders=void 0,(V=e.SocialLoginProviders||(e.SocialLoginProviders={})).Microsoft="microsoft",V.Facebook="facebook",V.Google="google",V.Github="github",e.ISubscriptionStatus=void 0,(H=e.ISubscriptionStatus||(e.ISubscriptionStatus={})).ACTIVE="active",H.CANCELED="canceled",H.INCOMPLETE="incomplete",H.EXPIRED="expired",e.ISubscriptionCancellationPolicy=void 0,(e.ISubscriptionCancellationPolicy||(e.ISubscriptionCancellationPolicy={})).AT_PERIOD_END="atPeriodEnd",e.ProviderType=void 0,(e.ProviderType||(e.ProviderType={})).Stripe="Stripe",e.PaymentMethodType=void 0,(B=e.PaymentMethodType||(e.PaymentMethodType={})).UNKNWON="unknown",B.CARD="card";const J={auth:j,teams:M,metadata:L,reports:E,connectivity:N,notifications:U,audits:x,tenants:D,accountSettings:W,roles:K,subscriptions:z,vendor:F};e.ContextHolder=n,e.FronteggApiError=r,e.FronteggContext=i,e.api=J,e.fetch=p,Object.defineProperty(e,"__esModule",{value:!0})}));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@frontegg/rest-api",
3
3
  "libName": "FronteggRestApi",
4
- "version": "2.10.27",
4
+ "version": "2.10.28",
5
5
  "author": "Frontegg LTD",
6
6
  "main": "dist/cjs/index.js",
7
7
  "types": "dist/es2015/index.d.ts",
@@ -6,6 +6,7 @@ export enum AuthStrategyEnum {
6
6
  EmailAndPassword = 'EmailAndPassword',
7
7
  MagicLink = 'MagicLink',
8
8
  Code = 'Code',
9
+ NoLocalAuthentication = 'NoLocalAuthentication',
9
10
  }
10
11
 
11
12
  export type IPreLogin = { email: string };
@@ -102,6 +103,7 @@ export type ISamlConfiguration = {
102
103
  updatedAt?: Date;
103
104
  acsUrl?: string;
104
105
  spEntityId?: string;
106
+ isSamlActive?: boolean;
105
107
  oidcClientId?: string;
106
108
  oidcSecret?: string;
107
109
  type?: string;