@ng-openapi/http-resource 0.0.34-pr-103-refactored-d262edf.0 → 0.0.34-pr-103-refactored-9f97df2.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 +11 -9
- package/index.cjs +1 -2
- package/index.d.ts +1 -1
- package/index.js +1 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -22,11 +22,8 @@
|
|
|
22
22
|
|
|
23
23
|
## What is HTTP Resource Plugin?
|
|
24
24
|
|
|
25
|
-
The HTTP Resource plugin generates Angular services using the
|
|
26
|
-
|
|
27
|
-
endpoints.
|
|
28
|
-
|
|
29
|
-
> ⚠️ **Experimental Feature**: `httpResource` is still experimental in Angular. Use with caution in production.
|
|
25
|
+
The HTTP Resource plugin generates Angular services using the `httpResource` API instead of traditional `HttpClient`.
|
|
26
|
+
This provides automatic caching, state management, and reactive data loading for your OpenAPI endpoints.
|
|
30
27
|
|
|
31
28
|
## Installation
|
|
32
29
|
|
|
@@ -46,8 +43,12 @@ import { HttpResourcePlugin } from "@ng-openapi/http-resource";
|
|
|
46
43
|
export default {
|
|
47
44
|
input: "./swagger.json",
|
|
48
45
|
output: "./src/api",
|
|
49
|
-
clientName: "
|
|
46
|
+
clientName: "MyApi",
|
|
50
47
|
plugins: [HttpResourcePlugin],
|
|
48
|
+
options: {
|
|
49
|
+
dateType: "Date",
|
|
50
|
+
enumStyle: "enum",
|
|
51
|
+
},
|
|
51
52
|
} as GeneratorConfig;
|
|
52
53
|
```
|
|
53
54
|
|
|
@@ -62,11 +63,12 @@ ng-openapi -c openapi.config.ts
|
|
|
62
63
|
```typescript
|
|
63
64
|
// app.config.ts
|
|
64
65
|
import { ApplicationConfig } from "@angular/core";
|
|
65
|
-
import {
|
|
66
|
+
import { provideMyApiClient } from "./api/providers";
|
|
66
67
|
|
|
67
68
|
export const appConfig: ApplicationConfig = {
|
|
68
69
|
providers: [
|
|
69
|
-
|
|
70
|
+
// The provider function is named after `clientName` ("MyApi" → provideMyApiClient)
|
|
71
|
+
provideMyApiClient({
|
|
70
72
|
basePath: "https://api.example.com",
|
|
71
73
|
}),
|
|
72
74
|
],
|
|
@@ -118,6 +120,6 @@ src/api/
|
|
|
118
120
|
|
|
119
121
|
## Documentation
|
|
120
122
|
|
|
121
|
-
- 📖 [Full Documentation](https://ng-openapi.dev/
|
|
123
|
+
- 📖 [Full Documentation](https://ng-openapi.dev/guide/http-resource)
|
|
122
124
|
- 🎯 [Angular httpResource Guide](https://angular.dev/guide/http/resource)
|
|
123
125
|
- 🚀 [Live Examples](https://stackblitz.com/@Mr-Jami/collections/ng-openapi-examples)
|
package/index.cjs
CHANGED
|
@@ -3064,8 +3064,7 @@ var PROVIDER_GENERATOR_HEADER_COMMENT = defaultHeaderComment + `* Generated prov
|
|
|
3064
3064
|
* Do not edit this file manually
|
|
3065
3065
|
*/
|
|
3066
3066
|
`;
|
|
3067
|
-
var HTTP_RESOURCE_GENERATOR_HEADER_COMMENT = /* @__PURE__ */ __name((resourceName) => defaultHeaderComment + `* \`httpResource\`
|
|
3068
|
-
* Generated Angular service for ${resourceName}
|
|
3067
|
+
var HTTP_RESOURCE_GENERATOR_HEADER_COMMENT = /* @__PURE__ */ __name((resourceName) => defaultHeaderComment + `* Generated Angular \`httpResource\` service for ${resourceName}
|
|
3069
3068
|
* Do not edit this file manually
|
|
3070
3069
|
*/
|
|
3071
3070
|
`, "HTTP_RESOURCE_GENERATOR_HEADER_COMMENT");
|
package/index.d.ts
CHANGED
|
@@ -152,7 +152,7 @@ type ResponseKind = "json" | "blob" | "arraybuffer" | "text";
|
|
|
152
152
|
* A spec operation with everything the generators need precomputed once at
|
|
153
153
|
* normalization time. Generators must not re-derive any of these fields or
|
|
154
154
|
* resolve $refs during emission — that is exactly the duplication this model
|
|
155
|
-
* exists to remove
|
|
155
|
+
* exists to remove.
|
|
156
156
|
*/
|
|
157
157
|
interface NormalizedOperation extends PathInfo {
|
|
158
158
|
/** parameters with in === "path" */
|
package/index.js
CHANGED
|
@@ -3030,8 +3030,7 @@ var PROVIDER_GENERATOR_HEADER_COMMENT = defaultHeaderComment + `* Generated prov
|
|
|
3030
3030
|
* Do not edit this file manually
|
|
3031
3031
|
*/
|
|
3032
3032
|
`;
|
|
3033
|
-
var HTTP_RESOURCE_GENERATOR_HEADER_COMMENT = /* @__PURE__ */ __name((resourceName) => defaultHeaderComment + `* \`httpResource\`
|
|
3034
|
-
* Generated Angular service for ${resourceName}
|
|
3033
|
+
var HTTP_RESOURCE_GENERATOR_HEADER_COMMENT = /* @__PURE__ */ __name((resourceName) => defaultHeaderComment + `* Generated Angular \`httpResource\` service for ${resourceName}
|
|
3035
3034
|
* Do not edit this file manually
|
|
3036
3035
|
*/
|
|
3037
3036
|
`, "HTTP_RESOURCE_GENERATOR_HEADER_COMMENT");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ng-openapi/http-resource",
|
|
3
|
-
"version": "0.0.34-pr-103-refactored-
|
|
3
|
+
"version": "0.0.34-pr-103-refactored-9f97df2.0",
|
|
4
4
|
"description": "HTTP Resource plugin for ng-openapi - Angular HTTP utilities with caching and state management",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|