@decaf-ts/for-http 0.2.10 → 0.2.12

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 (45) hide show
  1. package/README.md +23 -3
  2. package/dist/for-http.cjs +2 -712
  3. package/dist/for-http.cjs.map +1 -0
  4. package/dist/for-http.js +2 -0
  5. package/dist/for-http.js.map +1 -0
  6. package/lib/RestRepository.cjs +1 -1
  7. package/lib/RestRepository.js.map +1 -0
  8. package/lib/RestService.cjs +1 -1
  9. package/lib/RestService.js.map +1 -0
  10. package/lib/adapter.cjs +1 -1
  11. package/lib/adapter.js.map +1 -0
  12. package/lib/axios/axios.cjs +1 -1
  13. package/lib/axios/axios.js.map +1 -0
  14. package/lib/axios/constants.cjs +1 -1
  15. package/lib/axios/constants.js.map +1 -0
  16. package/lib/axios/index.cjs +1 -1
  17. package/lib/axios/index.js.map +1 -0
  18. package/lib/axios/types.cjs +1 -1
  19. package/lib/axios/types.js.map +1 -0
  20. package/lib/esm/RestRepository.js +1 -1
  21. package/lib/esm/RestRepository.js.map +1 -0
  22. package/lib/esm/RestService.js +1 -1
  23. package/lib/esm/RestService.js.map +1 -0
  24. package/lib/esm/adapter.js +1 -1
  25. package/lib/esm/adapter.js.map +1 -0
  26. package/lib/esm/axios/axios.js +1 -1
  27. package/lib/esm/axios/axios.js.map +1 -0
  28. package/lib/esm/axios/constants.js +1 -1
  29. package/lib/esm/axios/constants.js.map +1 -0
  30. package/lib/esm/axios/index.js +1 -1
  31. package/lib/esm/axios/index.js.map +1 -0
  32. package/lib/esm/axios/types.js +1 -1
  33. package/lib/esm/axios/types.js.map +1 -0
  34. package/lib/esm/index.d.ts +1 -1
  35. package/lib/esm/index.js +2 -2
  36. package/lib/esm/index.js.map +1 -0
  37. package/lib/esm/types.js +1 -1
  38. package/lib/esm/types.js.map +1 -0
  39. package/lib/index.cjs +2 -2
  40. package/lib/index.d.ts +1 -1
  41. package/lib/index.js.map +1 -0
  42. package/lib/types.cjs +1 -1
  43. package/lib/types.js.map +1 -0
  44. package/package.json +11 -22
  45. package/dist/for-http.esm.cjs +0 -705
package/README.md CHANGED
@@ -1,10 +1,9 @@
1
- ![Banner](./assets/Banner.png)
1
+ ![Banner](./workdocs/assets/decaf-logo.svg)
2
2
 
3
3
  # decaf-ts/for-http
4
4
 
5
5
  A lightweight HTTP adapter layer for decaf-ts that enables CRUD-style repositories and services over REST APIs. It defines a generic HttpAdapter with concrete implementations (e.g., Axios), a RestService for simple model-centric operations, and a RestRepository when you need repository decoration logic before submitting to the backend. Includes minimal types for configuration and request flags.
6
6
 
7
-
8
7
  ![Licence](https://img.shields.io/github/license/decaf-ts/for-http.svg?style=plastic)
9
8
  ![GitHub language count](https://img.shields.io/github/languages/count/decaf-ts/for-http?style=plastic)
10
9
  ![GitHub top language](https://img.shields.io/github/languages/top/decaf-ts/for-http?style=plastic)
@@ -28,6 +27,9 @@ A lightweight HTTP adapter layer for decaf-ts that enables CRUD-style repositori
28
27
 
29
28
  Documentation available [here](https://decaf-ts.github.io/for-http/)
30
29
 
30
+ Minimal size: 1.7 KB kb gzipped
31
+
32
+
31
33
  # decaf-ts/for-http — Detailed Description
32
34
 
33
35
  This package provides a small, focused HTTP integration for decaf-ts. It introduces a generic HttpAdapter abstraction that maps REST semantics (create/read/update/delete and bulk variants) onto decaf-ts repositories and services, plus minimal configuration and flags. A ready-to-use Axios adapter is included.
@@ -305,6 +307,24 @@ const f: AxiosFlags = { headers: { "X-Trace": "1" } };
305
307
  ```
306
308
 
307
309
 
310
+ ## Coding Principles
311
+
312
+ - group similar functionality in folders (analog to namespaces but without any namespace declaration)
313
+ - one class per file;
314
+ - one interface per file (unless interface is just used as a type);
315
+ - group types as other interfaces in a types.ts file per folder;
316
+ - group constants or enums in a constants.ts file per folder;
317
+ - group decorators in a decorators.ts file per folder;
318
+ - always import from the specific file, never from a folder or index file (exceptions for dependencies on other packages);
319
+ - prefer the usage of established design patters where applicable:
320
+ - Singleton (can be an anti-pattern. use with care);
321
+ - factory;
322
+ - observer;
323
+ - strategy;
324
+ - builder;
325
+ - etc;
326
+
327
+
308
328
  ### Related
309
329
 
310
330
  [![decaf-ts](https://github-readme-stats.vercel.app/api/pin/?username=decaf-ts&repo=decaf-ts)](https://github.com/decaf-ts/decaf-ts)
@@ -347,4 +367,4 @@ So if you can, if this project in any way. either by learning something or simpl
347
367
 
348
368
  This project is released under the [MIT License](./LICENSE.md).
349
369
 
350
- By developers, for developers...
370
+ By developers, for developers...