@smartbit4all/ng-client 3.3.71 → 3.3.73

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/esm2020/lib/session/api/api/session.service.mjs +1 -1
  2. package/esm2020/lib/session/api/encoder.mjs +1 -1
  3. package/esm2020/lib/session/api/model/accountInfo.mjs +1 -1
  4. package/esm2020/lib/session/api/model/apiError.mjs +1 -1
  5. package/esm2020/lib/session/api/model/authenticationProviderData.mjs +1 -1
  6. package/esm2020/lib/session/api/model/getAuthenticationProvidersResponse.mjs +1 -1
  7. package/esm2020/lib/session/api/model/models.mjs +1 -1
  8. package/esm2020/lib/session/api/model/refreshSessionRequest.mjs +1 -1
  9. package/esm2020/lib/session/api/model/session.mjs +1 -1
  10. package/esm2020/lib/session/api/model/sessionInfoData.mjs +1 -1
  11. package/esm2020/lib/session/api/model/userActivityLog.mjs +1 -1
  12. package/esm2020/lib/session/api/param.mjs +1 -1
  13. package/esm2020/lib/session/api/variables.mjs +1 -1
  14. package/esm2020/lib/shared/smart-tooltip.directive.mjs +1 -1
  15. package/esm2020/lib/smart-component-layout/api/api/api.mjs +1 -1
  16. package/esm2020/lib/smart-component-layout/api/api/default.service.mjs +1 -1
  17. package/esm2020/lib/smart-component-layout/api/api.module.mjs +1 -1
  18. package/esm2020/lib/smart-component-layout/api/configuration.mjs +1 -1
  19. package/esm2020/lib/smart-component-layout/api/encoder.mjs +1 -1
  20. package/esm2020/lib/smart-component-layout/api/index.mjs +1 -1
  21. package/esm2020/lib/smart-component-layout/api/model/componentType.mjs +1 -1
  22. package/esm2020/lib/smart-component-layout/api/model/componentWidgetType.mjs +1 -1
  23. package/esm2020/lib/smart-component-layout/api/model/layoutDirection.mjs +1 -1
  24. package/esm2020/lib/smart-component-layout/api/model/models.mjs +1 -1
  25. package/esm2020/lib/smart-component-layout/api/model/smartComponentLayoutDefinition.mjs +1 -1
  26. package/esm2020/lib/smart-component-layout/api/model/smartComponentWidgetDefinition.mjs +1 -1
  27. package/esm2020/lib/smart-component-layout/api/param.mjs +1 -1
  28. package/esm2020/lib/smart-component-layout/api/variables.mjs +1 -1
  29. package/esm2020/lib/smart-filter/api/filter/model/filterExpressionBoolOperator.mjs +1 -1
  30. package/esm2020/lib/smart-filter/api/filter/model/filterExpressionBuilderField.mjs +1 -1
  31. package/esm2020/lib/smart-filter/api/filter/model/filterExpressionBuilderGroup.mjs +1 -1
  32. package/esm2020/lib/smart-filter/api/filter/model/filterExpressionBuilderModel.mjs +1 -1
  33. package/esm2020/lib/smart-filter/api/filter/model/filterExpressionData.mjs +1 -1
  34. package/esm2020/lib/smart-filter/api/filter/model/filterExpressionDataType.mjs +1 -1
  35. package/esm2020/lib/smart-filter/api/filter/model/filterExpressionField.mjs +1 -1
  36. package/esm2020/lib/smart-filter/api/filter/model/filterExpressionFieldList.mjs +1 -1
  37. package/esm2020/lib/smart-filter/api/filter/model/filterExpressionFieldWidgetType.mjs +1 -1
  38. package/esm2020/lib/smart-filter/api/filter/model/filterExpressionList.mjs +1 -1
  39. package/esm2020/lib/smart-filter/api/filter/model/filterExpressionOperandData.mjs +1 -1
  40. package/esm2020/lib/smart-filter/api/filter/model/filterExpressionOperation.mjs +1 -1
  41. package/esm2020/lib/smart-filter/api/filter/model/filterExpressionOrderBy.mjs +1 -1
  42. package/esm2020/lib/smart-form/api/model/models.mjs +1 -1
  43. package/esm2020/lib/smart-form/api/model/selectionDefinition.mjs +1 -1
  44. package/esm2020/lib/smart-form/api/model/smartFormWidgetDirection.mjs +1 -1
  45. package/esm2020/lib/smart-form/api/model/smartFormWidgetType.mjs +1 -1
  46. package/esm2020/lib/smart-form/api/model/smartWidgetDefinition.mjs +1 -1
  47. package/esm2020/lib/smart-form/api/model/smartWidgetHint.mjs +1 -1
  48. package/esm2020/lib/smart-form/api/model/valueChangeMode.mjs +1 -1
  49. package/esm2020/lib/smart-grid/api/grid-api/api/grid.service.mjs +58 -1
  50. package/esm2020/lib/smart-grid/api/grid-api/model/gridColumnContentType.mjs +1 -1
  51. package/esm2020/lib/smart-grid/api/grid-api/model/gridColumnMeta.mjs +1 -1
  52. package/esm2020/lib/smart-grid/api/grid-api/model/gridDataAccessConfig.mjs +1 -1
  53. package/esm2020/lib/smart-grid/api/grid-api/model/gridModel.mjs +1 -1
  54. package/esm2020/lib/smart-grid/api/grid-api/model/gridRow.mjs +1 -1
  55. package/esm2020/lib/smart-grid/api/grid-api/model/gridSelectionChange.mjs +13 -0
  56. package/esm2020/lib/smart-grid/api/grid-api/model/gridSelectionMode.mjs +1 -1
  57. package/esm2020/lib/smart-grid/api/grid-api/model/gridSelectionType.mjs +1 -1
  58. package/esm2020/lib/smart-grid/api/grid-api/model/gridUpdateData.mjs +1 -1
  59. package/esm2020/lib/smart-grid/api/grid-api/model/gridView.mjs +1 -1
  60. package/esm2020/lib/smart-grid/api/grid-api/model/gridViewDescriptor.mjs +1 -1
  61. package/esm2020/lib/smart-grid/api/grid-api/model/models.mjs +2 -1
  62. package/esm2020/lib/smart-grid/smart-grid.component.mjs +18 -12
  63. package/esm2020/lib/smart-grid/smart-grid.service.mjs +6 -1
  64. package/esm2020/lib/smart-table/tables/material-table/material-table.component.mjs +3 -3
  65. package/esm2020/lib/smart-tree/tree-api/api/tree.service.mjs +1 -1
  66. package/esm2020/lib/smart-tree/tree-api/configuration.mjs +1 -1
  67. package/esm2020/lib/smart-tree/tree-api/encoder.mjs +1 -1
  68. package/esm2020/lib/smart-tree/tree-api/param.mjs +1 -1
  69. package/esm2020/lib/smart-tree/tree-api/variables.mjs +1 -1
  70. package/esm2020/lib/view-context/api/model/openPendingData.mjs +1 -1
  71. package/esm2020/lib/view-context/value-api/api/api.mjs +1 -1
  72. package/esm2020/lib/view-context/value-api/api/value.service.mjs +1 -1
  73. package/esm2020/lib/view-context/value-api/api.module.mjs +1 -1
  74. package/esm2020/lib/view-context/value-api/configuration.mjs +1 -1
  75. package/esm2020/lib/view-context/value-api/encoder.mjs +1 -1
  76. package/esm2020/lib/view-context/value-api/index.mjs +1 -1
  77. package/esm2020/lib/view-context/value-api/model/genericValue.mjs +1 -1
  78. package/esm2020/lib/view-context/value-api/model/models.mjs +1 -1
  79. package/esm2020/lib/view-context/value-api/model/value.mjs +1 -1
  80. package/esm2020/lib/view-context/value-api/model/valueSetDefinition.mjs +1 -1
  81. package/esm2020/lib/view-context/value-api/model/valueSetDefinitionIdentifier.mjs +1 -1
  82. package/esm2020/lib/view-context/value-api/model/valueSetOperand.mjs +1 -1
  83. package/esm2020/lib/view-context/value-api/param.mjs +1 -1
  84. package/esm2020/lib/view-context/value-api/variables.mjs +1 -1
  85. package/fesm2015/smartbit4all-ng-client.mjs +85 -17
  86. package/fesm2015/smartbit4all-ng-client.mjs.map +1 -1
  87. package/fesm2020/smartbit4all-ng-client.mjs +93 -13
  88. package/fesm2020/smartbit4all-ng-client.mjs.map +1 -1
  89. package/lib/smart-grid/api/grid-api/api/grid.service.d.ts +21 -0
  90. package/lib/smart-grid/api/grid-api/model/gridSelectionChange.d.ts +18 -0
  91. package/lib/smart-grid/api/grid-api/model/models.d.ts +1 -0
  92. package/lib/smart-grid/smart-grid.component.d.ts +1 -2
  93. package/lib/smart-grid/smart-grid.service.d.ts +1 -0
  94. package/package.json +1 -1
  95. package/smartbit4all-ng-client-3.3.73.tgz +0 -0
  96. package/src/lib/session/api/README.md +226 -226
  97. package/src/lib/smart-component-layout/api/README.md +226 -226
  98. package/src/lib/smart-tree/tree-api/README.md +226 -226
  99. package/src/lib/view-context/value-api/README.md +226 -226
  100. package/smartbit4all-ng-client-3.3.71.tgz +0 -0
