@stytch/vanilla-js 5.4.0 → 5.5.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.
Files changed (32) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/adminPortal/components/DeleteConnection.d.ts +5 -2
  3. package/dist/adminPortal/components/Select.d.ts +2 -0
  4. package/dist/adminPortal/index.esm.js +1 -1
  5. package/dist/adminPortal/index.js +1 -1
  6. package/dist/adminPortal/scim/AdminPortalSCIM.d.ts +11 -1
  7. package/dist/adminPortal/scim/SCIMConnectionDangerZoneSection.d.ts +5 -0
  8. package/dist/adminPortal/scim/SCIMConnectionDetailsSection.d.ts +5 -0
  9. package/dist/adminPortal/scim/SCIMConnectionRoleAssignmentsSection.d.ts +7 -0
  10. package/dist/adminPortal/scim/SCIMConnectionTokenRotationSection.d.ts +5 -0
  11. package/dist/adminPortal/scim/mountAdminPortalSCIM.d.ts +1 -1
  12. package/dist/adminPortal/sso/AdminPortalSSO.d.ts +2 -2
  13. package/dist/adminPortal/sso/IdpInfo.d.ts +6 -2
  14. package/dist/adminPortal/sso/RoleAssignmentsSection.d.ts +2 -2
  15. package/dist/adminPortal/sso/SSONewConnectionConfigureScreen.d.ts +3 -3
  16. package/dist/adminPortal/sso/SSORouter.d.ts +7 -7
  17. package/dist/adminPortal/sso/TaggedConnection.d.ts +5 -2
  18. package/dist/adminPortal/utils/Connection.d.ts +1 -1
  19. package/dist/adminPortal/utils/ConnectionType.d.ts +1 -1
  20. package/dist/adminPortal/utils/getSsoRoleAssignments.d.ts +8 -0
  21. package/dist/adminPortal/utils/prependAsterisks.d.ts +1 -0
  22. package/dist/adminPortal/utils/useMutateScimConnection.d.ts +1 -1
  23. package/dist/adminPortal/utils/useMutateSsoConnection.d.ts +2 -5
  24. package/dist/b2b/index.esm.js +12 -5
  25. package/dist/b2b/index.headless.esm.js +1 -1
  26. package/dist/b2b/index.headless.js +1 -1
  27. package/dist/b2b/index.js +12 -5
  28. package/dist/index.esm.js +1 -1
  29. package/dist/index.headless.esm.js +1 -1
  30. package/dist/index.headless.js +1 -1
  31. package/dist/index.js +1 -1
  32. package/package.json +1 -1
@@ -1,7 +1,17 @@
1
1
  import React from 'react';
2
2
  import { MappedPropsFromRouteMap } from '../Router';
3
3
  import { AdminPortalComponentMountOptions } from '../makeAdminPortalComponentMountFn';
