denotify-client 1.1.15 → 1.1.17

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,64 +1,64 @@
1
1
  import {
2
- Network,
3
- TriggerConfig,
4
- TriggerTypeId,
5
- TriggerUpdate,
6
- TriggerTypeRawId,
7
- TriggerOn,
8
- HandlerRawConfig,
9
- TriggerRawConfig,
10
- Trigger
2
+ Network,
3
+ TriggerConfig,
4
+ TriggerTypeId,
5
+ TriggerUpdate,
6
+ TriggerTypeRawId,
7
+ TriggerOn,
8
+ HandlerRawConfig,
9
+ TriggerRawConfig,
10
+ Trigger
11
11
  } from './trigger.js'
12
12
  import {
13
- PollFunctionV2,
14
- HandlerFunctionCallV2RawConfig,
15
- HandlerFunctionCallV2Update,
16
- HandlerFunctionCallV2RawResponse,
17
- HandlerFunctionCallV2RawUpdate,
18
- HandlerFunctionCallV2
13
+ PollFunctionV2,
14
+ HandlerFunctionCallV2RawConfig,
15
+ HandlerFunctionCallV2Update,
16
+ HandlerFunctionCallV2RawResponse,
17
+ HandlerFunctionCallV2RawUpdate,
18
+ HandlerFunctionCallV2
19
19
  } from './handler_function_call_v2.js'
20
20
  import {
21
- PollFunctionV1,
22
- HandlerFunctionCallRawConfig,
23
- HandlerFunctionCallUpdate,
24
- HandlerFunctionCallRawResponse,
25
- HandlerFunctionCallRawUpdate,
26
- HandlerFunctionCall
21
+ PollFunctionV1,
22
+ HandlerFunctionCallRawConfig,
23
+ HandlerFunctionCallUpdate,
24
+ HandlerFunctionCallRawResponse,
25
+ HandlerFunctionCallRawUpdate,
26
+ HandlerFunctionCall
27
27
  } from './handler_function_call.js'
28
28
  import {
29
- OnchainEventV1,
30
- HandlerOnchainEventRawConfig,
31
- HandlerOnchainEventUpdate,
32
- HandlerOnchainEventRawResponse,
33
- HandlerOnchainEventRawUpdate,
34
- HandlerOnchainEvent
29
+ OnchainEventV1,
30
+ HandlerOnchainEventRawConfig,
31
+ HandlerOnchainEventUpdate,
32
+ HandlerOnchainEventRawResponse,
33
+ HandlerOnchainEventRawUpdate,
34
+ HandlerOnchainEvent
35
35
  } from './handler_onchain_event.js'
36
36
  export {
37
- Network,
38
- TriggerConfig,
39
- TriggerTypeId,
40
- TriggerUpdate,
41
- TriggerTypeRawId,
42
- TriggerOn,
43
- HandlerRawConfig,
44
- TriggerRawConfig,
45
- Trigger,
46
- PollFunctionV2,
47
- HandlerFunctionCallV2RawConfig,
48
- HandlerFunctionCallV2Update,
49
- HandlerFunctionCallV2RawResponse,
50
- HandlerFunctionCallV2RawUpdate,
51
- HandlerFunctionCallV2,
52
- PollFunctionV1,
53
- HandlerFunctionCallRawConfig,
54
- HandlerFunctionCallUpdate,
55
- HandlerFunctionCallRawResponse,
56
- HandlerFunctionCallRawUpdate,
57
- HandlerFunctionCall,
58
- OnchainEventV1,
59
- HandlerOnchainEventRawConfig,
60
- HandlerOnchainEventUpdate,
61
- HandlerOnchainEventRawResponse,
62
- HandlerOnchainEventRawUpdate,
63
- HandlerOnchainEvent
37
+ Network,
38
+ TriggerConfig,
39
+ TriggerTypeId,
40
+ TriggerUpdate,
41
+ TriggerTypeRawId,
42
+ TriggerOn,
43
+ HandlerRawConfig,
44
+ TriggerRawConfig,
45
+ Trigger,
46
+ PollFunctionV2,
47
+ HandlerFunctionCallV2RawConfig,
48
+ HandlerFunctionCallV2Update,
49
+ HandlerFunctionCallV2RawResponse,
50
+ HandlerFunctionCallV2RawUpdate,
51
+ HandlerFunctionCallV2,
52
+ PollFunctionV1,
53
+ HandlerFunctionCallRawConfig,
54
+ HandlerFunctionCallUpdate,
55
+ HandlerFunctionCallRawResponse,
56
+ HandlerFunctionCallRawUpdate,
57
+ HandlerFunctionCall,
58
+ OnchainEventV1,
59
+ HandlerOnchainEventRawConfig,
60
+ HandlerOnchainEventUpdate,
61
+ HandlerOnchainEventRawResponse,
62
+ HandlerOnchainEventRawUpdate,
63
+ HandlerOnchainEvent
64
64
  }
