lavva.exalushome 2.0.112 → 2.0.113
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/build/exalushome-library-bundle.js +1 -1
- package/build/exalushome-library-bundle.js.map +1 -1
- package/build/js/Api.js +112 -112
- package/build/js/Api.js.map +1 -1
- package/build/js/AsyncLock.js +15 -15
- package/build/js/AsyncSemaphore.js +44 -44
- package/build/js/AsyncSemaphore.js.map +1 -1
- package/build/js/CancelationTokenSource.js +18 -18
- package/build/js/DataFrame.js +86 -86
- package/build/js/DependencyContainer.js +87 -87
- package/build/js/DependencyContainer.js.map +1 -1
- package/build/js/Event.js +24 -24
- package/build/js/Event.js.map +1 -1
- package/build/js/Guid.js +8 -8
- package/build/js/Helpers.js +132 -132
- package/build/js/Helpers.js.map +1 -1
- package/build/js/IDIService.js +1 -1
- package/build/js/INetworkService.js +41 -41
- package/build/js/Services/AppStateService.js +217 -217
- package/build/js/Services/AppStateService.js.map +1 -1
- package/build/js/Services/Chat/ChatImplementations/ControllerChat/ControllerChat.js +224 -224
- package/build/js/Services/Chat/ChatImplementations/ControllerChat/ControllerChat.js.map +1 -1
- package/build/js/Services/Chat/ChatImplementations/ControllerChat/IControllerChat.js +33 -33
- package/build/js/Services/Chat/ChatImplementations/FamillyChat/FamillyChat.js +147 -147
- package/build/js/Services/Chat/ChatImplementations/FamillyChat/FamillyChat.js.map +1 -1
- package/build/js/Services/Chat/ChatImplementations/FamillyChat/IFamillyChat.js +1 -1
- package/build/js/Services/Chat/ChatImplementations/GptChat/GptChat.js +184 -184
- package/build/js/Services/Chat/ChatImplementations/GptChat/GptChat.js.map +1 -1
- package/build/js/Services/Chat/ChatImplementations/GptChat/IGptChat.js +26 -26
- package/build/js/Services/Chat/ChatService.js +43 -43
- package/build/js/Services/Chat/ChatService.js.map +1 -1
- package/build/js/Services/Chat/IChatService.js +6 -6
- package/build/js/Services/Controller/ConnectedAppsService.js +117 -117
- package/build/js/Services/Controller/ConnectedAppsService.js.map +1 -1
- package/build/js/Services/Controller/ControllerConfigurationService.js +319 -319
- package/build/js/Services/Controller/ControllerConfigurationService.js.map +1 -1
- package/build/js/Services/Controller/ControllerExtensionsService.js +148 -148
- package/build/js/Services/Controller/ControllerExtensionsService.js.map +1 -1
- package/build/js/Services/Controller/FindControllerService.js +155 -155
- package/build/js/Services/Controller/FindControllerService.js.map +1 -1
- package/build/js/Services/Controller/GeolocationService.js +111 -111
- package/build/js/Services/Controller/GeolocationService.js.map +1 -1
- package/build/js/Services/Controller/IConnectedAppsService.js +24 -24
- package/build/js/Services/Controller/IControllerConfigurationService.js +1 -1
- package/build/js/Services/Controller/IControllerExtensionsService.js +1 -1
- package/build/js/Services/Controller/IGeolocationService.js +20 -20
- package/build/js/Services/DataMigrationService.js +169 -169
- package/build/js/Services/DataMigrationService.js.map +1 -1
- package/build/js/Services/Devices/ChannelsGroupsService.js +696 -696
- package/build/js/Services/Devices/ChannelsGroupsService.js.map +1 -1
- package/build/js/Services/Devices/Device.js +248 -248
- package/build/js/Services/Devices/Device.js.map +1 -1
- package/build/js/Services/Devices/DeviceChannel.js +304 -304
- package/build/js/Services/Devices/DeviceChannel.js.map +1 -1
- package/build/js/Services/Devices/DevicesService.js +1184 -1184
- package/build/js/Services/Devices/DevicesService.js.map +1 -1
- package/build/js/Services/Devices/IChannelsGroupsService.js +109 -109
- package/build/js/Services/Devices/IChannelsGroupsService.js.map +1 -1
- package/build/js/Services/Devices/IDevice.js +197 -197
- package/build/js/Services/Devices/IDeviceChannel.js +48 -48
- package/build/js/Services/Devices/IDeviceConfigService.js +1 -1
- package/build/js/Services/Devices/IDeviceState.d.ts +7 -1
- package/build/js/Services/Devices/IDeviceState.js +970 -963
- package/build/js/Services/Devices/IDeviceState.js.map +1 -1
- package/build/js/Services/Devices/IDeviceTask.js +36 -36
- package/build/js/Services/Devices/IDevicesService.js +9 -9
- package/build/js/Services/Devices/IManuallyPairedDevicesProtocolService.js +1 -1
- package/build/js/Services/Devices/IManuallyPairedDevicesService.js +1 -1
- package/build/js/Services/Devices/ManuallyPairedDevicesService.js +68 -68
- package/build/js/Services/Devices/ManuallyPairedDevicesService.js.map +1 -1
- package/build/js/Services/Devices/TaskExecutionResult.js +9 -9
- package/build/js/Services/Devices/Tasks/DeviceTask.js +42 -42
- package/build/js/Services/Devices/Tasks/Tasks.js +216 -216
- package/build/js/Services/Devices/dist/DevicesService.d.ts +17 -17
- package/build/js/Services/ExalusConnectionService.js +498 -498
- package/build/js/Services/ExalusConnectionService.js.map +1 -1
- package/build/js/Services/FieldChangeResult.js +51 -51
- package/build/js/Services/IAppStateService.js +66 -66
- package/build/js/Services/IExalusConnectionService.js +31 -31
- package/build/js/Services/ILocalStorageService.js +1 -1
- package/build/js/Services/IRemoteStorageService.js +8 -8
- package/build/js/Services/LocalNetworkExalusConnectionService.js +289 -289
- package/build/js/Services/LocalNetworkExalusConnectionService.js.map +1 -1
- package/build/js/Services/LocalStorageService.js +38 -38
- package/build/js/Services/LocalStorageService.js.map +1 -1
- package/build/js/Services/Logging/ILoggerService.js +8 -8
- package/build/js/Services/Logging/LoggerService.js +132 -132
- package/build/js/Services/Logging/LoggerService.js.map +1 -1
- package/build/js/Services/PictureInPicture.js +28 -28
- package/build/js/Services/PictureInPicture.js.map +1 -1
- package/build/js/Services/Pictures/IPicture.js +6 -6
- package/build/js/Services/Pictures/IPicturesService.js +1 -1
- package/build/js/Services/Pictures/Picture.js +50 -50
- package/build/js/Services/Pictures/PicturesService.js +441 -441
- package/build/js/Services/Pictures/PicturesService.js.map +1 -1
- package/build/js/Services/RemoteStorageService.js +122 -122
- package/build/js/Services/RemoteStorageService.js.map +1 -1
- package/build/js/Services/Scenes/IScenesService.js +7 -7
- package/build/js/Services/Scenes/LeftArgumentTypes.js +166 -166
- package/build/js/Services/Scenes/LeftArgumentTypes.js.map +1 -1
- package/build/js/Services/Scenes/SceneTaskTypes.js +32 -32
- package/build/js/Services/Scenes/Scenes.js +134 -134
- package/build/js/Services/Scenes/ScenesBuilder.js +1097 -1097
- package/build/js/Services/Scenes/ScenesBuilder.js.map +1 -1
- package/build/js/Services/Scenes/ScenesService.js +1131 -1131
- package/build/js/Services/Scenes/ScenesService.js.map +1 -1
- package/build/js/Services/Scenes/dist/ScenesService.d.ts +5 -5
- package/build/js/Services/Session/ISessionService.js +8 -8
- package/build/js/Services/Session/SessionService.js +222 -222
- package/build/js/Services/Session/SessionService.js.map +1 -1
- package/build/js/Services/StatesHistory/IStatesHistoryService.js +12 -12
- package/build/js/Services/StatesHistory/StatesHistory.js +75 -75
- package/build/js/Services/StatesHistory/StatesHistoryService.js +235 -235
- package/build/js/Services/StatesHistory/StatesHistoryService.js.map +1 -1
- package/build/js/Services/SupportedDevices/ISupportedDevicesService.js +115 -115
- package/build/js/Services/SupportedDevices/SupportedDevicesService.js +26 -26
- package/build/js/Services/Updates/CustomUpdateActions/ICustomUpdateActions.js +1 -1
- package/build/js/Services/Updates/IUpdateInfo.js +62 -62
- package/build/js/Services/Updates/IUpdatesProvider.js +48 -48
- package/build/js/Services/Updates/IUpdatesService.js +139 -139
- package/build/js/Services/Updates/UpdateProviderServices/IControllerModulesUpdatesProviderService.js +1 -1
- package/build/js/Services/Updates/UpdateProviderServices/IDeviceUpdateProviderService.js +1 -1
- package/build/js/Services/Updates/UpdateProviderServices/IUpdateProviderService.js +1 -1
- package/build/js/Services/Updates/UpdatesProvider.js +212 -212
- package/build/js/Services/Updates/UpdatesProvider.js.map +1 -1
- package/build/js/Services/Updates/UpdatesService.js +1487 -1487
- package/build/js/Services/Updates/UpdatesService.js.map +1 -1
- package/build/js/Services/Updates/dist/UpdatesService.d.ts +9 -9
- package/build/js/Services/Users/IUser.js +21 -21
- package/build/js/Services/Users/IUsersService.js +1 -1
- package/build/js/Services/Users/User.js +104 -104
- package/build/js/Services/Users/UsersService.js +302 -302
- package/build/js/Services/Users/UsersService.js.map +1 -1
- package/build/js/Services/WebApi/IWebApiCacheService.js +1 -1
- package/build/js/Services/WebApi/WebApiCacheService.js +42 -42
- package/build/js/Services/WebApi/WebApiCacheService.js.map +1 -1
- package/build/js/TypedEvent.js +23 -23
- package/build/js/TypedEvent.js.map +1 -1
- package/build/js/dist/Api.d.ts +12 -12
- package/build/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
package/build/js/Api.js
CHANGED
|
@@ -1,113 +1,113 @@
|
|
|
1
|
-
import { DependencyContainer } from './DependencyContainer';
|
|
2
|
-
import { LocalStorageService } from "./Services/LocalStorageService";
|
|
3
|
-
import { ExalusConnectionService } from './Services/ExalusConnectionService';
|
|
4
|
-
import { WebApiCacheService } from "./Services/WebApi/WebApiCacheService";
|
|
5
|
-
import { UsersService } from "./Services/Users/UsersService";
|
|
6
|
-
import { DevicesService } from "./Services/Devices/DevicesService";
|
|
7
|
-
import { SessionService } from "./Services/Session/SessionService";
|
|
8
|
-
import { GeolocationService } from "./Services/Controller/GeolocationService";
|
|
9
|
-
import { ControllerConfigurationService } from "./Services/Controller/ControllerConfigurationService";
|
|
10
|
-
// 0. Import Module
|
|
11
|
-
import { initializeLinq } from "linq-to-typescript";
|
|
12
|
-
import { ChannelsGroupsService } from "./Services/Devices/ChannelsGroupsService";
|
|
13
|
-
import { AppStateService } from "./Services/AppStateService";
|
|
14
|
-
import { PicturesService } from './Services/Pictures/PicturesService';
|
|
15
|
-
import { UpdatesService } from './Services/Updates/UpdatesService';
|
|
16
|
-
import { ManuallyPairedDevicesService } from './Services/Devices/ManuallyPairedDevicesService';
|
|
17
|
-
import { ControllerExtensionsService } from './Services/Controller/ControllerExtensionsService';
|
|
18
|
-
import { UpdatesProvider } from './Services/Updates/UpdatesProvider';
|
|
19
|
-
import { RemoteStorageService } from './Services/RemoteStorageService';
|
|
20
|
-
import { StatesHistoryService } from './Services/StatesHistory/StatesHistoryService';
|
|
21
|
-
import { ScenesService } from './Services/Scenes/ScenesService';
|
|
22
|
-
import { ChatService } from './Services/Chat/ChatService';
|
|
23
|
-
import { ConnectedAppsService } from './Services/Controller/ConnectedAppsService';
|
|
24
|
-
import { DataMigrationService } from './Services/DataMigrationService';
|
|
25
|
-
import { FindControllerService } from './Services/Controller/FindControllerService';
|
|
26
|
-
import { LocalNetworkExalusConnectionService } from './Services/LocalNetworkExalusConnectionService';
|
|
27
|
-
import { PictureInPictureService } from './Services/PictureInPicture';
|
|
28
|
-
import { SupportedDevicesService } from './Services/SupportedDevices/SupportedDevicesService';
|
|
29
|
-
// 2. Bind Linq Functions to Array, Map, etc
|
|
30
|
-
initializeLinq();
|
|
31
|
-
export function GetDependencyContainer() {
|
|
32
|
-
return DependencyContainer.Instance;
|
|
33
|
-
}
|
|
34
|
-
export class Api {
|
|
35
|
-
static Init() {
|
|
36
|
-
if (DependencyContainer.IsInitialized)
|
|
37
|
-
return;
|
|
38
|
-
let dep = DependencyContainer.Instance;
|
|
39
|
-
try {
|
|
40
|
-
dep.RegisterService(new DataMigrationService());
|
|
41
|
-
dep.RegisterService(new LocalStorageService());
|
|
42
|
-
dep.RegisterService(new AppStateService());
|
|
43
|
-
dep.RegisterService(new WebApiCacheService());
|
|
44
|
-
dep.RegisterService(new SessionService());
|
|
45
|
-
dep.RegisterService(new PictureInPictureService());
|
|
46
|
-
if (Api.IsRunningFromLocalNetwork()) {
|
|
47
|
-
console.log("\n\nRunning from local network!\n\n");
|
|
48
|
-
dep.RegisterService(new LocalNetworkExalusConnectionService());
|
|
49
|
-
}
|
|
50
|
-
else
|
|
51
|
-
dep.RegisterService(new ExalusConnectionService());
|
|
52
|
-
dep.RegisterService(new RemoteStorageService());
|
|
53
|
-
dep.RegisterService(new SupportedDevicesService());
|
|
54
|
-
dep.RegisterService(new RemoteStorageService());
|
|
55
|
-
dep.RegisterService(new GeolocationService());
|
|
56
|
-
dep.RegisterService(new ControllerConfigurationService());
|
|
57
|
-
dep.RegisterService(new FindControllerService());
|
|
58
|
-
dep.RegisterService(new ManuallyPairedDevicesService());
|
|
59
|
-
dep.RegisterService(new ControllerExtensionsService());
|
|
60
|
-
dep.RegisterService(new PicturesService());
|
|
61
|
-
dep.RegisterService(new UsersService());
|
|
62
|
-
dep.RegisterService(new DevicesService());
|
|
63
|
-
dep.RegisterService(new ChannelsGroupsService());
|
|
64
|
-
dep.RegisterService(new UpdatesProvider());
|
|
65
|
-
dep.RegisterService(new UpdatesService());
|
|
66
|
-
dep.RegisterService(new ConnectedAppsService());
|
|
67
|
-
dep.RegisterService(new StatesHistoryService());
|
|
68
|
-
dep.RegisterService(new ScenesService());
|
|
69
|
-
dep.RegisterService(new ChatService());
|
|
70
|
-
}
|
|
71
|
-
catch (ex) {
|
|
72
|
-
console.error(ex);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
static IsAppServedFromControllerAsync() {
|
|
76
|
-
// http reuqest to controller
|
|
77
|
-
const url = `http://${window.location.hostname}/controller_info`;
|
|
78
|
-
return fetch(url, { method: 'GET' })
|
|
79
|
-
.then(response => {
|
|
80
|
-
if (response.ok) {
|
|
81
|
-
return true;
|
|
82
|
-
}
|
|
83
|
-
return false;
|
|
84
|
-
})
|
|
85
|
-
.catch(error => {
|
|
86
|
-
return false;
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
static IsRunningFromLocalNetwork(hostname = window.location.hostname) {
|
|
90
|
-
return (
|
|
91
|
-
//(['localhost', '127.0.0.1', '', '::1'].includes(hostname))
|
|
92
|
-
//|| (hostname.startsWith('192.168.'))
|
|
93
|
-
(hostname.startsWith('192.168.'))
|
|
94
|
-
|| (hostname.startsWith('10.'))
|
|
95
|
-
//|| (hostname.endsWith('.local'))
|
|
96
|
-
);
|
|
97
|
-
}
|
|
98
|
-
static GetAsync(classType, cancelationToken) {
|
|
99
|
-
return DependencyContainer.Instance.GetServiceAsync(classType, cancelationToken);
|
|
100
|
-
}
|
|
101
|
-
static GetWithTimeoutAsync(classType, timeout) {
|
|
102
|
-
return DependencyContainer.Instance.GetServiceWithTimeoutAsync(classType, timeout);
|
|
103
|
-
}
|
|
104
|
-
static Get(classType) {
|
|
105
|
-
return DependencyContainer.Instance.GetService(classType);
|
|
106
|
-
}
|
|
107
|
-
static SleepForAsync(miliseconds) {
|
|
108
|
-
return new Promise(resolve => setTimeout(resolve, miliseconds));
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
Api.WorksInContextOf = "";
|
|
112
|
-
Api.Version = 1.0;
|
|
1
|
+
import { DependencyContainer } from './DependencyContainer';
|
|
2
|
+
import { LocalStorageService } from "./Services/LocalStorageService";
|
|
3
|
+
import { ExalusConnectionService } from './Services/ExalusConnectionService';
|
|
4
|
+
import { WebApiCacheService } from "./Services/WebApi/WebApiCacheService";
|
|
5
|
+
import { UsersService } from "./Services/Users/UsersService";
|
|
6
|
+
import { DevicesService } from "./Services/Devices/DevicesService";
|
|
7
|
+
import { SessionService } from "./Services/Session/SessionService";
|
|
8
|
+
import { GeolocationService } from "./Services/Controller/GeolocationService";
|
|
9
|
+
import { ControllerConfigurationService } from "./Services/Controller/ControllerConfigurationService";
|
|
10
|
+
// 0. Import Module
|
|
11
|
+
import { initializeLinq } from "linq-to-typescript";
|
|
12
|
+
import { ChannelsGroupsService } from "./Services/Devices/ChannelsGroupsService";
|
|
13
|
+
import { AppStateService } from "./Services/AppStateService";
|
|
14
|
+
import { PicturesService } from './Services/Pictures/PicturesService';
|
|
15
|
+
import { UpdatesService } from './Services/Updates/UpdatesService';
|
|
16
|
+
import { ManuallyPairedDevicesService } from './Services/Devices/ManuallyPairedDevicesService';
|
|
17
|
+
import { ControllerExtensionsService } from './Services/Controller/ControllerExtensionsService';
|
|
18
|
+
import { UpdatesProvider } from './Services/Updates/UpdatesProvider';
|
|
19
|
+
import { RemoteStorageService } from './Services/RemoteStorageService';
|
|
20
|
+
import { StatesHistoryService } from './Services/StatesHistory/StatesHistoryService';
|
|
21
|
+
import { ScenesService } from './Services/Scenes/ScenesService';
|
|
22
|
+
import { ChatService } from './Services/Chat/ChatService';
|
|
23
|
+
import { ConnectedAppsService } from './Services/Controller/ConnectedAppsService';
|
|
24
|
+
import { DataMigrationService } from './Services/DataMigrationService';
|
|
25
|
+
import { FindControllerService } from './Services/Controller/FindControllerService';
|
|
26
|
+
import { LocalNetworkExalusConnectionService } from './Services/LocalNetworkExalusConnectionService';
|
|
27
|
+
import { PictureInPictureService } from './Services/PictureInPicture';
|
|
28
|
+
import { SupportedDevicesService } from './Services/SupportedDevices/SupportedDevicesService';
|
|
29
|
+
// 2. Bind Linq Functions to Array, Map, etc
|
|
30
|
+
initializeLinq();
|
|
31
|
+
export function GetDependencyContainer() {
|
|
32
|
+
return DependencyContainer.Instance;
|
|
33
|
+
}
|
|
34
|
+
export class Api {
|
|
35
|
+
static Init() {
|
|
36
|
+
if (DependencyContainer.IsInitialized)
|
|
37
|
+
return;
|
|
38
|
+
let dep = DependencyContainer.Instance;
|
|
39
|
+
try {
|
|
40
|
+
dep.RegisterService(new DataMigrationService());
|
|
41
|
+
dep.RegisterService(new LocalStorageService());
|
|
42
|
+
dep.RegisterService(new AppStateService());
|
|
43
|
+
dep.RegisterService(new WebApiCacheService());
|
|
44
|
+
dep.RegisterService(new SessionService());
|
|
45
|
+
dep.RegisterService(new PictureInPictureService());
|
|
46
|
+
if (Api.IsRunningFromLocalNetwork()) {
|
|
47
|
+
console.log("\n\nRunning from local network!\n\n");
|
|
48
|
+
dep.RegisterService(new LocalNetworkExalusConnectionService());
|
|
49
|
+
}
|
|
50
|
+
else
|
|
51
|
+
dep.RegisterService(new ExalusConnectionService());
|
|
52
|
+
dep.RegisterService(new RemoteStorageService());
|
|
53
|
+
dep.RegisterService(new SupportedDevicesService());
|
|
54
|
+
dep.RegisterService(new RemoteStorageService());
|
|
55
|
+
dep.RegisterService(new GeolocationService());
|
|
56
|
+
dep.RegisterService(new ControllerConfigurationService());
|
|
57
|
+
dep.RegisterService(new FindControllerService());
|
|
58
|
+
dep.RegisterService(new ManuallyPairedDevicesService());
|
|
59
|
+
dep.RegisterService(new ControllerExtensionsService());
|
|
60
|
+
dep.RegisterService(new PicturesService());
|
|
61
|
+
dep.RegisterService(new UsersService());
|
|
62
|
+
dep.RegisterService(new DevicesService());
|
|
63
|
+
dep.RegisterService(new ChannelsGroupsService());
|
|
64
|
+
dep.RegisterService(new UpdatesProvider());
|
|
65
|
+
dep.RegisterService(new UpdatesService());
|
|
66
|
+
dep.RegisterService(new ConnectedAppsService());
|
|
67
|
+
dep.RegisterService(new StatesHistoryService());
|
|
68
|
+
dep.RegisterService(new ScenesService());
|
|
69
|
+
dep.RegisterService(new ChatService());
|
|
70
|
+
}
|
|
71
|
+
catch (ex) {
|
|
72
|
+
console.error(ex);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
static IsAppServedFromControllerAsync() {
|
|
76
|
+
// http reuqest to controller
|
|
77
|
+
const url = `http://${window.location.hostname}/controller_info`;
|
|
78
|
+
return fetch(url, { method: 'GET' })
|
|
79
|
+
.then(response => {
|
|
80
|
+
if (response.ok) {
|
|
81
|
+
return true;
|
|
82
|
+
}
|
|
83
|
+
return false;
|
|
84
|
+
})
|
|
85
|
+
.catch(error => {
|
|
86
|
+
return false;
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
static IsRunningFromLocalNetwork(hostname = window.location.hostname) {
|
|
90
|
+
return (
|
|
91
|
+
//(['localhost', '127.0.0.1', '', '::1'].includes(hostname))
|
|
92
|
+
//|| (hostname.startsWith('192.168.'))
|
|
93
|
+
(hostname.startsWith('192.168.'))
|
|
94
|
+
|| (hostname.startsWith('10.'))
|
|
95
|
+
//|| (hostname.endsWith('.local'))
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
static GetAsync(classType, cancelationToken) {
|
|
99
|
+
return DependencyContainer.Instance.GetServiceAsync(classType, cancelationToken);
|
|
100
|
+
}
|
|
101
|
+
static GetWithTimeoutAsync(classType, timeout) {
|
|
102
|
+
return DependencyContainer.Instance.GetServiceWithTimeoutAsync(classType, timeout);
|
|
103
|
+
}
|
|
104
|
+
static Get(classType) {
|
|
105
|
+
return DependencyContainer.Instance.GetService(classType);
|
|
106
|
+
}
|
|
107
|
+
static SleepForAsync(miliseconds) {
|
|
108
|
+
return new Promise(resolve => setTimeout(resolve, miliseconds));
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
Api.WorksInContextOf = "";
|
|
112
|
+
Api.Version = 1.0;
|
|
113
113
|
//# sourceMappingURL=Api.js.map
|
package/build/js/Api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Api.js","sourceRoot":"","sources":["../../src/Api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAG5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,0CAA0C,CAAC;AAC9E,OAAO,EAAE,8BAA8B,EAAE,MAAM,sDAAsD,CAAC;AACtG,mBAAmB;AACnB,OAAO,EAAE,cAAc,EAAe,MAAM,oBAAoB,CAAA;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,EAAE,4BAA4B,EAAE,MAAM,iDAAiD,CAAC;AAC/F,OAAO,EAAE,2BAA2B,EAAE,MAAM,mDAAmD,CAAC;AAChG,OAAO,EAAE,eAAe,EAAE,MAA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,OAAO;QACH,4DAA4D;QAC5D,sCAAsC;QACtC,CAAC,QAAQ,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;eAC9B,CAAC,QAAQ,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QAC/B,kCAAkC;SACrC,CAAA;IACL,CAAC;IAED,MAAM,CAAC,QAAQ,CAAuB,SAAiB,EAAE,gBAAyC;QAC9F,OAAO,mBAAmB,CAAC,QAAQ,CAAC,eAAe,CAAI,SAAS,EAAE,gBAAgB,CAAC,CAAC;IACxF,CAAC;IAED,MAAM,CAAC,mBAAmB,CAAuB,SAAiB,EAAE,OAAe;QAC/E,OAAO,mBAAmB,CAAC,QAAQ,CAAC,0BAA0B,CAAI,SAAS,EAAE,OAAO,CAAC,CAAC;IAC1F,CAAC;IAED,MAAM,CAAC,GAAG,CAAuB,SAAiB;QAC9C,OAAO,mBAAmB,CAAC,QAAQ,CAAC,UAAU,CAAI,SAAS,CAAC,CAAC;IACjE,CAAC;IAED,MAAM,CAAC,aAAa,CAAC,WAAmB;QACpC,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC;IACpE,CAAC;;AAvFM,oBAAgB,GAAW,EAAE,CAAC;AAC9B,WAAO,GAAW,GAAG,CAAC"}
|
package/build/js/AsyncLock.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
export class AsyncLock {
|
|
2
|
-
constructor() {
|
|
3
|
-
this._promise = Promise.resolve();
|
|
4
|
-
this._disable = () => { };
|
|
5
|
-
}
|
|
6
|
-
Lock() {
|
|
7
|
-
this._promise = new Promise(resolve => this._disable = resolve);
|
|
8
|
-
}
|
|
9
|
-
Unlock() {
|
|
10
|
-
this._disable();
|
|
11
|
-
}
|
|
12
|
-
WaitForLockAsync() {
|
|
13
|
-
return this._promise;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
1
|
+
export class AsyncLock {
|
|
2
|
+
constructor() {
|
|
3
|
+
this._promise = Promise.resolve();
|
|
4
|
+
this._disable = () => { };
|
|
5
|
+
}
|
|
6
|
+
Lock() {
|
|
7
|
+
this._promise = new Promise(resolve => this._disable = resolve);
|
|
8
|
+
}
|
|
9
|
+
Unlock() {
|
|
10
|
+
this._disable();
|
|
11
|
+
}
|
|
12
|
+
WaitForLockAsync() {
|
|
13
|
+
return this._promise;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
16
|
//# sourceMappingURL=AsyncLock.js.map
|
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
export class AsyncSemaphore {
|
|
2
|
-
constructor(initialCount) {
|
|
3
|
-
this.initialCount = initialCount;
|
|
4
|
-
this._running = 0;
|
|
5
|
-
this._waiting = [];
|
|
6
|
-
this.Take = () => {
|
|
7
|
-
if (this._waiting.length > 0 && this._running < this.initialCount) {
|
|
8
|
-
this._running++;
|
|
9
|
-
const task = this._waiting.shift();
|
|
10
|
-
task === null || task === void 0 ? void 0 : task.Resolve({ Release: this.Release });
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
/**
|
|
14
|
-
* Acquire a lock on the target resource.
|
|
15
|
-
* @returns a function to release the lock, it is critical that this function is called when the task is finished with the resource.
|
|
16
|
-
*/
|
|
17
|
-
this.AcquireAsync = () => {
|
|
18
|
-
if (this._running < this.initialCount) {
|
|
19
|
-
this._running++;
|
|
20
|
-
return Promise.resolve({ Release: this.Release });
|
|
21
|
-
}
|
|
22
|
-
return new Promise((resolve, reject) => {
|
|
23
|
-
this._waiting.push({ Resolve: resolve, Reject: reject });
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
this.Release = () => {
|
|
27
|
-
this._running--;
|
|
28
|
-
this.Take();
|
|
29
|
-
};
|
|
30
|
-
/**
|
|
31
|
-
* Purge all waiting tasks from the Semaphore instance
|
|
32
|
-
*/
|
|
33
|
-
this.Purge = () => {
|
|
34
|
-
this._waiting.forEach(task => {
|
|
35
|
-
task.Reject(new Error('The semaphore was purged and as a result this task has been cancelled'));
|
|
36
|
-
});
|
|
37
|
-
this._running = 0;
|
|
38
|
-
this._waiting = [];
|
|
39
|
-
};
|
|
40
|
-
if (initialCount < 1) {
|
|
41
|
-
throw new Error(`The semaphore was created with a max value of ${initialCount} but the max value cannot be less than 1`);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
1
|
+
export class AsyncSemaphore {
|
|
2
|
+
constructor(initialCount) {
|
|
3
|
+
this.initialCount = initialCount;
|
|
4
|
+
this._running = 0;
|
|
5
|
+
this._waiting = [];
|
|
6
|
+
this.Take = () => {
|
|
7
|
+
if (this._waiting.length > 0 && this._running < this.initialCount) {
|
|
8
|
+
this._running++;
|
|
9
|
+
const task = this._waiting.shift();
|
|
10
|
+
task === null || task === void 0 ? void 0 : task.Resolve({ Release: this.Release });
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Acquire a lock on the target resource.
|
|
15
|
+
* @returns a function to release the lock, it is critical that this function is called when the task is finished with the resource.
|
|
16
|
+
*/
|
|
17
|
+
this.AcquireAsync = () => {
|
|
18
|
+
if (this._running < this.initialCount) {
|
|
19
|
+
this._running++;
|
|
20
|
+
return Promise.resolve({ Release: this.Release });
|
|
21
|
+
}
|
|
22
|
+
return new Promise((resolve, reject) => {
|
|
23
|
+
this._waiting.push({ Resolve: resolve, Reject: reject });
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
this.Release = () => {
|
|
27
|
+
this._running--;
|
|
28
|
+
this.Take();
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Purge all waiting tasks from the Semaphore instance
|
|
32
|
+
*/
|
|
33
|
+
this.Purge = () => {
|
|
34
|
+
this._waiting.forEach(task => {
|
|
35
|
+
task.Reject(new Error('The semaphore was purged and as a result this task has been cancelled'));
|
|
36
|
+
});
|
|
37
|
+
this._running = 0;
|
|
38
|
+
this._waiting = [];
|
|
39
|
+
};
|
|
40
|
+
if (initialCount < 1) {
|
|
41
|
+
throw new Error(`The semaphore was created with a max value of ${initialCount} but the max value cannot be less than 1`);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
45
|
//# sourceMappingURL=AsyncSemaphore.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AsyncSemaphore.js","sourceRoot":"","sources":["../../src/AsyncSemaphore.ts"],"names":[],"mappings":"AASA,MAAM,OAAO,cAAc;IAKzB,YAAmB,YAAoB;QAApB,iBAAY,GAAZ,YAAY,CAAQ;QAH/B,aAAQ,GAAG,CAAC,CAAA;QACZ,aAAQ,GAAqB,EAAE,CAAA;QAU/B,SAAI,GAAG,GAAG,EAAE;YAClB,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,IAAI,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,YAAY,EAAE
|
|
1
|
+
{"version":3,"file":"AsyncSemaphore.js","sourceRoot":"","sources":["../../src/AsyncSemaphore.ts"],"names":[],"mappings":"AASA,MAAM,OAAO,cAAc;IAKzB,YAAmB,YAAoB;QAApB,iBAAY,GAAZ,YAAY,CAAQ;QAH/B,aAAQ,GAAG,CAAC,CAAA;QACZ,aAAQ,GAAqB,EAAE,CAAA;QAU/B,SAAI,GAAG,GAAG,EAAE;YAClB,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,IAAI,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,YAAY,EAAE;gBACjE,IAAI,CAAC,QAAQ,EAAE,CAAA;gBACf,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAA;gBAClC,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,OAAO,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAA;aACzC;QACH,CAAC,CAAA;QAED;;;UAGE;QACK,iBAAY,GAAG,GAAkB,EAAE;YACxC,IAAI,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,YAAY,EAAE;gBACrC,IAAI,CAAC,QAAQ,EAAE,CAAA;gBACf,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAA;aAClD;YAED,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;gBAC3C,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;YAC1D,CAAC,CAAC,CAAA;QACJ,CAAC,CAAA;QAEO,YAAO,GAAG,GAAG,EAAE;YACrB,IAAI,CAAC,QAAQ,EAAE,CAAA;YACf,IAAI,CAAC,IAAI,EAAE,CAAA;QACb,CAAC,CAAA;QAED;;WAEG;QACI,UAAK,GAAG,GAAG,EAAE;YAClB,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;gBAC3B,IAAI,CAAC,MAAM,CACT,IAAI,KAAK,CAAC,uEAAuE,CAAC,CACnF,CAAA;YACH,CAAC,CAAC,CAAA;YACF,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAA;YACjB,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAA;QACpB,CAAC,CAAA;QA9CC,IAAI,YAAY,GAAG,CAAC,EAAE;YACpB,MAAM,IAAI,KAAK,CACb,iDAAiD,YAAY,0CAA0C,CACxG,CAAA;SACF;IACH,CAAC;CA0CF"}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { TypedEvent } from './TypedEvent';
|
|
2
|
-
export class CancelationTokenSource {
|
|
3
|
-
constructor() {
|
|
4
|
-
this._canceled = false;
|
|
5
|
-
this._cancellationRequested = false;
|
|
6
|
-
this.CancellationEvent = new TypedEvent();
|
|
7
|
-
}
|
|
8
|
-
Cancel() {
|
|
9
|
-
if (this._cancellationRequested)
|
|
10
|
-
throw Error("Cancelation has already been requested.");
|
|
11
|
-
this._cancellationRequested = true;
|
|
12
|
-
this.CancellationEvent.Invoke();
|
|
13
|
-
this._canceled = true;
|
|
14
|
-
}
|
|
15
|
-
get IsCancelled() {
|
|
16
|
-
return this._canceled;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
1
|
+
import { TypedEvent } from './TypedEvent';
|
|
2
|
+
export class CancelationTokenSource {
|
|
3
|
+
constructor() {
|
|
4
|
+
this._canceled = false;
|
|
5
|
+
this._cancellationRequested = false;
|
|
6
|
+
this.CancellationEvent = new TypedEvent();
|
|
7
|
+
}
|
|
8
|
+
Cancel() {
|
|
9
|
+
if (this._cancellationRequested)
|
|
10
|
+
throw Error("Cancelation has already been requested.");
|
|
11
|
+
this._cancellationRequested = true;
|
|
12
|
+
this.CancellationEvent.Invoke();
|
|
13
|
+
this._canceled = true;
|
|
14
|
+
}
|
|
15
|
+
get IsCancelled() {
|
|
16
|
+
return this._canceled;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
19
|
//# sourceMappingURL=CancelationTokenSource.js.map
|
package/build/js/DataFrame.js
CHANGED
|
@@ -1,87 +1,87 @@
|
|
|
1
|
-
import { Helpers } from "./Helpers";
|
|
2
|
-
export class DataFrame {
|
|
3
|
-
constructor() {
|
|
4
|
-
this.TransactionId = Helpers.GenerateUUID();
|
|
5
|
-
}
|
|
6
|
-
}
|
|
7
|
-
export var Status;
|
|
8
|
-
(function (Status) {
|
|
9
|
-
/// <summary>
|
|
10
|
-
/// Gdy zapytanie się powiodło i nie wystąpiły błędy
|
|
11
|
-
/// </summary>
|
|
12
|
-
Status[Status["OK"] = 0] = "OK";
|
|
13
|
-
/// <summary>
|
|
14
|
-
/// Gdy wystąpił nieznany błąd podczas wykonywania zapytania
|
|
15
|
-
/// </summary>
|
|
16
|
-
Status[Status["UnknownError"] = 1] = "UnknownError";
|
|
17
|
-
/// <summary>
|
|
18
|
-
/// Gdy wystąpił błąd którego oprogramowanie kontrolera nie mogło rozwiązać
|
|
19
|
-
/// </summary>
|
|
20
|
-
Status[Status["FatalError"] = 2] = "FatalError";
|
|
21
|
-
/// <summary>
|
|
22
|
-
/// Gdy zapytanie zostało wykonane z niepoprawnymi danymi
|
|
23
|
-
/// </summary>
|
|
24
|
-
Status[Status["WrongData"] = 3] = "WrongData";
|
|
25
|
-
/// <summary>
|
|
26
|
-
/// Gdy zostało wykonane zapytanie do zasobu który nie istnieje
|
|
27
|
-
/// </summary>
|
|
28
|
-
Status[Status["ResourceDoesNotExists"] = 4] = "ResourceDoesNotExists";
|
|
29
|
-
/// <summary>
|
|
30
|
-
/// Gdy zostało wykonane zapytanie o wykonanie operacji do której zalogowany użytkownik nie ma uprawnień (np. gdy próbuje zmienić dane użytkownika o uprawnieniach wyższych od siebie)
|
|
31
|
-
/// </summary>
|
|
32
|
-
Status[Status["NoPermissionToPerformThisOperation"] = 5] = "NoPermissionToPerformThisOperation";
|
|
33
|
-
/// <summary>
|
|
34
|
-
/// Gdy zostanie dokonana próba ponownego logowania dla już zalogowanej sesji
|
|
35
|
-
/// </summary>
|
|
36
|
-
Status[Status["SessionHasAlreadyLoggedOnUser"] = 6] = "SessionHasAlreadyLoggedOnUser";
|
|
37
|
-
/// <summary>
|
|
38
|
-
/// Gdy żądana operacja jest niedozwolona
|
|
39
|
-
/// </summary>
|
|
40
|
-
Status[Status["OperationNotPermitted"] = 7] = "OperationNotPermitted";
|
|
41
|
-
/// <summary>
|
|
42
|
-
/// Gdy zostanie wykonane zapytanie do zasobu do którego użytkownik nie ma uprawnień
|
|
43
|
-
/// </summary>
|
|
44
|
-
Status[Status["NoPermissionsToCallGivenResource"] = 8] = "NoPermissionsToCallGivenResource";
|
|
45
|
-
/// <summary>
|
|
46
|
-
/// Gdy zostanie wykonane zapytanie do zasobu aktualnie nie dostępnego (gdy np. zasób został wyłączony)
|
|
47
|
-
/// </summary>
|
|
48
|
-
Status[Status["ResourceIsNotAvailable"] = 9] = "ResourceIsNotAvailable";
|
|
49
|
-
/// <summary>
|
|
50
|
-
/// Gdy zapytanie do zasobu zakończyło się okreslonym błędem
|
|
51
|
-
/// </summary>
|
|
52
|
-
Status[Status["Error"] = 10] = "Error";
|
|
53
|
-
/// <summary>
|
|
54
|
-
/// Gdy w ramach odpowiedzi na zapytanie nie są zwracane dane
|
|
55
|
-
/// </summary>
|
|
56
|
-
Status[Status["NoData"] = 11] = "NoData";
|
|
57
|
-
/// <summary>
|
|
58
|
-
/// Gdy zostanie wykonane zapytanie do nie wspieranego zasobu (np. dotyczącego okreslonego systemu operacyjnego)
|
|
59
|
-
/// </summary>
|
|
60
|
-
Status[Status["NotSupportedMethod"] = 12] = "NotSupportedMethod";
|
|
61
|
-
/// <summary>
|
|
62
|
-
/// Gdy zostanie wykonane zapytanie do dowolnego zasobu a żaden użytkownik nie jest zalogowany w ramach sesji
|
|
63
|
-
/// </summary>
|
|
64
|
-
Status[Status["UserIsNotLoggedIn"] = 13] = "UserIsNotLoggedIn";
|
|
65
|
-
/// <summary>
|
|
66
|
-
/// Przewidziane dla zapytań które zwracają wiele odpowiedzi, np. postęp w realizacji jakiegoś procesu
|
|
67
|
-
/// </summary>
|
|
68
|
-
Status[Status["MultiDataResponseStart"] = 14] = "MultiDataResponseStart";
|
|
69
|
-
/// <summary>
|
|
70
|
-
/// Przewidziane dla zapytań które zwracają wiele odpowiedzi, np. postęp w realizacji jakiegoś procesu. Informuje, że dana odpowiedź jest jedną z odpowiedzi
|
|
71
|
-
/// </summary>
|
|
72
|
-
Status[Status["MultiDataResponse"] = 15] = "MultiDataResponse";
|
|
73
|
-
/// <summary>
|
|
74
|
-
/// Przewidziane dla zapytań które zwracają wiele odpowiedzi, np. postęp w realizacji jakiegoś procesu. Informuje, że dana odpowiedź jest ostatnią odpowiedzią danego zasobu
|
|
75
|
-
/// </summary>
|
|
76
|
-
Status[Status["MultiDataResponseStop"] = 16] = "MultiDataResponseStop";
|
|
77
|
-
})(Status || (Status = {}));
|
|
78
|
-
export var Method;
|
|
79
|
-
(function (Method) {
|
|
80
|
-
Method[Method["Get"] = 0] = "Get";
|
|
81
|
-
Method[Method["Post"] = 1] = "Post";
|
|
82
|
-
Method[Method["Delete"] = 2] = "Delete";
|
|
83
|
-
Method[Method["Put"] = 3] = "Put";
|
|
84
|
-
Method[Method["Options"] = 4] = "Options";
|
|
85
|
-
Method[Method["Head"] = 5] = "Head";
|
|
86
|
-
})(Method || (Method = {}));
|
|
1
|
+
import { Helpers } from "./Helpers";
|
|
2
|
+
export class DataFrame {
|
|
3
|
+
constructor() {
|
|
4
|
+
this.TransactionId = Helpers.GenerateUUID();
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
export var Status;
|
|
8
|
+
(function (Status) {
|
|
9
|
+
/// <summary>
|
|
10
|
+
/// Gdy zapytanie się powiodło i nie wystąpiły błędy
|
|
11
|
+
/// </summary>
|
|
12
|
+
Status[Status["OK"] = 0] = "OK";
|
|
13
|
+
/// <summary>
|
|
14
|
+
/// Gdy wystąpił nieznany błąd podczas wykonywania zapytania
|
|
15
|
+
/// </summary>
|
|
16
|
+
Status[Status["UnknownError"] = 1] = "UnknownError";
|
|
17
|
+
/// <summary>
|
|
18
|
+
/// Gdy wystąpił błąd którego oprogramowanie kontrolera nie mogło rozwiązać
|
|
19
|
+
/// </summary>
|
|
20
|
+
Status[Status["FatalError"] = 2] = "FatalError";
|
|
21
|
+
/// <summary>
|
|
22
|
+
/// Gdy zapytanie zostało wykonane z niepoprawnymi danymi
|
|
23
|
+
/// </summary>
|
|
24
|
+
Status[Status["WrongData"] = 3] = "WrongData";
|
|
25
|
+
/// <summary>
|
|
26
|
+
/// Gdy zostało wykonane zapytanie do zasobu który nie istnieje
|
|
27
|
+
/// </summary>
|
|
28
|
+
Status[Status["ResourceDoesNotExists"] = 4] = "ResourceDoesNotExists";
|
|
29
|
+
/// <summary>
|
|
30
|
+
/// Gdy zostało wykonane zapytanie o wykonanie operacji do której zalogowany użytkownik nie ma uprawnień (np. gdy próbuje zmienić dane użytkownika o uprawnieniach wyższych od siebie)
|
|
31
|
+
/// </summary>
|
|
32
|
+
Status[Status["NoPermissionToPerformThisOperation"] = 5] = "NoPermissionToPerformThisOperation";
|
|
33
|
+
/// <summary>
|
|
34
|
+
/// Gdy zostanie dokonana próba ponownego logowania dla już zalogowanej sesji
|
|
35
|
+
/// </summary>
|
|
36
|
+
Status[Status["SessionHasAlreadyLoggedOnUser"] = 6] = "SessionHasAlreadyLoggedOnUser";
|
|
37
|
+
/// <summary>
|
|
38
|
+
/// Gdy żądana operacja jest niedozwolona
|
|
39
|
+
/// </summary>
|
|
40
|
+
Status[Status["OperationNotPermitted"] = 7] = "OperationNotPermitted";
|
|
41
|
+
/// <summary>
|
|
42
|
+
/// Gdy zostanie wykonane zapytanie do zasobu do którego użytkownik nie ma uprawnień
|
|
43
|
+
/// </summary>
|
|
44
|
+
Status[Status["NoPermissionsToCallGivenResource"] = 8] = "NoPermissionsToCallGivenResource";
|
|
45
|
+
/// <summary>
|
|
46
|
+
/// Gdy zostanie wykonane zapytanie do zasobu aktualnie nie dostępnego (gdy np. zasób został wyłączony)
|
|
47
|
+
/// </summary>
|
|
48
|
+
Status[Status["ResourceIsNotAvailable"] = 9] = "ResourceIsNotAvailable";
|
|
49
|
+
/// <summary>
|
|
50
|
+
/// Gdy zapytanie do zasobu zakończyło się okreslonym błędem
|
|
51
|
+
/// </summary>
|
|
52
|
+
Status[Status["Error"] = 10] = "Error";
|
|
53
|
+
/// <summary>
|
|
54
|
+
/// Gdy w ramach odpowiedzi na zapytanie nie są zwracane dane
|
|
55
|
+
/// </summary>
|
|
56
|
+
Status[Status["NoData"] = 11] = "NoData";
|
|
57
|
+
/// <summary>
|
|
58
|
+
/// Gdy zostanie wykonane zapytanie do nie wspieranego zasobu (np. dotyczącego okreslonego systemu operacyjnego)
|
|
59
|
+
/// </summary>
|
|
60
|
+
Status[Status["NotSupportedMethod"] = 12] = "NotSupportedMethod";
|
|
61
|
+
/// <summary>
|
|
62
|
+
/// Gdy zostanie wykonane zapytanie do dowolnego zasobu a żaden użytkownik nie jest zalogowany w ramach sesji
|
|
63
|
+
/// </summary>
|
|
64
|
+
Status[Status["UserIsNotLoggedIn"] = 13] = "UserIsNotLoggedIn";
|
|
65
|
+
/// <summary>
|
|
66
|
+
/// Przewidziane dla zapytań które zwracają wiele odpowiedzi, np. postęp w realizacji jakiegoś procesu
|
|
67
|
+
/// </summary>
|
|
68
|
+
Status[Status["MultiDataResponseStart"] = 14] = "MultiDataResponseStart";
|
|
69
|
+
/// <summary>
|
|
70
|
+
/// Przewidziane dla zapytań które zwracają wiele odpowiedzi, np. postęp w realizacji jakiegoś procesu. Informuje, że dana odpowiedź jest jedną z odpowiedzi
|
|
71
|
+
/// </summary>
|
|
72
|
+
Status[Status["MultiDataResponse"] = 15] = "MultiDataResponse";
|
|
73
|
+
/// <summary>
|
|
74
|
+
/// Przewidziane dla zapytań które zwracają wiele odpowiedzi, np. postęp w realizacji jakiegoś procesu. Informuje, że dana odpowiedź jest ostatnią odpowiedzią danego zasobu
|
|
75
|
+
/// </summary>
|
|
76
|
+
Status[Status["MultiDataResponseStop"] = 16] = "MultiDataResponseStop";
|
|
77
|
+
})(Status || (Status = {}));
|
|
78
|
+
export var Method;
|
|
79
|
+
(function (Method) {
|
|
80
|
+
Method[Method["Get"] = 0] = "Get";
|
|
81
|
+
Method[Method["Post"] = 1] = "Post";
|
|
82
|
+
Method[Method["Delete"] = 2] = "Delete";
|
|
83
|
+
Method[Method["Put"] = 3] = "Put";
|
|
84
|
+
Method[Method["Options"] = 4] = "Options";
|
|
85
|
+
Method[Method["Head"] = 5] = "Head";
|
|
86
|
+
})(Method || (Method = {}));
|
|
87
87
|
//# sourceMappingURL=DataFrame.js.map
|