denotify-client 1.1.13 → 1.1.14
Sign up to get free protection for your applications and to get access to all the features.
- package/.eslintrc +1 -1
- package/.prettierrc +2 -2
- package/.vscode/settings.json +4 -0
- package/dist/denotify-client.cjs +1 -1
- package/dist/denotify-client.d.ts +2 -2
- package/dist/denotify-client.iife.js +1 -1
- package/dist/denotify-client.mjs +1 -1
- package/package.json +1 -1
- package/tsconfig.json +33 -21
- package/types/alertbuilder.d.ts +99 -69
- package/types/client.d.ts +12 -12
- package/types/denotifyclient.d.ts +59 -46
- package/types/examples/aave-healthcheck.d.ts +1 -1
- package/types/examples/balance-monitor.d.ts +1 -1
- package/types/examples/delete-alert.d.ts +1 -1
- package/types/functionbuilder.d.ts +31 -20
- package/types/index.d.ts +14 -7
- package/types/notifications/index.d.ts +36 -3
- package/types/notifications/notification.d.ts +27 -18
- package/types/notifications/notify_discord_webhook.d.ts +32 -32
- package/types/temp.d.ts +1 -1
- package/types/triggers/handler_function_call.d.ts +60 -56
- package/types/triggers/handler_function_call_v2.d.ts +94 -79
- package/types/triggers/handler_onchain_event.d.ts +51 -47
- package/types/triggers/index.d.ts +64 -5
- package/types/triggers/trigger.d.ts +66 -31
- package/types/types/notification.d.ts +6 -6
- package/types/types/trigger.d.ts +24 -21
- package/types/types/types.d.ts +21 -18
- package/types/util/filter.d.ts +67 -40
package/types/types/types.d.ts
CHANGED
@@ -1,20 +1,23 @@
|
|
1
|
-
import {
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
import {
|
2
|
+
NotificationConfig,
|
3
|
+
NotificationTypeId
|
4
|
+
} from '../notifications/notification.js'
|
5
|
+
import { Network, TriggerConfig, TriggerTypeId } from '../triggers/trigger.js'
|
6
|
+
export type Condition = '>' | '>=' | '<' | '<=' | '=' | 'true'
|
7
|
+
export type TriggerOn = 'event' | 'latch'
|
5
8
|
export type DeNotifyOptions = {
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
}
|
9
|
+
email?: string
|
10
|
+
password?: string
|
11
|
+
projectId?: string
|
12
|
+
key?: string
|
13
|
+
url?: string
|
14
|
+
anonKey?: string
|
15
|
+
}
|
13
16
|
export type AlertConfig = {
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
}
|
17
|
+
name: string
|
18
|
+
network: Network
|
19
|
+
triggerId: TriggerTypeId
|
20
|
+
trigger: TriggerConfig
|
21
|
+
notificationId: NotificationTypeId
|
22
|
+
notification: NotificationConfig
|
23
|
+
}
|
package/types/util/filter.d.ts
CHANGED
@@ -1,46 +1,73 @@
|
|
1
|
-
type Logic = 'AND' | 'OR' | 'XOR' | 'NAND' | 'NOR' | 'WHERE'
|
2
|
-
type NumericOperation = 'eq' | '!eq' | 'gt' | 'gte' | 'lt' | 'lte'
|
3
|
-
type StringOperation =
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
1
|
+
type Logic = 'AND' | 'OR' | 'XOR' | 'NAND' | 'NOR' | 'WHERE'
|
2
|
+
type NumericOperation = 'eq' | '!eq' | 'gt' | 'gte' | 'lt' | 'lte'
|
3
|
+
type StringOperation =
|
4
|
+
| 'contains'
|
5
|
+
| '!contains'
|
6
|
+
| 'is'
|
7
|
+
| '!is'
|
8
|
+
| 'isEmpty'
|
9
|
+
| '!isEmpty'
|
10
|
+
type AddressOperation = 'is' | '!is' | 'isEmpty' | '!isEmpty'
|
11
|
+
type FilterDataTypes = 'String' | 'Address' | 'Number'
|
12
|
+
type FilterOpertationType =
|
13
|
+
| NumericOperation
|
14
|
+
| StringOperation
|
15
|
+
| AddressOperation
|
16
|
+
import * as yup from 'yup'
|
8
17
|
export type Condition = {
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
}
|
18
|
+
logic?: Logic
|
19
|
+
key: string
|
20
|
+
type: FilterDataTypes
|
21
|
+
operation: FilterOpertationType
|
22
|
+
constant: string | number
|
23
|
+
}
|
15
24
|
export type ConditionGroup = {
|
16
|
-
|
17
|
-
|
18
|
-
}
|
19
|
-
export type FilterConfig = ConditionGroup[]
|
25
|
+
logic: Logic
|
26
|
+
conditions: Condition[]
|
27
|
+
}
|
28
|
+
export type FilterConfig = ConditionGroup[]
|
20
29
|
export declare class Filter {
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
30
|
+
static version(): string
|
31
|
+
static execute(record: any, groupsIn: FilterConfig, version?: string): boolean
|
32
|
+
private static process
|
33
|
+
private static execLogic
|
34
|
+
private static execCondition
|
26
35
|
}
|
27
36
|
export declare class FilterBuilder {
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
37
|
+
private groups
|
38
|
+
constructor()
|
39
|
+
static version(): string
|
40
|
+
static new(): FilterBuilder
|
41
|
+
newGroup(logic: Logic): FilterBuilder
|
42
|
+
addCondition(
|
43
|
+
logic: Logic,
|
44
|
+
key: string,
|
45
|
+
type: FilterDataTypes,
|
46
|
+
operation: FilterOpertationType,
|
47
|
+
constant: string | number
|
48
|
+
): FilterBuilder
|
49
|
+
finalise(): ConditionGroup[]
|
50
|
+
static schema(): yup.ArraySchema<
|
51
|
+
| {
|
52
|
+
conditions?:
|
53
|
+
| {
|
54
|
+
operation?: string | undefined
|
55
|
+
constant?: {} | undefined
|
56
|
+
logic: NonNullable<
|
57
|
+
'AND' | 'OR' | 'XOR' | 'NAND' | 'NOR' | 'WHERE' | undefined
|
58
|
+
>
|
59
|
+
key: string
|
60
|
+
type: NonNullable<'String' | 'Address' | 'Number' | undefined>
|
61
|
+
}[]
|
62
|
+
| undefined
|
63
|
+
logic: NonNullable<
|
64
|
+
'AND' | 'OR' | 'XOR' | 'NAND' | 'NOR' | 'WHERE' | undefined
|
65
|
+
>
|
66
|
+
}[]
|
67
|
+
| undefined,
|
68
|
+
yup.AnyObject,
|
69
|
+
'',
|
70
|
+
''
|
71
|
+
>
|
45
72
|
}
|
46
|
-
export {}
|
73
|
+
export {}
|