@xeno-js/shared 0.2.1 → 1.0.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 +37 -11
- package/dist/index.cjs +0 -31
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +38 -44
- package/dist/index.d.ts +38 -44
- package/dist/index.js +0 -20
- package/dist/index.js.map +1 -1
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<div align="center">
|
|
2
|
-
<img src="logo/logo.png" alt="Xeno Shared Logo" width="140" />
|
|
2
|
+
<img src="logo/logo.png" alt="Xeno.JS Shared Logo" width="140" />
|
|
3
3
|
|
|
4
4
|
<h1>@xeno-js/shared</h1>
|
|
5
5
|
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
<img src="https://img.shields.io/npm/v/@xeno-js/shared?style=flat-square" alt="npm version" />
|
|
19
19
|
</a>
|
|
20
20
|
<a href="https://github.com/xeno-js/xeno-shared/blob/develop/LICENSE">
|
|
21
|
-
<img src="https://img.shields.io/npm/l/@xeno-js/shared?style=flat-square" alt="License:
|
|
21
|
+
<img src="https://img.shields.io/npm/l/@xeno-js/shared?style=flat-square" alt="License: MIT" />
|
|
22
22
|
</a>
|
|
23
23
|
<a href="https://buymeacoffee.com/xenojs">
|
|
24
24
|
<img src="https://img.shields.io/badge/Buy%20Me%20A%20Coffee-Support-FFdd00?style=flat-square&logo=buy-me-a-coffee&logoColor=black" alt="Buy Me A Coffee" />
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
## What is `@xeno-js/shared`?
|
|
32
32
|
|
|
33
33
|
`@xeno-js/shared` provides the **domain primitives and framework-neutral
|
|
34
|
-
contracts** used across the Xeno ecosystem.
|
|
34
|
+
contracts** used across the Xeno.JS ecosystem.
|
|
35
35
|
|
|
36
36
|
It gives TypeScript applications explicit building blocks for:
|
|
37
37
|
|
|
@@ -59,9 +59,10 @@ boundary.
|
|
|
59
59
|
|
|
60
60
|
---
|
|
61
61
|
|
|
62
|
-
## The Xeno architecture
|
|
62
|
+
## The Xeno.JS architecture
|
|
63
63
|
|
|
64
|
-
Xeno separates **what an application means** from **how the application
|
|
64
|
+
Xeno.JS separates **what an application means** from **how the application
|
|
65
|
+
runs**.
|
|
65
66
|
|
|
66
67
|
```text
|
|
67
68
|
┌─────────────────────────────────────────────┐
|
|
@@ -106,7 +107,7 @@ service
|
|
|
106
107
|
database
|
|
107
108
|
```
|
|
108
109
|
|
|
109
|
-
Xeno starts from the application model instead:
|
|
110
|
+
Xeno.JS starts from the application model instead:
|
|
110
111
|
|
|
111
112
|
```text
|
|
112
113
|
Domain
|
|
@@ -352,7 +353,7 @@ This distinction keeps CQRS from becoming tied to a particular transport.
|
|
|
352
353
|
Application code often needs to represent an expected failure without turning
|
|
353
354
|
every business outcome into an exception.
|
|
354
355
|
|
|
355
|
-
Xeno provides `Result` primitives alongside application/domain errors.
|
|
356
|
+
Xeno.JS provides `Result` primitives alongside application/domain errors.
|
|
356
357
|
|
|
357
358
|
Conceptually:
|
|
358
359
|
|
|
@@ -450,7 +451,7 @@ The domain and application contracts remain the application model.
|
|
|
450
451
|
npm install @xeno-js/shared
|
|
451
452
|
```
|
|
452
453
|
|
|
453
|
-
For the complete Xeno application architecture:
|
|
454
|
+
For the complete Xeno.JS application architecture:
|
|
454
455
|
|
|
455
456
|
```bash
|
|
456
457
|
npm install @xeno-js/core
|
|
@@ -544,7 +545,7 @@ runtime discovery or hidden conventions.
|
|
|
544
545
|
|
|
545
546
|
# Relationship with Xeno
|
|
546
547
|
|
|
547
|
-
The Xeno ecosystem can be understood as three layers:
|
|
548
|
+
The Xeno.JS ecosystem can be understood as three layers:
|
|
548
549
|
|
|
549
550
|
```text
|
|
550
551
|
Your application
|
|
@@ -581,6 +582,22 @@ The transport sits around the application rather than defining it.
|
|
|
581
582
|
|
|
582
583
|
---
|
|
583
584
|
|
|
585
|
+
## Documentation
|
|
586
|
+
|
|
587
|
+
The documentation hub contains the architecture and integration guides:
|
|
588
|
+
|
|
589
|
+
**[xeno-js.it](https://www.xeno-js.it/introduction)**
|
|
590
|
+
|
|
591
|
+
Recommended starting points:
|
|
592
|
+
|
|
593
|
+
- [Introduction](https://www.xeno-js.it/introduction)
|
|
594
|
+
- [Overview](https://www.xeno-js.it/docs/shared/overview)
|
|
595
|
+
- [Guards Utils](https://www.xeno-js.it/docs/shared/utils/guards)
|
|
596
|
+
- [Enumerabe Utils](https://www.xeno-js.it/docs/shared/utils/enumerable)
|
|
597
|
+
- [CLI](https://www.xeno-js.it/docs/cli/overview)
|
|
598
|
+
|
|
599
|
+
---
|
|
600
|
+
|
|
584
601
|
# Development
|
|
585
602
|
|
|
586
603
|
Clone the repository:
|
|
@@ -645,8 +662,17 @@ Pull requests should target `develop`.
|
|
|
645
662
|
|
|
646
663
|
---
|
|
647
664
|
|
|
648
|
-
|
|
665
|
+
## Support
|
|
666
|
+
|
|
667
|
+
If Xeno.JS is useful to you, you can support the project through the community
|
|
668
|
+
and sponsorship channels documented on the website:
|
|
669
|
+
|
|
670
|
+
**[Support Xeno](https://www.xeno-js.it/docs/support-us)**
|
|
649
671
|
|
|
650
|
-
|
|
672
|
+
---
|
|
673
|
+
|
|
674
|
+
## License
|
|
651
675
|
|
|
652
676
|
Copyright (c) 2026 Xeno.
|
|
677
|
+
|
|
678
|
+
Licensed under the [MIT License](LICENSE).
|
package/dist/index.cjs
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
6
|
var __export = (target, all) => {
|
|
9
7
|
for (var name in all)
|
|
@@ -17,14 +15,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
15
|
}
|
|
18
16
|
return to;
|
|
19
17
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
19
|
|
|
30
20
|
// src/index.ts
|
|
@@ -32,7 +22,6 @@ var index_exports = {};
|
|
|
32
22
|
__export(index_exports, {
|
|
33
23
|
AbortSignalHelper: () => AbortSignalHelper,
|
|
34
24
|
AppError: () => AppError,
|
|
35
|
-
AxiosFactory: () => AxiosFactory,
|
|
36
25
|
AxiosHttpClient: () => AxiosHttpClient,
|
|
37
26
|
BaseLogger: () => BaseLogger,
|
|
38
27
|
CacheKeyBuilder: () => CacheKeyBuilder,
|
|
@@ -2784,9 +2773,6 @@ var CacheKeyBuilder = class {
|
|
|
2784
2773
|
}
|
|
2785
2774
|
};
|
|
2786
2775
|
|
|
2787
|
-
// src/infrastructure/factories/axios.factory.ts
|
|
2788
|
-
var import_axios2 = __toESM(require("axios"), 1);
|
|
2789
|
-
|
|
2790
2776
|
// src/infrastructure/http/axios.http.ts
|
|
2791
2777
|
var import_axios = require("axios");
|
|
2792
2778
|
var AxiosHttpClient = class {
|
|
@@ -2892,22 +2878,6 @@ var AxiosHttpClient = class {
|
|
|
2892
2878
|
}
|
|
2893
2879
|
};
|
|
2894
2880
|
|
|
2895
|
-
// src/infrastructure/factories/axios.factory.ts
|
|
2896
|
-
var AxiosFactory = class {
|
|
2897
|
-
create(config) {
|
|
2898
|
-
const axiosInstance = import_axios2.default.create({
|
|
2899
|
-
baseURL: config.baseURL,
|
|
2900
|
-
headers: config.defaultHeaders,
|
|
2901
|
-
timeout: config.timeoutMs,
|
|
2902
|
-
maxRedirects: config.maxRedirects ?? 5,
|
|
2903
|
-
decompress: config.decompress ?? true,
|
|
2904
|
-
proxy: config.proxy,
|
|
2905
|
-
withCredentials: config.withCredentials
|
|
2906
|
-
});
|
|
2907
|
-
return new AxiosHttpClient(axiosInstance);
|
|
2908
|
-
}
|
|
2909
|
-
};
|
|
2910
|
-
|
|
2911
2881
|
// src/infrastructure/mappers/supabase-claims.mapper.ts
|
|
2912
2882
|
var SupabaseClaimsMapper = class {
|
|
2913
2883
|
map(user) {
|
|
@@ -3029,7 +2999,6 @@ var ZodValidatorService = class _ZodValidatorService {
|
|
|
3029
2999
|
0 && (module.exports = {
|
|
3030
3000
|
AbortSignalHelper,
|
|
3031
3001
|
AppError,
|
|
3032
|
-
AxiosFactory,
|
|
3033
3002
|
AxiosHttpClient,
|
|
3034
3003
|
BaseLogger,
|
|
3035
3004
|
CacheKeyBuilder,
|