4
- export type AdminPortalSCIMMountOptions = AdminPortalComponentMountOptions;
4
+ import { AdminPortalUIConfigRoleDisplayProvider } from '../utils/AdminPortalUIConfigRoleDisplayProvider';
5
+ /**
6
+ * The UI configuration object for SCIM used in the Admin Portal.
7
+ */
8
+ export type AdminPortalSCIMUIConfig = AdminPortalUIConfigRoleDisplayProvider;
9
+ export interface AdminPortalSCIMMountOptions extends AdminPortalComponentMountOptions {
10
+ /**
11
+ * An {@link AdminPortalSCIMUIConfig} object containing custom configuration.
12
+ */
13
+ config?: AdminPortalSCIMUIConfig;
14
+ }
5
15
  declare const routeMap: {
6
16
  scimConnection: () => React.JSX.Element;
7
17
  newConnection: () => React.JSX.Element;
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { SCIMConnection } from '@stytch/core/public';
3
+ export declare const DangerZoneSection: ({ connection }: {
4
+ connection: SCIMConnection;
5
+ }) => React.JSX.Element | null;
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { SCIMConnection } from '@stytch/core/public';
3
+ export declare const DetailsSection: ({ connection }: {
4
+ connection: SCIMConnection;
5
+ }) => React.JSX.Element;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { SCIMConnection } from '@stytch/core/public';
3
+ import { UseBlockNavigation } from '../Router';
4
+ export declare const RoleAssignmentsSection: ({ connection, useBlockNavigation, }: {
5
+ connection: SCIMConnection;
6
+ useBlockNavigation: UseBlockNavigation;
7
+ }) => React.JSX.Element;
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { SCIMConnection } from '@stytch/core/public';
3
+ export declare const TokenRotationSection: ({ connection }: {
4
+ connection: SCIMConnection;
5
+ }) => React.JSX.Element;
@@ -12,4 +12,4 @@ export type { AdminPortalSCIMMountOptions } from './AdminPortalSCIM';
12
12
  *
13
13
  * @throws An error when the element specified by element cannot be found.
14
14
  */
15
- export declare const mountAdminPortalSCIM: (options: import("../makeAdminPortalComponentMountFn").AdminPortalComponentMountOptions) => void;
15
+ export declare const mountAdminPortalSCIM: (options: import("./AdminPortalSCIM").AdminPortalSCIMMountOptions) => void;
@@ -18,8 +18,8 @@ declare const routeMap: {
18
18
  }) => React.JSX.Element;
19
19
  connectionsList: () => React.JSX.Element;
20
20
  newConnection: () => React.JSX.Element;
21
- newConnectionConfigure: ({ connection: connectionProp }: {
22
- connection: import("./TaggedConnection").TaggedConnection;
21
+ newConnectionConfigure: ({ connection: connectionProp, }: {
22
+ connection: import("./TaggedConnection").OIDCTaggedConnection | import("./TaggedConnection").SAMLTaggedConnection;
23
23
  }) => React.JSX.Element;
24
24
  };
25
25
  export type SsoRouterMappedProps = MappedPropsFromRouteMap<typeof routeMap>;
@@ -1,6 +1,6 @@
1
1
  import { RequireAllOrNone } from 'type-fest';
2
2
  import { ConnectionType } from '../utils/ConnectionType';
3
- import { OIDCTaggedConnection, SAMLTaggedConnection, TaggedConnection } from './TaggedConnection';
3
+ import { ExternalTaggedConnection, OIDCTaggedConnection, SAMLTaggedConnection, TaggedConnection } from './TaggedConnection';
4
4
  export type SamlKnownIdp = 'generic' | 'okta' | 'microsoft-entra' | 'google-workspace';
5
5
  export type OidcKnownIdp = 'generic' | 'okta' | 'microsoft-entra';
6
6
  export type KnownIdp = SamlKnownIdp | OidcKnownIdp;
@@ -138,7 +138,11 @@ type IdpAndConnectionInfoReturnType<TConnectionType extends ConnectionType> = ((
138
138
  connection: SAMLTaggedConnection;
139
139
  }) | (OidcTaggedIdpInfo & {
140
140
  connection: OIDCTaggedConnection;
141
- })) & {
141
+ }) | {
142
+ idp: undefined;
143
+ type: 'external';
144
+ connection: ExternalTaggedConnection;
145
+ }) & {
142
146
  type: TConnectionType;
143
147
  };
