@go-mondo/identity-sdk 0.0.2-beta.72 → 0.0.2-beta.73

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
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.0.2-beta.73](https://github.com/go-mondo/identity-node-sdk/compare/identity-sdk-v0.0.2-beta.72...identity-sdk-v0.0.2-beta.73) (2026-05-06)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * user insert schema verified attributes ([6ec4826](https://github.com/go-mondo/identity-node-sdk/commit/6ec48269a59f5ba6f3647ba40fdb74479ee3c83f))
9
+
3
10
  ## [0.0.2-beta.72](https://github.com/go-mondo/identity-node-sdk/compare/identity-sdk-v0.0.2-beta.71...identity-sdk-v0.0.2-beta.72) (2026-05-06)
4
11
 
5
12
 
@@ -205,8 +205,8 @@ export declare const InsertUserPayloadSchema: z.ZodObject<{
205
205
  roles: z.ZodOptional<z.ZodUnion<readonly [z.ZodUndefined, z.ZodArray<z.ZodString>]>>;
206
206
  unverifiedEmail: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodEmail, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<string | undefined, string | null | undefined>>>;
207
207
  unverifiedPhoneNumber: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodE164, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<string | undefined, string | null | undefined>>>;
208
- verifiedEmail: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodEmail, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<string | undefined, string | null | undefined>>>;
209
- verifiedPhoneNumber: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodE164, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<string | undefined, string | null | undefined>>>;
208
+ verifiedEmail: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodBoolean, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<boolean | undefined, boolean | null | undefined>>>;
209
+ verifiedPhoneNumber: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodBoolean, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<boolean | undefined, boolean | null | undefined>>>;
210
210
  givenName: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<string | undefined, string | null | undefined>>>;
211
211
  middleName: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<string | undefined, string | null | undefined>>>;
212
212
  familyName: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<string | undefined, string | null | undefined>>>;
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/customer/users/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AA2B5B,eAAO,MAAM,mBAAmB;;;CAGtB,CAAC;AAEX,MAAM,MAAM,sBAAsB,GAChC,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,CAAC;AAEjE,eAAO,MAAM,UAAU;;;;CAIb,CAAC;AACX,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,OAAO,UAAU,CAAC,CAAC;AAEzE,eAAO,MAAM,gBAAgB;;;;EAAoC,CAAC;AAElE,eAAO,MAAM,wBAAwB;;;;;;iBAMnC,CAAC;AAGH,eAAO,MAAM,8BAA8B;;;;;;iBAMzC,CAAC;AAGH,eAAO,MAAM,oBAAoB;;iBAE/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAEnE,eAAO,MAAM,mBAAmB,YAAY,CAAC;AAC7C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;;;;;;;;;GAIpB,CAAC;AACJ,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AACxD,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,UAAU,CAAC,CAAC;AAY/C,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAI3B,CAAC;AACJ,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAgB7D,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;iBA0BhC,CAAC;AACL,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACtE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAEzE,eAAO,MAAM,uBAAuB;;;;;;;;;;;;iBAMlC,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACtE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAEzE;;GAEG;AACH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;iBAMzC,CAAC;AACH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAC7C,OAAO,8BAA8B,CACtC,CAAC"}
@@ -133,7 +133,8 @@ exports.InsertUserPayloadSchema = z
133
133
  id: schema_js_3.UserIdSchema.optional(),
134
134
  status: exports.UserStatusSchema.optional(),
135
135
  ...exports.UserNamePropertiesSchema.shape,
136
- ...exports.VerifiedEmailOrPhonePropertiesSchema.shape,
136
+ verifiedEmail: (0, schema_js_2.optionallyNullishToUndefined)(z.boolean()),
137
+ verifiedPhoneNumber: (0, schema_js_2.optionallyNullishToUndefined)(z.boolean()),
137
138
  ...exports.UnverifiedEmailOrPhonePropertiesSchema.shape,
138
139
  ...exports.UserAssociationsSchema.shape,
139
140
  ...metadata_js_1.UpsertMetadataPropertyPayloadSchema.shape,
@@ -410,7 +410,7 @@ const schema_js_2 = require("./schema.js");
410
410
  foo: 'bar',
411
411
  id: (0, schema_js_1.generateUserId)(),
412
412
  familyName: 'Foo',
413
- verifiedPhoneNumber: '+12025551234',
413
+ verifiedPhoneNumber: true,
414
414
  };
415
415
  const result = schema_js_2.InsertUserPayloadSchema.safeParse(item);
416
416
  (0, vitest_1.expect)(result.success).toBe(true);
@@ -422,17 +422,17 @@ const schema_js_2 = require("./schema.js");
422
422
  (0, vitest_1.test)('should parse with all verified and unverified email/phone properties', async () => {
423
423
  const item = {
424
424
  id: (0, schema_js_1.generateUserId)(),
425
- verifiedEmail: 'verified@example.com',
425
+ verifiedEmail: true,
426
426
  unverifiedEmail: 'pending@example.com',
427
- verifiedPhoneNumber: '+1234567890',
427
+ verifiedPhoneNumber: true,
428
428
  unverifiedPhoneNumber: '+0987654321',
429
429
  };
430
430
  const result = schema_js_2.InsertUserPayloadSchema.safeParse(item);
431
431
  (0, vitest_1.expect)(result.success).toBe(true);
432
432
  if (result.success) {
433
- (0, vitest_1.expect)(result.data.verifiedEmail).toBe('verified@example.com');
433
+ (0, vitest_1.expect)(result.data.verifiedEmail).toBe(true);
434
434
  (0, vitest_1.expect)(result.data.unverifiedEmail).toBe('pending@example.com');
435
- (0, vitest_1.expect)(result.data.verifiedPhoneNumber).toBe('+1234567890');
435
+ (0, vitest_1.expect)(result.data.verifiedPhoneNumber).toBe(true);
436
436
  (0, vitest_1.expect)(result.data.unverifiedPhoneNumber).toBe('+0987654321');
437
437
  }
438
438
  });
@@ -440,7 +440,7 @@ const schema_js_2 = require("./schema.js");
440
440
  const item = {
441
441
  foo: 'bar',
442
442
  id: (0, schema_js_1.generateUserId)(),
443
- verifiedPhoneNumber: '+12025551234',
443
+ verifiedPhoneNumber: true,
444
444
  metadata: new Map(),
445
445
  };
446
446
  const result = schema_js_2.InsertUserPayloadSchema.safeParse(item);
@@ -451,7 +451,7 @@ const schema_js_2 = require("./schema.js");
451
451
  });