@@ -1,70 +1,70 @@
1
1
  import {
2
- HandlerFunctionCallRawConfig,
3
- HandlerFunctionCallRawResponse,
4
- HandlerFunctionCallUpdate,
5
- PollFunctionV1
2
+ HandlerFunctionCallRawConfig,
3
+ HandlerFunctionCallRawResponse,
4
+ HandlerFunctionCallUpdate,
5
+ PollFunctionV1
6
6
  } from './handler_function_call.js'
7
7
  import {
8
- HandlerOnchainEventRawConfig,
9
- HandlerOnchainEventRawResponse,
10
- HandlerOnchainEventUpdate,
11
- OnchainEventV1
8
+ HandlerOnchainEventRawConfig,
9
+ HandlerOnchainEventRawResponse,
10
+ HandlerOnchainEventUpdate,
11
+ OnchainEventV1
12
12
  } from './handler_onchain_event.js'
13
13
  import {
14
- HandlerFunctionCallV2RawConfig,
15
- HandlerFunctionCallV2RawResponse,
16
- HandlerFunctionCallV2Update,
17
- PollFunctionV2
14
+ HandlerFunctionCallV2RawConfig,
15
+ HandlerFunctionCallV2RawResponse,
16
+ HandlerFunctionCallV2Update,
17
+ PollFunctionV2
18
18
  } from './handler_function_call_v2.js'
19
19
  export type Network = 'avalanche' | 'ethereum'
20
20
  export type TriggerConfig = PollFunctionV2 | PollFunctionV1 | OnchainEventV1
21
21
  export type TriggerTypeId =
22
- | 'PollFunctionV2'
23
- | 'OnchainEventV1'
24
- | 'PollFunctionV1'
22
+ | 'PollFunctionV2'
23
+ | 'OnchainEventV1'
24
+ | 'PollFunctionV1'
25
25
  export type TriggerUpdate =
26
- | HandlerFunctionCallV2Update
27
- | HandlerFunctionCallUpdate
28
- | HandlerOnchainEventUpdate
26
+ | HandlerFunctionCallV2Update
27
+ | HandlerFunctionCallUpdate
28
+ | HandlerOnchainEventUpdate
29
29
  export type TriggerTypeRawId =
30
- | 'handler_function_call'
31
- | 'handler_onchain_event'
32
- | 'handler_function_call_v2'
30
+ | 'handler_function_call'
31
+ | 'handler_onchain_event'
32
+ | 'handler_function_call_v2'
33
33
  export type TriggerOn = 'event' | 'latch'
34
34
  export type HandlerRawConfig =
35
- | HandlerFunctionCallRawConfig
36
- | HandlerOnchainEventRawConfig
37
- | HandlerFunctionCallV2RawConfig
35
+ | HandlerFunctionCallRawConfig
36
+ | HandlerOnchainEventRawConfig
37
+ | HandlerFunctionCallV2RawConfig
38
38
  export type TriggerRawConfig = {
39
- nickname: string
40
- type: TriggerTypeRawId
41
- alertType: TriggerOn
42
- network: Network
43
- handler: HandlerRawConfig
39
+ nickname: string
40
+ type: TriggerTypeRawId
41
+ alertType: TriggerOn
42
+ network: Network
43
+ handler: HandlerRawConfig
44
44
  }
45
45
  export type HandlerRawResponse =
46
- | HandlerFunctionCallV2RawResponse
47
- | HandlerFunctionCallRawResponse
48
- | HandlerOnchainEventRawResponse
46
+ | HandlerFunctionCallV2RawResponse
47
+ | HandlerFunctionCallRawResponse
48
+ | HandlerOnchainEventRawResponse
49
49
  export type TriggerRawResponse = {
50
- id: number
51
- type: TriggerTypeRawId
52
- triggered: boolean
53
- lastBlock: number
54
- alertType: 'event' | 'latch'
55
- enabled: boolean
56
- nickname: string
57
- error: boolean
58
- error_message: string | null
59
- error_timestamp: number | null
60
- network: Network
61
- handler: HandlerRawResponse
50
+ id: number
51
+ type: TriggerTypeRawId
52
+ triggered: boolean
53
+ lastBlock: number
54
+ alertType: 'event' | 'latch'
55
+ enabled: boolean
56
+ nickname: string
57
+ error: boolean
58
+ error_message: string | null
59
+ error_timestamp: number | null
60
+ network: Network
61
+ handler: HandlerRawResponse
62
62
  }
63
63
  export declare class Trigger {
64
- static SimpleToRaw(
65
- name: string,
66
- id: TriggerTypeId,
67
- network: Network,
68
- config: TriggerConfig
69
- ): TriggerRawConfig
64
+ static SimpleToRaw(
65
+ name: string,
66
+ id: TriggerTypeId,
67
+ network: Network,
68
+ config: TriggerConfig
69
+ ): TriggerRawConfig
70
70
  }
@@ -1,7 +1,7 @@
1
1
  declare type DiscordWebhook = {
2
- url: string
3
- message: string
4
- username?: string
5
- avatar_url?: string
2
+ url: string
3
+ message: string
4
+ username?: string
5
+ avatar_url?: string
6
6
  }
