@passflow/core 0.2.11 → 0.6.0

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/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import F from "axios";
2
2
  import { v4 as H } from "uuid";
3
3
  import { startRegistration as K, startAuthentication as j } from "@simplewebauthn/browser";
4
- const z = "0.2.11", X = {
4
+ const z = "0.6.0", X = {
5
5
  version: z
6
6
  }, C = "X-Passflow-Clientid", I = "Authorization", W = "X-Passflow-DeviceId", J = "X-Passflow-DeviceType", Z = X.version, Ne = ["id", "offline", "openid"], Q = ["id", "offline", "tenant", "email", "oidc", "openid", "access:tenant:all"], V = "https://auth.passflow.cloud", Ke = "default", ee = 500, te = 600, re = 100, se = 6e4, G = 30, ie = 3, oe = 30, ne = 200, ae = (i) => {
7
7
  const e = [];
@@ -65,7 +65,7 @@ function v(i) {
65
65
  ), a = JSON.parse(o);
66
66
  return a.membership = a.passflow_tm && a.type !== "invite" ? ae(a.passflow_tm) : void 0, a;
67
67
  }
68
- var p = /* @__PURE__ */ ((i) => (i.id_token = "id_token", i.access_token = "access", i.refresh_token = "refresh", i.invite_token = "invite", i.reset_token = "reset", i.web_cookie = "web-cookie", i.management = "management", i.signin = "signin", i.actor = "actor", i.two_factor = "2fa", i))(p || {}), y = /* @__PURE__ */ ((i) => (i.JsonBody = "json_body", i.Cookie = "cookie", i.Mobile = "mobile", i.BFF = "bff", i))(y || {}), q = /* @__PURE__ */ ((i) => (i.Unknown = "unknown", i.Valid = "valid", i.Invalid = "invalid", i))(q || {});
68
+ var p = /* @__PURE__ */ ((i) => (i.id_token = "id_token", i.access_token = "access", i.refresh_token = "refresh", i.invite_token = "invite", i.reset_token = "reset", i.web_cookie = "web-cookie", i.management = "management", i.signin = "signin", i.actor = "actor", i.two_factor = "2fa", i))(p || {}), m = /* @__PURE__ */ ((i) => (i.JsonBody = "json_body", i.Cookie = "cookie", i.Mobile = "mobile", i.BFF = "bff", i))(m || {}), q = /* @__PURE__ */ ((i) => (i.Unknown = "unknown", i.Valid = "valid", i.Invalid = "invalid", i))(q || {});
69
69
  class Y {
70
70
  constructor(e) {
71
71
  this.storageManager = e, this.mode = "json_body", this.sessionState = "unknown", this.isInitializedFlag = !1, this.STORAGE_PREFIX = "passflow_", this.DELIVERY_MODE_KEY = `${this.STORAGE_PREFIX}delivery_mode`, this.SESSION_STATE_KEY = `${this.STORAGE_PREFIX}session_state`, this.loadPersistedMode(), this.loadPersistedSessionState();
@@ -166,7 +166,7 @@ class Y {
166
166
  loadPersistedMode() {
167
167
  try {
168
168
  const e = this.storageManager.storage.getItem(this.DELIVERY_MODE_KEY);
169
- e && Object.values(y).includes(e) && (this.mode = e, this.isInitializedFlag = !0);
169
+ e && Object.values(m).includes(e) && (this.mode = e, this.isInitializedFlag = !0);
170
170
  } catch {
171
171
  }
172
172
  }
@@ -228,7 +228,7 @@ class $ {
228
228
  */
229
229
  saveTokens(e, t) {
230
230
  const { id_token: r, access_token: s, refresh_token: o, scopes: a } = e;
231
- t === y.Cookie || t === y.BFF ? r && this.storage.setItem(this.ID_TOKEN_KEY, r) : (r && this.storage.setItem(this.getKeyForTokenType(p.id_token), r), s && this.storage.setItem(this.getKeyForTokenType(p.access_token), s), o && this.storage.setItem(this.getKeyForTokenType(p.refresh_token), o), a && this.storage.setItem(this.scopes, a.join(",")));
231
+ t === m.Cookie || t === m.BFF ? r && this.storage.setItem(this.ID_TOKEN_KEY, r) : (r && this.storage.setItem(this.getKeyForTokenType(p.id_token), r), s && this.storage.setItem(this.getKeyForTokenType(p.access_token), s), o && this.storage.setItem(this.getKeyForTokenType(p.refresh_token), o), a && this.storage.setItem(this.scopes, a.join(",")));
232
232
  }
233
233
  getToken(e) {
234
234
  const t = this.getKeyForTokenType(e);
@@ -241,7 +241,7 @@ class $ {
241
241
  */
242
242
  getTokens() {
243
243
  const e = this.getDeliveryMode();
244
- if (e === y.Cookie || e === y.BFF) {
244
+ if (e === m.Cookie || e === m.BFF) {
245
245
  const r = this.storage.getItem(this.ID_TOKEN_KEY);
246
246
  return r ? {
247
247
  id_token: r
@@ -324,7 +324,7 @@ class $ {
324
324
  getDeliveryMode() {
325
325
  try {
326
326
  const e = this.storage.getItem(this.DELIVERY_MODE_KEY);
327
- if (e && Object.values(y).includes(e))
327
+ if (e && Object.values(m).includes(e))
328
328
  return e;
329
329
  } catch {
330
330
  }
@@ -416,14 +416,14 @@ class B {
416
416
  return H();
417
417
  }
418
418
  }
419
- var E = /* @__PURE__ */ ((i) => (i.GET = "get", i.POST = "post", i.PUT = "put", i.PATCH = "patch", i.DELETE = "delete", i))(E || {}), c = /* @__PURE__ */ ((i) => (i.signin = "/auth/login", i.signup = "/auth/register", i.signInWithProvider = "/auth/federated/start/", i.passwordless = "/auth/passwordless/start", i.passwordlessComplete = "/auth/passwordless/complete", i.logout = "/user/logout", i.refresh = "/auth/refresh", i.validateSession = "/user/me", i.sendPasswordResetEmail = "/auth/password/reset", i.resetPassword = "/auth/password/change", i.appSettings = "/app/settings", i.passkeyRegisterStart = "/auth/passkey/register/start", i.passkeyRegisterComplete = "/auth/passkey/register/complete", i.passkeyAuthenticateStart = "/auth/passkey/authenticate/start", i.passkeyAuthenticateComplete = "/auth/passkey/authenticate/complete", i.passkeyValidate = "/auth/validate", i.settingsAll = "/settings", i.settingsPasswordPolicy = "/settings/password", i.settingsPasskey = "/settings/passkey", i.userPasskey = "/user/passkey", i.addUserPasskey = "/user/passkey/add/start", i.completeAddUserPasskey = "/user/passkey/add/complete", i.joinInvitation = "/user/tenant/join", i.tenantPath = "/user/tenant", i.invitationsPath = "/user/tenant/:tenantID/invitations", i.requestInvitation = "/user/invite", i.invitationDelete = "/user/invite/:invitationID", i.invitationResend = "/user/invite/:invitationID/resend", i.invitationGetLink = "/user/invite/:invitationID/link", i.twoFactor = "/user/2fa", i.twoFactorStatus = "/user/2fa/status", i.twoFactorSetupBegin = "/user/2fa/setup/begin", i.twoFactorSetupConfirm = "/user/2fa/setup/confirm", i.twoFactorVerify = "/auth/2fa/verify", i.twoFactorRecovery = "/auth/2fa/recovery", i.twoFactorRegenerateCodes = "/user/2fa/recovery-codes/regenerate", i.twoFactorSetupMagicLink = "/auth/2fa-setup", i.TwoFactorMethodsAvailable = "/v2/user/2fa/methods/available", i.TwoFactorMethodsRegistered = "/v2/user/2fa/methods", i.TwoFactorMethodSetupBegin = "/v2/user/2fa/methods/:method/setup/begin", i.TwoFactorMethodSetupConfirm = "/v2/user/2fa/methods/:method/setup/confirm", i.TwoFactorMethodRemove = "/v2/user/2fa/methods/:id", i.TwoFactorChallenge = "/v2/auth/2fa/challenge", i.TwoFactorVerifyV2 = "/v2/auth/2fa/verify", i.TwoFactorAlternative = "/v2/auth/2fa/alternative", i.TwoFactorTrustedDevices = "/v2/user/2fa/trusted-devices", i.TwoFactorTrustedDeviceRevoke = "/v2/user/2fa/trusted-devices/:id", i))(c || {}), T = /* @__PURE__ */ ((i) => (i.passkeyRegisterStart = "/admin/auth/passkey/register/start", i.passkeyRegisterComplete = "/admin/auth/passkey/register/complete", i.passkeyAuthenticateStart = "/admin/auth/passkey/authenticate/start", i.passkeyAuthenticateComplete = "/admin/auth/passkey/authenticate/complete", i.passkeyValidate = "/admin/auth/validate", i.logout = "/admin/auth/logout", i))(T || {});
419
+ var E = /* @__PURE__ */ ((i) => (i.GET = "get", i.POST = "post", i.PUT = "put", i.PATCH = "patch", i.DELETE = "delete", i))(E || {}), c = /* @__PURE__ */ ((i) => (i.signin = "/auth/login", i.signup = "/auth/register", i.signInWithProvider = "/auth/federated/start/", i.passwordless = "/auth/passwordless/start", i.passwordlessComplete = "/auth/passwordless/complete", i.logout = "/user/logout", i.refresh = "/auth/refresh", i.validateSession = "/user/me", i.sendPasswordResetEmail = "/auth/password/reset", i.resetPassword = "/auth/password/change", i.appSettings = "/app/settings", i.passkeyRegisterStart = "/auth/passkey/register/start", i.passkeyRegisterComplete = "/auth/passkey/register/complete", i.passkeyAuthenticateStart = "/auth/passkey/authenticate/start", i.passkeyAuthenticateComplete = "/auth/passkey/authenticate/complete", i.passkeyValidate = "/auth/validate", i.settingsAll = "/settings", i.settingsPasswordPolicy = "/settings/password", i.settingsPasskey = "/settings/passkey", i.userPasskey = "/user/passkey", i.addUserPasskey = "/user/passkey/add/start", i.completeAddUserPasskey = "/user/passkey/add/complete", i.joinInvitation = "/user/tenant/join", i.tenantPath = "/user/tenant", i.invitationsPath = "/user/tenant/:tenantID/invitations", i.requestInvitation = "/user/invite", i.invitationDelete = "/user/invite/:invitationID", i.invitationResend = "/user/invite/:invitationID/resend", i.invitationGetLink = "/user/invite/:invitationID/link", i.twoFactor = "/user/2fa", i.twoFactorStatus = "/user/2fa/status", i.twoFactorSetupBegin = "/user/2fa/setup/begin", i.twoFactorSetupConfirm = "/user/2fa/setup/confirm", i.twoFactorVerify = "/auth/2fa/verify", i.twoFactorRecovery = "/auth/2fa/recovery", i.twoFactorRegenerateCodes = "/user/2fa/recovery-codes/regenerate", i.twoFactorSetupMagicLink = "/auth/2fa-setup", i.TwoFactorMethodsAvailable = "/v2/user/2fa/methods/available", i.TwoFactorMethodsRegistered = "/v2/user/2fa/methods", i.TwoFactorMethodSetupBegin = "/v2/user/2fa/methods/:method/setup/begin", i.TwoFactorMethodSetupConfirm = "/v2/user/2fa/methods/:method/setup/confirm", i.TwoFactorMethodRemove = "/v2/user/2fa/methods/:id", i.TwoFactorChallenge = "/v2/auth/2fa/challenge", i.TwoFactorVerifyV2 = "/v2/auth/2fa/verify", i.TwoFactorAlternative = "/v2/auth/2fa/alternative", i.TwoFactorTrustedDevices = "/v2/user/2fa/trusted-devices", i.TwoFactorTrustedDeviceRevoke = "/v2/user/2fa/trusted-devices/:id", i.cliAuthStatus = "/cli/auth/status/:sessionId", i.cliAuthComplete = "/cli/auth/complete", i))(c || {}), _ = /* @__PURE__ */ ((i) => (i.passkeyRegisterStart = "/admin/auth/passkey/register/start", i.passkeyRegisterComplete = "/admin/auth/passkey/register/complete", i.passkeyAuthenticateStart = "/admin/auth/passkey/authenticate/start", i.passkeyAuthenticateComplete = "/admin/auth/passkey/authenticate/complete", i.passkeyValidate = "/admin/auth/validate", i.logout = "/admin/auth/logout", i))(_ || {});
420
420
  class u extends Error {
421
421
  constructor(e) {
422
422
  super(), this.id = e?.id ?? "unknown", this.message = e?.message ?? e ?? "Something went wrong", this.status = e?.status ?? 500, this.location = e?.location ?? "unknown", this.time = e?.time ?? (/* @__PURE__ */ new Date()).toISOString();
423
423
  }
424
424
  }
425
425
  var de = /* @__PURE__ */ ((i) => (i.google = "google", i.facebook = "facebook", i))(de || {}), b = /* @__PURE__ */ ((i) => (i.web = "web", i))(b || {});
426
- function m(i, e) {
426
+ function y(i, e) {
427
427
  let t = i;
428
428
  return Object.entries(e).forEach(([r, s]) => {
429
429
  t = t.replace(`:${r}`, s);
@@ -431,7 +431,7 @@ function m(i, e) {
431
431
  }
432
432
  var ue = /* @__PURE__ */ ((i) => (i.Disabled = "disabled", i.Optional = "optional", i.Required = "required", i))(ue || {});
433
433
  const le = 3, ge = 1e3;
434
- class _ {
434
+ class w {
435
435
  constructor(e, t, r) {
436
436
  this.refreshPromise = null, this.isRefreshing = !1, this.origin = typeof window < "u" ? window.location.origin : "", this.defaultHeaders = {
437
437
  Accept: "application/json",
@@ -622,7 +622,7 @@ class _ {
622
622
  }
623
623
  class pe {
624
624
  constructor(e, t, r) {
625
- this.axiosClient = new _(e, t, r);
625
+ this.axiosClient = new w(e, t, r);
626
626
  }
627
627
  setAppId(e) {
628
628
  this.axiosClient.setAppId(e);
@@ -633,7 +633,7 @@ class pe {
633
633
  }
634
634
  class fe {
635
635
  constructor(e, t, r) {
636
- this.axiosClient = new _(e, t, r);
636
+ this.axiosClient = new w(e, t, r);
637
637
  }
638
638
  setAppId(e) {
639
639
  this.axiosClient.setAppId(e);
@@ -690,7 +690,7 @@ class fe {
690
690
  );
691
691
  }
692
692
  logOut(e, t, r = !1) {
693
- const s = r ? void 0 : { refresh_token: t, device: e }, o = r ? T.logout : c.logout;
693
+ const s = r ? void 0 : { refresh_token: t, device: e }, o = r ? _.logout : c.logout;
694
694
  return this.axiosClient.post(o, s);
695
695
  }
696
696
  validateSession() {
@@ -720,7 +720,7 @@ class fe {
720
720
  create_tenant: o ?? !1,
721
721
  device: t,
722
722
  os: r
723
- }, d = s ? T.passkeyRegisterStart : c.passkeyRegisterStart;
723
+ }, d = s ? _.passkeyRegisterStart : c.passkeyRegisterStart;
724
724
  return this.axiosClient.post(d, a);
725
725
  }
726
726
  passkeyRegisterComplete(e, t, r, s = !1) {
@@ -728,7 +728,7 @@ class fe {
728
728
  challenge_id: r,
729
729
  device: t,
730
730
  passkey_data: e
731
- }, a = s ? T.passkeyRegisterComplete : c.passkeyRegisterComplete;
731
+ }, a = s ? _.passkeyRegisterComplete : c.passkeyRegisterComplete;
732
732
  return this.axiosClient.post(a, o);
733
733
  }
734
734
  passkeyAuthenticateStart(e, t, r, s = !1) {
@@ -737,7 +737,7 @@ class fe {
737
737
  user_id: e.user_id ?? "",
738
738
  device: t,
739
739
  os: r
740
- }, a = s ? T.passkeyAuthenticateStart : c.passkeyAuthenticateStart;
740
+ }, a = s ? _.passkeyAuthenticateStart : c.passkeyAuthenticateStart;
741
741
  return this.axiosClient.post(
742
742
  a,
743
743
  o
@@ -748,7 +748,7 @@ class fe {
748
748
  challenge_id: r,
749
749
  device: t,
750
750
  passkey_data: e
751
- }, a = s ? T.passkeyAuthenticateComplete : c.passkeyAuthenticateComplete;
751
+ }, a = s ? _.passkeyAuthenticateComplete : c.passkeyAuthenticateComplete;
752
752
  return this.axiosClient.post(a, o);
753
753
  }
754
754
  passkeyValidate(e, t, r, s = !1, o) {
@@ -758,14 +758,29 @@ class fe {
758
758
  challenge_id: r
759
759
  };
760
760
  let d = c.passkeyValidate;
761
- !o && s && (d = T.passkeyValidate);
761
+ !o && s && (d = _.passkeyValidate);
762
762
  const h = o ? { [C]: o } : {};
763
763
  return this.axiosClient.post(d, a, { headers: h });
764
764
  }
765
765
  }
766
+ class Ve {
767
+ constructor(e, t, r) {
768
+ this.axiosClient = new w(e, t, r);
769
+ }
770
+ setAppId(e) {
771
+ this.axiosClient.setAppId(e);
772
+ }
773
+ getCLIAuthStatus(e) {
774
+ const t = y(c.cliAuthStatus, { sessionId: e });
775
+ return this.axiosClient.get(t);
776
+ }
777
+ completeCLIAuth(e) {
778
+ return this.axiosClient.post(c.cliAuthComplete, e);
779
+ }
780
+ }
766
781
  class ke {
767
782
  constructor(e, t, r) {
768
- this.axiosClient = new _(e, t, r);
783
+ this.axiosClient = new w(e, t, r);
769
784
  }
770
785
  setAppId(e) {
771
786
  this.axiosClient.setAppId(e);
@@ -789,7 +804,7 @@ class ke {
789
804
  getInvitations(e) {
790
805
  const t = {};
791
806
  e.groupID && (t.group_id = e.groupID.toString()), e.skip !== void 0 && (t.skip = e.skip.toString()), e.limit !== void 0 && (t.limit = e.limit.toString());
792
- const r = m(c.invitationsPath, {
807
+ const r = y(c.invitationsPath, {
793
808
  tenantID: e.tenantID
794
809
  });
795
810
  return this.axiosClient.get(r, { params: t }).then((s) => ({
@@ -803,7 +818,7 @@ class ke {
803
818
  * @returns Promise with success response
804
819
  */
805
820
  deleteInvitation(e) {
806
- const t = m(c.invitationDelete, {
821
+ const t = y(c.invitationDelete, {
807
822
  invitationID: e
808
823
  });
809
824
  return this.axiosClient.delete(t);
@@ -814,7 +829,7 @@ class ke {
814
829
  * @returns Promise with success response
815
830
  */
816
831
  resendInvitation(e) {
817
- const t = m(c.invitationResend, {
832
+ const t = y(c.invitationResend, {
818
833
  invitationID: e
819
834
  });
820
835
  return this.axiosClient.post(t, {});
@@ -825,7 +840,7 @@ class ke {
825
840
  * @returns Promise with the link
826
841
  */
827
842
  getInvitationLink(e) {
828
- const t = m(c.invitationGetLink, {
843
+ const t = y(c.invitationGetLink, {
829
844
  invitationID: e
830
845
  });
831
846
  return this.axiosClient.get(t);
@@ -833,7 +848,7 @@ class ke {
833
848
  }
834
849
  class ve {
835
850
  constructor(e, t, r) {
836
- this.axiosClient = new _(e, t, r);
851
+ this.axiosClient = new w(e, t, r);
837
852
  }
838
853
  setAppId(e) {
839
854
  this.axiosClient.setAppId(e);
@@ -850,7 +865,7 @@ class ve {
850
865
  }
851
866
  class ye {
852
867
  constructor(e, t, r) {
853
- this.axiosClient = new _(e, t, r);
868
+ this.axiosClient = new w(e, t, r);
854
869
  }
855
870
  setAppId(e) {
856
871
  this.axiosClient.setAppId(e);
@@ -1083,7 +1098,7 @@ class ye {
1083
1098
  }
1084
1099
  class me {
1085
1100
  constructor(e, t, r) {
1086
- this.axiosClient = new _(e, t, r);
1101
+ this.axiosClient = new w(e, t, r);
1087
1102
  }
1088
1103
  setAppId(e) {
1089
1104
  this.axiosClient.setAppId(e);
@@ -1272,7 +1287,7 @@ class me {
1272
1287
  * POST /v2/user/2fa/methods/:method/setup/begin
1273
1288
  */
1274
1289
  beginMethodSetup(e) {
1275
- const t = m(c.TwoFactorMethodSetupBegin, { method: e });
1290
+ const t = y(c.TwoFactorMethodSetupBegin, { method: e });
1276
1291
  return this.axiosClient.post(t, {});
1277
1292
  }
1278
1293
  /**
@@ -1280,7 +1295,7 @@ class me {
1280
1295
  * POST /v2/user/2fa/methods/:method/setup/confirm
1281
1296
  */
1282
1297
  confirmMethodSetup(e, t) {
1283
- const r = m(c.TwoFactorMethodSetupConfirm, { method: e });
1298
+ const r = y(c.TwoFactorMethodSetupConfirm, { method: e });
1284
1299
  return this.axiosClient.post(r, t);
1285
1300
  }
1286
1301
  /**
@@ -1288,7 +1303,7 @@ class me {
1288
1303
  * DELETE /v2/user/2fa/methods/:id
1289
1304
  */
1290
1305
  removeMethod(e) {
1291
- const t = m(c.TwoFactorMethodRemove, { id: e });
1306
+ const t = y(c.TwoFactorMethodRemove, { id: e });
1292
1307
  return this.axiosClient.delete(t);
1293
1308
  }
1294
1309
  /**
@@ -1333,13 +1348,13 @@ class me {
1333
1348
  * DELETE /v2/user/2fa/trusted-devices/:id
1334
1349
  */
1335
1350
  revokeTrustedDevice(e) {
1336
- const t = m(c.TwoFactorTrustedDeviceRevoke, { id: e });
1351
+ const t = y(c.TwoFactorTrustedDeviceRevoke, { id: e });
1337
1352
  return this.axiosClient.delete(t);
1338
1353
  }
1339
1354
  }
1340
1355
  class Se {
1341
1356
  constructor(e, t, r) {
1342
- this.axiosClient = new _(e, t, r);
1357
+ this.axiosClient = new w(e, t, r);
1343
1358
  }
1344
1359
  setAppId(e) {
1345
1360
  this.axiosClient.setAppId(e);
@@ -1458,7 +1473,7 @@ function Ee(i) {
1458
1473
  }
1459
1474
  class Ie {
1460
1475
  constructor(e, t, r, s, o, a, d, h, g, f, k, A) {
1461
- this.authApi = e, this.deviceService = t, this.storageManager = r, this.subscribeStore = s, this.tokenCacheService = o, this.scopes = a, this.createTenantForNewUser = d, this.origin = h, this.url = g, this.sessionCallbacks = f, this.appId = k, this.tokenExchangeConfig = A, this.tokenDeliveryManager = new Y(r), A?.enabled && this.tokenDeliveryManager.setMode(y.BFF), this.initializeSession();
1476
+ this.authApi = e, this.deviceService = t, this.storageManager = r, this.subscribeStore = s, this.tokenCacheService = o, this.scopes = a, this.createTenantForNewUser = d, this.origin = h, this.url = g, this.sessionCallbacks = f, this.appId = k, this.tokenExchangeConfig = A, this.tokenDeliveryManager = new Y(r), A?.enabled && this.tokenDeliveryManager.setMode(m.BFF), this.initializeSession();
1462
1477
  }
1463
1478
  /**
1464
1479
  * Initialize session state on page load for cookie/BFF mode
@@ -4519,7 +4534,7 @@ class U extends l {
4519
4534
  }), this.name = "M2MConfigError";
4520
4535
  }
4521
4536
  }
4522
- const Ve = {
4537
+ const Ge = {
4523
4538
  InvalidRequest: "invalid_request",
4524
4539
  InvalidClient: "invalid_client",
4525
4540
  InvalidGrant: "invalid_grant",
@@ -4529,7 +4544,7 @@ const Ve = {
4529
4544
  RateLimitExceeded: "rate_limit_exceeded",
4530
4545
  ServerError: "server_error",
4531
4546
  TemporarilyUnavailable: "temporarily_unavailable"
4532
- }, w = {
4547
+ }, T = {
4533
4548
  /** Default token endpoint path */
4534
4549
  TOKEN_ENDPOINT: "/oauth2/token",
4535
4550
  /** Default request timeout in milliseconds */
@@ -4569,7 +4584,7 @@ const Ue = {
4569
4584
  return Math.pow(2, i - 1) * 1e3;
4570
4585
  }
4571
4586
  };
4572
- class Ge {
4587
+ class qe {
4573
4588
  /**
4574
4589
  * Create a new M2M client
4575
4590
  *
@@ -4600,16 +4615,16 @@ class Ge {
4600
4615
  scopes: e.scopes,
4601
4616
  audience: e.audience,
4602
4617
  autoRefresh: e.autoRefresh ?? !1,
4603
- refreshThreshold: e.refreshThreshold ?? w.REFRESH_THRESHOLD,
4604
- timeout: e.timeout ?? w.TIMEOUT,
4605
- retries: e.retries ?? w.RETRIES,
4606
- retryDelay: e.retryDelay ?? w.RETRY_DELAY,
4618
+ refreshThreshold: e.refreshThreshold ?? T.REFRESH_THRESHOLD,
4619
+ timeout: e.timeout ?? T.TIMEOUT,
4620
+ retries: e.retries ?? T.RETRIES,
4621
+ retryDelay: e.retryDelay ?? T.RETRY_DELAY,
4607
4622
  retryStrategy: e.retryStrategy,
4608
4623
  cache: e.cache,
4609
4624
  onTokenRequest: e.onTokenRequest,
4610
4625
  onTokenResponse: e.onTokenResponse,
4611
4626
  onError: e.onError
4612
- }, this.cache = e.cache ?? new xe(), this.retryStrategy = e.retryStrategy ?? Ue, this.tokenEndpoint = `${t}${w.TOKEN_ENDPOINT}`;
4627
+ }, this.cache = e.cache ?? new xe(), this.retryStrategy = e.retryStrategy ?? Ue, this.tokenEndpoint = `${t}${T.TOKEN_ENDPOINT}`;
4613
4628
  }
4614
4629
  /**
4615
4630
  * Get the cache key for this client
@@ -4700,7 +4715,7 @@ class Ge {
4700
4715
  const o = await fetch(this.tokenEndpoint, {
4701
4716
  method: "POST",
4702
4717
  headers: {
4703
- "Content-Type": w.CONTENT_TYPE,
4718
+ "Content-Type": T.CONTENT_TYPE,
4704
4719
  Accept: "application/json"
4705
4720
  },
4706
4721
  body: t.toString(),
@@ -4872,7 +4887,7 @@ class Ge {
4872
4887
  const s = await fetch(t, {
4873
4888
  method: "POST",
4874
4889
  headers: {
4875
- "Content-Type": w.CONTENT_TYPE
4890
+ "Content-Type": T.CONTENT_TYPE
4876
4891
  },
4877
4892
  body: r.toString()
4878
4893
  });
@@ -4922,6 +4937,7 @@ export {
4922
4937
  pe as AppAPI,
4923
4938
  fe as AuthAPI,
4924
4939
  Ie as AuthService,
4940
+ Ve as CLIAuthAPI,
4925
4941
  Ke as DEFAULT_GROUP_NAME,
4926
4942
  Q as DEFAULT_SCOPES,
4927
4943
  W as DEVICE_ID_HEADER_KEY,
@@ -4929,13 +4945,13 @@ export {
4929
4945
  ne as ERROR_MESSAGE_MAX_LENGTH,
4930
4946
  ke as InvitationAPI,
4931
4947
  be as InvitationService,
4932
- Ge as M2MClient,
4948
+ qe as M2MClient,
4933
4949
  U as M2MConfigError,
4934
4950
  l as M2MError,
4935
- Ve as M2MErrorCodes,
4951
+ Ge as M2MErrorCodes,
4936
4952
  N as M2MNetworkError,
4937
4953
  M as M2MTokenParseError,
4938
- w as M2M_DEFAULTS,
4954
+ T as M2M_DEFAULTS,
4939
4955
  Ne as MINIMAL_DEFAULT_SCOPES,
4940
4956
  b as OS,
4941
4957
  V as PASSFLOW_CLOUD_URL,
@@ -4944,7 +4960,7 @@ export {
4944
4960
  se as POPUP_TIMEOUT_MS,
4945
4961
  ee as POPUP_WIDTH,
4946
4962
  L as Passflow,
4947
- T as PassflowAdminEndpointPaths,
4963
+ _ as PassflowAdminEndpointPaths,
4948
4964
  c as PassflowEndpointPaths,
4949
4965
  u as PassflowError,
4950
4966
  n as PassflowEvent,
@@ -4958,7 +4974,7 @@ export {
4958
4974
  Me as TenantService,
4959
4975
  Re as TenantUserMembership,
4960
4976
  Fe as TokenCacheService,
4961
- y as TokenDeliveryMode,
4977
+ m as TokenDeliveryMode,
4962
4978
  p as TokenType,
4963
4979
  me as TwoFactorApiClient,
4964
4980
  ue as TwoFactorPolicy,
@@ -4973,7 +4989,7 @@ export {
4973
4989
  x as isValidPhoneNumber,
4974
4990
  _e as isValidUsername,
4975
4991
  v as parseToken,
4976
- m as pathWithParams,
4992
+ y as pathWithParams,
4977
4993
  Te as sanitizeErrorMessage
4978
4994
  };
4979
4995
  //# sourceMappingURL=index.mjs.map