144
148
  export declare const getIdpAndConnectionInfo: <TConnectionType extends ConnectionType>(connection: TaggedConnection & {
@@ -1,6 +1,6 @@
1
- import { SAMLConnection } from '@stytch/core/public';
2
1
  import React from 'react';
2
+ import { ExternalTaggedConnection, SAMLTaggedConnection } from './TaggedConnection';
3
3
  export declare const RoleAssignmentsSection: ({ canUpdateConnection, connection, }: {
4
4
  canUpdateConnection: boolean;
5
- connection: SAMLConnection;
5
+ connection: SAMLTaggedConnection | ExternalTaggedConnection;
6
6
  }) => React.JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { TaggedConnection } from './TaggedConnection';
3
- export declare const SSONewConnectionConfigureScreen: ({ connection: connectionProp }: {
4
- connection: TaggedConnection;
2
+ import { OIDCTaggedConnection, SAMLTaggedConnection } from './TaggedConnection';
3
+ export declare const SSONewConnectionConfigureScreen: ({ connection: connectionProp, }: {
4
+ connection: SAMLTaggedConnection | OIDCTaggedConnection;
5
5
  }) => React.JSX.Element;
@@ -7,8 +7,8 @@ export declare const SsoRouterProvider: ({ children, initialRoute, }: {
7
7
  }) => import("react").JSX.Element;
8
8
  connectionsList: () => import("react").JSX.Element;
9
9
  newConnection: () => import("react").JSX.Element;
10
- newConnectionConfigure: ({ connection: connectionProp }: {
11
- connection: import("./TaggedConnection").TaggedConnection;
10
+ newConnectionConfigure: ({ connection: connectionProp, }: {
11
+ connection: import("./TaggedConnection").OIDCTaggedConnection | import("./TaggedConnection").SAMLTaggedConnection;
12
12
  }) => import("react").JSX.Element;
13
13
  }>>;
14
14
  }) => import("react").JSX.Element, SsoRouter: ({ routeMap }: {
@@ -19,7 +19,7 @@ export declare const SsoRouterProvider: ({ children, initialRoute, }: {
19
19
  connectionsList: import("react").ComponentType<never>;
20
20
  newConnection: import("react").ComponentType<never>;
21
21
  newConnectionConfigure: import("react").ComponentType<{
22
- connection: import("./TaggedConnection").TaggedConnection;
22
+ connection: import("./TaggedConnection").OIDCTaggedConnection | import("./TaggedConnection").SAMLTaggedConnection;
23
23
  }>;
24
24
  };
25
25
  }) => import("react").JSX.Element | null, useSsoRouterController: () => import("../Router").RouterController<import("../Router").MappedPropsFromRouteMap<{
@@ -28,8 +28,8 @@ export declare const SsoRouterProvider: ({ children, initialRoute, }: {
28
28
  }) => import("react").JSX.Element;
29
29
  connectionsList: () => import("react").JSX.Element;
30
30
  newConnection: () => import("react").JSX.Element;
31
- newConnectionConfigure: ({ connection: connectionProp }: {
32
- connection: import("./TaggedConnection").TaggedConnection;
31
+ newConnectionConfigure: ({ connection: connectionProp, }: {
32
+ connection: import("./TaggedConnection").OIDCTaggedConnection | import("./TaggedConnection").SAMLTaggedConnection;
33
33
  }) => import("react").JSX.Element;
34
34
  }>>, useSsoRouterState: () => {
35
35
  currentRoute: import("../Router").RouterStateEntry<import("../Router").MappedPropsFromRouteMap<{
@@ -38,8 +38,8 @@ export declare const SsoRouterProvider: ({ children, initialRoute, }: {
38
38
  }) => import("react").JSX.Element;
39
39
  connectionsList: () => import("react").JSX.Element;
40
40
  newConnection: () => import("react").JSX.Element;
41
- newConnectionConfigure: ({ connection: connectionProp }: {
42
- connection: import("./TaggedConnection").TaggedConnection;
41
+ newConnectionConfigure: ({ connection: connectionProp, }: {
42
+ connection: import("./TaggedConnection").OIDCTaggedConnection | import("./TaggedConnection").SAMLTaggedConnection;
43
43
  }) => import("react").JSX.Element;
44
44
  }>>;
45
45
  };
@@ -1,8 +1,11 @@
1
- import { OIDCConnection, SAMLConnection } from '@stytch/core/public';
1
+ import { ExternalConnection, OIDCConnection, SAMLConnection } from '@stytch/core/public';
2
2
  export type OIDCTaggedConnection = OIDCConnection & {
3
3
  connectionType: 'oidc';
4
4
  };
5
5
  export type SAMLTaggedConnection = SAMLConnection & {
6
6
  connectionType: 'saml';
7
7
  };
8
- export type TaggedConnection = OIDCTaggedConnection | SAMLTaggedConnection;
8
+ export type ExternalTaggedConnection = ExternalConnection & {
9
+ connectionType: 'external';
10
+ };
11
+ export type TaggedConnection = OIDCTaggedConnection | SAMLTaggedConnection | ExternalTaggedConnection;
@@ -3,7 +3,7 @@ export type Connection = {
3
3
  id: string;
4
4
  displayName: string;
5
5
  connectionType: ConnectionType;
6
- idp: string;
6
+ idp: string | undefined;
7
7
  status: string;
8
8
  isDefault: boolean;
9
9
  };
@@ -1 +1 @@
1
- export type ConnectionType = 'saml' | 'oidc';
1
+ export type ConnectionType = 'saml' | 'oidc' | 'external';
@@ -0,0 +1,8 @@
1
+ import { ExternalTaggedConnection, SAMLTaggedConnection } from '../sso/TaggedConnection';
2
+ export declare const getSsoConnectionRoleAssignments: (connection: SAMLTaggedConnection | ExternalTaggedConnection) => {
3
+ role_id: string;
4
+ }[];
5
+ export declare const getSsoGroupRoleAssignments: (connection: SAMLTaggedConnection | ExternalTaggedConnection) => {
6
+ role_id: string;
7
+ group: string;
8
+ }[];
@@ -0,0 +1 @@
1
+ export declare const prependAsterisks: (value: string) => string;
@@ -1,4 +1,4 @@
1
1
  import { B2BSCIMUpdateConnectionOptions } from '@stytch/core/public';
2
2
  export declare const useMutateScimConnectionRoleAssignments: () => {
3
- mutate: import("./useMutateWithToast").MutationFn<B2BSCIMUpdateConnectionOptions, void>;
3
+ mutate: import("./useMutateWithToast").MutationFn<Pick<B2BSCIMUpdateConnectionOptions, "connection_id" | "scim_group_implicit_role_assignments">, void>;
4
4
  };
@@ -1,4 +1,4 @@
1
- import { B2BSSOOIDCUpdateConnectionOptions, B2BSSOSAMLDeleteVerificationCertificateOptions, B2BSSOSAMLUpdateConnectionByURLOptions, B2BSSOSAMLUpdateConnectionOptions } from '@stytch/core/public';
1
+ import { B2BSSOOIDCUpdateConnectionOptions, B2BSSOSAMLDeleteVerificationCertificateOptions, B2BSSOSAMLUpdateConnectionByURLOptions, B2BSSOSAMLUpdateConnectionOptions, B2BSSOUpdateExternalConnectionOptions } from '@stytch/core/public';
2
2
  import { ConnectionType } from './ConnectionType';
3
3
  export declare const useMutateSsoConnectionByUrl: () => {
4
4
  mutate: import("./useMutateWithToast").MutationFn<B2BSSOSAMLUpdateConnectionByURLOptions, void>;
@@ -12,8 +12,5 @@ export declare const useDeleteSsoConnectionCert: () => {
12
12
  mutate: import("./useMutateWithToast").MutationFn<B2BSSOSAMLDeleteVerificationCertificateOptions, void>;
13
13
  };
14
14
  export declare const useMutateSsoConnection: <TConnectionType extends ConnectionType>(connectionType: TConnectionType) => {
15
- mutate: import("./useMutateWithToast").MutationFn<TConnectionType extends "saml" ? B2BSSOSAMLUpdateConnectionOptions : B2BSSOOIDCUpdateConnectionOptions, void>;
16
- };
17
- export declare const useMutateSamlConnection: () => {
18
- mutate: import("./useMutateWithToast").MutationFn<B2BSSOSAMLUpdateConnectionOptions, void>;
15
+ mutate: import("./useMutateWithToast").MutationFn<TConnectionType extends "saml" ? B2BSSOSAMLUpdateConnectionOptions : TConnectionType extends "oidc" ? B2BSSOOIDCUpdateConnectionOptions : B2BSSOUpdateExternalConnectionOptions, void>;
19
16
  };
@@ -4861,16 +4861,23 @@ var PhoneInput = function PhoneInput(_ref87) {
4861
4861
  type: 'text',
4862
4862
  onChange: function onChange(e) {
4863
4863
  return __awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {
4864
- var parsedPhoneNumber;
4864
+ var userInput, parsedPhoneNumber;
4865
4865
  return _regeneratorRuntime().wrap(function _callee10$(_context10) {
4866
4866
  while (1) switch (_context10.prev = _context10.next) {
4867
4867
  case 0:
4868
- _context10.next = 2;
4869
- return parsePhoneNumber(e.target.value, country);
4870
- case 2:
4868
+ userInput = e.target.value;
4869
+ _context10.next = 3;
4870
+ return parsePhoneNumber(userInput, country);
4871
+ case 3:
4871
4872
  parsedPhoneNumber = _context10.sent;
4873
+ if (!(userInput !== e.target.value)) {
4874
+ _context10.next = 6;
4875
+ break;
4876
+ }
4877
+ return _context10.abrupt("return");
4878
+ case 6:
4872
4879
  setPhone(parsedPhoneNumber.national);
4873
- case 4:
4880
+ case 7:
4874
4881
  case "end":
4875
4882
  return _context10.stop();
4876
4883
  }
@@ -1433,7 +1433,7 @@ var B2BOneTapProvider = /*#__PURE__*/function () {
1433
1433
  }]);
1434
1434
  return B2BOneTapProvider;
1435
1435
  }();
1436
- var version = "5.4.0";
1436
+ var version = "5.5.0";
1437
1437
  var NetworkClient = /*#__PURE__*/function () {
1438
1438
  function NetworkClient(_publicToken, _subscriptionDataLayer, _liveAPIURL, _testAPIURL, additionalTelemetryDataFn) {
1439
1439
  _classCallCheck(this, NetworkClient);
@@ -1434,7 +1434,7 @@ var B2BOneTapProvider = /*#__PURE__*/function () {
1434
1434
  }]);
1435
1435
  return B2BOneTapProvider;
1436
1436
  }();
1437
- var version = "5.4.0";
1437
+ var version = "5.5.0";
1438
1438
  var NetworkClient = /*#__PURE__*/function () {
1439
1439
  function NetworkClient(_publicToken, _subscriptionDataLayer, _liveAPIURL, _testAPIURL, additionalTelemetryDataFn) {
1440
1440
  _classCallCheck(this, NetworkClient);
package/dist/b2b/index.js CHANGED
@@ -4862,16 +4862,23 @@ var PhoneInput = function PhoneInput(_ref87) {
4862
4862
  type: 'text',
4863
4863
  onChange: function onChange(e) {
4864
4864
  return internal.__awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {
4865
- var parsedPhoneNumber;
4865
+ var userInput, parsedPhoneNumber;
4866
4866
  return _regeneratorRuntime().wrap(function _callee10$(_context10) {
4867
4867
  while (1) switch (_context10.prev = _context10.next) {
4868
4868
  case 0:
4869
- _context10.next = 2;
4870
- return parsePhoneNumber(e.target.value, country);
4871
- case 2:
4869
+ userInput = e.target.value;
4870
+ _context10.next = 3;
4871
+ return parsePhoneNumber(userInput, country);
4872
+ case 3:
4872
4873
  parsedPhoneNumber = _context10.sent;
4874
+ if (!(userInput !== e.target.value)) {
4875
+ _context10.next = 6;
4876
+ break;
4877
+ }
4878
+ return _context10.abrupt("return");
4879
+ case 6:
4873
4880
  setPhone(parsedPhoneNumber.national);
4874
- case 4:
4881
+ case 7:
4875
4882
  case "end":
4876
4883
  return _context10.stop();
4877
4884
  }