@decaf-ts/for-http 0.2.11 → 0.2.13

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 (46) hide show
  1. package/LICENSE.md +0 -53
  2. package/README.md +23 -3
  3. package/dist/for-http.cjs +2 -712
  4. package/dist/for-http.cjs.map +1 -0
  5. package/dist/for-http.js +2 -0
  6. package/dist/for-http.js.map +1 -0
  7. package/lib/RestRepository.cjs +1 -1
  8. package/lib/RestRepository.js.map +1 -0
  9. package/lib/RestService.cjs +1 -1
  10. package/lib/RestService.js.map +1 -0
  11. package/lib/adapter.cjs +1 -1
  12. package/lib/adapter.js.map +1 -0
  13. package/lib/axios/axios.cjs +4 -2
  14. package/lib/axios/axios.js.map +1 -0
  15. package/lib/axios/constants.cjs +1 -1
  16. package/lib/axios/constants.js.map +1 -0
  17. package/lib/axios/index.cjs +1 -1
  18. package/lib/axios/index.js.map +1 -0
  19. package/lib/axios/types.cjs +1 -1
  20. package/lib/axios/types.js.map +1 -0
  21. package/lib/esm/RestRepository.js +1 -1
  22. package/lib/esm/RestRepository.js.map +1 -0
  23. package/lib/esm/RestService.js +1 -1
  24. package/lib/esm/RestService.js.map +1 -0
  25. package/lib/esm/adapter.js +1 -1
  26. package/lib/esm/adapter.js.map +1 -0
  27. package/lib/esm/axios/axios.js +4 -2
  28. package/lib/esm/axios/axios.js.map +1 -0
  29. package/lib/esm/axios/constants.js +1 -1
  30. package/lib/esm/axios/constants.js.map +1 -0
  31. package/lib/esm/axios/index.js +1 -1
  32. package/lib/esm/axios/index.js.map +1 -0
  33. package/lib/esm/axios/types.js +1 -1
  34. package/lib/esm/axios/types.js.map +1 -0
  35. package/lib/esm/index.d.ts +1 -1
  36. package/lib/esm/index.js +2 -2
  37. package/lib/esm/index.js.map +1 -0
  38. package/lib/esm/types.js +1 -1
  39. package/lib/esm/types.js.map +1 -0
  40. package/lib/index.cjs +2 -2
  41. package/lib/index.d.ts +1 -1
  42. package/lib/index.js.map +1 -0
  43. package/lib/types.cjs +1 -1
  44. package/lib/types.js.map +1 -0
  45. package/package.json +12 -49
  46. package/dist/for-http.esm.cjs +0 -705
package/LICENSE.md CHANGED
@@ -20,56 +20,3 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
20
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
21
  SOFTWARE.
22
22
 
23
- ---
24
-
25
- ## Section 2. AGPL Trigger: AI-Generated Code Usage
26
-
27
- If this software is incorporated into a product, service, or system that **uses AI generation of code**, then instead of MIT, the software is governed by the **GNU Affero General Public License v3.0 (AGPL-3.0)**, *in full*.
28
-
29
- **What “Uses AI generation of code” means (any of the following):**
30
- 1. The product uses AI to automatically generate **Decaf-TS front-end or back-end code**.
31
- 2. The product incorporates AI tools, pipelines, or workflows where **Decaf-TS code is generated** automatically or on demand.
32
- 3. Usage via **Decaf MCP** or any equivalent integration which enables AI-driven Decaf-TS code generation.
33
- 4. The product uses **Decaf-TS to dynamically generate UI** for AI agent conversation systems (chat, multimodal, interactive).
34
- 5. The product uses this software plus AI to generate software **“at scale”** (e.g. via automated bulk pipelines, continuous generation).
35
- 6. The product or service commercializes or sells software, tools, or applications **that were generated by AI using this software**.
36
-
37
- **Clarifications & Exceptions (these do *not* trigger AGPL):**
38
- - If AI is used only during **development time** (e.g. a developer uses AI + Decaf tooling as an assistant, writes or reviews code, then commits)—this **does not** count as “uses AI generation of code” in Section 2.
39
- - If a company builds a **Decaf-based product** using AI internally, but the **resulting product does not itself dynamically generate additional Decaf code**, then Section 2 is **not triggered**.
40
- - If a company builds a **Decaf-based product** using AI internally, and while the **resulting product does generate it's UI dynamically via Decaf, the product does not itself dynamically generate additional Decaf code as a service**, then Section 2 is **not triggered**.
41
-
42
- In all other cases meeting the six trigger conditions above, the software is subject to AGPL-3.0 — you must comply with all AGPL obligations (source disclosure, network interaction clause, etc.)
43
-
44
- ## Section 3. Reference to AGPL
45
-
46
- The full text of the GNU Affero General Public License v3.0 is available from the Free Software Foundation at:
47
- https://www.gnu.org/licenses/agpl-3.0.html
48
-
49
- ---
50
-
51
- ## Notes & Examples (for clarity)
52
-
53
- - A CLI tool that helps you scaffold Decaf code locally (without runtime AI generation) remains under MIT.
54
- - A web service that uses AI at runtime to produce new Decaf UI or backend code for users must operate under AGPL.
55
- - A SaaS product that sells modules generated via AI using this software falls under AGPL.
56
- - Internal use or development with AI suggestions, without dynamic generation in the delivered product, is under MIT.
57
-
58
- ---
59
-
60
- **Legal disclaimers, warranty, and liability** follow the same as in MIT or AGPL as applicable.
61
-
62
- ---
63
-
64
- ### Why this is more “bullet-proof” (improvements over earlier drafts)
65
-
66
- - The **trigger conditions** are enumerated and explicit (six bullet points).
67
- - The **exceptions** are limited and clearly stated (development-time, non-code-generating product).
68
- - We embed the MIT text fully (so recipients see their rights).
69
- - We **link to the full AGPL** rather than embed it (keeping the file manageable) but still make it binding by reference.
70
- - We include a **Notes & Examples** section to show boundary cases and reduce ambiguity.
71
- - The style is more “plain English + structured” (like n8n’s) to reduce misinterpretation.
72
-
73
- ---
74
-
75
- If you like, I can generate this as a **downloadable `LICENSE.md` file** for you right away, so you can drop it in your repo. Would you like me to do that?
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)
@@ -345,6 +365,6 @@ So if you can, if this project in any way. either by learning something or simpl
345
365
 
346
366
  ## License
347
367
 
348
- This project is released under MIT with an AGPL-3.0 trigger for AI-generated code usage; MIT covers standard development, but AI-driven Decaf code generation activates full AGPL obligations—see [LICENSE.md](./LICENSE.md) for full terms.
368
+ This project is released under the [MIT License](./LICENSE.md).
349
369
 
350
370
  By developers, for developers...