@fraym/streams 0.37.1 → 0.38.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/dist/client/client.d.ts
CHANGED
|
@@ -7,18 +7,18 @@ export interface StreamIterator {
|
|
|
7
7
|
isEmpty: () => Promise<boolean>;
|
|
8
8
|
}
|
|
9
9
|
export interface Client {
|
|
10
|
+
close: () => void;
|
|
11
|
+
publish: (topic: string, events: PublishEvent[]) => Promise<void>;
|
|
12
|
+
subscribe: (topics?: string[], ignoreUnhandledEvents?: boolean) => Subscription;
|
|
10
13
|
getEvent: (tenantId: string, topic: string, eventId: string) => Promise<SubscriptionEvent>;
|
|
11
14
|
getLastEvent: (tenantId: string, topic: string) => Promise<SubscriptionEvent | null>;
|
|
12
15
|
getLastEventByTypes: (tenantId: string, topic: string, types: string[]) => Promise<SubscriptionEvent | null>;
|
|
13
16
|
iterateAllEvents: (tenantId: string, topic: string, includedEventTypes: string[], perPage: number, handler: HandlerFunc) => Promise<void>;
|
|
14
17
|
iterateAllEventsAfterEvent: (tenantId: string, topic: string, includedEventTypes: string[], eventId: string, perPage: number, handler: HandlerFunc) => Promise<void>;
|
|
15
|
-
publish: (topic: string, events: PublishEvent[]) => Promise<void>;
|
|
16
18
|
getStreamIterator: (topic: string, tenantId: string, stream: string, perPage: number) => StreamIterator;
|
|
17
|
-
|
|
19
|
+
createStreamSnapshot: (tenantId: string, topic: string, stream: string, lastSnapshottedEventId: string, snapshotEvent: PublishEvent) => Promise<void>;
|
|
18
20
|
invalidateGdprData: (tenantId: string, topic: string, gdprId: string) => Promise<void>;
|
|
19
21
|
introduceGdprOnEventField: (tenantId: string, defaultValue: string, topic: string, eventId: string, fieldName: string) => Promise<void>;
|
|
20
|
-
createStreamSnapshot: (tenantId: string, topic: string, stream: string, lastSnapshottedEventId: string, snapshotEvent: PublishEvent) => Promise<void>;
|
|
21
22
|
renameEventType: (topic: string, oldEventType: string, newEventType: string) => Promise<void>;
|
|
22
|
-
close: () => void;
|
|
23
23
|
}
|
|
24
24
|
export declare const newClient: (inputConfig: ClientConfig) => Promise<Client>;
|
package/dist/client/config.d.ts
CHANGED
|
@@ -6,4 +6,4 @@ export interface ClientConfig {
|
|
|
6
6
|
deploymentId?: number;
|
|
7
7
|
}
|
|
8
8
|
export declare const useConfigDefaults: (config: ClientConfig) => Required<ClientConfig>;
|
|
9
|
-
export declare const
|
|
9
|
+
export declare const getEnvConfig: () => ClientConfig;
|
package/dist/client/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});function _export(target,all){for(var name in all)Object.defineProperty(target,name,{enumerable:true,get:all[name]})}_export(exports,{
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});function _export(target,all){for(var name in all)Object.defineProperty(target,name,{enumerable:true,get:all[name]})}_export(exports,{getEnvConfig:function(){return getEnvConfig},useConfigDefaults:function(){return useConfigDefaults}});var _dotenv=require("dotenv");var useConfigDefaults=function(config){var _process_env,_process;var deploymentId=((_process=process)===null||_process===void 0?void 0:(_process_env=_process.env)===null||_process_env===void 0?void 0:_process_env.STREAMS_CLIENT_DEPLOYMENT_ID)?parseInt(process.env.STREAMS_CLIENT_DEPLOYMENT_ID,10):undefined;var _config_keepaliveInterval,_config_keepaliveTimeout,_config_deploymentId,_ref;return{serverAddress:config.serverAddress,groupId:config.groupId,keepaliveInterval:(_config_keepaliveInterval=config.keepaliveInterval)!==null&&_config_keepaliveInterval!==void 0?_config_keepaliveInterval:40*1e3,keepaliveTimeout:(_config_keepaliveTimeout=config.keepaliveTimeout)!==null&&_config_keepaliveTimeout!==void 0?_config_keepaliveTimeout:3*1e3,deploymentId:(_ref=(_config_deploymentId=config.deploymentId)!==null&&_config_deploymentId!==void 0?_config_deploymentId:deploymentId)!==null&&_ref!==void 0?_ref:0}};var getEnvConfig=function(){(0,_dotenv.config)();var keepaliveInterval;var keepaliveTimeout;var deploymentId;var keepaliveIntervalString=process.env.STREAMS_CLIENT_KEEPALIVE_INTERVAL;var keepaliveTimeoutString=process.env.STREAMS_CLIENT_KEEPALIVE_TIMEOUT;var deploymentIdString=process.env.STREAMS_CLIENT_DEPLOYMENT_ID;if(keepaliveIntervalString){keepaliveInterval=parseInt(keepaliveIntervalString,10)}if(keepaliveTimeoutString){keepaliveTimeout=parseInt(keepaliveTimeoutString,10)}if(deploymentIdString){deploymentId=parseInt(deploymentIdString,10)}var _process_env_STREAMS_CLIENT_ADDRESS,_process_env_STREAMS_CLIENT_GROUP_ID;return{serverAddress:(_process_env_STREAMS_CLIENT_ADDRESS=process.env.STREAMS_CLIENT_ADDRESS)!==null&&_process_env_STREAMS_CLIENT_ADDRESS!==void 0?_process_env_STREAMS_CLIENT_ADDRESS:"",groupId:(_process_env_STREAMS_CLIENT_GROUP_ID=process.env.STREAMS_CLIENT_GROUP_ID)!==null&&_process_env_STREAMS_CLIENT_GROUP_ID!==void 0?_process_env_STREAMS_CLIENT_GROUP_ID:"",keepaliveInterval:keepaliveInterval,keepaliveTimeout:keepaliveTimeout,deploymentId:deploymentId}};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fraym/streams",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.38.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"homepage": "https://github.com/fraym/freym-api",
|
|
6
6
|
"repository": {
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"main": "dist/index.js",
|
|
23
23
|
"types": "dist/index.d.ts",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@fraym/proto": "^0.
|
|
25
|
+
"@fraym/proto": "^0.38.0",
|
|
26
26
|
"@grpc/grpc-js": "^1.13.4",
|
|
27
27
|
"dotenv": "^16.5.0",
|
|
28
28
|
"uuid": "^11.1.0"
|