@smartbit4all/ng-client 3.3.97 → 3.3.99
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/esm2020/lib/session/api/api/session.service.mjs +1 -1
- package/esm2020/lib/session/api/encoder.mjs +1 -1
- package/esm2020/lib/session/api/model/accountInfo.mjs +1 -1
- package/esm2020/lib/session/api/model/apiError.mjs +1 -1
- package/esm2020/lib/session/api/model/authenticationProviderData.mjs +1 -1
- package/esm2020/lib/session/api/model/getAuthenticationProvidersResponse.mjs +1 -1
- package/esm2020/lib/session/api/model/models.mjs +1 -1
- package/esm2020/lib/session/api/model/refreshSessionRequest.mjs +1 -1
- package/esm2020/lib/session/api/model/session.mjs +1 -1
- package/esm2020/lib/session/api/model/sessionInfoData.mjs +1 -1
- package/esm2020/lib/session/api/model/userActivityLog.mjs +1 -1
- package/esm2020/lib/session/api/param.mjs +1 -1
- package/esm2020/lib/session/api/variables.mjs +1 -1
- package/esm2020/lib/smart-component-layout/api/api/api.mjs +1 -1
- package/esm2020/lib/smart-component-layout/api/api/default.service.mjs +1 -1
- package/esm2020/lib/smart-component-layout/api/api.module.mjs +1 -1
- package/esm2020/lib/smart-component-layout/api/configuration.mjs +1 -1
- package/esm2020/lib/smart-component-layout/api/encoder.mjs +1 -1
- package/esm2020/lib/smart-component-layout/api/index.mjs +1 -1
- package/esm2020/lib/smart-component-layout/api/model/componentType.mjs +1 -1
- package/esm2020/lib/smart-component-layout/api/model/componentWidgetType.mjs +1 -1
- package/esm2020/lib/smart-component-layout/api/model/layoutDirection.mjs +1 -1
- package/esm2020/lib/smart-component-layout/api/model/models.mjs +1 -1
- package/esm2020/lib/smart-component-layout/api/model/smartComponentLayoutDefinition.mjs +1 -1
- package/esm2020/lib/smart-component-layout/api/model/smartComponentWidgetDefinition.mjs +1 -1
- package/esm2020/lib/smart-component-layout/api/param.mjs +1 -1
- package/esm2020/lib/smart-component-layout/api/variables.mjs +1 -1
- package/esm2020/lib/smart-filter-editor/api/api/filter.service.mjs +1 -1
- package/esm2020/lib/smart-filter-editor/api/configuration.mjs +1 -1
- package/esm2020/lib/smart-filter-editor/api/encoder.mjs +1 -1
- package/esm2020/lib/smart-filter-editor/api/model/filterExpressionBuilderApiConfig.mjs +1 -1
- package/esm2020/lib/smart-filter-editor/api/model/filterExpressionBuilderField.mjs +1 -1
- package/esm2020/lib/smart-filter-editor/api/model/filterExpressionBuilderModel.mjs +1 -1
- package/esm2020/lib/smart-filter-editor/api/model/filterExpressionFieldEditor.mjs +1 -1
- package/esm2020/lib/smart-filter-editor/api/model/filterExpressionFieldList.mjs +1 -1
- package/esm2020/lib/smart-filter-editor/api/model/filterExpressionList.mjs +1 -1
- package/esm2020/lib/smart-filter-editor/api/param.mjs +1 -1
- package/esm2020/lib/smart-filter-editor/api/variables.mjs +1 -1
- package/esm2020/lib/smart-form/api/model/smartWidgetDefinition.mjs +1 -1
- package/esm2020/lib/smart-form/api/model/valueChangeMode.mjs +1 -1
- package/esm2020/lib/smart-form/services/smartform.layout-definition.service.mjs +2 -1
- package/esm2020/lib/smart-form/smartform.form-model.mjs +1 -1
- package/esm2020/lib/smart-form/widgets/smartformwidget/smartformwidget.component.mjs +11 -4
- package/esm2020/lib/smart-grid/api/grid-api/api/api.mjs +1 -1
- package/esm2020/lib/smart-grid/api/grid-api/api/grid.service.mjs +1 -1
- package/esm2020/lib/smart-grid/api/grid-api/api.module.mjs +1 -1
- package/esm2020/lib/smart-grid/api/grid-api/configuration.mjs +1 -1
- package/esm2020/lib/smart-grid/api/grid-api/encoder.mjs +1 -1
- package/esm2020/lib/smart-grid/api/grid-api/index.mjs +1 -1
- package/esm2020/lib/smart-grid/api/grid-api/model/gridColumnContentType.mjs +1 -1
- package/esm2020/lib/smart-grid/api/grid-api/model/gridColumnMeta.mjs +1 -1
- package/esm2020/lib/smart-grid/api/grid-api/model/gridDataAccessConfig.mjs +1 -1
- package/esm2020/lib/smart-grid/api/grid-api/model/gridModel.mjs +1 -1
- package/esm2020/lib/smart-grid/api/grid-api/model/gridPage.mjs +1 -1
- package/esm2020/lib/smart-grid/api/grid-api/model/gridRow.mjs +1 -1
- package/esm2020/lib/smart-grid/api/grid-api/model/gridSelectionChange.mjs +1 -1
- package/esm2020/lib/smart-grid/api/grid-api/model/gridSelectionMode.mjs +1 -1
- package/esm2020/lib/smart-grid/api/grid-api/model/gridSelectionType.mjs +1 -1
- package/esm2020/lib/smart-grid/api/grid-api/model/gridServerModel.mjs +1 -1
- package/esm2020/lib/smart-grid/api/grid-api/model/gridUpdateData.mjs +1 -1
- package/esm2020/lib/smart-grid/api/grid-api/model/gridView.mjs +1 -1
- package/esm2020/lib/smart-grid/api/grid-api/model/gridViewDescriptor.mjs +1 -1
- package/esm2020/lib/smart-grid/api/grid-api/model/models.mjs +1 -1
- package/esm2020/lib/smart-grid/api/grid-api/param.mjs +1 -1
- package/esm2020/lib/smart-grid/api/grid-api/variables.mjs +1 -1
- package/esm2020/lib/smart-tree/tree-api/api/tree.service.mjs +1 -1
- package/esm2020/lib/smart-tree/tree-api/configuration.mjs +1 -1
- package/esm2020/lib/smart-tree/tree-api/encoder.mjs +1 -1
- package/esm2020/lib/smart-tree/tree-api/param.mjs +1 -1
- package/esm2020/lib/smart-tree/tree-api/variables.mjs +1 -1
- package/esm2020/lib/view-context/api/model/models.mjs +6 -1
- package/esm2020/lib/view-context/api/model/toolbarDefinition.mjs +2 -0
- package/esm2020/lib/view-context/api/model/toolbarDefinitionData.mjs +2 -0
- package/esm2020/lib/view-context/api/model/toolbarItem.mjs +2 -0
- package/esm2020/lib/view-context/api/model/toolbarItemKind.mjs +18 -0
- package/esm2020/lib/view-context/api/model/toolbarItemOperation.mjs +20 -0
- package/esm2020/lib/view-context/api/model/uiAction.mjs +1 -1
- package/esm2020/lib/view-context/api/model/uiActionRequest.mjs +1 -1
- package/esm2020/lib/view-context/api/model/valueSet.mjs +1 -1
- package/esm2020/lib/view-context/api/model/viewContextChange.mjs +1 -1
- package/esm2020/lib/view-context/smart-ui-action/ui-action-toolbar.component.mjs +6 -3
- package/esm2020/lib/view-context/value-api/api/api.mjs +1 -1
- package/esm2020/lib/view-context/value-api/api/value.service.mjs +1 -1
- package/esm2020/lib/view-context/value-api/api.module.mjs +1 -1
- package/esm2020/lib/view-context/value-api/configuration.mjs +1 -1
- package/esm2020/lib/view-context/value-api/encoder.mjs +1 -1
- package/esm2020/lib/view-context/value-api/index.mjs +1 -1
- package/esm2020/lib/view-context/value-api/model/genericValue.mjs +1 -1
- package/esm2020/lib/view-context/value-api/model/models.mjs +1 -1
- package/esm2020/lib/view-context/value-api/model/value.mjs +1 -1
- package/esm2020/lib/view-context/value-api/model/valueSetDefinition.mjs +1 -1
- package/esm2020/lib/view-context/value-api/model/valueSetDefinitionIdentifier.mjs +1 -1
- package/esm2020/lib/view-context/value-api/model/valueSetOperand.mjs +1 -1
- package/esm2020/lib/view-context/value-api/param.mjs +1 -1
- package/esm2020/lib/view-context/value-api/variables.mjs +1 -1
- package/fesm2015/smartbit4all-ng-client.mjs +55 -6
- package/fesm2015/smartbit4all-ng-client.mjs.map +1 -1
- package/fesm2020/smartbit4all-ng-client.mjs +55 -6
- package/fesm2020/smartbit4all-ng-client.mjs.map +1 -1
- package/lib/smart-form/api/model/smartWidgetDefinition.d.ts +4 -0
- package/lib/smart-form/smartform.form-model.d.ts +1 -0
- package/lib/view-context/api/model/models.d.ts +5 -0
- package/lib/view-context/api/model/toolbarDefinition.d.ts +23 -0
- package/lib/view-context/api/model/toolbarDefinitionData.d.ts +30 -0
- package/lib/view-context/api/model/toolbarItem.d.ts +33 -0
- package/lib/view-context/api/model/toolbarItemKind.d.ts +16 -0
- package/lib/view-context/api/model/toolbarItemOperation.d.ts +18 -0
- package/lib/view-context/api/model/uiAction.d.ts +4 -0
- package/package.json +1 -1
- package/smartbit4all-ng-client-3.3.99.tgz +0 -0
- package/src/lib/session/api/README.md +226 -226
- package/src/lib/smart-component-layout/api/README.md +226 -226
- package/src/lib/smart-filter-editor/api/README.md +226 -226
- package/src/lib/smart-grid/api/grid-api/README.md +226 -226
- package/src/lib/smart-tree/tree-api/README.md +226 -226
- package/src/lib/view-context/value-api/README.md +226 -226
- package/smartbit4all-ng-client-3.3.97.tgz +0 -0
|
@@ -84,4 +84,8 @@ export interface SmartWidgetDefinition {
|
|
|
84
84
|
maxLength?: number;
|
|
85
85
|
valueChangeMode?: ValueChangeMode;
|
|
86
86
|
showCharacterLimitSuffix?: boolean;
|
|
87
|
+
/**
|
|
88
|
+
* The default error message to show if the widget features an autocompletion filter operation, which returns no elements.
|
|
89
|
+
*/
|
|
90
|
+
filterErrorMessage?: string;
|
|
87
91
|
}
|
|
@@ -18,6 +18,11 @@ export * from './messageType';
|
|
|
18
18
|
export * from './openPendingData';
|
|
19
19
|
export * from './smartLinkData';
|
|
20
20
|
export * from './style';
|
|
21
|
+
export * from './toolbarDefinition';
|
|
22
|
+
export * from './toolbarDefinitionData';
|
|
23
|
+
export * from './toolbarItem';
|
|
24
|
+
export * from './toolbarItemKind';
|
|
25
|
+
export * from './toolbarItemOperation';
|
|
21
26
|
export * from './uiAction';
|
|
22
27
|
export * from './uiActionButtonDescriptor';
|
|
23
28
|
export * from './uiActionButtonType';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* View API
|
|
3
|
+
* View API
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0.0
|
|
6
|
+
* Contact: info@it4all.hu
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
import { ToolbarDefinitionData } from './toolbarDefinitionData';
|
|
13
|
+
/**
|
|
14
|
+
* This is the registry entry of the toolbars in the MDM Entry of the registry. This object defines a menu / toolbar in the application. It has a naming that can be referred from the source code of the page. The result is that the ToolbarManagementApi produces the UiActions on a Page with the proper settings. The toolbars can be hierarchical for hierarchical menus.
|
|
15
|
+
*/
|
|
16
|
+
export interface ToolbarDefinition {
|
|
17
|
+
uri: string;
|
|
18
|
+
/**
|
|
19
|
+
* A numerical value and that defines the precedence in a increasing order. It defines that we get the smallest precedence first and override it with the next one and so on.
|
|
20
|
+
*/
|
|
21
|
+
precedenceOrder?: number;
|
|
22
|
+
data?: ToolbarDefinitionData;
|
|
23
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* View API
|
|
3
|
+
* View API
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0.0
|
|
6
|
+
* Contact: info@it4all.hu
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
import { ToolbarItem } from './toolbarItem';
|
|
13
|
+
/**
|
|
14
|
+
* This is the registry entry of the toolbars in the MDM Entry of the registry. This object defines a menu / toolbar in the application. It has a naming that can be referred from the source code of the page. The result is that the ToolbarManagementApi produces the UiActions on a Page with the proper settings. The toolbars can be hierarchical for hierarchical menus.
|
|
15
|
+
*/
|
|
16
|
+
export interface ToolbarDefinitionData {
|
|
17
|
+
uri: string;
|
|
18
|
+
/**
|
|
19
|
+
* The namespace and the name of the toolbar. The code should be the unique name of the toolbar on the page and it is the last segment.
|
|
20
|
+
*/
|
|
21
|
+
qualifiedName: string;
|
|
22
|
+
/**
|
|
23
|
+
* The ites on the toolbar.
|
|
24
|
+
*/
|
|
25
|
+
items: Array<ToolbarItem>;
|
|
26
|
+
/**
|
|
27
|
+
* If we set the item producer logic then the items of the toolbar are coming from this invocation. In this case the items must be managed in the invocation call not here. It can be a workflow or a specific menu settings that can produce menu items dynamically.
|
|
28
|
+
*/
|
|
29
|
+
itemProducer?: any | null;
|
|
30
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* View API
|
|
3
|
+
* View API
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0.0
|
|
6
|
+
* Contact: info@it4all.hu
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
import { ToolbarDefinitionData } from './toolbarDefinitionData';
|
|
13
|
+
import { ToolbarItemOperation } from './toolbarItemOperation';
|
|
14
|
+
import { UiActionDescriptor } from './uiActionDescriptor';
|
|
15
|
+
import { ToolbarItemKind } from './toolbarItemKind';
|
|
16
|
+
/**
|
|
17
|
+
* This object is one item on the toolbar. The most tipical that it is an action referring to the action registry.
|
|
18
|
+
*/
|
|
19
|
+
export interface ToolbarItem {
|
|
20
|
+
uri: string;
|
|
21
|
+
kind?: ToolbarItemKind;
|
|
22
|
+
operation?: ToolbarItemOperation;
|
|
23
|
+
/**
|
|
24
|
+
* The qualified name fo the referenced toolbar that defines the inline items or the sub menu items.
|
|
25
|
+
*/
|
|
26
|
+
referredToolbar?: string;
|
|
27
|
+
toolbar?: ToolbarDefinitionData;
|
|
28
|
+
/**
|
|
29
|
+
* The qualified name of the action.
|
|
30
|
+
*/
|
|
31
|
+
action?: string;
|
|
32
|
+
descriptor?: UiActionDescriptor;
|
|
33
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* View API
|
|
3
|
+
* View API
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0.0
|
|
6
|
+
* Contact: info@it4all.hu
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
export declare enum ToolbarItemKind {
|
|
13
|
+
ACTION = "action",
|
|
14
|
+
INLINE = "inline",
|
|
15
|
+
SUBMENU = "submenu"
|
|
16
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* View API
|
|
3
|
+
* View API
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0.0
|
|
6
|
+
* Contact: info@it4all.hu
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
export declare enum ToolbarItemOperation {
|
|
13
|
+
ADD_BEFORE = "addBefore",
|
|
14
|
+
ADD_AFTER = "addAfter",
|
|
15
|
+
ADD_FIRST = "addFirst",
|
|
16
|
+
ADD_LAST = "addLast",
|
|
17
|
+
REMOVE = "remove"
|
|
18
|
+
}
|
package/package.json
CHANGED
|
Binary file
|
|
@@ -1,226 +1,226 @@
|
|
|
1
|
-
## @
|
|
2
|
-
|
|
3
|
-
### Building
|
|
4
|
-
|
|
5
|
-
To install the required dependencies and to build the typescript sources run:
|
|
6
|
-
```
|
|
7
|
-
npm install
|
|
8
|
-
npm run build
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
### publishing
|
|
12
|
-
|
|
13
|
-
First build the package then run ```npm publish dist``` (don't forget to specify the `dist` folder!)
|
|
14
|
-
|
|
15
|
-
### consuming
|
|
16
|
-
|
|
17
|
-
Navigate to the folder of your consuming project and run one of next commands.
|
|
18
|
-
|
|
19
|
-
_published:_
|
|
20
|
-
|
|
21
|
-
```
|
|
22
|
-
npm install @ --save
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
_without publishing (not recommended):_
|
|
26
|
-
|
|
27
|
-
```
|
|
28
|
-
npm install PATH_TO_GENERATED_PACKAGE/dist.tgz --save
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
_It's important to take the tgz file, otherwise you'll get trouble with links on windows_
|
|
32
|
-
|
|
33
|
-
_using `npm link`:_
|
|
34
|
-
|
|
35
|
-
In PATH_TO_GENERATED_PACKAGE/dist:
|
|
36
|
-
```
|
|
37
|
-
npm link
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
In your project:
|
|
41
|
-
```
|
|
42
|
-
npm link
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
__Note for Windows users:__ The Angular CLI has troubles to use linked npm packages.
|
|
46
|
-
Please refer to this issue https://github.com/angular/angular-cli/issues/8284 for a solution / workaround.
|
|
47
|
-
Published packages are not effected by this issue.
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
#### General usage
|
|
51
|
-
|
|
52
|
-
In your Angular project:
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
```
|
|
56
|
-
// without configuring providers
|
|
57
|
-
import { ApiModule } from '';
|
|
58
|
-
import { HttpClientModule } from '@angular/common/http';
|
|
59
|
-
|
|
60
|
-
@NgModule({
|
|
61
|
-
imports: [
|
|
62
|
-
ApiModule,
|
|
63
|
-
// make sure to import the HttpClientModule in the AppModule only,
|
|
64
|
-
// see https://github.com/angular/angular/issues/20575
|
|
65
|
-
HttpClientModule
|
|
66
|
-
],
|
|
67
|
-
declarations: [ AppComponent ],
|
|
68
|
-
providers: [],
|
|
69
|
-
bootstrap: [ AppComponent ]
|
|
70
|
-
})
|
|
71
|
-
export class AppModule {}
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
```
|
|
75
|
-
// configuring providers
|
|
76
|
-
import { ApiModule, Configuration, ConfigurationParameters } from '';
|
|
77
|
-
|
|
78
|
-
export function apiConfigFactory (): Configuration {
|
|
79
|
-
const params: ConfigurationParameters = {
|
|
80
|
-
// set configuration parameters here.
|
|
81
|
-
}
|
|
82
|
-
return new Configuration(params);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
@NgModule({
|
|
86
|
-
imports: [ ApiModule.forRoot(apiConfigFactory) ],
|
|
87
|
-
declarations: [ AppComponent ],
|
|
88
|
-
providers: [],
|
|
89
|
-
bootstrap: [ AppComponent ]
|
|
90
|
-
})
|
|
91
|
-
export class AppModule {}
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
```
|
|
95
|
-
// configuring providers with an authentication service that manages your access tokens
|
|
96
|
-
import { ApiModule, Configuration } from '';
|
|
97
|
-
|
|
98
|
-
@NgModule({
|
|
99
|
-
imports: [ ApiModule ],
|
|
100
|
-
declarations: [ AppComponent ],
|
|
101
|
-
providers: [
|
|
102
|
-
{
|
|
103
|
-
provide: Configuration,
|
|
104
|
-
useFactory: (authService: AuthService) => new Configuration(
|
|
105
|
-
{
|
|
106
|
-
basePath: environment.apiUrl,
|
|
107
|
-
accessToken: authService.getAccessToken.bind(authService)
|
|
108
|
-
}
|
|
109
|
-
),
|
|
110
|
-
deps: [AuthService],
|
|
111
|
-
multi: false
|
|
112
|
-
}
|
|
113
|
-
],
|
|
114
|
-
bootstrap: [ AppComponent ]
|
|
115
|
-
})
|
|
116
|
-
export class AppModule {}
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
```
|
|
120
|
-
import { DefaultApi } from '';
|
|
121
|
-
|
|
122
|
-
export class AppComponent {
|
|
123
|
-
constructor(private apiGateway: DefaultApi) { }
|
|
124
|
-
}
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
Note: The ApiModule is restricted to being instantiated once app wide.
|
|
128
|
-
This is to ensure that all services are treated as singletons.
|
|
129
|
-
|
|
130
|
-
#### Using multiple OpenAPI files / APIs / ApiModules
|
|
131
|
-
In order to use multiple `ApiModules` generated from different OpenAPI files,
|
|
132
|
-
you can create an alias name when importing the modules
|
|
133
|
-
in order to avoid naming conflicts:
|
|
134
|
-
```
|
|
135
|
-
import { ApiModule } from 'my-api-path';
|
|
136
|
-
import { ApiModule as OtherApiModule } from 'my-other-api-path';
|
|
137
|
-
import { HttpClientModule } from '@angular/common/http';
|
|
138
|
-
|
|
139
|
-
@NgModule({
|
|
140
|
-
imports: [
|
|
141
|
-
ApiModule,
|
|
142
|
-
OtherApiModule,
|
|
143
|
-
// make sure to import the HttpClientModule in the AppModule only,
|
|
144
|
-
// see https://github.com/angular/angular/issues/20575
|
|
145
|
-
HttpClientModule
|
|
146
|
-
]
|
|
147
|
-
})
|
|
148
|
-
export class AppModule {
|
|
149
|
-
|
|
150
|
-
}
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
### Set service base path
|
|
155
|
-
If different than the generated base path, during app bootstrap, you can provide the base path to your service.
|
|
156
|
-
|
|
157
|
-
```
|
|
158
|
-
import { BASE_PATH } from '';
|
|
159
|
-
|
|
160
|
-
bootstrap(AppComponent, [
|
|
161
|
-
{ provide: BASE_PATH, useValue: 'https://your-web-service.com' },
|
|
162
|
-
]);
|
|
163
|
-
```
|
|
164
|
-
or
|
|
165
|
-
|
|
166
|
-
```
|
|
167
|
-
import { BASE_PATH } from '';
|
|
168
|
-
|
|
169
|
-
@NgModule({
|
|
170
|
-
imports: [],
|
|
171
|
-
declarations: [ AppComponent ],
|
|
172
|
-
providers: [ provide: BASE_PATH, useValue: 'https://your-web-service.com' ],
|
|
173
|
-
bootstrap: [ AppComponent ]
|
|
174
|
-
})
|
|
175
|
-
export class AppModule {}
|
|
176
|
-
```
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
#### Using @angular/cli
|
|
180
|
-
First extend your `src/environments/*.ts` files by adding the corresponding base path:
|
|
181
|
-
|
|
182
|
-
```
|
|
183
|
-
export const environment = {
|
|
184
|
-
production: false,
|
|
185
|
-
API_BASE_PATH: 'http://127.0.0.1:8080'
|
|
186
|
-
};
|
|
187
|
-
```
|
|
188
|
-
|
|
189
|
-
In the src/app/app.module.ts:
|
|
190
|
-
```
|
|
191
|
-
import { BASE_PATH } from '';
|
|
192
|
-
import { environment } from '../environments/environment';
|
|
193
|
-
|
|
194
|
-
@NgModule({
|
|
195
|
-
declarations: [
|
|
196
|
-
AppComponent
|
|
197
|
-
],
|
|
198
|
-
imports: [ ],
|
|
199
|
-
providers: [{ provide: BASE_PATH, useValue: environment.API_BASE_PATH }],
|
|
200
|
-
bootstrap: [ AppComponent ]
|
|
201
|
-
})
|
|
202
|
-
export class AppModule { }
|
|
203
|
-
```
|
|
204
|
-
|
|
205
|
-
### Customizing path parameter encoding
|
|
206
|
-
|
|
207
|
-
Without further customization, only [path-parameters][parameter-locations-url] of [style][style-values-url] 'simple'
|
|
208
|
-
and Dates for format 'date-time' are encoded correctly.
|
|
209
|
-
|
|
210
|
-
Other styles (e.g. "matrix") are not that easy to encode
|
|
211
|
-
and thus are best delegated to other libraries (e.g.: [@honoluluhenk/http-param-expander]).
|
|
212
|
-
|
|
213
|
-
To implement your own parameter encoding (or call another library),
|
|
214
|
-
pass an arrow-function or method-reference to the `encodeParam` property of the Configuration-object
|
|
215
|
-
(see [General Usage](#general-usage) above).
|
|
216
|
-
|
|
217
|
-
Example value for use in your Configuration-Provider:
|
|
218
|
-
```typescript
|
|
219
|
-
new Configuration({
|
|
220
|
-
encodeParam: (param: Param) => myFancyParamEncoder(param),
|
|
221
|
-
})
|
|
222
|
-
```
|
|
223
|
-
|
|
224
|
-
[parameter-locations-url]: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#parameter-locations
|
|
225
|
-
[style-values-url]: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#style-values
|
|
226
|
-
[@honoluluhenk/http-param-expander]: https://www.npmjs.com/package/@honoluluhenk/http-param-expander
|
|
1
|
+
## @
|
|
2
|
+
|
|
3
|
+
### Building
|
|
4
|
+
|
|
5
|
+
To install the required dependencies and to build the typescript sources run:
|
|
6
|
+
```
|
|
7
|
+
npm install
|
|
8
|
+
npm run build
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
### publishing
|
|
12
|
+
|
|
13
|
+
First build the package then run ```npm publish dist``` (don't forget to specify the `dist` folder!)
|
|
14
|
+
|
|
15
|
+
### consuming
|
|
16
|
+
|
|
17
|
+
Navigate to the folder of your consuming project and run one of next commands.
|
|
18
|
+
|
|
19
|
+
_published:_
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
npm install @ --save
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
_without publishing (not recommended):_
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
npm install PATH_TO_GENERATED_PACKAGE/dist.tgz --save
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
_It's important to take the tgz file, otherwise you'll get trouble with links on windows_
|
|
32
|
+
|
|
33
|
+
_using `npm link`:_
|
|
34
|
+
|
|
35
|
+
In PATH_TO_GENERATED_PACKAGE/dist:
|
|
36
|
+
```
|
|
37
|
+
npm link
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
In your project:
|
|
41
|
+
```
|
|
42
|
+
npm link
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
__Note for Windows users:__ The Angular CLI has troubles to use linked npm packages.
|
|
46
|
+
Please refer to this issue https://github.com/angular/angular-cli/issues/8284 for a solution / workaround.
|
|
47
|
+
Published packages are not effected by this issue.
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
#### General usage
|
|
51
|
+
|
|
52
|
+
In your Angular project:
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
// without configuring providers
|
|
57
|
+
import { ApiModule } from '';
|
|
58
|
+
import { HttpClientModule } from '@angular/common/http';
|
|
59
|
+
|
|
60
|
+
@NgModule({
|
|
61
|
+
imports: [
|
|
62
|
+
ApiModule,
|
|
63
|
+
// make sure to import the HttpClientModule in the AppModule only,
|
|
64
|
+
// see https://github.com/angular/angular/issues/20575
|
|
65
|
+
HttpClientModule
|
|
66
|
+
],
|
|
67
|
+
declarations: [ AppComponent ],
|
|
68
|
+
providers: [],
|
|
69
|
+
bootstrap: [ AppComponent ]
|
|
70
|
+
})
|
|
71
|
+
export class AppModule {}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
// configuring providers
|
|
76
|
+
import { ApiModule, Configuration, ConfigurationParameters } from '';
|
|
77
|
+
|
|
78
|
+
export function apiConfigFactory (): Configuration {
|
|
79
|
+
const params: ConfigurationParameters = {
|
|
80
|
+
// set configuration parameters here.
|
|
81
|
+
}
|
|
82
|
+
return new Configuration(params);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
@NgModule({
|
|
86
|
+
imports: [ ApiModule.forRoot(apiConfigFactory) ],
|
|
87
|
+
declarations: [ AppComponent ],
|
|
88
|
+
providers: [],
|
|
89
|
+
bootstrap: [ AppComponent ]
|
|
90
|
+
})
|
|
91
|
+
export class AppModule {}
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
```
|
|
95
|
+
// configuring providers with an authentication service that manages your access tokens
|
|
96
|
+
import { ApiModule, Configuration } from '';
|
|
97
|
+
|
|
98
|
+
@NgModule({
|
|
99
|
+
imports: [ ApiModule ],
|
|
100
|
+
declarations: [ AppComponent ],
|
|
101
|
+
providers: [
|
|
102
|
+
{
|
|
103
|
+
provide: Configuration,
|
|
104
|
+
useFactory: (authService: AuthService) => new Configuration(
|
|
105
|
+
{
|
|
106
|
+
basePath: environment.apiUrl,
|
|
107
|
+
accessToken: authService.getAccessToken.bind(authService)
|
|
108
|
+
}
|
|
109
|
+
),
|
|
110
|
+
deps: [AuthService],
|
|
111
|
+
multi: false
|
|
112
|
+
}
|
|
113
|
+
],
|
|
114
|
+
bootstrap: [ AppComponent ]
|
|
115
|
+
})
|
|
116
|
+
export class AppModule {}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
```
|
|
120
|
+
import { DefaultApi } from '';
|
|
121
|
+
|
|
122
|
+
export class AppComponent {
|
|
123
|
+
constructor(private apiGateway: DefaultApi) { }
|
|
124
|
+
}
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
Note: The ApiModule is restricted to being instantiated once app wide.
|
|
128
|
+
This is to ensure that all services are treated as singletons.
|
|
129
|
+
|
|
130
|
+
#### Using multiple OpenAPI files / APIs / ApiModules
|
|
131
|
+
In order to use multiple `ApiModules` generated from different OpenAPI files,
|
|
132
|
+
you can create an alias name when importing the modules
|
|
133
|
+
in order to avoid naming conflicts:
|
|
134
|
+
```
|
|
135
|
+
import { ApiModule } from 'my-api-path';
|
|
136
|
+
import { ApiModule as OtherApiModule } from 'my-other-api-path';
|
|
137
|
+
import { HttpClientModule } from '@angular/common/http';
|
|
138
|
+
|
|
139
|
+
@NgModule({
|
|
140
|
+
imports: [
|
|
141
|
+
ApiModule,
|
|
142
|
+
OtherApiModule,
|
|
143
|
+
// make sure to import the HttpClientModule in the AppModule only,
|
|
144
|
+
// see https://github.com/angular/angular/issues/20575
|
|
145
|
+
HttpClientModule
|
|
146
|
+
]
|
|
147
|
+
})
|
|
148
|
+
export class AppModule {
|
|
149
|
+
|
|
150
|
+
}
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
### Set service base path
|
|
155
|
+
If different than the generated base path, during app bootstrap, you can provide the base path to your service.
|
|
156
|
+
|
|
157
|
+
```
|
|
158
|
+
import { BASE_PATH } from '';
|
|
159
|
+
|
|
160
|
+
bootstrap(AppComponent, [
|
|
161
|
+
{ provide: BASE_PATH, useValue: 'https://your-web-service.com' },
|
|
162
|
+
]);
|
|
163
|
+
```
|
|
164
|
+
or
|
|
165
|
+
|
|
166
|
+
```
|
|
167
|
+
import { BASE_PATH } from '';
|
|
168
|
+
|
|
169
|
+
@NgModule({
|
|
170
|
+
imports: [],
|
|
171
|
+
declarations: [ AppComponent ],
|
|
172
|
+
providers: [ provide: BASE_PATH, useValue: 'https://your-web-service.com' ],
|
|
173
|
+
bootstrap: [ AppComponent ]
|
|
174
|
+
})
|
|
175
|
+
export class AppModule {}
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
#### Using @angular/cli
|
|
180
|
+
First extend your `src/environments/*.ts` files by adding the corresponding base path:
|
|
181
|
+
|
|
182
|
+
```
|
|
183
|
+
export const environment = {
|
|
184
|
+
production: false,
|
|
185
|
+
API_BASE_PATH: 'http://127.0.0.1:8080'
|
|
186
|
+
};
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
In the src/app/app.module.ts:
|
|
190
|
+
```
|
|
191
|
+
import { BASE_PATH } from '';
|
|
192
|
+
import { environment } from '../environments/environment';
|
|
193
|
+
|
|
194
|
+
@NgModule({
|
|
195
|
+
declarations: [
|
|
196
|
+
AppComponent
|
|
197
|
+
],
|
|
198
|
+
imports: [ ],
|
|
199
|
+
providers: [{ provide: BASE_PATH, useValue: environment.API_BASE_PATH }],
|
|
200
|
+
bootstrap: [ AppComponent ]
|
|
201
|
+
})
|
|
202
|
+
export class AppModule { }
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
### Customizing path parameter encoding
|
|
206
|
+
|
|
207
|
+
Without further customization, only [path-parameters][parameter-locations-url] of [style][style-values-url] 'simple'
|
|
208
|
+
and Dates for format 'date-time' are encoded correctly.
|
|
209
|
+
|
|
210
|
+
Other styles (e.g. "matrix") are not that easy to encode
|
|
211
|
+
and thus are best delegated to other libraries (e.g.: [@honoluluhenk/http-param-expander]).
|
|
212
|
+
|
|
213
|
+
To implement your own parameter encoding (or call another library),
|
|
214
|
+
pass an arrow-function or method-reference to the `encodeParam` property of the Configuration-object
|
|
215
|
+
(see [General Usage](#general-usage) above).
|
|
216
|
+
|
|
217
|
+
Example value for use in your Configuration-Provider:
|
|
218
|
+
```typescript
|
|
219
|
+
new Configuration({
|
|
220
|
+
encodeParam: (param: Param) => myFancyParamEncoder(param),
|
|
221
|
+
})
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
[parameter-locations-url]: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#parameter-locations
|
|
225
|
+
[style-values-url]: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#style-values
|
|
226
|
+
[@honoluluhenk/http-param-expander]: https://www.npmjs.com/package/@honoluluhenk/http-param-expander
|