@workos-inc/node 7.48.0 → 7.49.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.
@@ -5,6 +5,7 @@ import { AuthenticationEvent, AuthenticationEventResponse, EmailVerificationEven
5
5
  import { OrganizationMembership, OrganizationMembershipResponse } from '../../user-management/interfaces/organization-membership.interface';
6
6
  import { RoleEvent, RoleEventResponse } from '../../roles/interfaces/role.interface';
7
7
  import { OrganizationDomain, OrganizationDomainResponse } from '../../organization-domains/interfaces';
8
+ import { AuthenticationRadarRiskDetectedEventData, AuthenticationRadarRiskDetectedEventResponseData } from '../../user-management/interfaces/authentication-radar-risk-detected-event.interface';
8
9
  export interface EventBase {
9
10
  id: string;
10
11
  createdAt: string;
@@ -77,6 +78,14 @@ export interface AuthenticationPasswordSucceededEventResponse extends EventRespo
77
78
  event: 'authentication.password_succeeded';
78
79
  data: AuthenticationEventResponse;
79
80
  }
81
+ export interface AuthenticationRadarRiskDetectedEvent extends EventBase {
82
+ event: 'authentication.radar_risk_detected';
83
+ data: AuthenticationRadarRiskDetectedEventData;
84
+ }
85
+ export interface AuthenticationRadarRiskDetectedEventResponse extends EventResponseBase {
86
+ event: 'authentication.radar_risk_detected';
87
+ data: AuthenticationRadarRiskDetectedEventResponseData;
88
+ }
80
89
  export interface AuthenticationSSOFailedEvent extends EventBase {
81
90
  event: 'authentication.sso_failed';
82
91
  data: AuthenticationEvent;
@@ -409,7 +418,7 @@ export interface OrganizationDomainVerificationFailedEventResponse extends Event
409
418
  event: 'organization_domain.verification_failed';
410
419
  data: OrganizationDomainResponse;
411
420
  }
412
- export type Event = AuthenticationEmailVerificationSucceededEvent | AuthenticationMfaSucceededEvent | AuthenticationOAuthFailedEvent | AuthenticationOAuthSucceededEvent | AuthenticationSSOFailedEvent | AuthenticationSSOSucceededEvent | AuthenticationPasswordFailedEvent | AuthenticationPasswordSucceededEvent | AuthenticationMagicAuthFailedEvent | AuthenticationMagicAuthSucceededEvent | ConnectionActivatedEvent | ConnectionDeactivatedEvent | ConnectionDeletedEvent | DsyncActivatedEvent | DsyncDeactivatedEvent | DsyncDeletedEvent | DsyncGroupCreatedEvent | DsyncGroupUpdatedEvent | DsyncGroupDeletedEvent | DsyncGroupUserAddedEvent | DsyncGroupUserRemovedEvent | DsyncUserCreatedEvent | DsyncUserUpdatedEvent | DsyncUserDeletedEvent | EmailVerificationCreatedEvent | InvitationCreatedEvent | MagicAuthCreatedEvent | PasswordResetCreatedEvent | PasswordResetSucceededEvent | UserCreatedEvent | UserUpdatedEvent | UserDeletedEvent | OrganizationMembershipAdded | OrganizationMembershipCreated | OrganizationMembershipDeleted | OrganizationMembershipUpdated | OrganizationMembershipRemoved | RoleCreatedEvent | RoleDeletedEvent | RoleUpdatedEvent | SessionCreatedEvent | OrganizationCreatedEvent | OrganizationUpdatedEvent | OrganizationDeletedEvent | OrganizationDomainVerifiedEvent | OrganizationDomainVerificationFailedEvent;
413
- export type EventResponse = AuthenticationEmailVerificationSucceededEventResponse | AuthenticationMagicAuthFailedEventResponse | AuthenticationMagicAuthSucceededEventResponse | AuthenticationMfaSucceededEventResponse | AuthenticationOAuthFailedEventResponse | AuthenticationOAuthSucceededEventResponse | AuthenticationPasswordFailedEventResponse | AuthenticationPasswordSucceededEventResponse | AuthenticationSSOFailedEventResponse | AuthenticationSSOSucceededEventResponse | ConnectionActivatedEventResponse | ConnectionDeactivatedEventResponse | ConnectionDeletedEventResponse | DsyncActivatedEventResponse | DsyncDeactivatedEventResponse | DsyncDeletedEventResponse | DsyncGroupCreatedEventResponse | DsyncGroupUpdatedEventResponse | DsyncGroupDeletedEventResponse | DsyncGroupUserAddedEventResponse | DsyncGroupUserRemovedEventResponse | DsyncUserCreatedEventResponse | DsyncUserUpdatedEventResponse | DsyncUserDeletedEventResponse | EmailVerificationCreatedEventResponse | InvitationCreatedEventResponse | MagicAuthCreatedEventResponse | PasswordResetCreatedEventResponse | PasswordResetSucceededEventResponse | UserCreatedEventResponse | UserUpdatedEventResponse | UserDeletedEventResponse | OrganizationMembershipAddedResponse | OrganizationMembershipCreatedResponse | OrganizationMembershipDeletedResponse | OrganizationMembershipUpdatedResponse | OrganizationMembershipRemovedResponse | RoleCreatedEventResponse | RoleDeletedEventResponse | RoleUpdatedEventResponse | SessionCreatedEventResponse | OrganizationCreatedResponse | OrganizationUpdatedResponse | OrganizationDeletedResponse | OrganizationDomainVerifiedEventResponse | OrganizationDomainVerificationFailedEventResponse;
421
+ export type Event = AuthenticationEmailVerificationSucceededEvent | AuthenticationMfaSucceededEvent | AuthenticationOAuthFailedEvent | AuthenticationOAuthSucceededEvent | AuthenticationSSOFailedEvent | AuthenticationSSOSucceededEvent | AuthenticationPasswordFailedEvent | AuthenticationPasswordSucceededEvent | AuthenticationMagicAuthFailedEvent | AuthenticationMagicAuthSucceededEvent | AuthenticationRadarRiskDetectedEvent | ConnectionActivatedEvent | ConnectionDeactivatedEvent | ConnectionDeletedEvent | DsyncActivatedEvent | DsyncDeactivatedEvent | DsyncDeletedEvent | DsyncGroupCreatedEvent | DsyncGroupUpdatedEvent | DsyncGroupDeletedEvent | DsyncGroupUserAddedEvent | DsyncGroupUserRemovedEvent | DsyncUserCreatedEvent | DsyncUserUpdatedEvent | DsyncUserDeletedEvent | EmailVerificationCreatedEvent | InvitationCreatedEvent | MagicAuthCreatedEvent | PasswordResetCreatedEvent | PasswordResetSucceededEvent | UserCreatedEvent | UserUpdatedEvent | UserDeletedEvent | OrganizationMembershipAdded | OrganizationMembershipCreated | OrganizationMembershipDeleted | OrganizationMembershipUpdated | OrganizationMembershipRemoved | RoleCreatedEvent | RoleDeletedEvent | RoleUpdatedEvent | SessionCreatedEvent | OrganizationCreatedEvent | OrganizationUpdatedEvent | OrganizationDeletedEvent | OrganizationDomainVerifiedEvent | OrganizationDomainVerificationFailedEvent;
422
+ export type EventResponse = AuthenticationEmailVerificationSucceededEventResponse | AuthenticationMagicAuthFailedEventResponse | AuthenticationMagicAuthSucceededEventResponse | AuthenticationMfaSucceededEventResponse | AuthenticationOAuthFailedEventResponse | AuthenticationOAuthSucceededEventResponse | AuthenticationPasswordFailedEventResponse | AuthenticationPasswordSucceededEventResponse | AuthenticationSSOFailedEventResponse | AuthenticationSSOSucceededEventResponse | AuthenticationRadarRiskDetectedEventResponse | ConnectionActivatedEventResponse | ConnectionDeactivatedEventResponse | ConnectionDeletedEventResponse | DsyncActivatedEventResponse | DsyncDeactivatedEventResponse | DsyncDeletedEventResponse | DsyncGroupCreatedEventResponse | DsyncGroupUpdatedEventResponse | DsyncGroupDeletedEventResponse | DsyncGroupUserAddedEventResponse | DsyncGroupUserRemovedEventResponse | DsyncUserCreatedEventResponse | DsyncUserUpdatedEventResponse | DsyncUserDeletedEventResponse | EmailVerificationCreatedEventResponse | InvitationCreatedEventResponse | MagicAuthCreatedEventResponse | PasswordResetCreatedEventResponse | PasswordResetSucceededEventResponse | UserCreatedEventResponse | UserUpdatedEventResponse | UserDeletedEventResponse | OrganizationMembershipAddedResponse | OrganizationMembershipCreatedResponse | OrganizationMembershipDeletedResponse | OrganizationMembershipUpdatedResponse | OrganizationMembershipRemovedResponse | RoleCreatedEventResponse | RoleDeletedEventResponse | RoleUpdatedEventResponse | SessionCreatedEventResponse | OrganizationCreatedResponse | OrganizationUpdatedResponse | OrganizationDeletedResponse | OrganizationDomainVerifiedEventResponse | OrganizationDomainVerificationFailedEventResponse;
414
423
  export type EventName = Event['event'];
415
424
  export {};
@@ -9,6 +9,7 @@ const organization_domain_serializer_1 = require("../../organization-domains/ser
9
9
  const organization_membership_serializer_1 = require("../../user-management/serializers/organization-membership.serializer");
10
10
  const role_serializer_1 = require("../../user-management/serializers/role.serializer");
11
11
  const session_serializer_1 = require("../../user-management/serializers/session.serializer");
12
+ const authentication_radar_risk_event_serializer_1 = require("../../user-management/serializers/authentication-radar-risk-event-serializer");
12
13
  const deserializeEvent = (event) => {
13
14
  const eventBase = {
14
15
  id: event.id,
@@ -26,6 +27,8 @@ const deserializeEvent = (event) => {
26
27
  case 'authentication.sso_failed':
27
28
  case 'authentication.sso_succeeded':
28
29
  return Object.assign(Object.assign({}, eventBase), { event: event.event, data: (0, serializers_4.deserializeAuthenticationEvent)(event.data) });
30
+ case 'authentication.radar_risk_detected':
31
+ return Object.assign(Object.assign({}, eventBase), { event: event.event, data: (0, authentication_radar_risk_event_serializer_1.deserializeAuthenticationRadarRiskDetectedEvent)(event.data) });
29
32
  case 'connection.activated':
30
33
  case 'connection.deactivated':
31
34
  case 'connection.deleted':
@@ -0,0 +1,20 @@
1
+ export type AuthenticationRadarRiskDetectedEventData = {
2
+ authMethod: string;
3
+ action: 'signup' | 'login';
4
+ control: string | null;
5
+ blocklistType: string | null;
6
+ ipAddress: string | null;
7
+ userAgent: string | null;
8
+ userId: string;
9
+ email: string;
10
+ };
11
+ export interface AuthenticationRadarRiskDetectedEventResponseData {
12
+ auth_method: string;
13
+ action: 'signup' | 'login';
14
+ control: string | null;
15
+ blocklist_type: string | null;
16
+ ip_address: string | null;
17
+ user_agent: string | null;
18
+ user_id: string;
19
+ email: string;
20
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -3,6 +3,10 @@ export interface AuthorizationURLOptions {
3
3
  codeChallenge?: string;
4
4
  codeChallengeMethod?: 'S256';
5
5
  connectionId?: string;
6
+ /**
7
+ * @deprecated We previously required initiate login endpoints to return the `context`
8
+ * query parameter when getting the authorization URL. This is no longer necessary.
9
+ */
6
10
  context?: string;
7
11
  organizationId?: string;
8
12
  domainHint?: string;
@@ -9,6 +9,7 @@ export * from './authenticate-with-session-cookie.interface';
9
9
  export * from './authenticate-with-totp-options.interface';
10
10
  export * from './authentication-event.interface';
11
11
  export * from './authentication-response.interface';
12
+ export * from './authentication-radar-risk-detected-event.interface';
12
13
  export * from './create-magic-auth-options.interface';
13
14
  export * from './create-organization-membership-options.interface';
14
15
  export * from './create-password-reset-options.interface';
@@ -25,6 +25,7 @@ __exportStar(require("./authenticate-with-session-cookie.interface"), exports);
25
25
  __exportStar(require("./authenticate-with-totp-options.interface"), exports);
26
26
  __exportStar(require("./authentication-event.interface"), exports);
27
27
  __exportStar(require("./authentication-response.interface"), exports);
28
+ __exportStar(require("./authentication-radar-risk-detected-event.interface"), exports);
28
29
  __exportStar(require("./create-magic-auth-options.interface"), exports);
29
30
  __exportStar(require("./create-organization-membership-options.interface"), exports);
30
31
  __exportStar(require("./create-password-reset-options.interface"), exports);
@@ -0,0 +1,2 @@
1
+ import type { AuthenticationRadarRiskDetectedEventData, AuthenticationRadarRiskDetectedEventResponseData } from '../interfaces';
2
+ export declare const deserializeAuthenticationRadarRiskDetectedEvent: (authenticationRadarRiskDetectedEvent: AuthenticationRadarRiskDetectedEventResponseData) => AuthenticationRadarRiskDetectedEventData;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.deserializeAuthenticationRadarRiskDetectedEvent = void 0;
4
+ const deserializeAuthenticationRadarRiskDetectedEvent = (authenticationRadarRiskDetectedEvent) => ({
5
+ authMethod: authenticationRadarRiskDetectedEvent.auth_method,
6
+ action: authenticationRadarRiskDetectedEvent.action,
7
+ control: authenticationRadarRiskDetectedEvent.control,
8
+ blocklistType: authenticationRadarRiskDetectedEvent.blocklist_type,
9
+ ipAddress: authenticationRadarRiskDetectedEvent.ip_address,
10
+ userAgent: authenticationRadarRiskDetectedEvent.user_agent,
11
+ userId: authenticationRadarRiskDetectedEvent.user_id,
12
+ email: authenticationRadarRiskDetectedEvent.email,
13
+ });
14
+ exports.deserializeAuthenticationRadarRiskDetectedEvent = deserializeAuthenticationRadarRiskDetectedEvent;
@@ -526,6 +526,10 @@ class UserManagement {
526
526
  if (provider !== 'authkit' && screenHint) {
527
527
  throw new TypeError(`'screenHint' is only supported for 'authkit' provider`);
528
528
  }
529
+ if (context) {
530
+ this.workos.emitWarning(`\`context\` is deprecated. We previously required initiate login endpoints to return the
531
+ \`context\` query parameter when getting the authorization URL. This is no longer necessary.`);
532
+ }
529
533
  const query = toQueryString({
530
534
  connection_id: connectionId,
531
535
  code_challenge: codeChallenge,
package/lib/workos.js CHANGED
@@ -31,7 +31,7 @@ const widgets_1 = require("./widgets/widgets");
31
31
  const actions_1 = require("./actions/actions");
32
32
  const vault_1 = require("./vault/vault");
33
33
  const conflict_exception_1 = require("./common/exceptions/conflict.exception");
34
- const VERSION = '7.48.0';
34
+ const VERSION = '7.49.0';
35
35
  const DEFAULT_HOSTNAME = 'api.workos.com';
36
36
  const HEADER_AUTHORIZATION = 'Authorization';
37
37
  const HEADER_IDEMPOTENCY_KEY = 'Idempotency-Key';
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "7.48.0",
2
+ "version": "7.49.0",
3
3
  "name": "@workos-inc/node",
4
4
  "author": "WorkOS",
5
5
  "description": "A Node wrapper for the WorkOS API",