@prowodo/angular-client 1.0.2 → 1.1.0

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/README.md CHANGED
@@ -1,185 +1,49 @@
1
- # @prowodo/angular-client@1.0.2
1
+ # @prowodo/angular-client
2
2
 
3
- PROject WOrk DOne
3
+ Typed Angular client for [ProWoDo](https://prowodo.com).
4
4
 
5
- The version of the OpenAPI document: 1.0.0
5
+ ## Install
6
6
 
7
- ## Building
8
-
9
- To install the required dependencies and to build the typescript sources run:
10
-
11
- ```console
12
- npm install
13
- npm run build
14
- ```
15
-
16
- ## Publishing
17
-
18
- First build the package then run `npm publish dist` (don't forget to specify the `dist` folder!)
19
-
20
- ## Consuming
21
-
22
- Navigate to the folder of your consuming project and run one of next commands.
23
-
24
- _published:_
25
-
26
- ```console
27
- npm install @prowodo/angular-client@1.0.2 --save
28
- ```
29
-
30
- _without publishing (not recommended):_
31
-
32
- ```console
33
- npm install PATH_TO_GENERATED_PACKAGE/dist.tgz --save
34
- ```
35
-
36
- _It's important to take the tgz file, otherwise you'll get trouble with links on windows_
37
-
38
- _using `npm link`:_
39
-
40
- In PATH_TO_GENERATED_PACKAGE/dist:
41
-
42
- ```console
43
- npm link
44
- ```
45
-
46
- In your project:
47
-
48
- ```console
49
- npm link @prowodo/angular-client
50
- ```
51
-
52
- __Note for Windows users:__ The Angular CLI has troubles to use linked npm packages.
53
- Please refer to this issue <https://github.com/angular/angular-cli/issues/8284> for a solution / workaround.
54
- Published packages are not effected by this issue.
55
-
56
- ### General usage
57
-
58
- In your Angular project:
59
-
60
- ```typescript
61
-
62
- import { ApplicationConfig } from '@angular/core';
63
- import { provideHttpClient } from '@angular/common/http';
64
- import { provideApi } from '@prowodo/angular-client';
65
-
66
- export const appConfig: ApplicationConfig = {
67
- providers: [
68
- // ...
69
- provideHttpClient(),
70
- provideApi()
71
- ],
72
- };
73
- ```
74
-
75
- **NOTE**
76
- If you're still using `AppModule` and haven't [migrated](https://angular.dev/reference/migrations/standalone) yet, you can still import an Angular module:
77
- ```typescript
78
- import { ApiModule } from '@prowodo/angular-client';
79
- ```
80
-
81
- If different from the generated base path, during app bootstrap, you can provide the base path to your service.
82
-
83
- ```typescript
84
- import { ApplicationConfig } from '@angular/core';
85
- import { provideHttpClient } from '@angular/common/http';
86
- import { provideApi } from '@prowodo/angular-client';
87
-
88
- export const appConfig: ApplicationConfig = {
89
- providers: [
90
- // ...
91
- provideHttpClient(),
92
- provideApi('http://localhost:9999')
93
- ],
94
- };
7
+ ```bash
8
+ npm install @prowodo/angular-client
95
9
  ```
96
10
 
97
- ```typescript
98
- // with a custom configuration
99
- import { ApplicationConfig } from '@angular/core';
100
- import { provideHttpClient } from '@angular/common/http';
101
- import { provideApi } from '@prowodo/angular-client';
102
-
103
- export const appConfig: ApplicationConfig = {
104
- providers: [
105
- // ...
106
- provideHttpClient(),
107
- provideApi({
108
- withCredentials: true,
109
- username: 'user',
110
- password: 'password'
111
- })
112
- ],
113
- };
114
- ```
11
+ ## Quick start
115
12
 
116
13
  ```typescript
117
- // with factory building a custom configuration
118
- import { ApplicationConfig } from '@angular/core';
119
- import { provideHttpClient } from '@angular/common/http';
120
- import { provideApi, Configuration } from '@prowodo/angular-client';
121
-
122
- export const appConfig: ApplicationConfig = {
123
- providers: [
124
- // ...
125
- provideHttpClient(),
126
- {
127
- provide: Configuration,
128
- useFactory: (authService: AuthService) => new Configuration({
129
- basePath: 'http://localhost:9999',
130
- withCredentials: true,
131
- username: authService.getUsername(),
132
- password: authService.getPassword(),
133
- }),
134
- deps: [AuthService],
135
- multi: false
136
- }
137
- ],
138
- };
139
- ```
140
-
141
- ### Using multiple OpenAPI files / APIs
142
-
143
- In order to use multiple APIs generated from different OpenAPI files,
144
- you can create an alias name when importing the modules
145
- in order to avoid naming conflicts:
14
+ import { ApiModule, Configuration, TasksService } from '@prowodo/angular-client';
15
+
16
+ @NgModule({
17
+ imports: [
18
+ ApiModule.forRoot(() => new Configuration({
19
+ basePath: 'https://backend.prowodo.com',
20
+ credentials: {
21
+ firebaseAuth: () => localStorage.getItem('FToken') ?? '',
22
+ },
23
+ })),
24
+ ],
25
+ })
26
+ export class AppModule {}
146
27
 
147
- ```typescript
148
- import { provideApi as provideUserApi } from 'my-user-api-path';
149
- import { provideApi as provideAdminApi } from 'my-admin-api-path';
150
- import { HttpClientModule } from '@angular/common/http';
151
- import { environment } from '../environments/environment';
28
+ // In a component:
29
+ constructor(private tasks: TasksService) {}
152
30
 
153
- export const appConfig: ApplicationConfig = {
154
- providers: [
155
- // ...
156
- provideHttpClient(),
157
- provideUserApi(environment.basePath),
158
- provideAdminApi(environment.basePath),
159
- ],
160
- };
31
+ ngOnInit() {
32
+ this.tasks.tasksList().subscribe(tasks => console.log(tasks));
33
+ }
161
34
  ```
162
35
 
163
- ### Customizing path parameter encoding
36
+ ## API reference
164
37
 
165
- Without further customization, only [path-parameters][parameter-locations-url] of [style][style-values-url] 'simple'
166
- and Dates for format 'date-time' are encoded correctly.
38
+ The client is generated from the ProWoDo OpenAPI schema. Browse the runtime schema at `https://backend.prowodo.com/api/schema/swagger-ui/`.
167
39
 
168
- Other styles (e.g. "matrix") are not that easy to encode
169
- and thus are best delegated to other libraries (e.g.: [@honoluluhenk/http-param-expander]).
40
+ ## Versioning
170
41
 
171
- To implement your own parameter encoding (or call another library),
172
- pass an arrow-function or method-reference to the `encodeParam` property of the Configuration-object
173
- (see [General Usage](#general-usage) above).
42
+ - **Patch** (1.0.x): additive non-breaking new endpoint, new optional field/param
43
+ - **Major** (x.0.0): breaking removed/renamed endpoint, removed field, changed type
174
44
 
175
- Example value for use in your Configuration-Provider:
45
+ See [CHANGELOG.md](https://github.com/i3idea/prowodo-api-clients/blob/main/CHANGELOG.md) in the repo for release notes.
176
46
 
177
- ```typescript
178
- new Configuration({
179
- encodeParam: (param: Param) => myFancyParamEncoder(param),
180
- })
181
- ```
47
+ ## License
182
48
 
183
- [parameter-locations-url]: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#parameter-locations
184
- [style-values-url]: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#style-values
185
- [@honoluluhenk/http-param-expander]: https://www.npmjs.com/package/@honoluluhenk/http-param-expander
49
+ MIT
@@ -3509,6 +3509,82 @@ class ApiService extends BaseService {
3509
3509
  reportProgress: reportProgress
3510
3510
  });
3511
3511
  }
3512
+ ticketsStatus(requestParameters, observe = 'body', reportProgress = false, options) {
3513
+ const ticketUuid = requestParameters?.ticketUuid;
3514
+ if (ticketUuid === null || ticketUuid === undefined) {
3515
+ throw new Error('Required parameter ticketUuid was null or undefined when calling ticketsStatus.');
3516
+ }
3517
+ let localVarHeaders = this.defaultHeaders;
3518
+ const localVarHttpHeaderAcceptSelected = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
3519
+ 'application/json'
3520
+ ]);
3521
+ if (localVarHttpHeaderAcceptSelected !== undefined) {
3522
+ localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
3523
+ }
3524
+ const localVarHttpContext = options?.context ?? new HttpContext();
3525
+ const localVarTransferCache = options?.transferCache ?? true;
3526
+ let responseType_ = 'json';
3527
+ if (localVarHttpHeaderAcceptSelected) {
3528
+ if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
3529
+ responseType_ = 'text';
3530
+ }
3531
+ else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
3532
+ responseType_ = 'json';
3533
+ }
3534
+ else {
3535
+ responseType_ = 'blob';
3536
+ }
3537
+ }
3538
+ let localVarPath = `/api/tickets/status/${this.configuration.encodeParam({ name: "ticketUuid", value: ticketUuid, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: "uuid" })}/`;
3539
+ const { basePath, withCredentials } = this.configuration;
3540
+ return this.httpClient.request('get', `${basePath}${localVarPath}`, {
3541
+ context: localVarHttpContext,
3542
+ responseType: responseType_,
3543
+ ...(withCredentials ? { withCredentials } : {}),
3544
+ headers: localVarHeaders,
3545
+ observe: observe,
3546
+ ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
3547
+ reportProgress: reportProgress
3548
+ });
3549
+ }
3550
+ ticketsStatus2(requestParameters, observe = 'body', reportProgress = false, options) {
3551
+ const ticketUuid = requestParameters?.ticketUuid;
3552
+ if (ticketUuid === null || ticketUuid === undefined) {
3553
+ throw new Error('Required parameter ticketUuid was null or undefined when calling ticketsStatus2.');
3554
+ }
3555
+ let localVarHeaders = this.defaultHeaders;
3556
+ const localVarHttpHeaderAcceptSelected = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
3557
+ 'application/json'
3558
+ ]);
3559
+ if (localVarHttpHeaderAcceptSelected !== undefined) {
3560
+ localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
3561
+ }
3562
+ const localVarHttpContext = options?.context ?? new HttpContext();
3563
+ const localVarTransferCache = options?.transferCache ?? true;
3564
+ let responseType_ = 'json';
3565
+ if (localVarHttpHeaderAcceptSelected) {
3566
+ if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
3567
+ responseType_ = 'text';
3568
+ }
3569
+ else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
3570
+ responseType_ = 'json';
3571
+ }
3572
+ else {
3573
+ responseType_ = 'blob';
3574
+ }
3575
+ }
3576
+ let localVarPath = `/api/ticketsstatus/${this.configuration.encodeParam({ name: "ticketUuid", value: ticketUuid, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: "uuid" })}/`;
3577
+ const { basePath, withCredentials } = this.configuration;
3578
+ return this.httpClient.request('get', `${basePath}${localVarPath}`, {
3579
+ context: localVarHttpContext,
3580
+ responseType: responseType_,
3581
+ ...(withCredentials ? { withCredentials } : {}),
3582
+ headers: localVarHeaders,
3583
+ observe: observe,
3584
+ ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
3585
+ reportProgress: reportProgress
3586
+ });
3587
+ }
3512
3588
  ticketsSubmit(requestParameters, observe = 'body', reportProgress = false, options) {
3513
3589
  const ticketSubmit = requestParameters?.ticketSubmit;
3514
3590
  if (ticketSubmit === null || ticketSubmit === undefined) {
@@ -10621,6 +10697,16 @@ const StatusEnum = {
10621
10697
  * Do not edit the class manually.
10622
10698
  */
10623
10699
 
10700
+ /**
10701
+ * ProWoDo API
10702
+ *
10703
+ *
10704
+ *
10705
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
10706
+ * https://openapi-generator.tech
10707
+ * Do not edit the class manually.
10708
+ */
10709
+
10624
10710
  /**
10625
10711
  * ProWoDo API
10626
10712
  *