@workos-inc/node 10.0.0 → 10.1.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.
@@ -667,7 +667,8 @@ const serializeAuthenticateWithMagicAuthOptions = (options) => ({
667
667
  invitation_token: options.invitationToken,
668
668
  link_authorization_code: options.linkAuthorizationCode,
669
669
  ip_address: options.ipAddress,
670
- user_agent: options.userAgent
670
+ user_agent: options.userAgent,
671
+ radar_auth_attempt_id: options.radarAuthAttemptId
671
672
  });
672
673
  //#endregion
673
674
  //#region src/user-management/serializers/authenticate-with-password-options.serializer.ts
@@ -679,7 +680,8 @@ const serializeAuthenticateWithPasswordOptions = (options) => ({
679
680
  password: options.password,
680
681
  invitation_token: options.invitationToken,
681
682
  ip_address: options.ipAddress,
682
- user_agent: options.userAgent
683
+ user_agent: options.userAgent,
684
+ radar_auth_attempt_id: options.radarAuthAttemptId
683
685
  });
684
686
  //#endregion
685
687
  //#region src/user-management/serializers/authenticate-with-refresh-token.options.serializer.ts
@@ -783,6 +785,7 @@ const deserializeUser = (user) => ({
783
785
  id: user.id,
784
786
  email: user.email,
785
787
  emailVerified: user.email_verified,
788
+ name: user.name ?? null,
786
789
  firstName: user.first_name,
787
790
  profilePictureUrl: user.profile_picture_url,
788
791
  lastName: user.last_name,
@@ -812,7 +815,10 @@ const deserializeAuthenticationResponse = (authenticationResponse) => {
812
815
  //#region src/user-management/serializers/create-magic-auth-options.serializer.ts
813
816
  const serializeCreateMagicAuthOptions = (options) => ({
814
817
  email: options.email,
815
- invitation_token: options.invitationToken
818
+ invitation_token: options.invitationToken,
819
+ ip_address: options.ipAddress,
820
+ user_agent: options.userAgent,
821
+ radar_auth_attempt_id: options.radarAuthAttemptId
816
822
  });
817
823
  //#endregion
818
824
  //#region src/user-management/serializers/create-password-reset-options.serializer.ts
@@ -954,17 +960,21 @@ const serializeCreateUserOptions = (options) => ({
954
960
  password: options.password,
955
961
  password_hash: options.passwordHash,
956
962
  password_hash_type: options.passwordHashType,
963
+ name: options.name,
957
964
  first_name: options.firstName,
958
965
  last_name: options.lastName,
959
966
  email_verified: options.emailVerified,
960
967
  external_id: options.externalId,
961
- metadata: options.metadata
968
+ metadata: options.metadata,
969
+ ip_address: options.ipAddress,
970
+ user_agent: options.userAgent
962
971
  });
963
972
  //#endregion
964
973
  //#region src/user-management/serializers/update-user-options.serializer.ts
965
974
  const serializeUpdateUserOptions = (options) => ({
966
975
  email: options.email,
967
976
  email_verified: options.emailVerified,
977
+ name: options.name,
968
978
  first_name: options.firstName,
969
979
  last_name: options.lastName,
970
980
  password: options.password,
@@ -1007,6 +1017,7 @@ const deserializeUserData = (userData) => {
1007
1017
  return {
1008
1018
  object: userData.object,
1009
1019
  email: userData.email,
1020
+ name: userData.name ?? null,
1010
1021
  firstName: userData.first_name,
1011
1022
  lastName: userData.last_name
1012
1023
  };
@@ -1287,6 +1298,7 @@ const deserializeProfile = (profile) => ({
1287
1298
  connectionId: profile.connection_id,
1288
1299
  connectionType: profile.connection_type,
1289
1300
  email: profile.email,
1301
+ ...profile.name !== void 0 && { name: profile.name },
1290
1302
  ...profile.first_name !== void 0 && { firstName: profile.first_name },
1291
1303
  ...profile.last_name !== void 0 && { lastName: profile.last_name },
1292
1304
  ...profile.role !== void 0 && { role: profile.role },
@@ -2232,8 +2244,7 @@ var Connect = class {
2232
2244
  * @throws {UnprocessableEntityException} 422
2233
2245
  */
2234
2246
  async listApplications(options) {
2235
- const paginationOptions = options;
2236
- return new AutoPaginatable(await fetchAndDeserialize(this.workos, "/connect/applications", deserializeConnectApplication, options ? serializeListApplicationsOptions(options) : void 0), (params) => fetchAndDeserialize(this.workos, "/connect/applications", deserializeConnectApplication, params), paginationOptions);
2247
+ return new AutoPaginatable(await fetchAndDeserialize(this.workos, "/connect/applications", deserializeConnectApplication, options ? serializeListApplicationsOptions(options) : void 0), (params) => fetchAndDeserialize(this.workos, "/connect/applications", deserializeConnectApplication, params), options ? serializeListApplicationsOptions(options) : void 0);
2237
2248
  }
2238
2249
  /**
2239
2250
  * Create a Connect Application
@@ -4139,14 +4150,18 @@ var UserManagement = class {
4139
4150
  *
4140
4151
  * Create a new user in the current environment.
4141
4152
  * @param payload - Object containing email.
4142
- * @returns {Promise<User>}
4153
+ * @returns {Promise<CreateUserResponse>}
4143
4154
  * @throws {BadRequestException} 400
4144
4155
  * @throws {NotFoundException} 404
4145
4156
  * @throws {UnprocessableEntityException} 422
4146
4157
  */
4147
4158
  async createUser(payload) {
4148
4159
  const { data } = await this.workos.post("/user_management/users", serializeCreateUserOptions(payload));
4149
- return deserializeUser(data);
4160
+ const { radar_auth_attempt_id, ...userResponse } = data;
4161
+ return {
4162
+ ...deserializeUser(userResponse),
4163
+ ...radar_auth_attempt_id ? { radarAuthAttemptId: radar_auth_attempt_id } : void 0
4164
+ };
4150
4165
  }
4151
4166
  /** Authenticate with magic auth. */
4152
4167
  async authenticateWithMagicAuth(payload) {
@@ -4406,14 +4421,18 @@ var UserManagement = class {
4406
4421
  *
4407
4422
  * Creates a one-time authentication code that can be sent to the user's email address. The code expires in 10 minutes. To verify the code, [authenticate the user with Magic Auth](https://workos.com/docs/reference/authkit/authentication/magic-auth).
4408
4423
  * @param options - Object containing email.
4409
- * @returns {Promise<MagicAuth>}
4424
+ * @returns {Promise<CreateMagicAuthResponse>}
4410
4425
  * @throws {BadRequestException} 400
4411
4426
  * @throws {UnprocessableEntityException} 422
4412
4427
  * @throws {RateLimitExceededException} 429
4413
4428
  */
4414
4429
  async createMagicAuth(options) {
4415
4430
  const { data } = await this.workos.post("/user_management/magic_auth", serializeCreateMagicAuthOptions({ ...options }));
4416
- return deserializeMagicAuth(data);
4431
+ const { radar_auth_attempt_id, ...magicAuthResponse } = data;
4432
+ return {
4433
+ ...deserializeMagicAuth(magicAuthResponse),
4434
+ ...radar_auth_attempt_id ? { radarAuthAttemptId: radar_auth_attempt_id } : void 0
4435
+ };
4417
4436
  }
4418
4437
  /**
4419
4438
  * Verify email
@@ -6809,7 +6828,7 @@ var Vault = class {
6809
6828
  };
6810
6829
  //#endregion
6811
6830
  //#region package.json
6812
- var version = "10.0.0";
6831
+ var version = "10.1.0";
6813
6832
  //#endregion
6814
6833
  //#region src/workos.ts
6815
6834
  const DEFAULT_HOSTNAME = "api.workos.com";
@@ -7386,4 +7405,4 @@ Object.defineProperty(exports, "serializeRevokeSessionOptions", {
7386
7405
  }
7387
7406
  });
7388
7407
 
7389
- //# sourceMappingURL=factory-CKDJjzbQ.cjs.map
7408
+ //# sourceMappingURL=factory-SnCyjvy0.cjs.map