@incodetech/core 2.0.0-alpha.1 → 2.0.0-alpha.10

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 (106) hide show
  1. package/dist/Manager-BGfxEmyv.d.ts +19 -0
  2. package/dist/OpenViduLogger-BdPfiZO6.esm.js +3 -0
  3. package/dist/OpenViduLogger-CQyDxBvM.esm.js +803 -0
  4. package/dist/StateMachine-DRE1oH2B.d.ts +2 -0
  5. package/dist/addEvent-W0ORK0jT.esm.js +16 -0
  6. package/dist/chunk-C_Yo44FK.esm.js +49 -0
  7. package/dist/email.d.ts +264 -0
  8. package/dist/email.esm.js +479 -0
  9. package/dist/endpoints-BSTFaHYo.esm.js +1706 -0
  10. package/dist/flow.d.ts +578 -0
  11. package/dist/flow.esm.js +628 -0
  12. package/dist/index.d.ts +226 -0
  13. package/dist/index.esm.js +155 -0
  14. package/dist/lib-Bu9XGMBW.esm.js +11700 -0
  15. package/dist/permissionServices-I6vX6DBy.esm.js +72 -0
  16. package/dist/phone.d.ts +292 -0
  17. package/dist/phone.esm.js +550 -0
  18. package/dist/selfie.d.ts +759 -0
  19. package/dist/selfie.esm.js +995 -0
  20. package/dist/types-iZi2rawo.d.ts +5 -0
  21. package/dist/warmup-CEJTfxQr.d.ts +55 -0
  22. package/dist/xstate.esm-B_rda9yU.esm.js +3261 -0
  23. package/package.json +14 -11
  24. package/src/camera/cameraActor.ts +0 -21
  25. package/src/camera/cameraService.test.ts +0 -437
  26. package/src/camera/cameraService.ts +0 -165
  27. package/src/camera/cameraServices.test.ts +0 -66
  28. package/src/camera/cameraServices.ts +0 -26
  29. package/src/camera/cameraStateMachine.test.ts +0 -602
  30. package/src/camera/cameraStateMachine.ts +0 -264
  31. package/src/camera/index.ts +0 -5
  32. package/src/camera/types.ts +0 -17
  33. package/src/device/getBrowser.ts +0 -31
  34. package/src/device/getDeviceClass.ts +0 -29
  35. package/src/device/index.ts +0 -2
  36. package/src/email/__mocks__/emailMocks.ts +0 -59
  37. package/src/email/emailActor.ts +0 -15
  38. package/src/email/emailManager.test.ts +0 -573
  39. package/src/email/emailManager.ts +0 -427
  40. package/src/email/emailServices.ts +0 -66
  41. package/src/email/emailStateMachine.test.ts +0 -741
  42. package/src/email/emailStateMachine.ts +0 -367
  43. package/src/email/index.ts +0 -39
  44. package/src/email/types.ts +0 -60
  45. package/src/events/addEvent.ts +0 -20
  46. package/src/events/types.ts +0 -7
  47. package/src/flow/__mocks__/flowMocks.ts +0 -84
  48. package/src/flow/flowActor.ts +0 -13
  49. package/src/flow/flowAnalyzer.test.ts +0 -266
  50. package/src/flow/flowAnalyzer.ts +0 -37
  51. package/src/flow/flowCompletionService.ts +0 -21
  52. package/src/flow/flowManager.test.ts +0 -560
  53. package/src/flow/flowManager.ts +0 -235
  54. package/src/flow/flowServices.test.ts +0 -109
  55. package/src/flow/flowServices.ts +0 -13
  56. package/src/flow/flowStateMachine.test.ts +0 -334
  57. package/src/flow/flowStateMachine.ts +0 -182
  58. package/src/flow/index.ts +0 -21
  59. package/src/flow/moduleLoader.test.ts +0 -136
  60. package/src/flow/moduleLoader.ts +0 -73
  61. package/src/flow/orchestratedFlowManager.test.ts +0 -240
  62. package/src/flow/orchestratedFlowManager.ts +0 -231
  63. package/src/flow/orchestratedFlowStateMachine.test.ts +0 -199
  64. package/src/flow/orchestratedFlowStateMachine.ts +0 -325
  65. package/src/flow/types.ts +0 -434
  66. package/src/http/__mocks__/api.ts +0 -88
  67. package/src/http/api.test.ts +0 -231
  68. package/src/http/api.ts +0 -90
  69. package/src/http/endpoints.ts +0 -17
  70. package/src/index.ts +0 -33
  71. package/src/permissions/index.ts +0 -2
  72. package/src/permissions/permissionServices.ts +0 -31
  73. package/src/permissions/types.ts +0 -3
  74. package/src/phone/__mocks__/phoneMocks.ts +0 -71
  75. package/src/phone/index.ts +0 -39
  76. package/src/phone/phoneActor.ts +0 -15
  77. package/src/phone/phoneManager.test.ts +0 -393
  78. package/src/phone/phoneManager.ts +0 -458
  79. package/src/phone/phoneServices.ts +0 -98
  80. package/src/phone/phoneStateMachine.test.ts +0 -918
  81. package/src/phone/phoneStateMachine.ts +0 -422
  82. package/src/phone/types.ts +0 -83
  83. package/src/recordings/recordingsRepository.test.ts +0 -87
  84. package/src/recordings/recordingsRepository.ts +0 -48
  85. package/src/recordings/streamingEvents.ts +0 -10
  86. package/src/selfie/__mocks__/selfieMocks.ts +0 -26
  87. package/src/selfie/index.ts +0 -14
  88. package/src/selfie/selfieActor.ts +0 -17
  89. package/src/selfie/selfieErrorUtils.test.ts +0 -116
  90. package/src/selfie/selfieErrorUtils.ts +0 -66
  91. package/src/selfie/selfieManager.test.ts +0 -297
  92. package/src/selfie/selfieManager.ts +0 -301
  93. package/src/selfie/selfieServices.ts +0 -362
  94. package/src/selfie/selfieStateMachine.test.ts +0 -283
  95. package/src/selfie/selfieStateMachine.ts +0 -804
  96. package/src/selfie/selfieUploadService.test.ts +0 -90
  97. package/src/selfie/selfieUploadService.ts +0 -81
  98. package/src/selfie/types.ts +0 -103
  99. package/src/session/index.ts +0 -5
  100. package/src/session/sessionService.ts +0 -78
  101. package/src/setup.test.ts +0 -61
  102. package/src/setup.ts +0 -171
  103. package/tsconfig.json +0 -13
  104. package/tsdown.config.ts +0 -22
  105. package/vitest.config.ts +0 -37
  106. package/vitest.setup.ts +0 -135
