@bett3r-dev/pv3-types 1.0.0 → 1.11.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/CHANGELOG.md +305 -0
- package/build/adminPlugin.d.ts +24 -0
- package/build/adminPlugin.d.ts.map +1 -0
- package/build/{eventsourcing/utils.js → adminPlugin.js} +1 -1
- package/build/adminPlugin.js.map +1 -0
- package/build/aggregateSchema.d.ts +94 -0
- package/build/aggregateSchema.d.ts.map +1 -0
- package/build/aggregateSchema.js +287 -0
- package/build/aggregateSchema.js.map +1 -0
- package/build/authentication.d.ts +179 -78
- package/build/authentication.d.ts.map +1 -1
- package/build/authentication.js +62 -19
- package/build/authentication.js.map +1 -1
- package/build/cache.d.ts +50 -4
- package/build/cache.d.ts.map +1 -1
- package/build/clusterAdministration.d.ts +712 -225
- package/build/clusterAdministration.d.ts.map +1 -1
- package/build/clusterAdministration.js +175 -52
- package/build/clusterAdministration.js.map +1 -1
- package/build/configuration.d.ts +26 -5
- package/build/configuration.d.ts.map +1 -1
- package/build/database.d.ts +240 -56
- package/build/database.d.ts.map +1 -1
- package/build/database.js +102 -20
- package/build/database.js.map +1 -1
- package/build/endpoints.d.ts +141 -41
- package/build/endpoints.d.ts.map +1 -1
- package/build/endpoints.js +50 -26
- package/build/endpoints.js.map +1 -1
- package/build/errors.d.ts +166 -0
- package/build/errors.d.ts.map +1 -0
- package/build/errors.js +276 -0
- package/build/errors.js.map +1 -0
- package/build/evenstore.d.ts +47 -7
- package/build/evenstore.d.ts.map +1 -1
- package/build/eventsourcing/aggregateBuilder.d.ts +17 -8
- package/build/eventsourcing/aggregateBuilder.d.ts.map +1 -1
- package/build/eventsourcing/commandBuilder.d.ts +20 -13
- package/build/eventsourcing/commandBuilder.d.ts.map +1 -1
- package/build/eventsourcing/commandHandlers.d.ts +155 -33
- package/build/eventsourcing/commandHandlers.d.ts.map +1 -1
- package/build/eventsourcing/commandHandlers.js +62 -14
- package/build/eventsourcing/commandHandlers.js.map +1 -1
- package/build/eventsourcing/eventHandlers.d.ts +173 -44
- package/build/eventsourcing/eventHandlers.d.ts.map +1 -1
- package/build/eventsourcing/eventHandlers.js +29 -21
- package/build/eventsourcing/eventHandlers.js.map +1 -1
- package/build/eventsourcing/eventHandlersBuilder.d.ts +18 -12
- package/build/eventsourcing/eventHandlersBuilder.d.ts.map +1 -1
- package/build/eventsourcing/eventHandlersBuilder.js.map +1 -1
- package/build/eventsourcing/eventsourcing.types.d.ts +322 -0
- package/build/eventsourcing/eventsourcing.types.d.ts.map +1 -0
- package/build/eventsourcing/eventsourcing.types.js +26 -0
- package/build/eventsourcing/eventsourcing.types.js.map +1 -0
- package/build/eventsourcing/externalSystemBuilder.d.ts +8 -7
- package/build/eventsourcing/externalSystemBuilder.d.ts.map +1 -1
- package/build/eventsourcing/index.d.ts +2 -378
- package/build/eventsourcing/index.d.ts.map +1 -1
- package/build/eventsourcing/index.js +2 -23
- package/build/eventsourcing/index.js.map +1 -1
- package/build/eventsourcing/invariants.d.ts +34 -10
- package/build/eventsourcing/invariants.d.ts.map +1 -1
- package/build/eventsourcing/shapeChangeForSubscriber.d.ts +33 -0
- package/build/eventsourcing/shapeChangeForSubscriber.d.ts.map +1 -0
- package/build/eventsourcing/shapeChangeForSubscriber.js +47 -0
- package/build/eventsourcing/shapeChangeForSubscriber.js.map +1 -0
- package/build/index.d.ts +6 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js +6 -1
- package/build/index.js.map +1 -1
- package/build/infrastructure.d.ts +9 -1
- package/build/infrastructure.d.ts.map +1 -1
- package/build/infrastructure.js +33 -1
- package/build/infrastructure.js.map +1 -1
- package/build/livenessWatchdog.d.ts +28 -0
- package/build/livenessWatchdog.d.ts.map +1 -0
- package/build/livenessWatchdog.js +43 -0
- package/build/livenessWatchdog.js.map +1 -0
- package/build/logger.d.ts +8 -9
- package/build/logger.d.ts.map +1 -1
- package/build/logger.js +18 -6
- package/build/logger.js.map +1 -1
- package/build/outboxManager.d.ts +858 -14
- package/build/outboxManager.d.ts.map +1 -1
- package/build/outboxManager.js +173 -15
- package/build/outboxManager.js.map +1 -1
- package/build/permissions.d.ts +47 -0
- package/build/permissions.d.ts.map +1 -0
- package/build/permissions.js +3 -0
- package/build/permissions.js.map +1 -0
- package/build/ports.d.ts +10 -10
- package/build/ports.d.ts.map +1 -1
- package/build/routesAuth.d.ts +17 -25
- package/build/routesAuth.d.ts.map +1 -1
- package/build/routesAuth.js +4 -14
- package/build/routesAuth.js.map +1 -1
- package/build/typedEventEmitter.d.ts +7 -13
- package/build/typedEventEmitter.d.ts.map +1 -1
- package/build/typedEventEmitter.js +2 -2
- package/build/typedEventEmitter.js.map +1 -1
- package/build/userSession.d.ts +8 -0
- package/build/userSession.d.ts.map +1 -0
- package/build/userSession.js +3 -0
- package/build/userSession.js.map +1 -0
- package/package.json +22 -7
- package/build/eventsourcing/utils.d.ts +0 -4
- package/build/eventsourcing/utils.d.ts.map +0 -1
- package/build/eventsourcing/utils.js.map +0 -1
- package/build/validation.d.ts +0 -64
- package/build/validation.d.ts.map +0 -1
- package/build/validation.js +0 -57
- package/build/validation.js.map +0 -1
- package/src/authentication.ts +0 -273
- package/src/cache.ts +0 -109
- package/src/clusterAdministration.ts +0 -216
- package/src/configuration.ts +0 -71
- package/src/database.ts +0 -157
- package/src/endpoints.ts +0 -198
- package/src/evenstore.ts +0 -27
- package/src/eventsourcing/aggregateBuilder.ts +0 -11
- package/src/eventsourcing/commandBuilder.ts +0 -64
- package/src/eventsourcing/commandHandlers.ts +0 -137
- package/src/eventsourcing/eventHandlers.ts +0 -118
- package/src/eventsourcing/eventHandlersBuilder.ts +0 -42
- package/src/eventsourcing/externalSystemBuilder.ts +0 -20
- package/src/eventsourcing/index.ts +0 -111
- package/src/eventsourcing/invariants.ts +0 -27
- package/src/eventsourcing/utils.ts +0 -4
- package/src/index.ts +0 -15
- package/src/infrastructure.ts +0 -41
- package/src/logger.ts +0 -45
- package/src/outboxManager.ts +0 -36
- package/src/ports.ts +0 -42
- package/src/routesAuth.ts +0 -58
- package/src/typedEventEmitter.ts +0 -73
- package/src/validation.ts +0 -89
- package/tsconfig.json +0 -15
package/build/cache.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export type CacheAdapter<T = any> = CacheType & AdapterBase<T> & {
|
|
|
8
8
|
/**
|
|
9
9
|
* @category Main Types
|
|
10
10
|
*/
|
|
11
|
-
export type CachePort = PortEmitter &
|
|
11
|
+
export type CachePort<T = any> = PortEmitter & CacheAdapter<T>;
|
|
12
12
|
/**
|
|
13
13
|
* @hidden
|
|
14
14
|
*/
|
|
@@ -38,10 +38,20 @@ export declare function remove(key: string): Promise<void>;
|
|
|
38
38
|
*/
|
|
39
39
|
export declare function incrementBy(key: string, value: number): Promise<number>;
|
|
40
40
|
/**
|
|
41
|
+
* INCRBY + EXPIRE in an atomic Redis pipeline. Returns the new count.
|
|
42
|
+
* TTL is applied on every call (sliding window).
|
|
41
43
|
* @category Cache Port
|
|
42
|
-
* @param function
|
|
43
44
|
*/
|
|
44
|
-
export declare function
|
|
45
|
+
export declare function incrementByWithExpiry(key: string, value: number, expirationSeconds: number): Promise<number>;
|
|
46
|
+
/**
|
|
47
|
+
* @category Cache Port
|
|
48
|
+
* @param func The function to memoize
|
|
49
|
+
* @param expirationSeconds TTL for the cache, in case of `false` passed, the cache would not expire
|
|
50
|
+
* @param expireOnlyIfUnused If true, only expire if the cache hasn't been accessed
|
|
51
|
+
*/
|
|
52
|
+
export declare function memoize<F extends (...args: any[]) => any>(func: F, expirationSeconds: number | false, expireOnlyIfUnused?: boolean): F & {
|
|
53
|
+
invalidate: (...args: Parameters<F>) => Promise<void>;
|
|
54
|
+
};
|
|
45
55
|
/**
|
|
46
56
|
* @category Cache Port
|
|
47
57
|
* @param pattern
|
|
@@ -52,6 +62,11 @@ export declare function keys(pattern: string): Promise<string[]>;
|
|
|
52
62
|
* @category Cache Port
|
|
53
63
|
* */
|
|
54
64
|
export declare function hashExists(key: string, hash: string): Promise<boolean>;
|
|
65
|
+
/**
|
|
66
|
+
* HLEN
|
|
67
|
+
* @category Cache Port
|
|
68
|
+
* */
|
|
69
|
+
export declare function hashLength(key: string): Promise<number>;
|
|
55
70
|
/** HGET */
|
|
56
71
|
export declare function hashGet<T>(key: string, hash: string): Promise<T>;
|
|
57
72
|
/**
|
|
@@ -74,12 +89,37 @@ export declare function hashSetIfNotExists<T>(key: string, hash: string, value:
|
|
|
74
89
|
* HINCRBY
|
|
75
90
|
* @category Cache Port
|
|
76
91
|
* */
|
|
77
|
-
export declare function hashIncrementBy(key: string, hash: string, value: number): Promise<
|
|
92
|
+
export declare function hashIncrementBy(key: string, hash: string, value: number): Promise<number>;
|
|
78
93
|
/**
|
|
79
94
|
* HDEL
|
|
80
95
|
* @category Cache Port
|
|
81
96
|
* */
|
|
82
97
|
export declare function hashDel(key: string, hash: string): Promise<boolean>;
|
|
98
|
+
/**
|
|
99
|
+
* SETBIT
|
|
100
|
+
* @category Cache Port
|
|
101
|
+
* */
|
|
102
|
+
export declare function setBit(key: string, offset: number | string, value: number | string): Promise<void>;
|
|
103
|
+
/**
|
|
104
|
+
* GETBIT
|
|
105
|
+
* @category Cache Port
|
|
106
|
+
* */
|
|
107
|
+
export declare function getBit(key: string, offset: number | string): Promise<boolean>;
|
|
108
|
+
/**
|
|
109
|
+
* RPUSH — atomically appends one or more values to a list
|
|
110
|
+
* @category Cache Port
|
|
111
|
+
* @param key The list key
|
|
112
|
+
* @param values The values to append (JSON-stringified internally)
|
|
113
|
+
* @returns The length of the list after the push
|
|
114
|
+
*/
|
|
115
|
+
export declare function listPush<T>(key: string, ...values: T[]): Promise<number>;
|
|
116
|
+
/**
|
|
117
|
+
* LRANGE 0 -1 — returns all elements of a list
|
|
118
|
+
* @category Cache Port
|
|
119
|
+
* @param key The list key
|
|
120
|
+
* @returns All elements in the list
|
|
121
|
+
*/
|
|
122
|
+
export declare function listGetAll<T>(key: string): Promise<T[]>;
|
|
83
123
|
/**
|
|
84
124
|
* @category Main Types
|
|
85
125
|
*/
|
|
@@ -90,12 +130,18 @@ export type CacheType = {
|
|
|
90
130
|
memoize: typeof memoize;
|
|
91
131
|
remove: typeof remove;
|
|
92
132
|
incrementBy: typeof incrementBy;
|
|
133
|
+
incrementByWithExpiry: typeof incrementByWithExpiry;
|
|
93
134
|
hashExists: typeof hashExists;
|
|
135
|
+
hashLength: typeof hashLength;
|
|
94
136
|
hashGet: typeof hashGet;
|
|
95
137
|
hashGetAll: typeof hashGetAll;
|
|
96
138
|
hashSet: typeof hashSet;
|
|
97
139
|
hashSetIfNotExists: typeof hashSetIfNotExists;
|
|
98
140
|
hashIncrementBy: typeof hashIncrementBy;
|
|
141
|
+
setBit: typeof setBit;
|
|
142
|
+
getBit: typeof getBit;
|
|
99
143
|
hashDel: typeof hashDel;
|
|
144
|
+
listPush: typeof listPush;
|
|
145
|
+
listGetAll: typeof listGetAll;
|
|
100
146
|
};
|
|
101
147
|
//# sourceMappingURL=cache.d.ts.map
|
package/build/cache.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../src/cache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEnD;;GAEG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,GAAG,GAAG,IAAI,SAAS,GAAG,WAAW,CAAC,CAAC,CAAC,GAAG;IAC/D,QAAQ,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAC9B,
|
|
1
|
+
{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../src/cache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEnD;;GAEG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,GAAG,GAAG,IAAI,SAAS,GAAG,WAAW,CAAC,CAAC,CAAC,GAAG;IAC/D,QAAQ,EA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