@xeno-js/shared 0.1.6 → 0.1.7
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 +8 -8
- package/dist/index.cjs +24 -185
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +130 -217
- package/dist/index.d.ts +130 -217
- package/dist/index.js +24 -185
- package/dist/index.js.map +1 -1
- package/package.json +110 -109
package/dist/index.d.ts
CHANGED
|
@@ -785,25 +785,14 @@ type Permission = (typeof PERMISSIONS)[keyof typeof PERMISSIONS];
|
|
|
785
785
|
* @description This file defines the tokens used for dependency injection in the application.
|
|
786
786
|
* Tokens are unique identifiers that are used to register and resolve dependencies in the container.
|
|
787
787
|
* They can be symbols, strings, or classes, but using symbols is a common practice to avoid naming collisions.
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
*/
|
|
788
|
+
*
|
|
789
|
+
* @author Xeno
|
|
790
|
+
* @version 1.0.0
|
|
791
|
+
* @since 2025-09-30
|
|
792
|
+
* @link https://github.com/xeno-js/xeno-js
|
|
793
|
+
*/
|
|
795
794
|
declare const TOKENS: Readonly<{
|
|
796
|
-
|
|
797
|
-
readonly ALLOW_METHOD: "ALLOW_METHOD";
|
|
798
|
-
/** @description Token used to register and resolve the AuthorizationPipeline instance in the dependency injection container.
|
|
799
|
-
*
|
|
800
|
-
* @author Xeno
|
|
801
|
-
* @version 1.0.0
|
|
802
|
-
* @since 2025-09-30
|
|
803
|
-
* @link https://github.com/xeno-js/xeno-js
|
|
804
|
-
*/
|
|
805
|
-
readonly AUTHORIZATION_PIPELINE: "AUTHORIZATION_PIPELINE";
|
|
806
|
-
/** @description Token used to register and resolve the AuthService instance in the dependency injection container.
|
|
795
|
+
/** @description Token used to register and resolve the Extendend AuthService instance in the dependency injection container.
|
|
807
796
|
*
|
|
808
797
|
* @author Xeno
|
|
809
798
|
* @version 1.0.0
|
|
@@ -811,15 +800,14 @@ declare const TOKENS: Readonly<{
|
|
|
811
800
|
* @link https://github.com/xeno-js/xeno-js
|
|
812
801
|
*/
|
|
813
802
|
readonly AUTH_SERVICE: "AUTH_SERVICE";
|
|
814
|
-
|
|
815
|
-
/** @description Token used to register and resolve the BearerTokenExtractor instance in the dependency injection container.
|
|
803
|
+
/** @description Token used to register and resolve the BaseAuthService instance in the dependency injection container.
|
|
816
804
|
*
|
|
817
805
|
* @author Xeno
|
|
818
806
|
* @version 1.0.0
|
|
819
807
|
* @since 2025-09-30
|
|
820
808
|
* @link https://github.com/xeno-js/xeno-js
|
|
821
809
|
*/
|
|
822
|
-
readonly
|
|
810
|
+
readonly BASE_AUTH_SERVICE: "BASE_AUTH_SERVICE";
|
|
823
811
|
/** @description Token used to register and resolve the InMemoryCache instance in the dependency injection container.
|
|
824
812
|
*
|
|
825
813
|
* @author Xeno
|
|
@@ -836,14 +824,6 @@ declare const TOKENS: Readonly<{
|
|
|
836
824
|
* @link https://github.com/xeno-js/xeno-js
|
|
837
825
|
*/
|
|
838
826
|
readonly CACHE_KEY_BUILDER: "CACHE_KEY_BUILDER";
|
|
839
|
-
/** @description Token used to register and resolve the ClaimsIdentityMapper instance in the dependency injection container.
|
|
840
|
-
*
|
|
841
|
-
* @author Xeno
|
|
842
|
-
* @version 1.0.0
|
|
843
|
-
* @since 2025-09-30
|
|
844
|
-
* @link https://github.com/xeno-js/xeno-js
|
|
845
|
-
*/
|
|
846
|
-
readonly CLAIMS_IDENTITY_MAPPER: "CLAIMS_IDENTITY_MAPPER";
|
|
847
827
|
/** @description Token used to register and resolve command pipeline behaviors in the dependency injection container.
|
|
848
828
|
*
|
|
849
829
|
* @author Xeno
|
|
@@ -852,22 +832,6 @@ declare const TOKENS: Readonly<{
|
|
|
852
832
|
* @link https://github.com/xeno-js/xeno-js
|
|
853
833
|
*/
|
|
854
834
|
readonly COMMAND_PIPELINES_BEHAVIOR: "COMMAND_PIPELINES_BEHAVIOR";
|
|
855
|
-
/** @description Token used to register and resolve the CompositePipeline instance in the dependency injection container.
|
|
856
|
-
*
|
|
857
|
-
* @author Xeno
|
|
858
|
-
* @version 1.0.0
|
|
859
|
-
* @since 2025-09-30
|
|
860
|
-
* @link https://github.com/xeno-js/xeno-js
|
|
861
|
-
*/
|
|
862
|
-
readonly COMPOSITE_PIPELINE: "COMPOSITE_PIPELINE";
|
|
863
|
-
/** @description Token used to register and resolve the ConcurrencyRetryPipeline instance in the dependency injection container.
|
|
864
|
-
*
|
|
865
|
-
* @author Xeno
|
|
866
|
-
* @version 1.0.0
|
|
867
|
-
* @since 2025-09-30
|
|
868
|
-
* @link https://github.com/xeno-js/xeno-js
|
|
869
|
-
*/
|
|
870
|
-
readonly CONCURRENCY_RETRY_PIPELINE: "CONCURRENCY_RETRY_PIPELINE";
|
|
871
835
|
/** @description Token used to register and resolve the ConcurrencyService instance in the dependency injection container.
|
|
872
836
|
*
|
|
873
837
|
* @author Xeno
|
|
@@ -884,14 +848,6 @@ declare const TOKENS: Readonly<{
|
|
|
884
848
|
* @link https://github.com/xeno-js/xeno-js
|
|
885
849
|
*/
|
|
886
850
|
readonly CONFIGURATION_SERVICE: "CONFIGURATION_SERVICE";
|
|
887
|
-
/** @description Token used to register and resolve the ConsoleLogger instance in the dependency injection container.
|
|
888
|
-
*
|
|
889
|
-
* @author Xeno
|
|
890
|
-
* @version 1.0.0
|
|
891
|
-
* @since 2025-09-30
|
|
892
|
-
* @link https://github.com/xeno-js/xeno-js
|
|
893
|
-
*/
|
|
894
|
-
readonly CONSOLE_LOGGER: "CONSOLE_LOGGER";
|
|
895
851
|
/** @description Token used to register and resolve the ContextAccessor instance in the dependency injection container.
|
|
896
852
|
*
|
|
897
853
|
* @author Xeno
|
|
@@ -900,46 +856,30 @@ declare const TOKENS: Readonly<{
|
|
|
900
856
|
* @link https://github.com/xeno-js/xeno-js
|
|
901
857
|
*/
|
|
902
858
|
readonly CONTEXT_ACCESSOR: "CONTEXT_ACCESSOR";
|
|
903
|
-
/** @description Token used to register and resolve the
|
|
859
|
+
/** @description Token used to register and resolve the CryptoService instance in the dependency injection container.
|
|
904
860
|
*
|
|
905
861
|
* @author Xeno
|
|
906
862
|
* @version 1.0.0
|
|
907
863
|
* @since 2025-09-30
|
|
908
864
|
* @link https://github.com/xeno-js/xeno-js
|
|
909
865
|
*/
|
|
910
|
-
readonly
|
|
911
|
-
/** @description Token used to register and resolve the
|
|
866
|
+
readonly CRYPTO_SERVICE: "CRYPTO_SERVICE";
|
|
867
|
+
/** @description Token used to register and resolve the CsrfTokenService instance in the dependency injection container.
|
|
912
868
|
*
|
|
913
869
|
* @author Xeno
|
|
914
870
|
* @version 1.0.0
|
|
915
871
|
* @since 2025-09-30
|
|
916
872
|
* @link https://github.com/xeno-js/xeno-js
|
|
917
873
|
*/
|
|
918
|
-
readonly
|
|
919
|
-
/** @description Token used to register and resolve the
|
|
920
|
-
*
|
|
921
|
-
* @author Xeno
|
|
922
|
-
* @version 1.0.0
|
|
923
|
-
* @since 2025-09-30
|
|
924
|
-
* @link https://github.com/xeno-js/xeno-js
|
|
925
|
-
*/
|
|
926
|
-
readonly GATE_KEEPER: "GATE_KEEPER";
|
|
927
|
-
/** @description Token used to register and resolve the IdempotencyPipeline instance in the dependency injection container.
|
|
928
|
-
*
|
|
929
|
-
* @author Xeno
|
|
930
|
-
* @version 1.0.0
|
|
931
|
-
* @since 2025-09-30
|
|
932
|
-
* @link https://github.com/xeno-js/xeno-js
|
|
933
|
-
*/
|
|
934
|
-
readonly IDEMPOTENCY_PIPELINE: "IDEMPOTENCY_PIPELINE";
|
|
935
|
-
/** @description Token used to register and resolve the IdempotencyStore instance in the dependency injection container.
|
|
874
|
+
readonly CSRF_TOKEN_SERVICE: "CSRF_TOKEN_SERVICE";
|
|
875
|
+
/** @description Token used to register and resolve the DbContext instance in the dependency injection container.
|
|
936
876
|
*
|
|
937
877
|
* @author Xeno
|
|
938
878
|
* @version 1.0.0
|
|
939
879
|
* @since 2025-09-30
|
|
940
880
|
* @link https://github.com/xeno-js/xeno-js
|
|
941
881
|
*/
|
|
942
|
-
readonly
|
|
882
|
+
readonly DB_CONTEXT: "DB_CONTEXT";
|
|
943
883
|
/** @description Token used to register and resolve the IdentityAccessor instance in the dependency injection container.
|
|
944
884
|
*
|
|
945
885
|
* @author Xeno
|
|
@@ -956,22 +896,6 @@ declare const TOKENS: Readonly<{
|
|
|
956
896
|
* @link https://github.com/xeno-js/xeno-js
|
|
957
897
|
*/
|
|
958
898
|
readonly LOGGER: "LOGGER";
|
|
959
|
-
/** @description Token used to register and resolve the LoggerConfig instance in the dependency injection container.
|
|
960
|
-
*
|
|
961
|
-
* @author Xeno
|
|
962
|
-
* @version 1.0.0
|
|
963
|
-
* @since 2025-09-30
|
|
964
|
-
* @link https://github.com/xeno-js/xeno-js
|
|
965
|
-
*/
|
|
966
|
-
readonly LOGGER_CONFIG: "LOGGER_CONFIG";
|
|
967
|
-
/** @description Token used to register and resolve the LoggingPipeline instance in the dependency injection container.
|
|
968
|
-
*
|
|
969
|
-
* @author Xeno
|
|
970
|
-
* @version 1.0.0
|
|
971
|
-
* @since 2025-09-30
|
|
972
|
-
* @link https://github.com/xeno-js/xeno-js
|
|
973
|
-
*/
|
|
974
|
-
readonly LOGGING_PIPELINE: "LOGGING_PIPELINE";
|
|
975
899
|
/** @description Token used to register and resolve the Mediator instance in the dependency injection container.
|
|
976
900
|
*
|
|
977
901
|
* @author Xeno
|
|
@@ -980,46 +904,14 @@ declare const TOKENS: Readonly<{
|
|
|
980
904
|
* @link https://github.com/xeno-js/xeno-js
|
|
981
905
|
*/
|
|
982
906
|
readonly MEDIATOR: "MEDIATOR";
|
|
983
|
-
/** @description Token used to register and resolve the
|
|
984
|
-
*
|
|
985
|
-
* @author Xeno
|
|
986
|
-
* @version 1.0.0
|
|
987
|
-
* @since 2025-09-30
|
|
988
|
-
* @link https://github.com/xeno-js/xeno-js
|
|
989
|
-
*/
|
|
990
|
-
readonly PERFORMANCE_PIPELINE: "PERFORMANCE_PIPELINE";
|
|
991
|
-
/** @description Token used to register and resolve the PermissionAuthorizationPipeline instance in the dependency injection container.
|
|
992
|
-
*
|
|
993
|
-
* @author Xeno
|
|
994
|
-
* @version 1.0.0
|
|
995
|
-
* @since 2025-09-30
|
|
996
|
-
* @link https://github.com/xeno-js/xeno-js
|
|
997
|
-
*/
|
|
998
|
-
readonly PERMISSION_AUTHORIZATION_PIPELINE: "PERMISSION_AUTHORIZATION_PIPELINE";
|
|
999
|
-
/** @description Token used to register and resolve the PinoLogger instance in the dependency injection container.
|
|
1000
|
-
*
|
|
1001
|
-
* @author Xeno
|
|
1002
|
-
* @version 1.0.0
|
|
1003
|
-
* @since 2025-09-30
|
|
1004
|
-
* @link https://github.com/xeno-js/xeno-js
|
|
1005
|
-
*/
|
|
1006
|
-
readonly PINO_LOGGER: "PINO_LOGGER";
|
|
1007
|
-
/** @description Token used to register and resolve the PolicyRegistry instance in the dependency injection container.
|
|
907
|
+
/** @description Token used to register and resolve the NetworkContextFactory in the dependency injection container.
|
|
1008
908
|
*
|
|
1009
909
|
* @author Xeno
|
|
1010
910
|
* @version 1.0.0
|
|
1011
911
|
* @since 2025-09-30
|
|
1012
912
|
* @link https://github.com/xeno-js/xeno-js
|
|
1013
913
|
*/
|
|
1014
|
-
readonly
|
|
1015
|
-
/** @description Token used to register and resolve the QueryCachingPipeline instance in the dependency injection container.
|
|
1016
|
-
*
|
|
1017
|
-
* @author Xeno
|
|
1018
|
-
* @version 1.0.0
|
|
1019
|
-
* @since 2025-09-30
|
|
1020
|
-
* @link https://github.com/xeno-js/xeno-js
|
|
1021
|
-
*/
|
|
1022
|
-
readonly QUERY_CACHING_PIPELINE: "QUERY_CACHING_PIPELINE";
|
|
914
|
+
readonly NETWORK_CONTEXT_ACCESSOR: "NETWORK_CONTEXT_ACCESSOR";
|
|
1023
915
|
/** @description Token used to register and resolve query pipeline behaviors in the dependency injection container.
|
|
1024
916
|
*
|
|
1025
917
|
* @author Xeno
|
|
@@ -1036,7 +928,7 @@ declare const TOKENS: Readonly<{
|
|
|
1036
928
|
* @link https://github.com/xeno-js/xeno-js
|
|
1037
929
|
*/
|
|
1038
930
|
readonly REQUEST_CONTEXT: "REQUEST_CONTEXT";
|
|
1039
|
-
/** @description Token used to register and resolve the
|
|
931
|
+
/** @description Token used to register and resolve the CompositeMiddleware in the dependency injection container.
|
|
1040
932
|
*
|
|
1041
933
|
* @author Xeno
|
|
1042
934
|
* @version 1.0.0
|
|
@@ -1044,14 +936,6 @@ declare const TOKENS: Readonly<{
|
|
|
1044
936
|
* @link https://github.com/xeno-js/xeno-js
|
|
1045
937
|
*/
|
|
1046
938
|
readonly MIDDLEWARE: "MIDDLEWARE";
|
|
1047
|
-
readonly AUTH_MIDDLEWARE: "AUTH_MIDDLEWARE";
|
|
1048
|
-
readonly CSRF_MIDDLEWARE: "CSRF_MIDDLEWARE";
|
|
1049
|
-
readonly ALLOW_ORIGIN_MIDDLEWARE: "ALLOW_ORIGIN_MIDDLEWARE";
|
|
1050
|
-
readonly CORS_MIDDLEWARE: "CORS_MIDDLEWARE";
|
|
1051
|
-
readonly METHOD_CHECK_MIDDLEWARE: "METHOD_CHECK_MIDDLEWARE";
|
|
1052
|
-
readonly OPTIONS_MIDDLEWARE: "OPTIONS_MIDDLEWARE";
|
|
1053
|
-
readonly REQUEST_CONTEXT_MIDDLEWARE: "REQUEST_CONTEXT_MIDDLEWARE";
|
|
1054
|
-
readonly RATE_LIMITER_MIDDLEWARE: "RATE_LIMITER_MIDDLEWARE";
|
|
1055
939
|
/** @description Token used to register and resolve the IServiceResilience instance in the dependency injection container.
|
|
1056
940
|
*
|
|
1057
941
|
* @author Xeno
|
|
@@ -1060,14 +944,6 @@ declare const TOKENS: Readonly<{
|
|
|
1060
944
|
* @link https://github.com/xeno-js/xeno-js
|
|
1061
945
|
*/
|
|
1062
946
|
readonly RESILIENCE_CLIENT: "RESILIENCE_CLIENT";
|
|
1063
|
-
/** @description Token used to register and resolve the RoleAuthorizationPipeline instance in the dependency injection container.
|
|
1064
|
-
*
|
|
1065
|
-
* @author Xeno
|
|
1066
|
-
* @version 1.0.0
|
|
1067
|
-
* @since 2025-09-30
|
|
1068
|
-
* @link https://github.com/xeno-js/xeno-js
|
|
1069
|
-
*/
|
|
1070
|
-
readonly ROLE_AUTHORIZATION_PIPELINE: "ROLE_AUTHORIZATION_PIPELINE";
|
|
1071
947
|
/** @description Token used to register and resolve the SchemaValidationStrategy instance in the dependency injection container.
|
|
1072
948
|
*
|
|
1073
949
|
* @author Xeno
|
|
@@ -1076,14 +952,6 @@ declare const TOKENS: Readonly<{
|
|
|
1076
952
|
* @link https://github.com/xeno-js/xeno-js
|
|
1077
953
|
*/
|
|
1078
954
|
readonly SCHEMA_VALIDATION_STRATEGY: "SCHEMA_VALIDATION_STRATEGY";
|
|
1079
|
-
/** @description Token used to register and resolve the SentryLogger instance in the dependency injection container.
|
|
1080
|
-
*
|
|
1081
|
-
* @author Xeno
|
|
1082
|
-
* @version 1.0.0
|
|
1083
|
-
* @since 2025-09-30
|
|
1084
|
-
* @link https://github.com/xeno-js/xeno-js
|
|
1085
|
-
*/
|
|
1086
|
-
readonly SENTRY_LOGGER: "SENTRY_LOGGER";
|
|
1087
955
|
/** @description Token used to register and resolve the ServiceContainer instance in the dependency injection container.
|
|
1088
956
|
*
|
|
1089
957
|
* @author Xeno
|
|
@@ -1100,22 +968,14 @@ declare const TOKENS: Readonly<{
|
|
|
1100
968
|
* @link https://github.com/xeno-js/xeno-js
|
|
1101
969
|
*/
|
|
1102
970
|
readonly SERVICE_EXTRACTOR: "SERVICE_EXTRACTOR";
|
|
1103
|
-
/** @description Token used to register and resolve the
|
|
1104
|
-
*
|
|
1105
|
-
* @author Xeno
|
|
1106
|
-
* @version 1.0.0
|
|
1107
|
-
* @since 2025-09-30
|
|
1108
|
-
* @link https://github.com/xeno-js/xeno-js
|
|
1109
|
-
*/
|
|
1110
|
-
readonly SERVICE_SCOPE_FACTORY: "SERVICE_SCOPE_FACTORY";
|
|
1111
|
-
/** @description Token used to register and resolve the TenantAuthorizationPipeline instance in the dependency injection container.
|
|
971
|
+
/** @description Token used to register and resolve the ServiceScopeAccessor in the dependency injection container.
|
|
1112
972
|
*
|
|
1113
973
|
* @author Xeno
|
|
1114
974
|
* @version 1.0.0
|
|
1115
975
|
* @since 2025-09-30
|
|
1116
976
|
* @link https://github.com/xeno-js/xeno-js
|
|
1117
977
|
*/
|
|
1118
|
-
readonly
|
|
978
|
+
readonly SERVICE_SCOPE_ACCESSOR: "SERVICE_SCOPE_ACCESSOR";
|
|
1119
979
|
/** @description Token used to register and resolve the UnitOfWork instance in the dependency injection container.
|
|
1120
980
|
*
|
|
1121
981
|
* @author Xeno
|
|
@@ -1124,34 +984,14 @@ declare const TOKENS: Readonly<{
|
|
|
1124
984
|
* @link https://github.com/xeno-js/xeno-js
|
|
1125
985
|
*/
|
|
1126
986
|
readonly UNIT_OF_WORK: "UNIT_OF_WORK";
|
|
1127
|
-
/** @description Token used to register and resolve the
|
|
1128
|
-
*
|
|
1129
|
-
* @author Xeno
|
|
1130
|
-
* @version 1.0.0
|
|
1131
|
-
* @since 2025-09-30
|
|
1132
|
-
* @link https://github.com/xeno-js/xeno-js
|
|
1133
|
-
*/
|
|
1134
|
-
readonly USER_AUTHORIZATION_PIPELINE: "USER_AUTHORIZATION_PIPELINE";
|
|
1135
|
-
/** @description Token used to register and resolve the ValidationPipeline instance in the dependency injection container.
|
|
987
|
+
/** @description Token used to register and resolve the ValidatorService instance in the dependency injection container.
|
|
1136
988
|
*
|
|
1137
989
|
* @author Xeno
|
|
1138
990
|
* @version 1.0.0
|
|
1139
991
|
* @since 2025-09-30
|
|
1140
992
|
* @link https://github.com/xeno-js/xeno-js
|
|
1141
993
|
*/
|
|
1142
|
-
readonly
|
|
1143
|
-
/** @description Token used to register and resolve the ZodValidator instance in the dependency injection container.
|
|
1144
|
-
*
|
|
1145
|
-
* @author Xeno
|
|
1146
|
-
* @version 1.0.0
|
|
1147
|
-
* @since 2025-09-30
|
|
1148
|
-
* @link https://github.com/xeno-js/xeno-js
|
|
1149
|
-
*/
|
|
1150
|
-
readonly ZOD_VALIDATOR: "ZOD_VALIDATOR";
|
|
1151
|
-
readonly SERVICE_SCOPE_ACCESSOR: "SERVICE_SCOPE_ACCESSOR";
|
|
1152
|
-
readonly NETWORK_CONTEXT_ACCESSOR: "NETWORK_CONTEXT_ACCESSOR";
|
|
1153
|
-
readonly USER_CONTEXT_FACTORY: "USER_CONTEXT_FACTORY";
|
|
1154
|
-
readonly TRANSACTION_STATE: "TRANSACTION_STATE";
|
|
994
|
+
readonly VALIDATOR_SERVICE: "VALIDATOR_SERVICE";
|
|
1155
995
|
}>;
|
|
1156
996
|
|
|
1157
997
|
/**
|
|
@@ -1546,12 +1386,25 @@ interface HttpResponse<TData = unknown> {
|
|
|
1546
1386
|
*/
|
|
1547
1387
|
readonly data: TData;
|
|
1548
1388
|
}
|
|
1389
|
+
/**
|
|
1390
|
+
* @description Represents the CookieOptions interface.
|
|
1391
|
+
*
|
|
1392
|
+
* @author Xeno
|
|
1393
|
+
* @version 1.0.0
|
|
1394
|
+
* @since 2025-09-30
|
|
1395
|
+
* @link https://github.com/xeno-js/xeno-js
|
|
1396
|
+
*/
|
|
1549
1397
|
interface CookieOptions {
|
|
1398
|
+
/** @description The path for which the cookie is valid. Defaults to '/'. */
|
|
1550
1399
|
path?: Optional<string>;
|
|
1400
|
+
/** @description The value of the maximum age in seconds. If not specified, the cookie will expire when the browser session ends. */
|
|
1551
1401
|
maxAge?: Optional<number>;
|
|
1552
|
-
|
|
1553
|
-
secure?: boolean;
|
|
1402
|
+
/** @description The domain for which the cookie is valid. Defaults to the domain of the current document host. */
|
|
1554
1403
|
domain?: Optional<string>;
|
|
1404
|
+
/** @description Whether the cookie is only transmitted over secure (HTTPS) connections. Defaults to true in production. */
|
|
1405
|
+
secure?: Optional<boolean>;
|
|
1406
|
+
/** @description Controls whether the cookie is withheld on cross-site requests, providing some protection against cross-site request forgery attacks. */
|
|
1407
|
+
sameSite?: Optional<'lax' | 'strict' | 'none' | boolean>;
|
|
1555
1408
|
}
|
|
1556
1409
|
|
|
1557
1410
|
/**
|
|
@@ -2721,10 +2574,10 @@ declare const GuidHelper: Readonly<{
|
|
|
2721
2574
|
*/
|
|
2722
2575
|
declare const HttpHelper: Readonly<{
|
|
2723
2576
|
/**
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2577
|
+
* @description A function that masks the IP address in the given headers object.
|
|
2578
|
+
* @param ip The IP address to mask.
|
|
2579
|
+
* @returns The masked IP address.
|
|
2580
|
+
*/
|
|
2728
2581
|
readonly maskIp: (ip: Optional<string>) => Optional<string>;
|
|
2729
2582
|
/**
|
|
2730
2583
|
* @description Normalizes HTTP headers by converting all header values to strings. If a header value is an array, it joins the array elements into a single string separated by commas. This method ensures that the headers are in a consistent format, which can be particularly useful when working with different HTTP client libraries that may represent headers in various ways. If the input headers are not defined or not an object, it returns an empty object.
|
|
@@ -3038,17 +2891,47 @@ declare const StringHelper: Readonly<{
|
|
|
3038
2891
|
readonly getSingleValueWithSplit: (value: string, separator: string) => string;
|
|
3039
2892
|
}>;
|
|
3040
2893
|
|
|
2894
|
+
/**
|
|
2895
|
+
* @description Configuration options for the authentication service.
|
|
2896
|
+
* @author Xeno
|
|
2897
|
+
* @version 1.0.0
|
|
2898
|
+
* @since 2025-09-30
|
|
2899
|
+
* @link https://github.com/xeno-js/xeno-js
|
|
2900
|
+
*/
|
|
3041
2901
|
interface AuthConfig<TOptions = unknown> {
|
|
2902
|
+
/**
|
|
2903
|
+
* @description The URL of the authentication service.
|
|
2904
|
+
* @type {string}
|
|
2905
|
+
*/
|
|
3042
2906
|
url: string;
|
|
2907
|
+
/**
|
|
2908
|
+
* @description The key of the authentication service.
|
|
2909
|
+
* @type {string}
|
|
2910
|
+
*/
|
|
3043
2911
|
key: string;
|
|
2912
|
+
/**
|
|
2913
|
+
* @description The options of the authentication service.
|
|
2914
|
+
* @type {TOptions}
|
|
2915
|
+
*/
|
|
3044
2916
|
opts: Optional<TOptions>;
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
2917
|
+
/**
|
|
2918
|
+
* @description The storage options of the authentication service.
|
|
2919
|
+
* @type {StorageOptions}
|
|
2920
|
+
* @default { type: 'local', cookieOpts: {}, storage: null }
|
|
2921
|
+
*/
|
|
2922
|
+
storageOpts: Optional<StorageOptions>;
|
|
2923
|
+
/**
|
|
2924
|
+
* @description The redirect URL of the authentication service.
|
|
2925
|
+
* @type {string}
|
|
2926
|
+
* @default '/'
|
|
2927
|
+
*/
|
|
3050
2928
|
redirectTo: Optional<string>;
|
|
3051
2929
|
}
|
|
2930
|
+
interface StorageOptions {
|
|
2931
|
+
type: Optional<'local' | 'session' | 'memory' | 'cookie'>;
|
|
2932
|
+
cookieOpts: Optional<CookieOptions>;
|
|
2933
|
+
storage: Optional<IStorage>;
|
|
2934
|
+
}
|
|
3052
2935
|
|
|
3053
2936
|
/** @description Configuration for Redis integration, including details such as host, port, and credentials. If enabled, the query bus and command bus (in case of idempotency) pipelines will use Redis as the cache system to store and retrieve data efficiently. The configuration includes specific details for Redis integration, such as host, port, and credentials, providing flexibility in how the cache is implemented and used within the application.
|
|
3054
2937
|
*
|
|
@@ -5298,18 +5181,16 @@ interface IRepository<T> {
|
|
|
5298
5181
|
/**
|
|
5299
5182
|
* @description IAuthService defines the contract for authentication services.
|
|
5300
5183
|
* It provides methods to check if a user is authenticated and to retrieve the user's claims.
|
|
5301
|
-
|
|
5302
|
-
|
|
5303
|
-
|
|
5304
|
-
|
|
5305
|
-
|
|
5306
|
-
|
|
5307
|
-
*/
|
|
5184
|
+
*
|
|
5185
|
+
* @author Xeno
|
|
5186
|
+
* @version 1.0.0
|
|
5187
|
+
* @since 2025-09-30
|
|
5188
|
+
* @link https://github.com/xeno-js/xeno-js
|
|
5189
|
+
*/
|
|
5308
5190
|
interface IBaseAuthService {
|
|
5309
5191
|
/**
|
|
5310
5192
|
* Checks if the user is authenticated.
|
|
5311
5193
|
* @returns A promise that resolves to true if the user is authenticated, false otherwise.
|
|
5312
|
-
|
|
5313
5194
|
*
|
|
5314
5195
|
* @author Xeno
|
|
5315
5196
|
* @version 1.0.0
|
|
@@ -5318,14 +5199,19 @@ interface IBaseAuthService {
|
|
|
5318
5199
|
*/
|
|
5319
5200
|
isAuthenticated(): Promise<boolean>;
|
|
5320
5201
|
/**
|
|
5321
|
-
*
|
|
5202
|
+
* Retrieves the user's claims.
|
|
5203
|
+
* @returns A promise that resolves to the user's claims, or null if not authenticated.
|
|
5204
|
+
*
|
|
5205
|
+
* @author Xeno
|
|
5206
|
+
* @version 1.0.0
|
|
5207
|
+
* @since 2025-09-30
|
|
5208
|
+
* @link https://github.com/xeno-js/xeno-js
|
|
5322
5209
|
*/
|
|
5323
5210
|
getUser(): Promise<ResultType<Maybe<AuthClaims>>>;
|
|
5324
5211
|
/**
|
|
5325
5212
|
* Authenticates a user based on a token.
|
|
5326
5213
|
* @param token The token to authenticate the user.
|
|
5327
5214
|
* @returns A promise that resolves to the user's claims, or null if not authenticated.
|
|
5328
|
-
|
|
5329
5215
|
*
|
|
5330
5216
|
* @author Xeno
|
|
5331
5217
|
* @version 1.0.0
|
|
@@ -5346,22 +5232,38 @@ interface IBaseAuthService {
|
|
|
5346
5232
|
*/
|
|
5347
5233
|
interface IAuthService {
|
|
5348
5234
|
/**
|
|
5349
|
-
*
|
|
5235
|
+
* Signs in a user by the specified provider.
|
|
5236
|
+
* @param provider The provider to use for signing in the user.
|
|
5237
|
+
* @returns A promise that resolves to the URL for the specified provider.
|
|
5350
5238
|
*/
|
|
5351
5239
|
signInWithProvider(provider: Provider): Promise<ResultType<{
|
|
5352
5240
|
url: string;
|
|
5353
5241
|
}>>;
|
|
5354
5242
|
/**
|
|
5355
|
-
*
|
|
5243
|
+
* @description Gets the current session of the user.
|
|
5244
|
+
* @returns A promise that resolves to the current session of the user.
|
|
5356
5245
|
*/
|
|
5357
5246
|
getSession(): Promise<ResultType<Maybe<Session>>>;
|
|
5358
5247
|
/**
|
|
5359
|
-
*
|
|
5248
|
+
* @description Signs out the user.
|
|
5249
|
+
* @returns A promise that resolves when the user is signed out.
|
|
5360
5250
|
*/
|
|
5361
5251
|
signOut(): Promise<ResultType<void>>;
|
|
5252
|
+
/**
|
|
5253
|
+
* @description Exchanges the code for a session.
|
|
5254
|
+
* @param code the code to exchange for a session
|
|
5255
|
+
* @returns A promise that resolves to the session wit
|
|
5256
|
+
*/
|
|
5362
5257
|
exchangeCodeForSession(code: string): Promise<ResultType<Optional<Session>>>;
|
|
5363
5258
|
}
|
|
5364
|
-
|
|
5259
|
+
/**
|
|
5260
|
+
* @description An extended version of the IAuthService interface that includes additional methods for managing user sessions.
|
|
5261
|
+
* @author Xeno
|
|
5262
|
+
* @version 1.0.0
|
|
5263
|
+
* @since 2025-09-30
|
|
5264
|
+
* @link https://github.com/xeno-js/xeno-js
|
|
5265
|
+
*/
|
|
5266
|
+
interface IExtendendAuthService extends IBaseAuthService, IAuthService {
|
|
5365
5267
|
}
|
|
5366
5268
|
|
|
5367
5269
|
/**
|
|
@@ -5853,12 +5755,26 @@ declare abstract class ValueObject<T extends object> implements IValueObject<T>
|
|
|
5853
5755
|
toString(): string;
|
|
5854
5756
|
}
|
|
5855
5757
|
|
|
5758
|
+
/**
|
|
5759
|
+
* @description Base class for all commands.
|
|
5760
|
+
* @author Xeno
|
|
5761
|
+
* @version 1.0.0
|
|
5762
|
+
* @since 2025-09-30
|
|
5763
|
+
* @link https://github.com/xeno-js/xeno-js
|
|
5764
|
+
*/
|
|
5856
5765
|
declare abstract class Command<TResponse = unknown> implements ICommand<TResponse> {
|
|
5857
5766
|
readonly intent: string;
|
|
5858
5767
|
readonly type: RequestType;
|
|
5859
5768
|
constructor(intent: string);
|
|
5860
5769
|
}
|
|
5861
5770
|
|
|
5771
|
+
/**
|
|
5772
|
+
* @description Base class for all queries.
|
|
5773
|
+
* @author Xeno
|
|
5774
|
+
* @version 1.0.0
|
|
5775
|
+
* @since 2025-09-30
|
|
5776
|
+
* @link https://github.com/xeno-js/xeno-js
|
|
5777
|
+
*/
|
|
5862
5778
|
declare abstract class Query<TResponse = unknown> implements IQuery<TResponse> {
|
|
5863
5779
|
readonly intent: string;
|
|
5864
5780
|
readonly cacheOptions: ICacheableOptions;
|
|
@@ -5868,13 +5784,12 @@ declare abstract class Query<TResponse = unknown> implements IQuery<TResponse> {
|
|
|
5868
5784
|
|
|
5869
5785
|
/**
|
|
5870
5786
|
* @description Concrete implementation of the ILogger interface that serves as a central logging service within the application. This class is designed to broadcast log messages to multiple logging clients (implementations of ILoggerClient) that are injected via the constructor. The BaseLogger class provides methods for logging messages at different levels (info, warn, debug, error) and ensures that only messages that meet or exceed the specified minimum log level are forwarded to the registered logging clients. This design allows for flexibility in logging, enabling the use of various logging providers (e.g., Sentry, Pino) without coupling the application code to specific logging frameworks.
|
|
5871
|
-
|
|
5872
|
-
|
|
5873
|
-
|
|
5874
|
-
|
|
5875
|
-
|
|
5876
|
-
|
|
5877
|
-
*/
|
|
5787
|
+
*
|
|
5788
|
+
* @author Xeno
|
|
5789
|
+
* @version 1.0.0
|
|
5790
|
+
* @since 2025-09-30
|
|
5791
|
+
* @link https://github.com/xeno-js/xeno-js
|
|
5792
|
+
*/
|
|
5878
5793
|
declare class BaseLogger implements ILogger {
|
|
5879
5794
|
private readonly _requestContext;
|
|
5880
5795
|
private readonly _minLevel;
|
|
@@ -5884,7 +5799,6 @@ declare class BaseLogger implements ILogger {
|
|
|
5884
5799
|
* @param _requestContext The request context that provides contextual information for log messages, such as request-specific data or metadata.
|
|
5885
5800
|
* @param config The minimum log level for this logger instance. Only messages with a log level equal to or higher than this level will be processed and forwarded to the logging clients.
|
|
5886
5801
|
* @param loggers An array of ILoggerClient instances that will receive log messages from this logger. Each ILoggerClient represents a different logging provider or destination (e.g., console, file, external service).
|
|
5887
|
-
|
|
5888
5802
|
*
|
|
5889
5803
|
* @author Xeno
|
|
5890
5804
|
* @version 1.0.0
|
|
@@ -5902,7 +5816,6 @@ declare class BaseLogger implements ILogger {
|
|
|
5902
5816
|
* @param message The log message.
|
|
5903
5817
|
* @param context Optional context information to include with the log message.
|
|
5904
5818
|
* @param error Optional error object to include with the log message.
|
|
5905
|
-
|
|
5906
5819
|
*
|
|
5907
5820
|
* @author Xeno
|
|
5908
5821
|
* @version 1.0.0
|
|
@@ -6118,4 +6031,4 @@ declare class ZodValidatorService implements IValidatorService {
|
|
|
6118
6031
|
validate<T>(key: string, data: T): Promise<ResultType<boolean>>;
|
|
6119
6032
|
}
|
|
6120
6033
|
|
|
6121
|
-
export { AbortSignalHelper, type AbstractConstructor, type ApiResponseDto, AppError, type AsyncFactory, type AsyncResolver, type AuthClaims, type AuthConfig, type AuthPolicy, AxiosFactory, AxiosHttpClient, BaseLogger, type CacheClientConfig, type CacheConfig, CacheKeyBuilder, Command, type Constructor, type CookieOptions, DEFAULT_CONCURRENCY, DateHelper, type DbConfig, type Delegate, type Dictionary, ERROR_CODES, ERROR_CODE_MESSAGES, Entity, Enumerable, type ErrorCode, type ErrorResponseDto, type Factory, GUEST, Guards, type Guid, GuidHelper, type HttpBaseRequest, type HttpClientConfig, type HttpHeaders, HttpHelper, type HttpMethod, type HttpOptions, type HttpQueryValue, type HttpRequest, type HttpResponse, type HttpResponseType, type IAuthService, type IBaseAccessor, type IBaseAuthService, type IBaseMapper, type ICache, type ICacheKeyBuilder, type ICacheableOptions, type ICommand, type IConcurrencyService, type IConfigurationService, type IContextAccessor, type IController, IDEMPOTENCY_CONSTANTS, type IDisposable, type IEntity, type
|
|
6034
|
+
export { AbortSignalHelper, type AbstractConstructor, type ApiResponseDto, AppError, type AsyncFactory, type AsyncResolver, type AuthClaims, type AuthConfig, type AuthPolicy, AxiosFactory, AxiosHttpClient, BaseLogger, type CacheClientConfig, type CacheConfig, CacheKeyBuilder, Command, type Constructor, type CookieOptions, DEFAULT_CONCURRENCY, DateHelper, type DbConfig, type Delegate, type Dictionary, ERROR_CODES, ERROR_CODE_MESSAGES, Entity, Enumerable, type ErrorCode, type ErrorResponseDto, type Factory, GUEST, Guards, type Guid, GuidHelper, type HttpBaseRequest, type HttpClientConfig, type HttpHeaders, HttpHelper, type HttpMethod, type HttpOptions, type HttpQueryValue, type HttpRequest, type HttpResponse, type HttpResponseType, type IAuthService, type IBaseAccessor, type IBaseAuthService, type IBaseMapper, type ICache, type ICacheKeyBuilder, type ICacheableOptions, type ICommand, type IConcurrencyService, type IConfigurationService, type IContextAccessor, type IController, IDEMPOTENCY_CONSTANTS, type IDisposable, type IEntity, type IExtendendAuthService, type IFactory, type IGateKeeper, type IHandler, type IHttpClient, type IIdempotencyStore, type IIdentityAccessor, type ILogger, type ILoggerClient, type IMapper, type IMediator, type IMiddleware, type INetworkContextAccessor, type IPaginatedResult, type IPipelineBehavior, type IPolicyRegistry, type IQuery, type IReadDao, type IReadDataSource, type IRemoteDataSource, type IRepository, type IRequest, type IServiceExtractor, type IServiceResilience, type ISpecification, type IStorage, type IStrategy, type ITransactionState, type IUnitOfWork, type IValidatorService, type IValueObject, type IWriteDataSource, type Identity, InMemoryCache, type InjectionToken, type KeysOfType, LOG_LEVEL, LOG_LEVEL_NAMES, type LogLevel, type LoggerContext, LoggerUtils, MathHelper, type Maybe, type MessageSequence, type MessagingContext, type Metadata, type NetworkContext, type Nullable, type Optional, type Override, PAGINATION_DEFAULTS, PERMISSIONS, type Permission, PromiseHelper, type Provider, type ProxyConfig, Query, REQUEST_TYPE, RESILIENCE_DEFAULTS, ROLES, type RequestContext, type RequestType, type RequireKeys, type Resolver, type ResponseDto, Result, type ResultType, type Role, SORT_DIRECTION, STATUS_CODES, SanitizeHelper, type Session, type SetupAction, type SortDirection, type StatusCode, StorageHelper, StringHelper, type SuccessResponseDto, SupabaseAuthService, SupabaseClaimsMapper, SupabaseSessionMapper, TOKENS, type TracingContext, UniqueId, type UserContext, ValueObject, ZodUtils, ZodValidatorService };
|