@notabene/javascript-sdk 2.0.3 → 2.0.4-NEXT.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 (119) hide show
  1. package/README.md +28 -0
  2. package/dist/js/notabene.js +1 -0
  3. package/dist/notabene.cjs +1 -1
  4. package/dist/notabene.d.ts +30 -17
  5. package/dist/notabene.js +98 -70
  6. package/docs/README.md +28 -0
  7. package/docs/_media/TransactionOptions.md +6 -6
  8. package/docs/ivms/types/enumerations/PayloadVersionCode.md +2 -2
  9. package/docs/ivms/types/interfaces/PayloadMetadata.md +2 -2
  10. package/docs/ivms/types/type-aliases/Address.md +1 -1
  11. package/docs/ivms/types/type-aliases/AddressTypeCode.md +1 -1
  12. package/docs/ivms/types/type-aliases/Beneficiary.md +1 -1
  13. package/docs/ivms/types/type-aliases/BeneficiaryVASP.md +1 -1
  14. package/docs/ivms/types/type-aliases/DateAndPlaceOfBirth.md +1 -1
  15. package/docs/ivms/types/type-aliases/ISOCountryCode.md +1 -1
  16. package/docs/ivms/types/type-aliases/ISODate.md +1 -1
  17. package/docs/ivms/types/type-aliases/IVMS101.md +1 -1
  18. package/docs/ivms/types/type-aliases/IntermediaryVASP.md +1 -1
  19. package/docs/ivms/types/type-aliases/LegalPerson.md +1 -1
  20. package/docs/ivms/types/type-aliases/LegalPersonName.md +1 -1
  21. package/docs/ivms/types/type-aliases/LegalPersonNameID.md +1 -1
  22. package/docs/ivms/types/type-aliases/LegalPersonNameTypeCode.md +1 -1
  23. package/docs/ivms/types/type-aliases/LocalLegalPersonNameID.md +1 -1
  24. package/docs/ivms/types/type-aliases/LocalNaturalPersonNameID.md +1 -1
  25. package/docs/ivms/types/type-aliases/NationalIdentification.md +1 -1
  26. package/docs/ivms/types/type-aliases/NationalIdentifierTypeCode.md +1 -1
  27. package/docs/ivms/types/type-aliases/NaturalPerson.md +1 -1
  28. package/docs/ivms/types/type-aliases/NaturalPersonName.md +1 -1
  29. package/docs/ivms/types/type-aliases/NaturalPersonNameID.md +1 -1
  30. package/docs/ivms/types/type-aliases/NaturalPersonNameTypeCode.md +1 -1
  31. package/docs/ivms/types/type-aliases/OriginatingVASP.md +1 -1
  32. package/docs/ivms/types/type-aliases/Originator.md +1 -1
  33. package/docs/ivms/types/type-aliases/Person.md +1 -1
  34. package/docs/ivms/types/type-aliases/TransferPath.md +1 -1
  35. package/docs/ivms/types/type-aliases/TransliterationMethodCode.md +1 -1
  36. package/docs/notabene/README.md +6 -6
  37. package/docs/notabene/classes/EmbeddedComponent.md +39 -16
  38. package/docs/notabene/classes/default.md +6 -6
  39. package/docs/notabene/functions/decodeFragmentToObject.md +1 -1
  40. package/docs/notabene/interfaces/NotabeneConfig.md +5 -5
  41. package/docs/notabene/type-aliases/MessageCallback.md +1 -1
  42. package/docs/types/README.md +1 -1
  43. package/docs/types/enumerations/AgentType.md +2 -2
  44. package/docs/types/enumerations/CMType.md +6 -17
  45. package/docs/types/enumerations/HMType.md +2 -2
  46. package/docs/types/enumerations/PersonType.md +3 -3
  47. package/docs/types/enumerations/ProofStatus.md +4 -4
  48. package/docs/types/enumerations/ProofTypes.md +12 -12
  49. package/docs/types/enumerations/Status.md +5 -5
  50. package/docs/types/enumerations/VASPSearchControl.md +34 -0
  51. package/docs/types/enumerations/ValidationSections.md +4 -4
  52. package/docs/types/interfaces/Agent.md +6 -6
  53. package/docs/types/interfaces/CallbackOptions.md +2 -2
  54. package/docs/types/interfaces/ComponentRequest.md +2 -2
  55. package/docs/types/interfaces/ComponentResponse.md +4 -4
  56. package/docs/types/interfaces/ConnectionRecord.md +7 -7
  57. package/docs/types/interfaces/ConnectionRequest.md +3 -3
  58. package/docs/types/interfaces/Counterparty.md +10 -10
  59. package/docs/types/interfaces/DeclarationProof.md +6 -6
  60. package/docs/types/interfaces/Deposit.md +9 -9
  61. package/docs/types/interfaces/DepositRequest.md +7 -7
  62. package/docs/types/interfaces/DepositRequestOptions.md +1 -1
  63. package/docs/types/interfaces/LegalPerson.md +13 -13
  64. package/docs/types/interfaces/MicroTransferProof.md +9 -9
  65. package/docs/types/interfaces/NaturalPerson.md +13 -13
  66. package/docs/types/interfaces/OwnershipProof.md +4 -4
  67. package/docs/types/interfaces/ScreenshotProof.md +5 -5
  68. package/docs/types/interfaces/SignatureProof.md +7 -7
  69. package/docs/types/interfaces/ThresholdOptions.md +3 -3
  70. package/docs/types/interfaces/Transaction.md +8 -8
  71. package/docs/types/interfaces/TransactionOptions.md +6 -6
  72. package/docs/types/interfaces/TransactionResponse.md +8 -8
  73. package/docs/types/interfaces/VASP.md +9 -9
  74. package/docs/types/interfaces/Wallet.md +8 -8
  75. package/docs/types/interfaces/Withdrawal.md +9 -9
  76. package/docs/types/type-aliases/BlockchainAddress.md +1 -1
  77. package/docs/types/type-aliases/CAIP10.md +1 -1
  78. package/docs/types/type-aliases/CAIP19.md +1 -1
  79. package/docs/types/type-aliases/CAIP2.md +1 -1
  80. package/docs/types/type-aliases/CAIP220.md +1 -1
  81. package/docs/types/type-aliases/Cancel.md +1 -1
  82. package/docs/types/type-aliases/Completed.md +1 -1
  83. package/docs/types/type-aliases/ComponentMessage.md +2 -4
  84. package/docs/types/type-aliases/ConnectionOptions.md +1 -1
  85. package/docs/types/type-aliases/CryptoCredential.md +1 -1
  86. package/docs/types/type-aliases/DID.md +1 -1
  87. package/docs/types/type-aliases/DTI.md +1 -1
  88. package/docs/types/type-aliases/Destination.md +1 -1
  89. package/docs/types/type-aliases/Error.md +17 -1
  90. package/docs/types/type-aliases/FieldOptions.md +1 -1
  91. package/docs/types/type-aliases/FieldTypes.md +1 -1
  92. package/docs/types/type-aliases/HostMessage.md +1 -1
  93. package/docs/types/type-aliases/ISOCurrency.md +1 -1
  94. package/docs/types/type-aliases/InvalidValue.md +1 -1
  95. package/docs/types/type-aliases/LEI.md +1 -1
  96. package/docs/types/type-aliases/LegalPersonFieldName.md +1 -1
  97. package/docs/types/type-aliases/LegalPersonFields.md +1 -1
  98. package/docs/types/type-aliases/NaturalPersonFieldName.md +1 -1
  99. package/docs/types/type-aliases/NaturalPersonFields.md +1 -1
  100. package/docs/types/type-aliases/NotabeneAsset.md +1 -1
  101. package/docs/types/type-aliases/ResizeRequest.md +1 -1
  102. package/docs/types/type-aliases/Source.md +1 -1
  103. package/docs/types/type-aliases/Theme.md +9 -9
  104. package/docs/types/type-aliases/TransactionAsset.md +1 -1
  105. package/docs/types/type-aliases/TravelAddress.md +1 -1
  106. package/docs/types/type-aliases/URI.md +1 -1
  107. package/docs/types/type-aliases/UUID.md +1 -1
  108. package/docs/types/type-aliases/UpdateValue.md +1 -1
  109. package/docs/types/type-aliases/V1Asset.md +1 -1
  110. package/docs/types/type-aliases/V1Transaction.md +1 -1
  111. package/docs/types/type-aliases/VASPOptions.md +5 -1
  112. package/docs/types/type-aliases/ValidationError.md +1 -1
  113. package/package.json +5 -5
  114. package/src/components/EmbeddedComponent.ts +44 -4
  115. package/src/components/__tests__/EmbeddedComponent.test.ts +126 -3
  116. package/src/notabene.ts +2 -2
  117. package/src/types.ts +22 -17
  118. package/src/utils/__tests__/MessageEventManager.test.ts +7 -7
  119. package/docs/types/type-aliases/Ready.md +0 -21