452
452
  (0, vitest_1.test)('should allow optional id and status', async () => {
453
453
  const item = {
454
- verifiedEmail: 'test@example.com',
454
+ verifiedEmail: true,
455
455
  };
456
456
  const result = schema_js_2.InsertUserPayloadSchema.safeParse(item);
457
457
  (0, vitest_1.expect)(result.success).toBe(true);
@@ -463,7 +463,7 @@ const schema_js_2 = require("./schema.js");
463
463
  (0, vitest_1.test)('should parse with roles association', async () => {
464
464
  const item = {
465
465
  id: (0, schema_js_1.generateUserId)(),
466
- verifiedEmail: 'test@example.com',
466
+ verifiedEmail: true,
467
467
  roles: [
468
468
  'rol_2NfYOTzVqhCHgWFzUL0WPfRRuhH',
469
469
  'rol_2NfYOTzVqhCHgWFzUL0WPfRRuhI',
@@ -495,31 +495,53 @@ const schema_js_2 = require("./schema.js");
495
495
  });
496
496
  (0, vitest_1.test)('should accept with only verifiedEmail', async () => {
497
497
  const item = {
498
- verifiedEmail: 'test@example.com',
498
+ verifiedEmail: true,
499
499
  };
500
500
  const result = schema_js_2.InsertUserPayloadSchema.safeParse(item);
501
501
  (0, vitest_1.expect)(result.success).toBe(true);
502
+ if (result.success) {
503
+ (0, vitest_1.expect)(result.data.verifiedEmail).toBe(true);
504
+ }
502
505
  });
503
506
  (0, vitest_1.test)('should accept with only verifiedPhoneNumber', async () => {
504
507
  const item = {
505
- verifiedPhoneNumber: '+12025551234',
508
+ verifiedPhoneNumber: true,
506
509
  };
507
510
  const result = schema_js_2.InsertUserPayloadSchema.safeParse(item);
508
511
  (0, vitest_1.expect)(result.success).toBe(true);
512
+ if (result.success) {
513
+ (0, vitest_1.expect)(result.data.verifiedPhoneNumber).toBe(true);
514
+ }
509
515
  });
510
- (0, vitest_1.test)('should accept with only unverifiedEmail', async () => {
516
+ (0, vitest_1.test)('should succeed with only unverifiedEmail', async () => {
511
517
  const item = {
512
518
  unverifiedEmail: 'test@example.com',
519
+ verifiedEmail: true,
520
+ unverifiedPhoneNumber: undefined,
513
521
  };
514
522
  const result = schema_js_2.InsertUserPayloadSchema.safeParse(item);
515
523
  (0, vitest_1.expect)(result.success).toBe(true);
524
+ if (result.success) {
525
+ (0, vitest_1.expect)(result.data.unverifiedEmail).toBe('test@example.com');
526
+ (0, vitest_1.expect)(result.data.unverifiedPhoneNumber).toBeUndefined();
527
+ (0, vitest_1.expect)(result.data.verifiedEmail).toBe(true);
528
+ (0, vitest_1.expect)(result.data.verifiedPhoneNumber).toBeUndefined();
529
+ }
516
530
  });
517
- (0, vitest_1.test)('should accept with only unverifiedPhoneNumber', async () => {
531
+ (0, vitest_1.test)('should succeed with only unverifiedPhoneNumber', async () => {
518
532
  const item = {
533
+ unverifiedEmail: undefined,
519
534
  unverifiedPhoneNumber: '+12025551234',
535
+ verifiedPhoneNumber: true,
520
536
  };
521
537
  const result = schema_js_2.InsertUserPayloadSchema.safeParse(item);
522
538
  (0, vitest_1.expect)(result.success).toBe(true);
539
+ if (result.success) {
540
+ (0, vitest_1.expect)(result.data.unverifiedPhoneNumber).toBe('+12025551234');
541
+ (0, vitest_1.expect)(result.data.unverifiedEmail).toBeUndefined();
542
+ (0, vitest_1.expect)(result.data.verifiedEmail).toBeUndefined();
543
+ (0, vitest_1.expect)(result.data.verifiedPhoneNumber).toBe(true);
544
+ }
523
545
  });
524
546
  });
525
547
  (0, vitest_1.describe)('Update User Payload', () => {
@@ -205,8 +205,8 @@ export declare const InsertUserPayloadSchema: z.ZodObject<{
205
205
  roles: z.ZodOptional<z.ZodUnion<readonly [z.ZodUndefined, z.ZodArray<z.ZodString>]>>;
206
206
  unverifiedEmail: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodEmail, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<string | undefined, string | null | undefined>>>;
207
207
  unverifiedPhoneNumber: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodE164, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<string | undefined, string | null | undefined>>>;
208
- verifiedEmail: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodEmail, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<string | undefined, string | null | undefined>>>;
209
- verifiedPhoneNumber: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodE164, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<string | undefined, string | null | undefined>>>;
208
+ verifiedEmail: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodBoolean, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<boolean | undefined, boolean | null | undefined>>>;
209
+ verifiedPhoneNumber: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodBoolean, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<boolean | undefined, boolean | null | undefined>>>;
210
210
  givenName: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<string | undefined, string | null | undefined>>>;
211
211
  middleName: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<string | undefined, string | null | undefined>>>;
212
212
  familyName: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<string | undefined, string | null | undefined>>>;
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/customer/users/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AA2B5B,eAAO,MAAM,mBAAmB;;;CAGtB,CAAC;AAEX,MAAM,MAAM,sBAAsB,GAChC,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,CAAC;AAEjE,eAAO,MAAM,UAA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,CAAC,CAAC;AAEzE;;GAEG;AACH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;iBAMzC,CAAC;AACH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAC7C,OAAO,8BAA8B,CACtC,CAAC"}
@@ -97,7 +97,8 @@ export const InsertUserPayloadSchema = z
97
97
  id: UserIdSchema.optional(),
98
98
  status: UserStatusSchema.optional(),
99
99
  ...UserNamePropertiesSchema.shape,
100
- ...VerifiedEmailOrPhonePropertiesSchema.shape,
100
+ verifiedEmail: optionallyNullishToUndefined(z.boolean()),
101
+ verifiedPhoneNumber: optionallyNullishToUndefined(z.boolean()),
101
102
  ...UnverifiedEmailOrPhonePropertiesSchema.shape,
102
103
  ...UserAssociationsSchema.shape,
103
104
  ...UpsertMetadataPropertyPayloadSchema.shape,
@@ -1,6 +1,6 @@
1
1
  import { describe, expect, test } from 'vitest';
2
2
  import { generateUserId } from '../schema.js';
3
- import { InsertUserPayloadSchema, UpdateUserPayloadSchema, UserPayloadSchema, UserSchema, UserStatus, UserStatusSchema, VerifiedEmailOrPhonePropertiesSchema, UnverifiedEmailOrPhonePropertiesSchema, VerifiableAttribute, UserNamePropertiesSchema, UpdateUserNamePropertiesSchema, EmailOrPhonePropertiesSchema, UserAssociationReferenceSchema, } from './schema.js';
3
+ import { EmailOrPhonePropertiesSchema, InsertUserPayloadSchema, UnverifiedEmailOrPhonePropertiesSchema, UpdateUserNamePropertiesSchema, UpdateUserPayloadSchema, UserAssociationReferenceSchema, UserNamePropertiesSchema, UserPayloadSchema, UserSchema, UserStatus, UserStatusSchema, VerifiableAttribute, VerifiedEmailOrPhonePropertiesSchema, } from './schema.js';
4
4
  describe('Customer - User', () => {
5
5
  describe('VerifiableAttribute', () => {
6
6
  test('should have correct constants', () => {
@@ -408,7 +408,7 @@ describe('Customer - User', () => {
408
408
  foo: 'bar',
409
409
  id: generateUserId(),
410
410
  familyName: 'Foo',
411
- verifiedPhoneNumber: '+12025551234',
411
+ verifiedPhoneNumber: true,
412
412
  };
413
413
  const result = InsertUserPayloadSchema.safeParse(item);
414
414
  expect(result.success).toBe(true);
@@ -420,17 +420,17 @@ describe('Customer - User', () => {
420
420
  test('should parse with all verified and unverified email/phone properties', async () => {
421
421
  const item = {
422
422
  id: generateUserId(),
423
- verifiedEmail: 'verified@example.com',
423
+ verifiedEmail: true,
424
424
  unverifiedEmail: 'pending@example.com',
425
- verifiedPhoneNumber: '+1234567890',
425
+ verifiedPhoneNumber: true,
426
426
  unverifiedPhoneNumber: '+0987654321',
427
427
  };
428
428
  const result = InsertUserPayloadSchema.safeParse(item);
429
429
  expect(result.success).toBe(true);
430
430
  if (result.success) {
431
- expect(result.data.verifiedEmail).toBe('verified@example.com');
431
+ expect(result.data.verifiedEmail).toBe(true);
432
432
  expect(result.data.unverifiedEmail).toBe('pending@example.com');
433
- expect(result.data.verifiedPhoneNumber).toBe('+1234567890');
433
+ expect(result.data.verifiedPhoneNumber).toBe(true);
434
434
  expect(result.data.unverifiedPhoneNumber).toBe('+0987654321');
435
435
  }
436
436
  });
@@ -438,7 +438,7 @@ describe('Customer - User', () => {
438
438
  const item = {
439
439
  foo: 'bar',
440
440
  id: generateUserId(),
441
- verifiedPhoneNumber: '+12025551234',
441
+ verifiedPhoneNumber: true,
442
442
  metadata: new Map(),
443
443
  };
444
444
  const result = InsertUserPayloadSchema.safeParse(item);
@@ -449,7 +449,7 @@ describe('Customer - User', () => {
449
449
  });
450
450
  test('should allow optional id and status', async () => {
451
451
  const item = {
452
- verifiedEmail: 'test@example.com',
452
+ verifiedEmail: true,
453
453
  };
454
454
  const result = InsertUserPayloadSchema.safeParse(item);
455
455
  expect(result.success).toBe(true);
@@ -461,7 +461,7 @@ describe('Customer - User', () => {
461
461
  test('should parse with roles association', async () => {
462
462
  const item = {
463
463
  id: generateUserId(),
464
- verifiedEmail: 'test@example.com',
464
+ verifiedEmail: true,
465
465
  roles: [
466
466
  'rol_2NfYOTzVqhCHgWFzUL0WPfRRuhH',
467
467
  'rol_2NfYOTzVqhCHgWFzUL0WPfRRuhI',
@@ -493,31 +493,53 @@ describe('Customer - User', () => {
493
493
  });
494
494
  test('should accept with only verifiedEmail', async () => {
495
495
  const item = {
496
- verifiedEmail: 'test@example.com',
496
+ verifiedEmail: true,
497
497
  };
498
498
  const result = InsertUserPayloadSchema.safeParse(item);
499
499
  expect(result.success).toBe(true);
500
+ if (result.success) {
501
+ expect(result.data.verifiedEmail).toBe(true);
502
+ }
500
503
  });
501
504
  test('should accept with only verifiedPhoneNumber', async () => {
502
505
  const item = {
503
- verifiedPhoneNumber: '+12025551234',
506
+ verifiedPhoneNumber: true,
504
507
  };
505
508
  const result = InsertUserPayloadSchema.safeParse(item);
506
509
  expect(result.success).toBe(true);
510
+ if (result.success) {
511
+ expect(result.data.verifiedPhoneNumber).toBe(true);
512
+ }
507
513
  });
508
- test('should accept with only unverifiedEmail', async () => {
514
+ test('should succeed with only unverifiedEmail', async () => {
509
515
  const item = {
510
516
  unverifiedEmail: 'test@example.com',
517
+ verifiedEmail: true,
518
+ unverifiedPhoneNumber: undefined,
511
519
  };
512
520
  const result = InsertUserPayloadSchema.safeParse(item);
513
521
  expect(result.success).toBe(true);
522
+ if (result.success) {
523
+ expect(result.data.unverifiedEmail).toBe('test@example.com');
524
+ expect(result.data.unverifiedPhoneNumber).toBeUndefined();
525
+ expect(result.data.verifiedEmail).toBe(true);
526
+ expect(result.data.verifiedPhoneNumber).toBeUndefined();
527
+ }
514
528
  });
515
- test('should accept with only unverifiedPhoneNumber', async () => {
529
+ test('should succeed with only unverifiedPhoneNumber', async () => {
516
530
  const item = {
531
+ unverifiedEmail: undefined,
517
532
  unverifiedPhoneNumber: '+12025551234',
533
+ verifiedPhoneNumber: true,
518
534
  };
519
535
  const result = InsertUserPayloadSchema.safeParse(item);
520
536
  expect(result.success).toBe(true);
537
+ if (result.success) {
538
+ expect(result.data.unverifiedPhoneNumber).toBe('+12025551234');
539
+ expect(result.data.unverifiedEmail).toBeUndefined();
540
+ expect(result.data.verifiedEmail).toBeUndefined();
541
+ expect(result.data.verifiedPhoneNumber).toBe(true);
542
+ }
521
543
  });
522
544
  });
523
545
  describe('Update User Payload', () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@go-mondo/identity-sdk",
3
- "version": "0.0.2-beta.72",
3
+ "version": "0.0.2-beta.73",
4
4
  "type": "module",
5
5
  "description": "A node SDK for Mondo Identity",
6
6
  "license": "MIT",