@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
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interface for AppEngine-specific exceptions that provide structured error information.
|
|
3
|
+
* This interface defines the contract for exceptions thrown by the AppEngine system,
|
|
4
|
+
* following the RFC 7807 Problem Details specification with Title and Detail properties.
|
|
5
|
+
*
|
|
6
|
+
* AppEngineExceptions are typically used for business logic errors, validation failures,
|
|
7
|
+
* and other application-specific error conditions that need to be communicated to the UI
|
|
8
|
+
* with clear, user-friendly information.
|
|
9
|
+
*
|
|
10
|
+
* This interface is designed to work with C# backend services that implement
|
|
11
|
+
* the ProblemDetails standard for consistent error reporting across the application.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
15
|
+
* const exception: IAppEngineException = {
|
|
16
|
+
* Title: "Validation Error",
|
|
17
|
+
* Detail: "The provided email address is not in a valid format"
|
|
18
|
+
* };
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```typescript
|
|
23
|
+
* // Business logic error
|
|
24
|
+
* const businessError: IAppEngineException = {
|
|
25
|
+
* Title: "Operation Not Allowed",
|
|
26
|
+
* Detail: "Cannot delete a customer that has active orders"
|
|
27
|
+
* };
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export default interface IAppEngineException {
|
|
31
|
+
/**
|
|
32
|
+
* A short, human-readable summary of the problem.
|
|
33
|
+
* This should be a brief title that describes the general nature of the error
|
|
34
|
+
* without including instance-specific details.
|
|
35
|
+
*
|
|
36
|
+
* The title should be suitable for display in error dialogs, notifications,
|
|
37
|
+
* or as a heading for more detailed error information.
|
|
38
|
+
*
|
|
39
|
+
* @example "Validation Error", "Authorization Failed", "Resource Not Found"
|
|
40
|
+
* @example "Operation Not Allowed", "Configuration Error", "Service Unavailable"
|
|
41
|
+
*/
|
|
42
|
+
Title: string;
|
|
43
|
+
/**
|
|
44
|
+
* A human-readable explanation specific to this occurrence of the problem.
|
|
45
|
+
* This should provide detailed information about what went wrong and,
|
|
46
|
+
* when possible, guidance on how to resolve the issue.
|
|
47
|
+
*
|
|
48
|
+
* The detail should be informative enough for users or developers to understand
|
|
49
|
+
* the specific error condition and take appropriate action.
|
|
50
|
+
*
|
|
51
|
+
* @example "The email field must contain a valid email address format"
|
|
52
|
+
* @example "You do not have permission to access this resource. Please contact your administrator."
|
|
53
|
+
* @example "The customer cannot be deleted because they have 3 active orders. Please cancel or complete the orders first."
|
|
54
|
+
*/
|
|
55
|
+
Detail: string;
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=IAppEngineException.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IAppEngineException.d.ts","sourceRoot":"","sources":["../../../src/models/interfaces/IAppEngineException.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,CAAC,OAAO,WAAW,mBAAmB;IAC3C;;;;;;;;;;OAUG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;;;;;;;;;OAWG;IACH,MAAM,EAAE,MAAM,CAAC;CACf"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interface for AppEngine-specific exceptions that provide structured error information.
|
|
3
|
+
* This interface defines the contract for exceptions thrown by the AppEngine system,
|
|
4
|
+
* following the RFC 7807 Problem Details specification with Title and Detail properties.
|
|
5
|
+
*
|
|
6
|
+
* AppEngineExceptions are typically used for business logic errors, validation failures,
|
|
7
|
+
* and other application-specific error conditions that need to be communicated to the UI
|
|
8
|
+
* with clear, user-friendly information.
|
|
9
|
+
*
|
|
10
|
+
* This interface is designed to work with C# backend services that implement
|
|
11
|
+
* the ProblemDetails standard for consistent error reporting across the application.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
15
|
+
* const exception: IAppEngineException = {
|
|
16
|
+
* title: "Validation Error",
|
|
17
|
+
* detail: "The provided email address is not in a valid format",
|
|
18
|
+
* documentationUrl: "https://learn.computec.one"
|
|
19
|
+
* };
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```typescript
|
|
24
|
+
* // Business logic error
|
|
25
|
+
* const businessError: IAppEngineException = {
|
|
26
|
+
* title: "Operation Not Allowed",
|
|
27
|
+
* detail: "Cannot delete a customer that has active orders",
|
|
28
|
+
* documentationUrl: "https://learn.computec.one"
|
|
29
|
+
* };
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export default interface IDocumentedException {
|
|
33
|
+
/**
|
|
34
|
+
* A short, human-readable summary of the problem.
|
|
35
|
+
* This should be a brief title that describes the general nature of the error
|
|
36
|
+
* without including instance-specific details.
|
|
37
|
+
*
|
|
38
|
+
* The title should be suitable for display in error dialogs, notifications,
|
|
39
|
+
* or as a heading for more detailed error information.
|
|
40
|
+
*
|
|
41
|
+
* @example "Validation Error", "Authorization Failed", "Resource Not Found"
|
|
42
|
+
* @example "Operation Not Allowed", "Configuration Error", "Service Unavailable"
|
|
43
|
+
*/
|
|
44
|
+
title: string;
|
|
45
|
+
/**
|
|
46
|
+
* A human-readable explanation specific to this occurrence of the problem.
|
|
47
|
+
* This should provide detailed information about what went wrong and,
|
|
48
|
+
* when possible, guidance on how to resolve the issue.
|
|
49
|
+
*
|
|
50
|
+
* The detail should be informative enough for users or developers to understand
|
|
51
|
+
* the specific error condition and take appropriate action.
|
|
52
|
+
*
|
|
53
|
+
* @example "The email field must contain a valid email address format"
|
|
54
|
+
* @example "You do not have permission to access this resource. Please contact your administrator."
|
|
55
|
+
* @example "The customer cannot be deleted because they have 3 active orders. Please cancel or complete the orders first."
|
|
56
|
+
*/
|
|
57
|
+
detail: string;
|
|
58
|
+
documentationUrl: string;
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=IDocumentedException.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IDocumentedException.d.ts","sourceRoot":"","sources":["../../../src/models/interfaces/IDocumentedException.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAM,CAAC,OAAO,WAAW,oBAAoB;IAC5C;;;;;;;;;;OAUG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;;;;;;;;;OAWG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf,gBAAgB,EAAE,MAAM,CAAC;CACzB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IHttpResponse.d.ts","sourceRoot":"","sources":["../../../src/models/interfaces/IHttpResponse.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa,CAAC,CAAC;IAC/B,IAAI,EAAE,CAAC,CAAC;IACR,QAAQ,EAAE,QAAQ,CAAC;CACnB"}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a detailed error entry within an OData error response.
|
|
3
|
+
* Each detail provides specific information about individual validation errors
|
|
4
|
+
* or issues that occurred during the operation.
|
|
5
|
+
*
|
|
6
|
+
* This follows the OData v4 specification for error detail structures,
|
|
7
|
+
* commonly used in C# Web API and Entity Framework OData implementations.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* const detail: IODataErrorDetail = {
|
|
12
|
+
* code: "FIELD_REQUIRED",
|
|
13
|
+
* message: "The Name field is required",
|
|
14
|
+
* target: "Name"
|
|
15
|
+
* };
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export interface IODataErrorDetail {
|
|
19
|
+
/**
|
|
20
|
+
* The error code specific to this detail.
|
|
21
|
+
* Typically represents a validation rule or specific error type.
|
|
22
|
+
*
|
|
23
|
+
* @example "FIELD_REQUIRED", "INVALID_FORMAT", "VALUE_OUT_OF_RANGE"
|
|
24
|
+
*/
|
|
25
|
+
code?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Human-readable description of the specific error.
|
|
28
|
+
* Should provide clear information about what went wrong.
|
|
29
|
+
*
|
|
30
|
+
* @example "The Name field is required", "Invalid email format"
|
|
31
|
+
*/
|
|
32
|
+
message?: string;
|
|
33
|
+
/**
|
|
34
|
+
* The target field, property, or parameter that caused this error.
|
|
35
|
+
* Helps identify which specific input or data element has the issue.
|
|
36
|
+
*
|
|
37
|
+
* @example "Name", "Email", "User.Address.PostalCode"
|
|
38
|
+
*/
|
|
39
|
+
target?: string;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Represents the inner error structure containing technical debugging information.
|
|
43
|
+
* This is typically populated by C# backend services and contains detailed
|
|
44
|
+
* technical information useful for developers and system administrators.
|
|
45
|
+
*
|
|
46
|
+
* Inner errors can be nested to represent a chain of exceptions that led
|
|
47
|
+
* to the final error condition.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```typescript
|
|
51
|
+
* const innerError: IODataInnerError = {
|
|
52
|
+
* message: "Object reference not set to an instance of an object",
|
|
53
|
+
* type: "System.NullReferenceException",
|
|
54
|
+
* stacktrace: "at MyService.ProcessData()...",
|
|
55
|
+
* innererror: {
|
|
56
|
+
* message: "Connection timeout",
|
|
57
|
+
* type: "System.TimeoutException"
|
|
58
|
+
* }
|
|
59
|
+
* };
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
export interface IODataInnerError {
|
|
63
|
+
/**
|
|
64
|
+
* The technical error message from the underlying exception.
|
|
65
|
+
* Usually contains the actual exception message from the C# backend.
|
|
66
|
+
*
|
|
67
|
+
* @example "Object reference not set to an instance of an object"
|
|
68
|
+
*/
|
|
69
|
+
message?: string;
|
|
70
|
+
/**
|
|
71
|
+
* The .NET type name of the exception that occurred.
|
|
72
|
+
* Useful for developers to understand the specific exception type.
|
|
73
|
+
*
|
|
74
|
+
* @example "System.NullReferenceException", "System.ArgumentException"
|
|
75
|
+
*/
|
|
76
|
+
type?: string;
|
|
77
|
+
/**
|
|
78
|
+
* The full stack trace from the C# exception.
|
|
79
|
+
* Contains detailed information about where the error occurred in the code.
|
|
80
|
+
*
|
|
81
|
+
* @example "at MyNamespace.MyClass.MyMethod() in C:\\Source\\MyFile.cs:line 42"
|
|
82
|
+
*/
|
|
83
|
+
stacktrace?: string;
|
|
84
|
+
/**
|
|
85
|
+
* Nested inner error for chained exceptions.
|
|
86
|
+
* Allows representation of exception chains where one exception caused another.
|
|
87
|
+
*
|
|
88
|
+
* @example When a database timeout causes a business logic exception
|
|
89
|
+
*/
|
|
90
|
+
innererror?: IODataInnerError;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Represents the core error object structure within an OData error response.
|
|
94
|
+
* This contains the primary error information including code, message, details,
|
|
95
|
+
* and optional inner error data.
|
|
96
|
+
*
|
|
97
|
+
* This interface is designed to match the OData v4 error format specification
|
|
98
|
+
* and is typically implemented by C# Web API services using Entity Framework
|
|
99
|
+
* or ASP.NET Core OData middleware.
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
* ```typescript
|
|
103
|
+
* const errorObject: IOdataErrorObject = {
|
|
104
|
+
* code: "VALIDATION_FAILED",
|
|
105
|
+
* message: "One or more validation errors occurred",
|
|
106
|
+
* details: [
|
|
107
|
+
* { code: "REQUIRED", message: "Name is required", target: "Name" }
|
|
108
|
+
* ],
|
|
109
|
+
* innererror: {
|
|
110
|
+
* type: "ValidationException",
|
|
111
|
+
* message: "Validation failed for entity"
|
|
112
|
+
* }
|
|
113
|
+
* };
|
|
114
|
+
* ```
|
|
115
|
+
*/
|
|
116
|
+
export interface IOdataErrorObject {
|
|
117
|
+
/**
|
|
118
|
+
* The primary error code identifying the type of error.
|
|
119
|
+
* Represents the main category or type of error that occurred.
|
|
120
|
+
*
|
|
121
|
+
* @example "VALIDATION_FAILED", "UNAUTHORIZED", "NOT_FOUND", "INTERNAL_ERROR"
|
|
122
|
+
*/
|
|
123
|
+
code: string;
|
|
124
|
+
/**
|
|
125
|
+
* The primary human-readable error message.
|
|
126
|
+
* Should provide a clear, user-friendly description of what went wrong.
|
|
127
|
+
*
|
|
128
|
+
* @example "One or more validation errors occurred", "Access denied"
|
|
129
|
+
*/
|
|
130
|
+
message: string;
|
|
131
|
+
/**
|
|
132
|
+
* Array of detailed error information.
|
|
133
|
+
* Contains specific details about individual errors, particularly useful
|
|
134
|
+
* for validation errors where multiple fields may have issues.
|
|
135
|
+
*/
|
|
136
|
+
details: IODataErrorDetail[];
|
|
137
|
+
/**
|
|
138
|
+
* Optional inner error containing technical debugging information.
|
|
139
|
+
* Typically includes exception details, stack traces, and other
|
|
140
|
+
* technical information from the C# backend service.
|
|
141
|
+
*/
|
|
142
|
+
innererror?: IODataInnerError;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Represents the complete OData error response structure.
|
|
146
|
+
* This is the top-level interface that wraps the error object and matches
|
|
147
|
+
* the standard OData v4 error response format.
|
|
148
|
+
*
|
|
149
|
+
* This structure is typically returned by C# Web API services when errors occur,
|
|
150
|
+
* following the OData specification for error responses.
|
|
151
|
+
*
|
|
152
|
+
* @example
|
|
153
|
+
* ```typescript
|
|
154
|
+
* // Typical OData error response from C# Web API
|
|
155
|
+
* const odataErrorResponse: IODataError = {
|
|
156
|
+
* error: {
|
|
157
|
+
* code: "VALIDATION_FAILED",
|
|
158
|
+
* message: "Validation failed",
|
|
159
|
+
* details: [
|
|
160
|
+
* {
|
|
161
|
+
* code: "REQUIRED_FIELD",
|
|
162
|
+
* message: "The Name field is required",
|
|
163
|
+
* target: "Name"
|
|
164
|
+
* }
|
|
165
|
+
* ],
|
|
166
|
+
* innererror: {
|
|
167
|
+
* type: "System.ComponentModel.DataAnnotations.ValidationException",
|
|
168
|
+
* message: "Validation failed for one or more entities"
|
|
169
|
+
* }
|
|
170
|
+
* }
|
|
171
|
+
* };
|
|
172
|
+
* ```
|
|
173
|
+
*/
|
|
174
|
+
export interface IODataError {
|
|
175
|
+
/**
|
|
176
|
+
* The error object containing all error information.
|
|
177
|
+
* This follows the OData v4 specification requirement that errors
|
|
178
|
+
* be wrapped in an "error" property at the root level.
|
|
179
|
+
*/
|
|
180
|
+
error: IOdataErrorObject;
|
|
181
|
+
}
|
|
182
|
+
//# sourceMappingURL=IOdataError.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IOdataError.d.ts","sourceRoot":"","sources":["../../../src/models/interfaces/IOdataError.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,iBAAiB;IACjC;;;;;OAKG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,WAAW,gBAAgB;IAChC;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,gBAAgB,CAAC;CAC9B;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,WAAW,iBAAiB;IACjC;;;;;OAKG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;;;OAKG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;;;OAIG;IACH,OAAO,EAAE,iBAAiB,EAAE,CAAC;IAE7B;;;;OAIG;IACH,UAAU,CAAC,EAAE,gBAAgB,CAAC;CAC9B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,WAAW,WAAW;IAC3B;;;;OAIG;IACH,KAAK,EAAE,iBAAiB,CAAC;CACzB"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interface representing the RFC 7807 Problem Details for HTTP APIs specification.
|
|
3
|
+
* This standard provides a consistent format for returning error information
|
|
4
|
+
* from HTTP APIs, ensuring machine-readable error responses with human-readable details.
|
|
5
|
+
*
|
|
6
|
+
* Problem Details are commonly used in C# ASP.NET Core applications through
|
|
7
|
+
* the built-in ProblemDetails class and are the standard way to communicate
|
|
8
|
+
* errors in REST APIs following modern best practices.
|
|
9
|
+
*
|
|
10
|
+
* @see {@link https://tools.ietf.org/html/rfc7807 | RFC 7807 - Problem Details for HTTP APIs}
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```typescript
|
|
14
|
+
* const problem: IProblemDetails = {
|
|
15
|
+
* type: "https://example.com/probs/validation-error",
|
|
16
|
+
* title: "Validation Failed",
|
|
17
|
+
* status: 400,
|
|
18
|
+
* detail: "One or more validation errors occurred",
|
|
19
|
+
* instance: "/api/users/123"
|
|
20
|
+
* };
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```typescript
|
|
25
|
+
* // Simple error without optional fields
|
|
26
|
+
* const simpleError: IProblemDetails = {
|
|
27
|
+
* title: "Resource Not Found",
|
|
28
|
+
* status: 404
|
|
29
|
+
* };
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export interface IProblemDetails {
|
|
33
|
+
/**
|
|
34
|
+
* A URI reference that identifies the problem type.
|
|
35
|
+
* This should be a stable identifier that doesn't change over time.
|
|
36
|
+
* When dereferenced, it should provide human-readable documentation
|
|
37
|
+
* for the problem type.
|
|
38
|
+
*
|
|
39
|
+
* If not provided, it defaults to "about:blank" per RFC 7807.
|
|
40
|
+
*
|
|
41
|
+
* @example "https://example.com/probs/validation-error"
|
|
42
|
+
* @example "https://api.myapp.com/errors/insufficient-funds"
|
|
43
|
+
* @example "urn:problem-type:authentication-required"
|
|
44
|
+
*/
|
|
45
|
+
type?: string;
|
|
46
|
+
/**
|
|
47
|
+
* A short, human-readable summary of the problem type.
|
|
48
|
+
* This should not change from occurrence to occurrence of the problem,
|
|
49
|
+
* except for purposes of localization.
|
|
50
|
+
*
|
|
51
|
+
* This is the primary error message that should be displayed to users.
|
|
52
|
+
*
|
|
53
|
+
* @example "Validation Failed", "Resource Not Found", "Authentication Required"
|
|
54
|
+
* @example "Insufficient Funds", "Rate Limit Exceeded", "Service Unavailable"
|
|
55
|
+
*/
|
|
56
|
+
title: string;
|
|
57
|
+
/**
|
|
58
|
+
* The HTTP status code generated by the origin server for this occurrence.
|
|
59
|
+
* This provides the numeric status code that should be returned in the HTTP response.
|
|
60
|
+
*
|
|
61
|
+
* @example 400 // Bad Request
|
|
62
|
+
* @example 401 // Unauthorized
|
|
63
|
+
* @example 404 // Not Found
|
|
64
|
+
* @example 422 // Unprocessable Entity
|
|
65
|
+
* @example 500 // Internal Server Error
|
|
66
|
+
*/
|
|
67
|
+
status: number;
|
|
68
|
+
/**
|
|
69
|
+
* A human-readable explanation specific to this occurrence of the problem.
|
|
70
|
+
* This should provide additional context and details about what went wrong
|
|
71
|
+
* in this particular instance.
|
|
72
|
+
*
|
|
73
|
+
* Unlike the title, this can vary from occurrence to occurrence.
|
|
74
|
+
*
|
|
75
|
+
* @example "The email field is required and must be a valid email address"
|
|
76
|
+
* @example "User with ID 123 was not found in the system"
|
|
77
|
+
* @example "Account balance of $50.00 is insufficient for transaction of $75.00"
|
|
78
|
+
*/
|
|
79
|
+
detail?: string;
|
|
80
|
+
/**
|
|
81
|
+
* A URI reference that identifies the specific occurrence of the problem.
|
|
82
|
+
* This is typically the request URI that generated the problem, but can be
|
|
83
|
+
* any URI that helps identify this particular problem instance.
|
|
84
|
+
*
|
|
85
|
+
* This is useful for debugging and logging purposes.
|
|
86
|
+
*
|
|
87
|
+
* @example "/api/users/123"
|
|
88
|
+
* @example "/api/orders/456/payments"
|
|
89
|
+
* @example "https://api.example.com/v1/accounts/789/transfer"
|
|
90
|
+
*/
|
|
91
|
+
instance?: string;
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=IProblemDetails.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IProblemDetails.d.ts","sourceRoot":"","sources":["../../../src/models/interfaces/IProblemDetails.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAM,WAAW,eAAe;IAC/B;;;;;;;;;;;OAWG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;;;;;;;OASG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;;;;;;;OASG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;;;;;;;;;OAUG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { IProblemDetails } from "./IProblemDetails";
|
|
2
|
+
/**
|
|
3
|
+
* Interface representing validation-specific problem details that extend the RFC 7807 standard.
|
|
4
|
+
* This interface is designed to handle validation errors from C# ASP.NET Core applications
|
|
5
|
+
* using model validation, data annotations, and FluentValidation.
|
|
6
|
+
*
|
|
7
|
+
* ValidationProblemDetails provides structured information about validation failures,
|
|
8
|
+
* mapping each field or property to its specific validation error messages.
|
|
9
|
+
* This allows for detailed, field-specific error reporting in user interfaces.
|
|
10
|
+
*
|
|
11
|
+
* This interface corresponds to the ASP.NET Core ValidationProblemDetails class
|
|
12
|
+
* and is commonly returned by controllers with model validation errors.
|
|
13
|
+
*
|
|
14
|
+
* @extends IProblemDetails
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```typescript
|
|
18
|
+
* const validationError: IValidationProblemDetails = {
|
|
19
|
+
* title: "Validation Failed",
|
|
20
|
+
* status: 400,
|
|
21
|
+
* detail: "One or more validation errors occurred",
|
|
22
|
+
* errors: {
|
|
23
|
+
* "Name": ["The Name field is required"],
|
|
24
|
+
* "Email": ["Invalid email format", "Email already exists"],
|
|
25
|
+
* "Age": ["Age must be between 18 and 120"]
|
|
26
|
+
* },
|
|
27
|
+
* traceId: "0HMV0LR8T4Q8B:00000001"
|
|
28
|
+
* };
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```typescript
|
|
33
|
+
* // Nested property validation errors
|
|
34
|
+
* const nestedValidation: IValidationProblemDetails = {
|
|
35
|
+
* title: "Validation Failed",
|
|
36
|
+
* status: 422,
|
|
37
|
+
* errors: {
|
|
38
|
+
* "Address.Street": ["Street address is required"],
|
|
39
|
+
* "Address.PostalCode": ["Invalid postal code format"],
|
|
40
|
+
* "ContactInfo.Phone": ["Phone number must be 10 digits"]
|
|
41
|
+
* }
|
|
42
|
+
* };
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
export interface IValidationProblemDetails extends IProblemDetails {
|
|
46
|
+
/**
|
|
47
|
+
* A dictionary mapping field names to arrays of validation error messages.
|
|
48
|
+
* Each key represents a property or field name that failed validation,
|
|
49
|
+
* and the corresponding value is an array of error messages for that field.
|
|
50
|
+
*
|
|
51
|
+
* Field names can include nested properties using dot notation (e.g., "Address.Street")
|
|
52
|
+
* and array indices (e.g., "Items[0].Name") to represent complex object structures.
|
|
53
|
+
*
|
|
54
|
+
* Multiple error messages per field allow for comprehensive validation feedback,
|
|
55
|
+
* such as when a field fails multiple validation rules.
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```typescript
|
|
59
|
+
* {
|
|
60
|
+
* "Name": ["The Name field is required"],
|
|
61
|
+
* "Email": ["Invalid email format", "Email already exists"],
|
|
62
|
+
* "Password": ["Password must be at least 8 characters", "Password must contain uppercase letter"],
|
|
63
|
+
* "Address.PostalCode": ["Postal code is required", "Invalid postal code format"]
|
|
64
|
+
* }
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
errors: Record<string, string[]>;
|
|
68
|
+
/**
|
|
69
|
+
* Optional trace identifier for request tracking and debugging.
|
|
70
|
+
* This is typically generated by the server to correlate this error response
|
|
71
|
+
* with server-side logs, making it easier to debug issues in production.
|
|
72
|
+
*
|
|
73
|
+
* The trace ID format may vary depending on the logging framework used
|
|
74
|
+
* (e.g., ASP.NET Core's Activity.TraceId, Application Insights correlation ID).
|
|
75
|
+
*
|
|
76
|
+
* @example "0HMV0LR8T4Q8B:00000001"
|
|
77
|
+
* @example "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
|
|
78
|
+
* @example "req_1234567890abcdef"
|
|
79
|
+
*/
|
|
80
|
+
traceId?: string;
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=IValidationProblemDetails.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IValidationProblemDetails.d.ts","sourceRoot":"","sources":["../../../src/models/interfaces/IValidationProblemDetails.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,MAAM,WAAW,yBAA0B,SAAQ,eAAe;IACjE;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAEjC;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<library xmlns="http://www.sap.com/sap.ui.library.xsd">
|
|
3
3
|
<name>computec.appengine.uibase</name>
|
|
4
4
|
<vendor>CompuTec S.A.</vendor>
|
|
5
|
-
<version>1.0.
|
|
5
|
+
<version>1.0.10</version>
|
|
6
6
|
<copyright>Copyright (c) CompuTec S.A.2025</copyright>
|
|
7
7
|
<title>uibase</title>
|
|
8
8
|
<documentation>Core library required by AppEngine plugins</documentation>
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
sap.ui.define([], function () {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
7
|
+
function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function (t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i.return) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine(u), _regeneratorDefine(u, o, "Generator"), _regeneratorDefine(u, n, function () { return this; }), _regeneratorDefine(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function () { return { w: i, m: f }; })(); }
|
|
8
|
+
function _regeneratorDefine(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine = function (e, r, n, t) { function o(r, n) { _regeneratorDefine(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine(e, r, n, t); }
|
|
9
|
+
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
10
|
+
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
|
|
11
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
12
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
13
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
14
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
15
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
16
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
17
|
+
/**
|
|
18
|
+
* Helper for navigating from UIAPI Web Client extensions to AppEngine plugin routes.
|
|
19
|
+
*
|
|
20
|
+
* AppEngine plugins are opened via the Web Client hash URL format:
|
|
21
|
+
* `#webclient-CompuTecWebClientStart-CompuTecWebClientStart&/{pluginId},{route}/{pluginName}`
|
|
22
|
+
*
|
|
23
|
+
* Routes containing path separators (e.g. `ctp/4/0`) must be double-encoded
|
|
24
|
+
* so that both the browser and the SAPUI5 router decode them correctly.
|
|
25
|
+
*/
|
|
26
|
+
var WebClientNavigationHelper = /*#__PURE__*/function () {
|
|
27
|
+
function WebClientNavigationHelper() {
|
|
28
|
+
_classCallCheck(this, WebClientNavigationHelper);
|
|
29
|
+
}
|
|
30
|
+
return _createClass(WebClientNavigationHelper, null, [{
|
|
31
|
+
key: "buildPluginUrl",
|
|
32
|
+
value:
|
|
33
|
+
/**
|
|
34
|
+
* Build the full Web Client hash URL for navigating to an AppEngine plugin route.
|
|
35
|
+
*
|
|
36
|
+
* @param pluginId The plugin identifier (e.g. `"MRP"`)
|
|
37
|
+
* @param route The SAPUI5 route path including parameters (e.g. `"ctp/4/0"`, `"wizard"`)
|
|
38
|
+
* @param pluginName Optional display name; defaults to `pluginId`
|
|
39
|
+
* @returns The complete hash URL string
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```typescript
|
|
43
|
+
* WebClientNavigationHelper.buildPluginUrl("MRP", "ctp/4/0");
|
|
44
|
+
* // => "#webclient-CompuTecWebClientStart-CompuTecWebClientStart&/MRP,ctp%252F4%252F0/MRP"
|
|
45
|
+
*
|
|
46
|
+
* WebClientNavigationHelper.buildPluginUrl("MRP", "wizard");
|
|
47
|
+
* // => "#webclient-CompuTecWebClientStart-CompuTecWebClientStart&/MRP,wizard/MRP"
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
function buildPluginUrl(pluginId, route, pluginName) {
|
|
51
|
+
var encodedRoute = encodeURIComponent(encodeURIComponent(route));
|
|
52
|
+
return "".concat(WebClientNavigationHelper.HASH_PREFIX, "&/").concat(pluginId, ",").concat(encodedRoute, "/").concat(pluginName !== null && pluginName !== void 0 ? pluginName : pluginId);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Navigate to an AppEngine plugin route using the SDKEnv `open` method.
|
|
57
|
+
*
|
|
58
|
+
* @param openFn A function that opens a URL — typically `oEnv.open.bind(oEnv)` or `(url) => oEnv.open(url)`
|
|
59
|
+
* @param pluginId The plugin identifier (e.g. `"MRP"`)
|
|
60
|
+
* @param route The SAPUI5 route path including parameters (e.g. `"ctp/4/0"`)
|
|
61
|
+
* @param pluginName Optional display name; defaults to `pluginId`
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* ```typescript
|
|
65
|
+
* // In a UIAPI controller:
|
|
66
|
+
* import { WebClientNavigationHelper } from "@computec/uibase";
|
|
67
|
+
*
|
|
68
|
+
* await WebClientNavigationHelper.openPlugin(
|
|
69
|
+
* (url) => oEnv.open(url),
|
|
70
|
+
* "MRP",
|
|
71
|
+
* `ctp/${docEntry}/${lineNum}`
|
|
72
|
+
* );
|
|
73
|
+
* ```
|
|
74
|
+
*/
|
|
75
|
+
}, {
|
|
76
|
+
key: "openPlugin",
|
|
77
|
+
value: (function () {
|
|
78
|
+
var _openPlugin = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(openFn, pluginId, route, pluginName) {
|
|
79
|
+
var url;
|
|
80
|
+
return _regenerator().w(function (_context) {
|
|
81
|
+
while (1) switch (_context.n) {
|
|
82
|
+
case 0:
|
|
83
|
+
url = WebClientNavigationHelper.buildPluginUrl(pluginId, route, pluginName);
|
|
84
|
+
_context.n = 1;
|
|
85
|
+
return openFn(url);
|
|
86
|
+
case 1:
|
|
87
|
+
return _context.a(2);
|
|
88
|
+
}
|
|
89
|
+
}, _callee);
|
|
90
|
+
}));
|
|
91
|
+
function openPlugin(_x, _x2, _x3, _x4) {
|
|
92
|
+
return _openPlugin.apply(this, arguments);
|
|
93
|
+
}
|
|
94
|
+
return openPlugin;
|
|
95
|
+
}())
|
|
96
|
+
}]);
|
|
97
|
+
}();
|
|
98
|
+
_defineProperty(WebClientNavigationHelper, "HASH_PREFIX", "#webclient-CompuTecWebClientStart-CompuTecWebClientStart");
|
|
99
|
+
return WebClientNavigationHelper;
|
|
100
|
+
});
|