@@ -102,7 +102,7 @@ export default class EmbeddedComponent<V, O> {
102
102
  this.removeEmbed();
103
103
  this.iframe = document.createElement('iframe');
104
104
  this.iframe.src = this.url + (!modal ? '&embedded=true' : '');
105
- this.iframe.allow = 'web-share; clipboard-write';
105
+ this.iframe.allow = 'web-share; clipboard-write; hid; bluetooth;';
106
106
  this.iframe.style.width = '100%';
107
107
  this.iframe.style.height = '0px';
108
108
  this.iframe.style.border = 'none';
@@ -173,15 +173,21 @@ export default class EmbeddedComponent<V, O> {
173
173
  completion(): Promise<TransactionResponse<V>> {
174
174
  return new Promise((resolve, reject) => {
175
175
  let removeComplete: undefined | (() => void) = undefined;
176
+ let removeCancel: undefined | (() => void) = undefined;
176
177
  let removeError: undefined | (() => void) = undefined;
177
178
  function cleanup() {
178
179
  if (removeComplete) removeComplete();
180
+ if (removeCancel) removeCancel();
179
181
  if (removeError) removeError();
180
182
  }
181
183
  removeComplete = this.on(CMType.COMPLETE, (message) => {
182
184
  resolve((message as any).response);
183
185
  cleanup();
184
186
  });
187
+ removeCancel = this.on(CMType.CANCEL, () => {
188
+ reject(new Error('User cancelled'));
189
+ cleanup();
190
+ });
185
191
  removeError = this.on('error', (message) => {
186
192
  reject(new Error((message as any).message));
187
193
  cleanup();
@@ -207,11 +213,11 @@ export default class EmbeddedComponent<V, O> {
207
213
 
208
214
  document.body.appendChild(this.modal);
209
215
  this.embed(this.modal, true);
210
- this.on(CMType.CANCEL, () => {
216
+ const removeCancel = this.on(CMType.CANCEL, () => {
211
217
  this.closeModal();
212
218
  });
213
219
 
214
- this.on(CMType.COMPLETE, () => {
220
+ const removeComplete = this.on(CMType.COMPLETE, () => {
215
221
  this.closeModal();
216
222
  });
217
223
 
@@ -220,8 +226,12 @@ export default class EmbeddedComponent<V, O> {
220
226
  // console.log('click');
221
227
  this.closeModal();
222
228
  });
223
- return this.completion();
229
+ return this.completion().finally(() => {
230
+ removeCancel();
231
+ removeComplete();
232
+ });
224
233
  }
234
+
225
235
  /**
226
236
  * Closes the modal dialog
227
237
  *
@@ -235,4 +245,34 @@ export default class EmbeddedComponent<V, O> {
235
245
  this.modal = undefined;
236
246
  }
237
247
  }
248
+
249
+ /**
250
+ * Opens the component in a popup window. This may be needed to support many self-hosted wallets
251
+ * @returns A promise that resolves with the transaction response
252
+ * @see [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Window/open#restrictions)
253
+ * @see [Cross-Origin-Opener-Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cross-Origin-Opener-Policy)
254
+ */
255
+ public popup(): Promise<TransactionResponse<V>> {
256
+ const popup = window.open(this.url, '_blank', 'popup=true');
257
+ window.addEventListener('message', (event: MessageEvent) => {
258
+ if (event.source !== popup) {
259
+ return;
260
+ }
261
+ console.log('received message from popup', event.data);
262
+ this.eventManager?.setPort(event.ports[0]);
263
+ });
264
+
265
+ const removeCancel = this.on(CMType.CANCEL, () => {
266
+ popup?.close();
267
+ });
268
+
269
+ const removeComplete = this.on(CMType.COMPLETE, () => {
270
+ popup?.close();
271
+ });
272
+
273
+ return this.completion().finally(() => {
274
+ removeCancel();
275
+ removeComplete();
276
+ });
277
+ }
238
278
  }
@@ -281,8 +281,8 @@ describe('EmbeddedComponent', () => {
281
281
  vi.unstubAllGlobals();
282
282
  });
283
283
 
284
- test('modal closes on cancel message', () => {
285
- component.openModal();
284
+ test('modal closes on cancel message', async () => {
285
+ const completionPromise = component.openModal();
286
286
 
287
287
  // Trigger cancel message through event manager
288
288
  component['eventManager']['handleMessage']({
@@ -291,7 +291,9 @@ describe('EmbeddedComponent', () => {
291
291
 
292
292
  expect(dialog.close).toHaveBeenCalled();
293
293
  expect(dialog.remove).toHaveBeenCalled();
294
- // await expect(completionPromise).rejects.toThrow();
294
+
295
+ // Add expectation for the rejection
296
+ await expect(completionPromise).rejects.toThrow('User cancelled');
295
297
  });
296
298
 
297
299
  test('modal closes on completion', async () => {
@@ -527,4 +529,125 @@ describe('EmbeddedComponent', () => {
527
529
  expect(component.options).toEqual(newOptions);
528
530
  });
529
531
  });
532
+
533
+ describe('popup', () => {
534
+ let component: EmbeddedComponent<Withdrawal, TransactionOptions>;
535
+ let mockWindow: Window;
536
+ let popupWindow: Window;
537
+
538
+ beforeEach(() => {
539
+ popupWindow = {
540
+ close: vi.fn(),
541
+ } as unknown as Window;
542
+
543
+ mockWindow = {
544
+ open: vi.fn().mockReturnValue(popupWindow),
545
+ addEventListener: vi.fn(),
546
+ } as unknown as Window;
547
+
548
+ vi.stubGlobal('window', mockWindow);
549
+
550
+ component = new EmbeddedComponent<Withdrawal, TransactionOptions>(
551
+ url,
552
+ value,
553
+ );
554
+ });
555
+
556
+ afterEach(() => {
557
+ vi.unstubAllGlobals();
558
+ });
559
+
560
+ test('opens popup window with correct parameters', () => {
561
+ component.popup();
562
+ expect(mockWindow.open).toHaveBeenCalledWith(url, '_blank', 'popup=true');
563
+ });
564
+
565
+ test('popup closes on cancel message', async () => {
566
+ const completionPromise = component.popup();
567
+
568
+ // Trigger cancel message through event manager
569
+ component['eventManager']['handleMessage']({
570
+ data: { type: CMType.CANCEL },
571
+ } as MessageEvent);
572
+
573
+ expect(popupWindow.close).toHaveBeenCalled();
574
+ await expect(completionPromise).rejects.toThrow('User cancelled');
575
+ });
576
+
577
+ test('popup closes on completion', async () => {
578
+ const completionPromise = component.popup();
579
+ const response = { valid: true, value: 'completed' };
580
+
581
+ // Trigger complete message through event manager
582
+ component['eventManager']['handleMessage']({
583
+ data: { type: CMType.COMPLETE, response },
584
+ } as MessageEvent);
585
+
586
+ expect(popupWindow.close).toHaveBeenCalled();
587
+ await expect(completionPromise).resolves.toBe(response);
588
+ });
589
+
590
+ test('handles message events from popup window', async () => {
591
+ const completionPromise = component.popup(); // Store the promise
592
+
593
+ // Get the event listener callback
594
+ const messageHandler =
595
+ // @ts-expect-error TS is getting confused with the mock
596
+ (mockWindow.addEventListener as vi.Mock).mock.calls.find(
597
+ // @ts-expect-error TS is getting confused with the mock
598
+ (call) => call[0] === 'message',
599
+ )?.[1];
600
+
601
+ expect(messageHandler).toBeDefined();
602
+
603
+ // Mock a message event from the popup
604
+ const mockPort = { start: vi.fn() };
605
+ const mockEvent = {
606
+ source: popupWindow,
607
+ ports: [mockPort],
608
+ };
609
+
610
+ // Call the handler
611
+ messageHandler(mockEvent);
612
+
613
+ // Verify the port was set in the event manager
614
+ expect(component['eventManager']['port']).toBe(mockPort);
615
+
616
+ // Clean up by completing the promise
617
+ component['eventManager']['handleMessage']({
618
+ data: { type: CMType.COMPLETE, response: { valid: true } },
619
+ } as MessageEvent);
620
+
621
+ await completionPromise; // Wait for the promise to complete
622
+ });
623
+
624
+ test('ignores message events from other sources', async () => {
625
+ const completionPromise = component.popup();
626
+
627
+ const messageHandler =
628
+ // @ts-expect-error TS is getting confused with the mock
629
+ (mockWindow.addEventListener as vi.Mock).mock.calls.find(
630
+ // @ts-expect-error TS is getting confused with the mock
631
+ (call) => call[0] === 'message',
632
+ )?.[1];
633
+
634
+ // Mock a message event from a different source
635
+ const mockEvent = {
636
+ source: {} as Window,
637
+ ports: [{ start: vi.fn() }],
638
+ };
639
+
640
+ messageHandler(mockEvent);
641
+
642
+ // Verify the port was not set in the event manager
643
+ expect(component['eventManager']['port']).toBeUndefined();
644
+
645
+ // Clean up by completing the promise
646
+ component['eventManager']['handleMessage']({
647
+ data: { type: CMType.COMPLETE, response: { valid: true } },
648
+ } as MessageEvent);
649
+
650
+ await completionPromise; // Wait for the promise to complete
651
+ });
652
+ });
530
653
  });
package/src/notabene.ts CHANGED
@@ -33,7 +33,6 @@ import type {
33
33
  NaturalPerson,
34
34
  NotabeneAsset,
35
35
  OwnershipProof,
36
- Ready,
37
36
  ResizeRequest,
38
37
  ScreenshotProof,
39
38
  SignatureProof,
@@ -61,6 +60,7 @@ import {
61
60
  ProofTypes,
62
61
  Status,
63
62
  ValidationSections,
63
+ VASPSearchControl,
64
64
  } from './types';
65
65
  import { type MessageCallback } from './utils/MessageEventManager';
66
66
  import { decodeFragmentToObject, encodeObjectToFragment } from './utils/urls';
@@ -76,6 +76,7 @@ export {
76
76
  ProofTypes,
77
77
  Status,
78
78
  ValidationSections,
79
+ VASPSearchControl,
79
80
  };
80
81
  export type {
81
82
  Agent,
@@ -110,7 +111,6 @@ export type {
110
111
  NaturalPerson,
111
112
  NotabeneAsset,
112
113
  OwnershipProof,
113
- Ready,
114
114
  ResizeRequest,
115
115
  ScreenshotProof,
116
116
  SignatureProof,
package/src/types.ts CHANGED
@@ -235,10 +235,10 @@ export type ISOCurrency = string;
235
235
  * @public
236
236
  */
237
237
  export type Theme = {
238
- primaryColor: string;
239
- secondaryColor: string;
240
- fontFamily: string;
241
- logo: string;
238
+ primaryColor?: string;
239
+ secondaryColor?: string;
240
+ fontFamily?: string;
241
+ logo?: string;
242
242
  };
243
243
 
244
244
  /**
@@ -700,6 +700,19 @@ export type FieldTypes = {
700
700
  legalPerson?: LegalPersonFields;
701
701
  };
702
702
 
703
+ /**
704
+ * VASP Visibility Control representing allow/deny behaviour for VASP visibility
705
+ *
706
+ * @remarks
707
+ * - ALLOWED: Include VASPs you have explicitly allowed in the Notabene Network
708
+ * - PENDING: Include VASPs neither allowed nor denied
709
+ * @public
710
+ */
711
+ export const enum VASPSearchControl {
712
+ ALLOWED = 'allowed',
713
+ PENDING = 'pending',
714
+ }
715
+
703
716
  /**
704
717
  * Options for which VASPs to be searchable
705
718
  * @public
@@ -707,6 +720,7 @@ export type FieldTypes = {
707
720
  export type VASPOptions = {
708
721
  addUnknown?: boolean;
709
722
  onlyActive?: boolean;
723
+ searchable?: VASPSearchControl[]; // If array left empty all VASPs will be searchable
710
724
  };
711
725
 
712
726
  /**
@@ -765,7 +779,6 @@ export interface TransactionOptions {
765
779
  * - COMPLETE: Indicates a completed operation with response data
766
780
  * - RESIZE: Request to adjust component size/dimensions
767
781
  * - RESULT: Operation result notification
768
- * - READY: Component is initialized and ready
769
782
  * - INVALID: Validation failed with errors
770
783
  * - ERROR: Operation encountered an error
771
784
  * - CANCEL: Operation was cancelled
@@ -775,7 +788,6 @@ export const enum CMType {
775
788
  COMPLETE = 'complete',
776
789
  RESIZE = 'resize',
777
790
  RESULT = 'result',
778
- READY = 'ready',
779
791
  INVALID = 'invalid',
780
792
  ERROR = 'error',
781
793
  CANCEL = 'cancel',
@@ -792,14 +804,6 @@ export type Completed<T> = {
792
804
  response: TransactionResponse<T>;
793
805
  };
794
806
 
795
- /**
796
- * Represents a ready component message
797
- * @public
798
- */
799
- export type Ready = {
800
- type: CMType.READY;
801
- };
802
-
803
807
  /**
804
808
  * Represents a resize request component message. This is handled by the library.
805
809
  * @internal
@@ -812,11 +816,15 @@ export type ResizeRequest = {
812
816
  /**
813
817
  * Represents an error component message
814
818
  * @param message - Error message
819
+ * @param description - Description of the error message
820
+ * @param identifier - Identifier code of the error message
815
821
  * @public
816
822
  */
817
823
  export type Error = {
818
824
  type: CMType.ERROR;
819
825
  message: string;
826
+ description?: string;
827
+ identifier?: string;
820
828
  };
821
829
 
822
830
  /**
@@ -849,7 +857,6 @@ export type InvalidValue<T> = {
849
857
  * - Completed: Operation finished successfully with response data
850
858
  * - Cancel: User cancelled the operation
851
859
  * - Error: Operation failed with error message
852
- * - Ready: Component initialized and ready for use
853
860
  * - ResizeRequest: Component needs to adjust its dimensions
854
861
  * - InvalidValue: Validation failed with current partial value
855
862
  *
@@ -858,7 +865,6 @@ export type InvalidValue<T> = {
858
865
  * @see {@link Completed} For successful completion message format
859
866
  * @see {@link Cancel} For cancellation message format
860
867
  * @see {@link Error} For error message format
861
- * @see {@link Ready} For ready message format
862
868
  * @see {@link ResizeRequest} For resize message format
863
869
  * @see {@link InvalidValue} For validation failure message format
864
870
  * @public
@@ -867,7 +873,6 @@ export type ComponentMessage<T> =
867
873
  | Completed<T>
868
874
  | Cancel
869
875
  | Error
870
- | Ready
871
876
  | ResizeRequest
872
877
  | InvalidValue<T>;
873
878
 
@@ -1,6 +1,5 @@
1
1
  import { beforeEach, describe, expect, it, vi } from 'vitest';
2
2
  import {
3
- HMType,
4
3
  type TransactionOptions,
5
4
  type UpdateValue,
6
5
  type Withdrawal,
@@ -34,13 +33,13 @@ describe('MessageEventManager', () => {
34
33
  });
35
34
 
36
35
  it('should subscribe and receive messages of a specific type', () => {
37
- const readyHandler = vi.fn();
38
- messageEventManager.on('ready', readyHandler);
36
+ const completeHandler = vi.fn();
37
+ messageEventManager.on('complete', completeHandler);
39
38
 
40
- const readyMessage = { type: 'ready' };
41
- mockPort.onmessage!({ data: readyMessage } as MessageEvent);
39
+ const completeMessage = { type: 'complete' };
40
+ mockPort.onmessage!({ data: completeMessage } as MessageEvent);
42
41
 
43
- expect(readyHandler).toHaveBeenCalledWith(readyMessage);
42
+ expect(completeHandler).toHaveBeenCalledWith(completeMessage);
44
43
  });
45
44
 
46
45
  it('should not call handlers for different message types', () => {
@@ -82,7 +81,8 @@ describe('MessageEventManager', () => {
82
81
 
83
82
  it('should send messages through the port', () => {
84
83
  const message: UpdateValue<Withdrawal, TransactionOptions> = {
85
- type: HMType.UPDATE,
84
+ // @ts-expect-error Type '"update"' is not assignable to type 'HMType.UPDATE'.
85
+ type: 'update',
86
86
  value: { requestId: 'id' },
87
87
  };
88
88
  messageEventManager.send(message);
@@ -1,21 +0,0 @@
1
- [**@notabene/javascript-sdk**](../../README.md) • **Docs**
2
-
3
- ***
4
-
5
- [@notabene/javascript-sdk](../../modules.md) / [types](../README.md) / Ready
6
-
7
- # Type Alias: Ready
8
-
9
- > **Ready**: `object`
10
-
11
- Represents a ready component message
12
-
13
- ## Type declaration
14
-
15
- ### type
16
-
17
- > **type**: [`READY`](../enumerations/CMType.md#ready)
18
-
19
- ## Defined in
20
-
21
- [types.ts:799](https://gitlab.com/notabene/open-source/javascript-sdk/-/blob/675e0bac9f2136d1cf47e6f5980760f80d3d1995/src/types.ts#L799)