@moneypot/hub 1.4.0 → 1.4.1

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 CHANGED
@@ -76,6 +76,6 @@ insert into hub.api_key default values returning key;
76
76
 
77
77
  ## Changelog
78
78
 
79
- ### 1.4.0
79
+ ### 1.4.1
80
80
 
81
81
  - Added `hubPutAlert` subscription
@@ -28,7 +28,7 @@ export const HubPutAlertPlugin = makeExtendSchemaPlugin(() => {
28
28
  return "";
29
29
  }
30
30
  });
31
- return listenWithFilter($pgSubscriber, $channelKey, jsonParse, $identity, (identity, item) => {
31
+ return listenWithFilter($pgSubscriber, $channelKey, jsonParse, $identity, (item, identity) => {
32
32
  if (identity?.kind !== "user") {
33
33
  return false;
34
34
  }
@@ -5,7 +5,7 @@ export declare class ListenWithFilterStep<TTopics extends {
5
5
  [topic: string]: any;
6
6
  }, TTopic extends keyof TTopics, TPayloadStep extends Step, TFilterInput> extends Step<TTopics[TTopic][]> {
7
7
  itemPlan: (itemPlan: __ItemStep<TTopics[TTopic]>) => TPayloadStep;
8
- filterFn: (filterInput: TFilterInput, item: any) => boolean;
8
+ filterFn: (item: any, filterInput: TFilterInput) => boolean;
9
9
  static $$export: {
10
10
  moduleName: string;
11
11
  exportName: string;
@@ -14,9 +14,9 @@ export declare class ListenWithFilterStep<TTopics extends {
14
14
  private pubsubDep;
15
15
  private topicDep;
16
16
  private filterInputDep;
17
- constructor(pubsubOrPlan: Step<GrafastSubscriber<TTopics> | null> | GrafastSubscriber<TTopics> | null, topicOrPlan: Step<TTopic> | string, itemPlan: ((itemPlan: __ItemStep<TTopics[TTopic]>) => TPayloadStep) | undefined, filterInputPlan: Step<TFilterInput>, filterFn: (filterInput: TFilterInput, item: any) => boolean);
17
+ constructor(pubsubOrPlan: Step<GrafastSubscriber<TTopics> | null> | GrafastSubscriber<TTopics> | null, topicOrPlan: Step<TTopic> | string, itemPlan: ((itemPlan: __ItemStep<TTopics[TTopic]>) => TPayloadStep) | undefined, filterInputPlan: Step<TFilterInput>, filterFn: (item: any, filterInput: TFilterInput) => boolean);
18
18
  execute({ indexMap, values, stream, }: ExecutionDetails<readonly [GrafastSubscriber<TTopics>, TTopic]>): GrafastResultStreamList<TTopics[TTopic]>;
19
19
  }
20
20
  export declare function listenWithFilter<TTopics extends {
21
21
  [topic: string]: any;
22
- }, TTopic extends keyof TTopics, TPayloadStep extends Step, TFilterInput>(pubsubOrPlan: Step<GrafastSubscriber<TTopics> | null> | GrafastSubscriber<TTopics> | null, topicOrPlan: Step<TTopic> | string, itemPlan: ((itemPlan: __ItemStep<TTopics[TTopic]>) => TPayloadStep) | undefined, filterInputPlan: Step<TFilterInput>, filterFn: (filterInput: TFilterInput, item: any) => boolean): ListenWithFilterStep<TTopics, TTopic, TPayloadStep, TFilterInput>;
22
+ }, TTopic extends keyof TTopics, TPayloadStep extends Step, TFilterInput>(pubsubOrPlan: Step<GrafastSubscriber<TTopics> | null> | GrafastSubscriber<TTopics> | null, topicOrPlan: Step<TTopic> | string, itemPlan: ((itemPlan: __ItemStep<TTopics[TTopic]>) => TPayloadStep) | undefined, filterInputPlan: Step<TFilterInput>, filterFn: (item: any, filterInput: TFilterInput) => boolean): ListenWithFilterStep<TTopics, TTopic, TPayloadStep, TFilterInput>;
@@ -47,7 +47,7 @@ export class ListenWithFilterStep extends Step {
47
47
  [Symbol.asyncIterator]: async function* () {
48
48
  const iterator = await origStream;
49
49
  for await (const item of iterator) {
50
- if (filterFn(filterInput, item)) {
50
+ if (filterFn(item, filterInput)) {
51
51
  yield item;
52
52
  }
53
53
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moneypot/hub",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "author": "moneypot.com",
5
5
  "homepage": "https://moneypot.com/hub",
6
6
  "keywords": [