@@ -1,6 +1,7 @@
1
1
  import { HttpClient, HttpHeaders, HttpResponse, HttpEvent, HttpParameterCodec, HttpContext } from '@angular/common/http';
2
2
  import { Observable } from 'rxjs';
3
3
  import { GridModel } from '../model/gridModel';
4
+ import { GridSelectionChange } from '../model/gridSelectionChange';
4
5
  import { GridUpdateData } from '../model/gridUpdateData';
5
6
  import { ViewContextChange } from '../../../../view-context/api';
6
7
  import { Configuration } from '../configuration';
@@ -94,6 +95,26 @@ export declare class GridService {
94
95
  httpHeaderAccept?: 'application/json';
95
96
  context?: HttpContext;
96
97
  }): Observable<HttpEvent<ViewContextChange>>;
98
+ /**
99
+ *
100
+ * @param uuid
101
+ * @param gridId
102
+ * @param gridSelectionChange
103
+ * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
104
+ * @param reportProgress flag to report request and response progress.
105
+ */
106
+ selectRows(uuid: string, gridId: string, gridSelectionChange: GridSelectionChange, observe?: 'body', reportProgress?: boolean, options?: {
107
+ httpHeaderAccept?: 'application/json';
108
+ context?: HttpContext;
109
+ }): Observable<ViewContextChange>;
110
+ selectRows(uuid: string, gridId: string, gridSelectionChange: GridSelectionChange, observe?: 'response', reportProgress?: boolean, options?: {
111
+ httpHeaderAccept?: 'application/json';
112
+ context?: HttpContext;
113
+ }): Observable<HttpResponse<ViewContextChange>>;
114
+ selectRows(uuid: string, gridId: string, gridSelectionChange: GridSelectionChange, observe?: 'events', reportProgress?: boolean, options?: {
115
+ httpHeaderAccept?: 'application/json';
116
+ context?: HttpContext;
117
+ }): Observable<HttpEvent<ViewContextChange>>;
97
118
  /**
98
119
  *
99
120
  * @param uuid
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Grid api
3
+ * The grid api is resposible for the grid components that shows a list of item.
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
+ /**
13
+ * This object contains all information about a grid\'s selection change.
14
+ */
15
+ export interface GridSelectionChange {
16
+ selected: Array<string>;
17
+ unselected: Array<string>;
18
+ }
@@ -4,6 +4,7 @@ export * from './gridDataAccessConfig';
4
4
  export * from './gridModel';