package/vitest.setup.ts DELETED
@@ -1,135 +0,0 @@
1
- // Polyfill ImageData for Node.js test environment
2
- export {};
3
-
4
- if (typeof ImageData === 'undefined') {
5
- globalThis.ImageData = class ImageData {
6
- data: Uint8ClampedArray;
7
- width: number;
8
- height: number;
9
-
10
- constructor(width: number, height: number);
11
- constructor(data: Uint8ClampedArray, width: number, height?: number);
12
- constructor(
13
- widthOrData: number | Uint8ClampedArray,
14
- heightOrWidth?: number,
15
- height?: number,
16
- ) {
17
- if (typeof widthOrData === 'number') {
18
- this.width = widthOrData;
19
- this.height = heightOrWidth ?? widthOrData;
20
- this.data = new Uint8ClampedArray(this.width * this.height * 4);
21
- } else {
22
- this.data = widthOrData;
23
- this.width = heightOrWidth ?? 0;
24
- this.height = height ?? 0;
25
- }
26
- }
27
- } as typeof ImageData;
28
- }
29
-
30
- // Polyfill DOM APIs for Node.js test environment
31
- if (typeof document === 'undefined') {
32
- const { JSDOM } = await import('jsdom');
33
-
34
- const dom = new JSDOM('<!DOCTYPE html><html><body></body></html>', {
35
- url: 'http://localhost',
36
- pretendToBeVisual: true,
37
- resources: 'usable',
38
- });
39
-
40
- globalThis.document = dom.window.document;
41
- globalThis.window = dom.window as unknown as Window & typeof globalThis;
42
-
43
- // Mock navigator.permissions for testing
44
- // Use a simple function that can be replaced in tests
45
- let permissionState: 'granted' | 'denied' | 'prompt' = 'prompt';
46
- const mockPermissions = {
47
- query: async () => ({ state: permissionState }),
48
- };
49
-
50
- Object.defineProperty(globalThis, 'navigator', {
51
- value: {
52
- ...dom.window.navigator,
53
- permissions: mockPermissions,
54
- },
55
- writable: true,
56
- configurable: true,
57
- });
58
-
59
- // Export setter for test control
60
- (
61
- globalThis as {
62
- __setPermissionState?: (state: 'granted' | 'denied' | 'prompt') => void;
63
- }
64
- ).__setPermissionState = (state) => {
65
- permissionState = state;
66
- };
67
-
68
- globalThis.HTMLVideoElement = dom.window.HTMLVideoElement;
69
- globalThis.HTMLCanvasElement = dom.window.HTMLCanvasElement;
70
- Object.defineProperty(globalThis.HTMLCanvasElement.prototype, 'getContext', {
71
- value: () =>
72
- ({
73
- drawImage: () => {},
74
- getImageData: () => new ImageData(1, 1),
75
- putImageData: () => {},
76
- clearRect: () => {},
77
- }) as unknown as CanvasRenderingContext2D,
78
- configurable: true,
79
- });
80
-
81
- if (!('HTMLMediaElement' in globalThis)) {
82
- (
83
- globalThis as { HTMLMediaElement: typeof dom.window.HTMLMediaElement }
84
- ).HTMLMediaElement = dom.window.HTMLMediaElement;
85
- }
86
-
87
- Object.defineProperty(globalThis.HTMLMediaElement.prototype, 'play', {
88
- value: () => Promise.resolve(),
89
- configurable: true,
90
- });
91
- }
92
-
93
- // Polyfill window for Node.js test environment
94
- if (typeof window === 'undefined') {
95
- (globalThis as { window: typeof globalThis }).window =
96
- globalThis as typeof window;
97
- (
98
- globalThis as unknown as { window: { wasmArrayBuffer: null } }
99
- ).window.wasmArrayBuffer = null;
100
- }
101
-
102
- // Polyfill MediaStream for Node.js test environment
103
- if (typeof MediaStream === 'undefined') {
104
- class MockMediaStream {
105
- id = 'mock-stream-id';
106
- active = true;
107
- getVideoTracks() {
108
- return [];
109
- }
110
- getAudioTracks() {
111
- return [];
112
- }
113
- getTracks() {
114
- return [];
115
- }
116
- getTrackById() {
117
- return null;
118
- }
119
- addTrack() {}
120
- removeTrack() {}
121
- clone() {
122
- return new MockMediaStream();
123
- }
124
- addEventListener() {}
125
- removeEventListener() {}
126
- dispatchEvent() {
127
- return true;
128
- }
129
- onaddtrack = null;
130
- onremovetrack = null;
131
- }
132
-
133
- (globalThis as unknown as { MediaStream: typeof MediaStream }).MediaStream =
134
- MockMediaStream as unknown as typeof MediaStream;
135
- }