7
7
  declare type NotificationType = DiscordWebhook
@@ -1,14 +1,14 @@
1
1
  import { FilterConfig } from '../util/filter'
2
2
  export declare type FunctionCallerConfig = {
3
- address: string
4
- bytecode: string
5
- abiHash: string
6
- function: string
3
+ address: string
4
+ bytecode: string
5
+ abiHash: string
6
+ function: string
7
7
  }[]
8
8
  export declare type TriggerTypeId =
9
- | 'PollFunctionV2'
10
- | 'OnchainEventV2'
11
- | 'FunctionEventV2'
9
+ | 'PollFunctionV2'
10
+ | 'OnchainEventV2'
11
+ | 'FunctionEventV2'
12
12
  declare type TimeBase = 'blocks' | 'time'
13
13
  /**
14
14
  * @typedef PollFunction
@@ -17,16 +17,16 @@ declare type TimeBase = 'blocks' | 'time'
17
17
  *
18
18
  */
19
19
  export declare type PollFunction = {
20
- timeBase: TimeBase
21
- nBlocks?: number
22
- timePeriod?: string | null
23
- startTime?: number
24
- debounceCount?: number
25
- functions: FunctionCallerConfig
26
- triggerOn: 'always' | 'filter'
27
- latch?: boolean
28
- filterVersion?: string
29
- filter?: FilterConfig
20
+ timeBase: TimeBase
21
+ nBlocks?: number
22
+ timePeriod?: string | null
23
+ startTime?: number
24
+ debounceCount?: number
25
+ functions: FunctionCallerConfig
26
+ triggerOn: 'always' | 'filter'
27
+ latch?: boolean
28
+ filterVersion?: string
29
+ filter?: FilterConfig
30
30
  }
31
31
  export declare type TriggerType = PollFunction
32
32
  export {}
@@ -1,23 +1,23 @@
1
1
  import {
2
- NotificationConfig,
3
- NotificationTypeId
2
+ NotificationConfig,
3
+ NotificationTypeId
4
4
  } from '../notifications/notification.js'
5
5
  import { Network, TriggerConfig, TriggerTypeId } from '../triggers/trigger.js'
6
6
  export type Condition = '>' | '>=' | '<' | '<=' | '=' | 'true'
7
7
  export type TriggerOn = 'event' | 'latch'
8
8
  export type DeNotifyOptions = {
9
- email?: string
10
- password?: string
11
- projectId?: string
12
- key?: string
13
- url?: string
14
- anonKey?: string
9
+ email?: string
10
+ password?: string
11
+ projectId?: string
12
+ key?: string
13
+ url?: string
14
+ anonKey?: string
15
15
  }
16
16
  export type AlertConfig = {
17
- name: string
18
- network: Network
19
- triggerId: TriggerTypeId
20
- trigger: TriggerConfig
21
- notificationId: NotificationTypeId
22
- notification: NotificationConfig
17
+ name: string
18
+ network: Network
19
+ triggerId: TriggerTypeId
20
+ trigger: TriggerConfig
21
+ notificationId: NotificationTypeId
22
+ notification: NotificationConfig
23
23
  }
@@ -1,73 +1,73 @@
1
1
  type Logic = 'AND' | 'OR' | 'XOR' | 'NAND' | 'NOR' | 'WHERE'
2
2
  type NumericOperation = 'eq' | '!eq' | 'gt' | 'gte' | 'lt' | 'lte'
3
3
  type StringOperation =
4
- | 'contains'
5
- | '!contains'
6
- | 'is'
7
- | '!is'
8
- | 'isEmpty'
9
- | '!isEmpty'
4
+ | 'contains'
5
+ | '!contains'
6
+ | 'is'
7
+ | '!is'
8
+ | 'isEmpty'
9
+ | '!isEmpty'
10
10
  type AddressOperation = 'is' | '!is' | 'isEmpty' | '!isEmpty'
11
11
  type FilterDataTypes = 'String' | 'Address' | 'Number'
12
12
  type FilterOpertationType =
13
- | NumericOperation
14
- | StringOperation
15
- | AddressOperation
13
+ | NumericOperation
14
+ | StringOperation
15
+ | AddressOperation
16
16
  import * as yup from 'yup'
17
17
  export type Condition = {
18
- logic?: Logic
19
- key: string
20
- type: FilterDataTypes
21
- operation: FilterOpertationType
22
- constant: string | number
18
+ logic?: Logic
19
+ key: string
20
+ type: FilterDataTypes
21
+ operation: FilterOpertationType
22
+ constant: string | number
23
23
  }
24
24
  export type ConditionGroup = {
25
- logic: Logic
26
- conditions: Condition[]
25
+ logic: Logic
26
+ conditions: Condition[]
27
27
  }
28
28
  export type FilterConfig = ConditionGroup[]
29
29
  export declare class Filter {
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
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
35
35
  }
36
36
  export declare class FilterBuilder {
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
- >
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
+ >
72
72
  }
73
73
  export {}