5
5
  export * from './gridPage';
6
6
  export * from './gridRow';
7
+ export * from './gridSelectionChange';
7
8
  export * from './gridSelectionMode';
8
9
  export * from './gridSelectionType';
9
10
  export * from './gridServerModel';
@@ -94,9 +94,8 @@ export declare class SmartGridComponent implements AfterViewInit, OnDestroy, OnC
94
94
  onDoubleClick(gridRow: GridRow): void;
95
95
  private handleOnClick;
96
96
  onSelect(rowId: any): Promise<void>;
97
- private selectRowInternal;
98
- private onSelectList;
99
97
  private onSelectAll;
98
+ private onSelectRows;
100
99
  editColumns(): void;
101
100
  static ɵfac: i0.ɵɵFactoryDeclaration<SmartGridComponent, never>;
102
101
  static ɵcmp: i0.ɵɵComponentDeclaration<SmartGridComponent, "smart-grid", never, { "smartGrid": "smartGrid"; "uuid": "uuid"; "dev": "dev"; }, {}, never, never>;
@@ -13,6 +13,7 @@ export declare class SmartGridService {
13
13
  sort(smartGrid: SmartGrid, gridUpdateData: GridUpdateData): Promise<void>;
14
14
  expand(smartGrid: SmartGrid, rowId: string): Promise<any>;
15
15
  select(smartGrid: SmartGrid, gridRow: GridRow): Promise<any>;
16
+ selectRows(smartGrid: SmartGrid, selected: string[], unselected: string[]): Promise<any>;
16
17
  selectAll(smartGrid: SmartGrid, selected: boolean): Promise<any>;
17
18
  update(uuid: string, identifier: string, updateData: GridUpdateData): Promise<void>;
18
19
  private updateGrid;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smartbit4all/ng-client",
3
- "version": "3.3.71",
3
+ "version": "3.3.73",
4
4
  "peerDependencies": {
5
5
  "@angular/animations": "^13.3.9",
6
6
  "@angular/common": "^13.2.0",
@@ -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