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

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 (104) hide show
  1. package/dist/Manager-6BwbaI_H.d.ts +19 -0
  2. package/dist/StateMachine-7c1gcu94.d.ts +2 -0
  3. package/dist/addEvent-1Mi5CEiq.esm.js +16 -0
  4. package/dist/chunk-C_Yo44FK.esm.js +49 -0
  5. package/dist/email.d.ts +264 -0
  6. package/dist/email.esm.js +479 -0
  7. package/dist/endpoints-D_pUMaqA.esm.js +1701 -0
  8. package/dist/flow.d.ts +578 -0
  9. package/dist/flow.esm.js +628 -0
  10. package/dist/index.d.ts +226 -0
  11. package/dist/index.esm.js +155 -0
  12. package/dist/lib-CyIAFRfr.esm.js +12499 -0
  13. package/dist/permissionServices-CVR0Pq38.esm.js +72 -0
  14. package/dist/phone.d.ts +292 -0
  15. package/dist/phone.esm.js +550 -0
  16. package/dist/selfie.d.ts +758 -0
  17. package/dist/selfie.esm.js +978 -0
  18. package/dist/types-tq1ypYSL.d.ts +5 -0
  19. package/dist/warmup-Dr7OcFND.d.ts +55 -0
  20. package/dist/xstate.esm-B_rda9yU.esm.js +3261 -0
  21. package/package.json +14 -11
  22. package/src/camera/cameraActor.ts +0 -21
  23. package/src/camera/cameraService.test.ts +0 -437
  24. package/src/camera/cameraService.ts +0 -165
  25. package/src/camera/cameraServices.test.ts +0 -66
  26. package/src/camera/cameraServices.ts +0 -26
  27. package/src/camera/cameraStateMachine.test.ts +0 -602
  28. package/src/camera/cameraStateMachine.ts +0 -264
  29. package/src/camera/index.ts +0 -5
  30. package/src/camera/types.ts +0 -17
  31. package/src/device/getBrowser.ts +0 -31
  32. package/src/device/getDeviceClass.ts +0 -29
  33. package/src/device/index.ts +0 -2
  34. package/src/email/__mocks__/emailMocks.ts +0 -59
  35. package/src/email/emailActor.ts +0 -15
  36. package/src/email/emailManager.test.ts +0 -573
  37. package/src/email/emailManager.ts +0 -427
  38. package/src/email/emailServices.ts +0 -66
  39. package/src/email/emailStateMachine.test.ts +0 -741
  40. package/src/email/emailStateMachine.ts +0 -367
  41. package/src/email/index.ts +0 -39
  42. package/src/email/types.ts +0 -60
  43. package/src/events/addEvent.ts +0 -20
  44. package/src/events/types.ts +0 -7
  45. package/src/flow/__mocks__/flowMocks.ts +0 -84
  46. package/src/flow/flowActor.ts +0 -13
  47. package/src/flow/flowAnalyzer.test.ts +0 -266
  48. package/src/flow/flowAnalyzer.ts +0 -37
  49. package/src/flow/flowCompletionService.ts +0 -21
  50. package/src/flow/flowManager.test.ts +0 -560
  51. package/src/flow/flowManager.ts +0 -235
  52. package/src/flow/flowServices.test.ts +0 -109
  53. package/src/flow/flowServices.ts +0 -13
  54. package/src/flow/flowStateMachine.test.ts +0 -334
  55. package/src/flow/flowStateMachine.ts +0 -182
  56. package/src/flow/index.ts +0 -21
  57. package/src/flow/moduleLoader.test.ts +0 -136
  58. package/src/flow/moduleLoader.ts +0 -73
  59. package/src/flow/orchestratedFlowManager.test.ts +0 -240
  60. package/src/flow/orchestratedFlowManager.ts +0 -231
  61. package/src/flow/orchestratedFlowStateMachine.test.ts +0 -199
  62. package/src/flow/orchestratedFlowStateMachine.ts +0 -325
  63. package/src/flow/types.ts +0 -434
  64. package/src/http/__mocks__/api.ts +0 -88
  65. package/src/http/api.test.ts +0 -231
  66. package/src/http/api.ts +0 -90
  67. package/src/http/endpoints.ts +0 -17
  68. package/src/index.ts +0 -33
  69. package/src/permissions/index.ts +0 -2
  70. package/src/permissions/permissionServices.ts +0 -31
  71. package/src/permissions/types.ts +0 -3
  72. package/src/phone/__mocks__/phoneMocks.ts +0 -71
  73. package/src/phone/index.ts +0 -39
  74. package/src/phone/phoneActor.ts +0 -15
  75. package/src/phone/phoneManager.test.ts +0 -393
  76. package/src/phone/phoneManager.ts +0 -458
  77. package/src/phone/phoneServices.ts +0 -98
  78. package/src/phone/phoneStateMachine.test.ts +0 -918
  79. package/src/phone/phoneStateMachine.ts +0 -422
  80. package/src/phone/types.ts +0 -83
  81. package/src/recordings/recordingsRepository.test.ts +0 -87
  82. package/src/recordings/recordingsRepository.ts +0 -48
  83. package/src/recordings/streamingEvents.ts +0 -10
  84. package/src/selfie/__mocks__/selfieMocks.ts +0 -26
  85. package/src/selfie/index.ts +0 -14
  86. package/src/selfie/selfieActor.ts +0 -17
  87. package/src/selfie/selfieErrorUtils.test.ts +0 -116
  88. package/src/selfie/selfieErrorUtils.ts +0 -66
  89. package/src/selfie/selfieManager.test.ts +0 -297
  90. package/src/selfie/selfieManager.ts +0 -301
  91. package/src/selfie/selfieServices.ts +0 -362
  92. package/src/selfie/selfieStateMachine.test.ts +0 -283
  93. package/src/selfie/selfieStateMachine.ts +0 -804
  94. package/src/selfie/selfieUploadService.test.ts +0 -90
  95. package/src/selfie/selfieUploadService.ts +0 -81
  96. package/src/selfie/types.ts +0 -103
  97. package/src/session/index.ts +0 -5
  98. package/src/session/sessionService.ts +0 -78
  99. package/src/setup.test.ts +0 -61
  100. package/src/setup.ts +0 -171
  101. package/tsconfig.json +0 -13
  102. package/tsdown.config.ts +0 -22
  103. package/vitest.config.ts +0 -37
  104. 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
- }