@computec/uibase 1.0.8 → 1.0.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.
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist-amd/communication/ConnectionOptions.d.ts +48 -0
- package/dist-amd/communication/ConnectionOptions.d.ts.map +1 -0
- package/dist-amd/communication/ConnectionOptions.js +11 -0
- package/dist-amd/communication/HttpClient.d.ts +249 -0
- package/dist-amd/communication/HttpClient.d.ts.map +1 -0
- package/dist-amd/communication/HttpClient.js +362 -0
- package/dist-amd/communication/HttpClientCacheOptions.d.ts +9 -0
- package/dist-amd/communication/HttpClientCacheOptions.d.ts.map +1 -0
- package/dist-amd/communication/HttpClientCacheOptions.js +27 -0
- package/dist-amd/communication/IBaseHttpClientOptions.d.ts +18 -0
- package/dist-amd/communication/IBaseHttpClientOptions.d.ts.map +1 -0
- package/dist-amd/communication/IBaseHttpClientOptions.js +4 -0
- package/dist-amd/communication/IConnectionInfo.d.ts +17 -0
- package/dist-amd/communication/IConnectionInfo.d.ts.map +1 -0
- package/dist-amd/communication/IConnectionInfo.js +4 -0
- package/dist-amd/communication/ISignalRHubClient.d.ts +47 -0
- package/dist-amd/communication/ISignalRHubClient.d.ts.map +1 -0
- package/dist-amd/communication/ISignalRHubClient.js +4 -0
- package/dist-amd/communication/ISignalRMessage.d.ts +8 -0
- package/dist-amd/communication/ISignalRMessage.d.ts.map +1 -0
- package/dist-amd/communication/ISignalRMessage.js +4 -0
- package/dist-amd/communication/SignalRHubClient.d.ts +26 -0
- package/dist-amd/communication/SignalRHubClient.d.ts.map +1 -0
- package/dist-amd/communication/SignalRHubClient.js +135 -0
- package/dist-amd/communication/SignalRMessage.d.ts +10 -0
- package/dist-amd/communication/SignalRMessage.d.ts.map +1 -0
- package/dist-amd/communication/SignalRMessage.js +11 -0
- package/dist-amd/communication/SubscribeProperties.d.ts +17 -0
- package/dist-amd/communication/SubscribeProperties.d.ts.map +1 -0
- package/dist-amd/communication/SubscribeProperties.js +27 -0
- package/dist-amd/helpers/ErrorHelper.d.ts +15 -0
- package/dist-amd/helpers/ErrorHelper.d.ts.map +1 -0
- package/dist-amd/helpers/ErrorHelper.js +51 -0
- package/dist-amd/helpers/HttpClientHelper.d.ts +42 -0
- package/dist-amd/helpers/HttpClientHelper.d.ts.map +1 -0
- package/dist-amd/helpers/HttpClientHelper.js +188 -0
- package/dist-amd/helpers/NavigationHelper.d.ts +52 -0
- package/dist-amd/helpers/NavigationHelper.d.ts.map +1 -0
- package/dist-amd/helpers/NavigationHelper.js +73 -0
- package/dist-amd/helpers/WebClientNavigationHelper.d.ts +52 -0
- package/dist-amd/helpers/WebClientNavigationHelper.d.ts.map +1 -0
- package/dist-amd/helpers/WebClientNavigationHelper.js +73 -0
- package/dist-amd/index.d.ts +37 -0
- package/dist-amd/index.d.ts.map +1 -0
- package/dist-amd/index.js +56 -0
- package/dist-amd/models/AppEngineConfiguration.d.ts +26 -0
- package/dist-amd/models/AppEngineConfiguration.d.ts.map +1 -0
- package/dist-amd/models/AppEngineConfiguration.js +11 -0
- package/dist-amd/models/AppEngineException.d.ts +21 -0
- package/dist-amd/models/AppEngineException.d.ts.map +1 -0
- package/dist-amd/models/AppEngineException.js +46 -0
- package/dist-amd/models/BaseBusinessObject.d.ts +157 -0
- package/dist-amd/models/BaseBusinessObject.d.ts.map +1 -0
- package/dist-amd/models/BaseBusinessObject.js +189 -0
- package/dist-amd/models/BaseError.d.ts +51 -0
- package/dist-amd/models/BaseError.d.ts.map +1 -0
- package/dist-amd/models/BaseError.js +55 -0
- package/dist-amd/models/CompanyInfo.d.ts +11 -0
- package/dist-amd/models/CompanyInfo.d.ts.map +1 -0
- package/dist-amd/models/CompanyInfo.js +24 -0
- package/dist-amd/models/DocumentedException.d.ts +22 -0
- package/dist-amd/models/DocumentedException.d.ts.map +1 -0
- package/dist-amd/models/DocumentedException.js +50 -0
- package/dist-amd/models/HttpResponse.d.ts +7 -0
- package/dist-amd/models/HttpResponse.d.ts.map +1 -0
- package/dist-amd/models/HttpResponse.js +11 -0
- package/dist-amd/models/IOdataResponse.d.ts +6 -0
- package/dist-amd/models/IOdataResponse.d.ts.map +1 -0
- package/dist-amd/models/IOdataResponse.js +4 -0
- package/dist-amd/models/LocalStorage.d.ts +9 -0
- package/dist-amd/models/LocalStorage.d.ts.map +1 -0
- package/dist-amd/models/LocalStorage.js +55 -0
- package/dist-amd/models/OdataError.d.ts +56 -0
- package/dist-amd/models/OdataError.d.ts.map +1 -0
- package/dist-amd/models/OdataError.js +90 -0
- package/dist-amd/models/ProblemDetails.d.ts +23 -0
- package/dist-amd/models/ProblemDetails.d.ts.map +1 -0
- package/dist-amd/models/ProblemDetails.js +39 -0
- package/dist-amd/models/Session.d.ts +19 -0
- package/dist-amd/models/Session.d.ts.map +1 -0
- package/dist-amd/models/Session.js +11 -0
- package/dist-amd/models/UserInfo.d.ts +33 -0
- package/dist-amd/models/UserInfo.d.ts.map +1 -0
- package/dist-amd/models/UserInfo.js +11 -0
- package/dist-amd/models/ValidationProblemDetails.d.ts +19 -0
- package/dist-amd/models/ValidationProblemDetails.d.ts.map +1 -0
- package/dist-amd/models/ValidationProblemDetails.js +43 -0
- package/dist-amd/models/Version.d.ts +35 -0
- package/dist-amd/models/Version.d.ts.map +1 -0
- package/dist-amd/models/Version.js +187 -0
- package/dist-amd/models/enums/HeadersContentTypeEnum.d.ts +15 -0
- package/dist-amd/models/enums/HeadersContentTypeEnum.d.ts.map +1 -0
- package/dist-amd/models/enums/HeadersContentTypeEnum.js +19 -0
- package/dist-amd/models/enums/StorageTypeEnum.d.ts +5 -0
- package/dist-amd/models/enums/StorageTypeEnum.d.ts.map +1 -0
- package/dist-amd/models/enums/StorageTypeEnum.js +10 -0
- package/dist-amd/models/interfaces/IAppEngineConfiguration.d.ts +24 -0
- package/dist-amd/models/interfaces/IAppEngineConfiguration.d.ts.map +1 -0
- package/dist-amd/models/interfaces/IAppEngineConfiguration.js +4 -0
- package/dist-amd/models/interfaces/IAppEngineException.d.ts +57 -0
- package/dist-amd/models/interfaces/IAppEngineException.d.ts.map +1 -0
- package/dist-amd/models/interfaces/IAppEngineException.js +4 -0
- package/dist-amd/models/interfaces/IDocumentedException.d.ts +60 -0
- package/dist-amd/models/interfaces/IDocumentedException.d.ts.map +1 -0
- package/dist-amd/models/interfaces/IDocumentedException.js +4 -0
- package/dist-amd/models/interfaces/IHttpResponse.d.ts +5 -0
- package/dist-amd/models/interfaces/IHttpResponse.d.ts.map +1 -0
- package/dist-amd/models/interfaces/IHttpResponse.js +4 -0
- package/dist-amd/models/interfaces/IOdataError.d.ts +182 -0
- package/dist-amd/models/interfaces/IOdataError.d.ts.map +1 -0
- package/dist-amd/models/interfaces/IOdataError.js +4 -0
- package/dist-amd/models/interfaces/IProblemDetails.d.ts +93 -0
- package/dist-amd/models/interfaces/IProblemDetails.d.ts.map +1 -0
- package/dist-amd/models/interfaces/IProblemDetails.js +4 -0
- package/dist-amd/models/interfaces/IValidationProblemDetails.d.ts +82 -0
- package/dist-amd/models/interfaces/IValidationProblemDetails.d.ts.map +1 -0
- package/dist-amd/models/interfaces/IValidationProblemDetails.js +4 -0
- package/dist-ui5/resources/computec/appengine/uibase/.library +1 -1
- package/dist-ui5/resources/computec/appengine/uibase/helpers/WebClientNavigationHelper-dbg.js +100 -0
- package/dist-ui5/resources/computec/appengine/uibase/helpers/WebClientNavigationHelper.js +2 -0
- package/dist-ui5/resources/computec/appengine/uibase/helpers/WebClientNavigationHelper.js.map +1 -0
- package/dist-ui5/resources/computec/appengine/uibase/index-dbg.js +3 -1
- package/dist-ui5/resources/computec/appengine/uibase/index.js +1 -1
- package/dist-ui5/resources/computec/appengine/uibase/index.js.map +1 -1
- package/dist-ui5/resources/computec/appengine/uibase/library-dbg.js +1 -1
- package/dist-ui5/resources/computec/appengine/uibase/library-preload.js +6 -3
- package/dist-ui5/resources/computec/appengine/uibase/library-preload.js.map +1 -1
- package/dist-ui5/resources/computec/appengine/uibase/library.js +1 -1
- package/dist-ui5/resources/computec/appengine/uibase/library.js.map +1 -1
- package/dist-ui5/resources/computec/appengine/uibase/manifest.json +1 -1
- package/package.json +2 -1
package/dist/index.d.ts
CHANGED
|
@@ -7,6 +7,8 @@ export { default as ErrorHelper } from './helpers/ErrorHelper';
|
|
|
7
7
|
export * from './helpers/ErrorHelper';
|
|
8
8
|
export { default as HttpClientHelper } from './helpers/HttpClientHelper';
|
|
9
9
|
export * from './helpers/HttpClientHelper';
|
|
10
|
+
export { default as WebClientNavigationHelper } from './helpers/WebClientNavigationHelper';
|
|
11
|
+
export * from './helpers/WebClientNavigationHelper';
|
|
10
12
|
export { default as AppEngineConfiguration } from './models/AppEngineConfiguration';
|
|
11
13
|
export * from './models/AppEngineConfiguration';
|
|
12
14
|
export { default as AppEngineException } from './models/AppEngineException';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACnE,cAAc,4BAA4B,CAAC;AAC3C,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;AAC3F,cAAc,wCAAwC,CAAC;AACvD,cAAc,wCAAwC,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAC/D,cAAc,uBAAuB,CAAC;AACtC,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACzE,cAAc,4BAA4B,CAAC;AAC3C,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACpF,cAAc,iCAAiC,CAAC;AAChD,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAC5E,cAAc,6BAA6B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,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACxD,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACtD,cAAc,kBAAkB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -17,7 +17,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
17
17
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
18
|
};
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.Version = exports.UserInfo = exports.Session = exports.LocalStorage = exports.HeadersContentTypeEnum = exports.CompanyInfo = exports.BaseBusinessObject = exports.DocumentedException = exports.AppEngineException = exports.AppEngineConfiguration = exports.HttpClientHelper = exports.ErrorHelper = exports.HttpClientCacheOptions = exports.HttpClient = void 0;
|
|
20
|
+
exports.Version = exports.UserInfo = exports.Session = exports.LocalStorage = exports.HeadersContentTypeEnum = exports.CompanyInfo = exports.BaseBusinessObject = exports.DocumentedException = exports.AppEngineException = exports.AppEngineConfiguration = exports.WebClientNavigationHelper = exports.HttpClientHelper = exports.ErrorHelper = exports.HttpClientCacheOptions = exports.HttpClient = void 0;
|
|
21
21
|
var HttpClient_1 = require("./communication/HttpClient");
|
|
22
22
|
Object.defineProperty(exports, "HttpClient", { enumerable: true, get: function () { return __importDefault(HttpClient_1).default; } });
|
|
23
23
|
__exportStar(require("./communication/HttpClient"), exports);
|
|
@@ -31,6 +31,9 @@ __exportStar(require("./helpers/ErrorHelper"), exports);
|
|
|
31
31
|
var HttpClientHelper_1 = require("./helpers/HttpClientHelper");
|
|
32
32
|
Object.defineProperty(exports, "HttpClientHelper", { enumerable: true, get: function () { return __importDefault(HttpClientHelper_1).default; } });
|
|
33
33
|
__exportStar(require("./helpers/HttpClientHelper"), exports);
|
|
34
|
+
var WebClientNavigationHelper_1 = require("./helpers/WebClientNavigationHelper");
|
|
35
|
+
Object.defineProperty(exports, "WebClientNavigationHelper", { enumerable: true, get: function () { return __importDefault(WebClientNavigationHelper_1).default; } });
|
|
36
|
+
__exportStar(require("./helpers/WebClientNavigationHelper"), exports);
|
|
34
37
|
var AppEngineConfiguration_1 = require("./models/AppEngineConfiguration");
|
|
35
38
|
Object.defineProperty(exports, "AppEngineConfiguration", { enumerable: true, get: function () { return __importDefault(AppEngineConfiguration_1).default; } });
|
|
36
39
|
__exportStar(require("./models/AppEngineConfiguration"), exports);
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @name ConnectionOptions
|
|
3
|
+
* ConnectionOptions is used to configure the connection to the server.
|
|
4
|
+
*/
|
|
5
|
+
declare class ConnectionOptions {
|
|
6
|
+
/**
|
|
7
|
+
* The root path for the connection. If not provided default is `${window.location.origin}/tnc`.
|
|
8
|
+
*/
|
|
9
|
+
rootPath?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Indicates whether to use a shared connection. False by default
|
|
12
|
+
*/
|
|
13
|
+
useSharedConnection?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Indicates whether to automatically connect to the server. True by default. If true connection is made after creagin the object.
|
|
16
|
+
*/
|
|
17
|
+
autoConnect?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Indicates whether to automatically reconnect to the server.
|
|
20
|
+
*/
|
|
21
|
+
autoReconnect?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* The interval or intervals (in milliseconds) at which to attempt auto reconnection.
|
|
24
|
+
*/
|
|
25
|
+
autoReconnectInterval?: number | number[];
|
|
26
|
+
/**
|
|
27
|
+
* The retry policy for auto reconnection. If policy is provided, autoReconnectInterval is ignored.
|
|
28
|
+
*/
|
|
29
|
+
autoReconnectPolicy?: signalR.IRetryPolicy;
|
|
30
|
+
/**
|
|
31
|
+
* The interval (in milliseconds) at which to send keep-alive messages to the server.
|
|
32
|
+
*/
|
|
33
|
+
keepAliveIntervalInMilliseconds?: number;
|
|
34
|
+
/**
|
|
35
|
+
* The timeout (in milliseconds) for server responses.
|
|
36
|
+
*/
|
|
37
|
+
serverTimeoutInMilliseconds?: number;
|
|
38
|
+
/**
|
|
39
|
+
* The Company Api Key used for authentication
|
|
40
|
+
*/
|
|
41
|
+
companyApiKey?: string;
|
|
42
|
+
/**
|
|
43
|
+
* The Company id used for authentication
|
|
44
|
+
*/
|
|
45
|
+
companyId?: string;
|
|
46
|
+
}
|
|
47
|
+
export default ConnectionOptions;
|
|
48
|
+
//# sourceMappingURL=ConnectionOptions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConnectionOptions.d.ts","sourceRoot":"","sources":["../../src/communication/ConnectionOptions.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,cAAM,iBAAiB;IACtB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAE9B;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,qBAAqB,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAE1C;;OAEG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC;IAE3C;;OAEG;IACH,+BAA+B,CAAC,EAAE,MAAM,CAAC;IAEzC;;OAEG;IACH,2BAA2B,CAAC,EAAE,MAAM,CAAC;IAErC;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,eAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
define(["require", "exports"], function (require, exports) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
/**
|
|
5
|
+
* @name ConnectionOptions
|
|
6
|
+
* ConnectionOptions is used to configure the connection to the server.
|
|
7
|
+
*/
|
|
8
|
+
class ConnectionOptions {
|
|
9
|
+
}
|
|
10
|
+
exports.default = ConnectionOptions;
|
|
11
|
+
});
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
import { IBasicHttpRequest, IGetHttpClientOptions, IBaseHttpClientOptions } from "./IBaseHttpClientOptions";
|
|
2
|
+
/**
|
|
3
|
+
* @class
|
|
4
|
+
* @description This class is used to make requests to the server. It is a wrapper for the jQuery.ajax method.
|
|
5
|
+
* @method request - This method is used to make a other requests to the server. Remember, that you should use the other methods of this class instead of this method. This is the 2nd version of the request method. The first version is in the {@link Http}.
|
|
6
|
+
* @method get - This method is used to make a GET request to the server.
|
|
7
|
+
* @method getCache - This method is used to make a GET request to the server.
|
|
8
|
+
* @method post - This method is used to make a POST request to the server.
|
|
9
|
+
* @method postJSON - This method is used to make a POST request to the server with a JSON body.
|
|
10
|
+
* @method postFile - This method is used to make a POST request to the server with a file.
|
|
11
|
+
* @method put - This method is used to make a PUT request to the server.
|
|
12
|
+
* @method putJSON - This method is used to make a PUT request to the server with a JSON body.
|
|
13
|
+
* @method patch - This method is used to make a PATCH request to the server.
|
|
14
|
+
* @method patchJSON - This method is used to make a PATCH request to the server with a JSON body.
|
|
15
|
+
* @method remove - This method is used to make a DELETE request to the server.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
*
|
|
19
|
+
* import HttpClient from 'computec/appengine/uicore/communication/HttpClient';
|
|
20
|
+
*
|
|
21
|
+
* const getProduct = async () => {
|
|
22
|
+
* const data = await HttpClient.get({
|
|
23
|
+
* url: "odata/odata.svc/Products",
|
|
24
|
+
* useCache: true
|
|
25
|
+
* });
|
|
26
|
+
*
|
|
27
|
+
* return data;
|
|
28
|
+
* }u
|
|
29
|
+
*
|
|
30
|
+
* const createProduct = () => {
|
|
31
|
+
* return HttpClient.postJSON({
|
|
32
|
+
* url: "odata/odata.svc/Products",
|
|
33
|
+
* data: {
|
|
34
|
+
* Name: "Test"
|
|
35
|
+
* }
|
|
36
|
+
* });
|
|
37
|
+
* }
|
|
38
|
+
*/
|
|
39
|
+
export default class HttpClient {
|
|
40
|
+
/**
|
|
41
|
+
* @memberof computec.appengine.uicore.communication.HttpClient
|
|
42
|
+
* @static
|
|
43
|
+
* @public
|
|
44
|
+
* @description This method is used to clear the cache from service worker.
|
|
45
|
+
* @example
|
|
46
|
+
* import HttpClient from 'computec/appengine/uicore/communication/HttpClient';
|
|
47
|
+
*
|
|
48
|
+
* HttpClient.clearCache();
|
|
49
|
+
*/
|
|
50
|
+
static clearCache(): void;
|
|
51
|
+
/**
|
|
52
|
+
* @obsolete Use cacheControl with refresh option instead
|
|
53
|
+
* @memberof computec.appengine.uicore.communication.HttpClient
|
|
54
|
+
* @static
|
|
55
|
+
* @public
|
|
56
|
+
* @description This method is used to remove a specific url from the cache.
|
|
57
|
+
* @param {string} url - The url to remove from the cache.
|
|
58
|
+
* @example
|
|
59
|
+
* import HttpClient from 'computec/appengine/uicore/communication/HttpClient';
|
|
60
|
+
*
|
|
61
|
+
* HttpClient.removeCache("odata/odata.svc/Products");
|
|
62
|
+
*/
|
|
63
|
+
static removeCache(url: string): void;
|
|
64
|
+
/**
|
|
65
|
+
* @memberof computec.appengine.uicore.communication.HttpClient
|
|
66
|
+
* @static
|
|
67
|
+
* @public
|
|
68
|
+
* @async
|
|
69
|
+
* @description This method is used to make a other requests to the server. Remember, that you should use the other methods of this class instead of this method.
|
|
70
|
+
* @param {IBasicHttpRequest} options - The options for the request.
|
|
71
|
+
* @param {boolean} failHandling - If true, the request will be handled as a failure.
|
|
72
|
+
* @param {boolean} handleBusy - If true, the request will be handled as a busy request.
|
|
73
|
+
* @param {boolean} includeResponse - If true, the full response will be returned and data (HttpResponse<T>) will be in the "data" property.
|
|
74
|
+
* @param {MBusyIndicator} busyIndicator - The busy indicator to show.
|
|
75
|
+
* @returns {Promise<T>} - The response of the request.
|
|
76
|
+
* @example
|
|
77
|
+
* import HttpClient from 'computec/appengine/uicore/communication/HttpClient';
|
|
78
|
+
*
|
|
79
|
+
* const getProduct = async () => {
|
|
80
|
+
* const data = await HttpClient.request({
|
|
81
|
+
* url: "odata/odata.svc/Products",
|
|
82
|
+
* method: "GET",
|
|
83
|
+
* headers: {
|
|
84
|
+
* "Content-Type": "application/json"
|
|
85
|
+
* Accepted: "application/json"
|
|
86
|
+
* },
|
|
87
|
+
* busyIndicator: this.getView().byId("busyIndicator")
|
|
88
|
+
* });
|
|
89
|
+
*
|
|
90
|
+
* return data;
|
|
91
|
+
* }
|
|
92
|
+
*
|
|
93
|
+
* void getProduct();
|
|
94
|
+
*/
|
|
95
|
+
static request<T>(options?: IBasicHttpRequest): Promise<T>;
|
|
96
|
+
/**
|
|
97
|
+
*
|
|
98
|
+
* @description get request. You can set options to the request. You can also choose if you want to use local cache. If data is already in cache, it will be returned from cache. Otherwise it will be requested from server and cached. Remember to use "useCache" when you know, that data is not changable.
|
|
99
|
+
* @see {@link IGetHttpClientOptions}
|
|
100
|
+
* @param url url
|
|
101
|
+
* @param options options
|
|
102
|
+
* @param options.headers by default Content-Type: "application/json", Accepted: "json"
|
|
103
|
+
* @param options.useCache This is a boolean value. If true, the data will be cached. If data is already in cache, it will be returned from cache. Otherwise it will be requested from server and cached. Remember to use "useCache" when you know, that data is not changable.
|
|
104
|
+
* @returns {T}
|
|
105
|
+
* @memberof HttpClient
|
|
106
|
+
* @static
|
|
107
|
+
* @example
|
|
108
|
+
* import HttpClient from "computec/appengine/uicore/model/Http";
|
|
109
|
+
*
|
|
110
|
+
* console.log("get account from server, without cache");
|
|
111
|
+
* const getAccounts = async () => {
|
|
112
|
+
* const account = await Http.get<IAccount>(`/api/Account/${id}`);
|
|
113
|
+
* return account;
|
|
114
|
+
* }
|
|
115
|
+
*
|
|
116
|
+
* @example
|
|
117
|
+
* import HttpClient from "computec/appengine/uicore/model/Http";
|
|
118
|
+
*
|
|
119
|
+
* console.log("get account from cache");
|
|
120
|
+
* const getAccounts = async () => {
|
|
121
|
+
* const account = await Http.get<IAccount>(`/api/Account/${id}`, {useCache: true});
|
|
122
|
+
* return account;
|
|
123
|
+
* }
|
|
124
|
+
*
|
|
125
|
+
*/
|
|
126
|
+
static get<T>(url: string, options?: IGetHttpClientOptions): Promise<T>;
|
|
127
|
+
/**
|
|
128
|
+
*
|
|
129
|
+
* @description get request with cache as true. You can set options to the request. If data is already in cache, it will be returned from cache. Otherwise it will be requested from server and cached. Remember to use "useCache" when you know, that data is not changable.
|
|
130
|
+
* @see {@link IGetHttpClientOptions}
|
|
131
|
+
* @param url url
|
|
132
|
+
* @param options options
|
|
133
|
+
* @param options.headers by default Content-Type: "application/json", Accepted: "json"
|
|
134
|
+
* @returns {T}
|
|
135
|
+
* @memberof HttpClient
|
|
136
|
+
* @static
|
|
137
|
+
*
|
|
138
|
+
* @example
|
|
139
|
+
* import HttpClient from "computec/appengine/uicore/model/Http";
|
|
140
|
+
*
|
|
141
|
+
* console.log("get account from cache");
|
|
142
|
+
* const getAccounts = async () => {
|
|
143
|
+
* const account = await Http.getCache<IAccount>(`/api/Account/${id}`, {useCache: true});
|
|
144
|
+
* return account;
|
|
145
|
+
* }
|
|
146
|
+
*
|
|
147
|
+
*/
|
|
148
|
+
static getCache<T>(url: string, options?: IGetHttpClientOptions): Promise<T>;
|
|
149
|
+
/**
|
|
150
|
+
* @description post request. You can set options to the request. {@link IBaseHttpClientOptions}
|
|
151
|
+
* @param data data
|
|
152
|
+
* @param url url
|
|
153
|
+
* @param options options
|
|
154
|
+
* @param options.headers by default {Content-Type: "application/json", Accepted: "json"}
|
|
155
|
+
* @returns {T} value. It depends from server response
|
|
156
|
+
*
|
|
157
|
+
* @example
|
|
158
|
+
* import HttpClient from "computec/appengine/uicore/model/Http";
|
|
159
|
+
*
|
|
160
|
+
* console.log("post account to server");
|
|
161
|
+
* const postAccount = async () => {
|
|
162
|
+
* const dataInJSON = JSON.stringify({name: "test"});
|
|
163
|
+
* const account = await Http.post<IAccount>(`/api/Account`, dataInJSON);
|
|
164
|
+
* return account;
|
|
165
|
+
* }
|
|
166
|
+
*/
|
|
167
|
+
static post<T>(data: string, url: string, options?: IBaseHttpClientOptions): Promise<T>;
|
|
168
|
+
/**
|
|
169
|
+
* @description post request with JSON data. You can set options to the request. {@link IBaseHttpClientOptions}
|
|
170
|
+
* @param data data
|
|
171
|
+
* @param url url
|
|
172
|
+
* @param options options
|
|
173
|
+
* @returns {T} value. It depends from server response
|
|
174
|
+
*
|
|
175
|
+
* @example
|
|
176
|
+
* import HttpClient from "computec/appengine/uicore/model/Http";
|
|
177
|
+
*
|
|
178
|
+
* console.log("post account to server");
|
|
179
|
+
* const postAccount = async () => {
|
|
180
|
+
* const account = await Http.postJSON<IAccount>(`/api/Account`, {name: "test"});
|
|
181
|
+
* return account;
|
|
182
|
+
* }
|
|
183
|
+
*
|
|
184
|
+
*/
|
|
185
|
+
static postJSON<T>(data: object, url: string, options?: IBaseHttpClientOptions): Promise<T>;
|
|
186
|
+
/**
|
|
187
|
+
* @description post request with File as data. You can set options to the request. {@link IBaseHttpClientOptions}
|
|
188
|
+
* @param data - file that will be send to server
|
|
189
|
+
* @param url url
|
|
190
|
+
* @param options options
|
|
191
|
+
* @param options.headers by default {Content-Type: "application/json", Accepted: "json"}
|
|
192
|
+
* @returns {T} value. It depends from server response
|
|
193
|
+
*
|
|
194
|
+
* @example
|
|
195
|
+
* import HttpClient from "computec/appengine/uicore/model/Http";
|
|
196
|
+
*
|
|
197
|
+
* console.log("send attachment to server");
|
|
198
|
+
* const setAttachment = async (file: File) => {
|
|
199
|
+
* const isPicture = file.type.includes("image").toString();
|
|
200
|
+
* const data = await HttpClient.postFile<IAttachment[]>(file, `api/Attachments/SetAttachment/${isPicture}/true`);
|
|
201
|
+
* return data[0];
|
|
202
|
+
* }
|
|
203
|
+
*
|
|
204
|
+
*/
|
|
205
|
+
static postFile<T>(data: File, url: string, options?: IBaseHttpClientOptions): Promise<T>;
|
|
206
|
+
/**
|
|
207
|
+
* @description put request. You can set options to the request. {@link IBaseHttpClientOptions}
|
|
208
|
+
* @param data data
|
|
209
|
+
* @param url url
|
|
210
|
+
* @param options options
|
|
211
|
+
* @param options.headers by default {Content-Type: "application/json", Accepted: "json"}
|
|
212
|
+
* @returns {T} value. It depends from server response
|
|
213
|
+
*/
|
|
214
|
+
static put<T>(data: string, url: string, options?: IBaseHttpClientOptions): Promise<T>;
|
|
215
|
+
/**
|
|
216
|
+
* @description put request with JSON data. You can set options to the request. {@link IBaseHttpClientOptions}
|
|
217
|
+
* @param data data
|
|
218
|
+
* @param url url
|
|
219
|
+
* @param options options
|
|
220
|
+
* @returns {T} value. It depends from server response
|
|
221
|
+
*/
|
|
222
|
+
static putJSON<T>(data: object, url: string, options?: IBaseHttpClientOptions): Promise<T>;
|
|
223
|
+
/**
|
|
224
|
+
* @description patch request. You can set options to the request. {@link IBaseHttpClientOptions}
|
|
225
|
+
* @param data data
|
|
226
|
+
* @param url url
|
|
227
|
+
* @param options options
|
|
228
|
+
* @param options.headers by default {Content-Type: "application/json", Accepted: "json"}
|
|
229
|
+
* @returns {T} value. It depends from server response
|
|
230
|
+
*/
|
|
231
|
+
static patch<T>(data: string, url: string, options?: IBaseHttpClientOptions): Promise<T>;
|
|
232
|
+
/**
|
|
233
|
+
* @description patch request with JSON data. You can set options to the request. {@link IBaseHttpClientOptions}
|
|
234
|
+
* @param data data
|
|
235
|
+
* @param url url
|
|
236
|
+
* @param options options
|
|
237
|
+
* @returns {T} value. It depends from server response
|
|
238
|
+
*/
|
|
239
|
+
static patchJSON<T>(data: object, url: string, options?: IBaseHttpClientOptions): Promise<T>;
|
|
240
|
+
/**
|
|
241
|
+
* @description delete request. You can set options to the request. {@link IBaseHttpClientOptions}
|
|
242
|
+
* @param url url
|
|
243
|
+
* @param contentType by default "application/json"
|
|
244
|
+
* @returns {T} value. It depends from server response
|
|
245
|
+
*/
|
|
246
|
+
static remove<T>(url: string, options?: IBaseHttpClientOptions): Promise<T>;
|
|
247
|
+
private static _appendToHeaders;
|
|
248
|
+
}
|
|
249
|
+
//# sourceMappingURL=HttpClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HttpClient.d.ts","sourceRoot":"","sources":["../../src/communication/HttpClient.ts"],"names":[],"mappings":"AAMA,OAAO,EACN,iBAAiB,EACjB,qBAAqB,EACrB,sBAAsB,EACtB,MAAM,0BAA0B,CAAC;AAGlC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,MAAM,CAAC,OAAO,OAAO,UAAU;IAE9B;;;;;;;;;OASG;WACW,UAAU;IAUxB;;;;;;;;;;;OAWG;WACW,WAAW,CAAC,GAAG,EAAE,MAAM;IAIrC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;WACiB,OAAO,CAAC,CAAC,EAAE,OAAO,GAAE,iBAAsB,GAAG,OAAO,CAAC,CAAC,CAAC;IAwC3E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;WACW,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,GAAE,qBAA0B;IAWrE;;;;;;;;;;;;;;;;;;;;OAoBG;WACW,QAAQ,CAAC,CAAC,EACvB,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,qBAER;IAKF;;;;;;;;;;;;;;;;;OAiBG;WACW,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,GAAE,sBAA2B;IASrF;;;;;;;;;;;;;;;;OAgBG;WACW,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,GAAE,sBAA2B;IASzF;;;;;;;;;;;;;;;;;;OAkBG;WACW,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,GAAE,sBAA2B;IAcvF;;;;;;;OAOG;WACW,GAAG,CAAC,CAAC,EA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